Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions apollo-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ tags:
description: 实例管理相关接口,包括实例查询、配置生效状态等功能
- name: Organization Management
description: 组织管理相关接口,包括组织信息查询等功能
- name: Environment Management
description: 环境管理相关接口,包括环境查询等功能
paths:
/openapi/v1/apps:
post:
Expand Down Expand Up @@ -1659,8 +1661,8 @@ paths:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
description: '操作人用户名,openapi外部调用时需传入'
required: false
schema:
type: string
responses:
Expand Down Expand Up @@ -3599,6 +3601,29 @@ paths:
allOf:
- $ref: '#/components/schemas/SuccessEmptyResponse'
headers: {}
/openapi/v1/envs:
get:
summary: 获取所有环境
operationId: getEnvs
deprecated: false
description: GET /openapi/v1/envs
tags:
- Environment Management
responses:
'200':
description: 成功获取环境列表
content:
application/json:
schema:
type: array
items:
type: string
example:
- 'DEV'
- 'FAT'
- 'UAT'
- 'PRO'
headers: {}
components:
securitySchemes:
ApiKeyAuth:
Expand Down Expand Up @@ -3742,6 +3767,17 @@ components:
appId:
type: string
description: 所属应用的唯一标识符
id:
type: integer
description: 集群的唯一标识符
format: int64
parentClusterId:
type: integer
description: 父集群的ID
format: int64
comment:
type: string
description: 集群的备注说明
description: Apollo集群信息数据传输对象,表示应用在特定环境下的集群配置
MapString:
type: object
Expand Down
3 changes: 3 additions & 0 deletions java-client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build.gradle
build.sbt
docs/AppManagementApi.md
docs/ClusterManagementApi.md
docs/EnvironmentManagementApi.md
docs/InstanceManagementApi.md
docs/ItemManagementApi.md
docs/KVEntity.md
Expand Down Expand Up @@ -66,6 +67,7 @@ src/main/java/org/openapitools/client/ServerVariable.java
src/main/java/org/openapitools/client/StringUtil.java
src/main/java/org/openapitools/client/api/AppManagementApi.java
src/main/java/org/openapitools/client/api/ClusterManagementApi.java
src/main/java/org/openapitools/client/api/EnvironmentManagementApi.java
src/main/java/org/openapitools/client/api/InstanceManagementApi.java
src/main/java/org/openapitools/client/api/ItemManagementApi.java
src/main/java/org/openapitools/client/api/NamespaceBranchManagementApi.java
Expand Down Expand Up @@ -107,6 +109,7 @@ src/main/java/org/openapitools/client/model/OpenReleaseDTO.java
src/main/java/org/openapitools/client/model/RichResponseEntity.java
src/test/java/org/openapitools/client/api/AppManagementApiTest.java
src/test/java/org/openapitools/client/api/ClusterManagementApiTest.java
src/test/java/org/openapitools/client/api/EnvironmentManagementApiTest.java
src/test/java/org/openapitools/client/api/InstanceManagementApiTest.java
src/test/java/org/openapitools/client/api/ItemManagementApiTest.java
src/test/java/org/openapitools/client/api/NamespaceBranchManagementApiTest.java
Expand Down
1 change: 1 addition & 0 deletions java-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Class | Method | HTTP request | Description
*ClusterManagementApi* | [**createCluster**](docs/ClusterManagementApi.md#createCluster) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters | 创建集群 (original openapi)
*ClusterManagementApi* | [**deleteCluster**](docs/ClusterManagementApi.md#deleteCluster) | **DELETE** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName} | 删除集群 (new added)
*ClusterManagementApi* | [**getCluster**](docs/ClusterManagementApi.md#getCluster) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName} | 获取指定集群信息 (original openapi)
*EnvironmentManagementApi* | [**getEnvs**](docs/EnvironmentManagementApi.md#getEnvs) | **GET** /openapi/v1/envs | 获取所有环境
*InstanceManagementApi* | [**getByRelease**](docs/InstanceManagementApi.md#getByRelease) | **GET** /openapi/v1/envs/{env}/releases/{releaseId}/instances | 根据发布版本查询实例(支持分页) (new added)
*InstanceManagementApi* | [**getByReleasesNotIn**](docs/InstanceManagementApi.md#getByReleasesNotIn) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/instances_not_in | 查询不在指定发布版本中的实例 (new added)
*InstanceManagementApi* | [**getInstanceCountByNamespace**](docs/InstanceManagementApi.md#getInstanceCountByNamespace) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/instances | 获取命名空间下的实例数量 (original openapi)
Expand Down
43 changes: 41 additions & 2 deletions java-client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ tags:
name: Instance Management
- description: 组织管理相关接口,包括组织信息查询等功能
name: Organization Management
- description: 环境管理相关接口,包括环境查询等功能
name: Environment Management
paths:
/openapi/v1/apps:
get:
Expand Down Expand Up @@ -1782,11 +1784,11 @@ paths:
schema:
type: string
style: simple
- description: 操作人用户名
- description: 操作人用户名,openapi外部调用时需传入
explode: true
in: query
name: operator
required: true
required: false
schema:
type: string
style: form
Expand Down Expand Up @@ -4039,6 +4041,29 @@ paths:
- Namespace Branch Management
x-content-type: application/json
x-accepts: application/json
/openapi/v1/envs:
get:
deprecated: false
description: GET /openapi/v1/envs
operationId: getEnvs
responses:
"200":
content:
application/json:
example:
- DEV
- FAT
- UAT
- PRO
schema:
items:
type: string
type: array
description: 成功获取环境列表
summary: 获取所有环境
tags:
- Environment Management
x-accepts: application/json
components:
schemas:
OpenAppDTO:
Expand Down Expand Up @@ -4205,6 +4230,9 @@ components:
appId: appId
dataChangeCreatedBy: dataChangeCreatedBy
name: name
parentClusterId: 6
comment: comment
id: 0
dataChangeLastModifiedTime: 2025-09-29T12:34:56Z
properties:
dataChangeCreatedBy:
Expand All @@ -4227,6 +4255,17 @@ components:
appId:
description: 所属应用的唯一标识符
type: string
id:
description: 集群的唯一标识符
format: int64
type: integer
parentClusterId:
description: 父集群的ID
format: int64
type: integer
comment:
description: 集群的备注说明
type: string
type: object
MapString:
additionalProperties:
Expand Down
4 changes: 2 additions & 2 deletions java-client/docs/ClusterManagementApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class Example {
String env = "env_example"; // String |
String appId = "appId_example"; // String |
String clusterName = "clusterName_example"; // String |
String operator = "operator_example"; // String | 操作人用户名
String operator = "operator_example"; // String | 操作人用户名,openapi外部调用时需传入
try {
Object result = apiInstance.deleteCluster(env, appId, clusterName, operator);
System.out.println(result);
Expand All @@ -139,7 +139,7 @@ public class Example {
| **env** | **String**| | |
| **appId** | **String**| | |
| **clusterName** | **String**| | |
| **operator** | **String**| 操作人用户名 | |
| **operator** | **String**| 操作人用户名,openapi外部调用时需传入 | [optional] |

### Return type

Expand Down
73 changes: 73 additions & 0 deletions java-client/docs/EnvironmentManagementApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# EnvironmentManagementApi

All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**getEnvs**](EnvironmentManagementApi.md#getEnvs) | **GET** /openapi/v1/envs | 获取所有环境 |


<a id="getEnvs"></a>
# **getEnvs**
> List&lt;String&gt; getEnvs()

获取所有环境

GET /openapi/v1/envs

### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.EnvironmentManagementApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

EnvironmentManagementApi apiInstance = new EnvironmentManagementApi(defaultClient);
try {
List<String> result = apiInstance.getEnvs();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EnvironmentManagementApi#getEnvs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

**List&lt;String&gt;**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | 成功获取环境列表 | - |
3 changes: 3 additions & 0 deletions java-client/docs/OpenClusterDTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ Apollo集群信息数据传输对象,表示应用在特定环境下的集群
|**dataChangeLastModifiedTime** | **String** | 集群最后修改时间,ISO 8601格式的时间戳 | [optional] |
|**name** | **String** | 集群名称,在同一应用和环境下唯一标识一个集群 | [optional] |
|**appId** | **String** | 所属应用的唯一标识符 | [optional] |
|**id** | **Long** | 集群的唯一标识符 | [optional] |
|**parentClusterId** | **Long** | 父集群的ID | [optional] |
|**comment** | **String** | 集群的备注说明 | [optional] |
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public okhttp3.Call createClusterAsync(String appId, String env, OpenClusterDTO
* @param env (required)
* @param appId (required)
* @param clusterName (required)
* @param operator 操作人用户名 (required)
* @param operator 操作人用户名,openapi外部调用时需传入 (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand Down Expand Up @@ -310,11 +310,6 @@ private okhttp3.Call deleteClusterValidateBeforeCall(String env, String appId, S
throw new ApiException("Missing the required parameter 'clusterName' when calling deleteCluster(Async)");
}

// verify the required parameter 'operator' is set
if (operator == null) {
throw new ApiException("Missing the required parameter 'operator' when calling deleteCluster(Async)");
}

return deleteClusterCall(env, appId, clusterName, operator, _callback);

}
Expand All @@ -325,7 +320,7 @@ private okhttp3.Call deleteClusterValidateBeforeCall(String env, String appId, S
* @param env (required)
* @param appId (required)
* @param clusterName (required)
* @param operator 操作人用户名 (required)
* @param operator 操作人用户名,openapi外部调用时需传入 (optional)
* @return Object
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Expand All @@ -348,7 +343,7 @@ public Object deleteCluster(String env, String appId, String clusterName, String
* @param env (required)
* @param appId (required)
* @param clusterName (required)
* @param operator 操作人用户名 (required)
* @param operator 操作人用户名,openapi外部调用时需传入 (optional)
* @return ApiResponse&lt;Object&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Expand All @@ -372,7 +367,7 @@ public ApiResponse<Object> deleteClusterWithHttpInfo(String env, String appId, S
* @param env (required)
* @param appId (required)
* @param clusterName (required)
* @param operator 操作人用户名 (required)
* @param operator 操作人用户名,openapi外部调用时需传入 (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand Down
Loading