From c4fb407b388c4d2f514ad5bef06a8def3c3b447a Mon Sep 17 00:00:00 2001 From: wxq <15523186+Anilople@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:15:37 +0800 Subject: [PATCH 1/5] docs: openapi 3.2.17 Create App And grant administrative privileges --- docs/en/usage/apollo-open-api-platform.md | 43 ++++++++++++++++++++++- docs/zh/usage/apollo-open-api-platform.md | 40 +++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/docs/en/usage/apollo-open-api-platform.md b/docs/en/usage/apollo-open-api-platform.md index 7bd6df27fcf..10d827d6996 100644 --- a/docs/en/usage/apollo-open-api-platform.md +++ b/docs/en/usage/apollo-open-api-platform.md @@ -532,7 +532,7 @@ This interface is the interface used to get whether the current namespace is loc * **URL** : `http://{portal_address}/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/ latest` * **Method** : GET * **Request Params** : None -* **Response Sample** : None +* **Response Sample** : ``` json { @@ -605,6 +605,47 @@ This interface is the interface used to get whether the current namespace is loc } ``` +##### 3.2.17 Create App And grant administrative privileges + +App can be created through this interface, + +> note: 需要在创建第三方应用时,**勾选允许创建app,否则会触发异常,HTTP状态码401** +> +> note: When creating and allowing third-party application, **check the box to Allow app creation, otherwise an exception will be throw, HTTP status code 401** + +* **URL** : http://{portal_address}/openapi/v1/apps/ +* **Method** : POST +* **Request Params** :无 +* **Request Body, JSON format**: + +| Parameter Name | Required | Type | Description | +| ------------------- | -------- | -------- | -------------------------------------------------------- | +| assignAppRoleToSelf | true | Boolean | true:granting app's administrative privileges to self | +| admins | false | String[] | granting app's administrative privileges to those users | +| app | true | Object | APP's information,see Request Sample followed for field | + +* **Request Sample** : + +```json +{ + "assignAppRoleToSelf": true, + "admins": [ + "user1", + "user2" + ], + "app": { + "name": "appName1234", + "appId": "xxx-web", + "orgId": "development", + "orgName": "产品研发部", + "ownerName": "user3", + "ownerEmail": "user3@test.com" + } +} +``` + +* **Response Sample** : None + ### IV. Error code description Under normal circumstances, the Http status code returned by the interface is 200, the following lists the non-200 error code descriptions that Apollo will return. diff --git a/docs/zh/usage/apollo-open-api-platform.md b/docs/zh/usage/apollo-open-api-platform.md index 45400ff737f..6c869a16c00 100644 --- a/docs/zh/usage/apollo-open-api-platform.md +++ b/docs/zh/usage/apollo-open-api-platform.md @@ -102,6 +102,7 @@ namespaceName | 所管理的Namespace的名称,如果是非properties格式, - [3.2.14 获取 Namespace 最后一次发布的内容](#_3214-获取某个namespace当前生效的已发布配置接口) - [3.2.15 回滚 Namespace](#_3215-回滚已发布配置接口) - [3.2.16 分页获取配置项](#_3216-分页获取配置项接口) +- [3.2.17 创建App并授权给当前token](#3.2.17 创建App并授权给当前token) ##### 3.2.1 获取App的环境,集群信息 @@ -609,6 +610,45 @@ size | false | int | 页大小,默认为 50 } ``` +##### 3.2.17 创建App并获取管理员权限 + +可以通过此接口创建App, + +> 注意:需要在创建第三方应用时,**勾选允许创建app,否则会产生异常,HTTP状态码401** + +* **URL** : http://{portal_address}/openapi/v1/apps/ +* **Method** : POST +* **Request Params** :无 +* **请求内容(Request Body, JSON格式)** : + +| 参数名 | 必选 | 类型 | 说明 | +| ------------------- | ----- | -------- | ------------------------------------- | +| assignAppRoleToSelf | true | Boolean | true:授予自己APP的管理权限 | +| admins | false | String[] | 授予这些用户APP的管理权限 | +| app | true | Object | APP的信息,字段参考下方的请求值Sample | + +* **请求值 Sample** : + +```json +{ + "assignAppRoleToSelf": true, + "admins": [ + "user1", + "user2" + ], + "app": { + "name": "appName1234", + "appId": "xxx-web", + "orgId": "development", + "orgName": "产品研发部", + "ownerName": "user3", + "ownerEmail": "user3@test.com" + } +} +``` + +* **返回值 Sample** : 无返回值 + ### 四、错误码说明 正常情况下,接口返回的Http状态码是200,下面列举了Apollo会返回的非200错误码说明。 From 9c94bbfae1861314bb15ce61428002edfe1a4115 Mon Sep 17 00:00:00 2001 From: wxq <15523186+Anilople@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:17:49 +0800 Subject: [PATCH 2/5] fix: url link --- docs/zh/usage/apollo-open-api-platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/usage/apollo-open-api-platform.md b/docs/zh/usage/apollo-open-api-platform.md index 6c869a16c00..5abdcf56791 100644 --- a/docs/zh/usage/apollo-open-api-platform.md +++ b/docs/zh/usage/apollo-open-api-platform.md @@ -102,7 +102,7 @@ namespaceName | 所管理的Namespace的名称,如果是非properties格式, - [3.2.14 获取 Namespace 最后一次发布的内容](#_3214-获取某个namespace当前生效的已发布配置接口) - [3.2.15 回滚 Namespace](#_3215-回滚已发布配置接口) - [3.2.16 分页获取配置项](#_3216-分页获取配置项接口) -- [3.2.17 创建App并授权给当前token](#3.2.17 创建App并授权给当前token) +- [3.2.17 创建App并获取管理员权限](#_3217-创建App并获取管理员权限) ##### 3.2.1 获取App的环境,集群信息 From dc0c0e182eece69f544b6795a5c8c7eee796b466 Mon Sep 17 00:00:00 2001 From: wxq <15523186+Anilople@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:15:37 +0800 Subject: [PATCH 3/5] docs: openapi 3.2.17 Create App And grant administrative privileges --- docs/en/usage/apollo-open-api-platform.md | 43 ++++++++++++++++++++++- docs/zh/usage/apollo-open-api-platform.md | 40 +++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/docs/en/usage/apollo-open-api-platform.md b/docs/en/usage/apollo-open-api-platform.md index 7bd6df27fcf..10d827d6996 100644 --- a/docs/en/usage/apollo-open-api-platform.md +++ b/docs/en/usage/apollo-open-api-platform.md @@ -532,7 +532,7 @@ This interface is the interface used to get whether the current namespace is loc * **URL** : `http://{portal_address}/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/ latest` * **Method** : GET * **Request Params** : None -* **Response Sample** : None +* **Response Sample** : ``` json { @@ -605,6 +605,47 @@ This interface is the interface used to get whether the current namespace is loc } ``` +##### 3.2.17 Create App And grant administrative privileges + +App can be created through this interface, + +> note: 需要在创建第三方应用时,**勾选允许创建app,否则会触发异常,HTTP状态码401** +> +> note: When creating and allowing third-party application, **check the box to Allow app creation, otherwise an exception will be throw, HTTP status code 401** + +* **URL** : http://{portal_address}/openapi/v1/apps/ +* **Method** : POST +* **Request Params** :无 +* **Request Body, JSON format**: + +| Parameter Name | Required | Type | Description | +| ------------------- | -------- | -------- | -------------------------------------------------------- | +| assignAppRoleToSelf | true | Boolean | true:granting app's administrative privileges to self | +| admins | false | String[] | granting app's administrative privileges to those users | +| app | true | Object | APP's information,see Request Sample followed for field | + +* **Request Sample** : + +```json +{ + "assignAppRoleToSelf": true, + "admins": [ + "user1", + "user2" + ], + "app": { + "name": "appName1234", + "appId": "xxx-web", + "orgId": "development", + "orgName": "产品研发部", + "ownerName": "user3", + "ownerEmail": "user3@test.com" + } +} +``` + +* **Response Sample** : None + ### IV. Error code description Under normal circumstances, the Http status code returned by the interface is 200, the following lists the non-200 error code descriptions that Apollo will return. diff --git a/docs/zh/usage/apollo-open-api-platform.md b/docs/zh/usage/apollo-open-api-platform.md index 45400ff737f..6c869a16c00 100644 --- a/docs/zh/usage/apollo-open-api-platform.md +++ b/docs/zh/usage/apollo-open-api-platform.md @@ -102,6 +102,7 @@ namespaceName | 所管理的Namespace的名称,如果是非properties格式, - [3.2.14 获取 Namespace 最后一次发布的内容](#_3214-获取某个namespace当前生效的已发布配置接口) - [3.2.15 回滚 Namespace](#_3215-回滚已发布配置接口) - [3.2.16 分页获取配置项](#_3216-分页获取配置项接口) +- [3.2.17 创建App并授权给当前token](#3.2.17 创建App并授权给当前token) ##### 3.2.1 获取App的环境,集群信息 @@ -609,6 +610,45 @@ size | false | int | 页大小,默认为 50 } ``` +##### 3.2.17 创建App并获取管理员权限 + +可以通过此接口创建App, + +> 注意:需要在创建第三方应用时,**勾选允许创建app,否则会产生异常,HTTP状态码401** + +* **URL** : http://{portal_address}/openapi/v1/apps/ +* **Method** : POST +* **Request Params** :无 +* **请求内容(Request Body, JSON格式)** : + +| 参数名 | 必选 | 类型 | 说明 | +| ------------------- | ----- | -------- | ------------------------------------- | +| assignAppRoleToSelf | true | Boolean | true:授予自己APP的管理权限 | +| admins | false | String[] | 授予这些用户APP的管理权限 | +| app | true | Object | APP的信息,字段参考下方的请求值Sample | + +* **请求值 Sample** : + +```json +{ + "assignAppRoleToSelf": true, + "admins": [ + "user1", + "user2" + ], + "app": { + "name": "appName1234", + "appId": "xxx-web", + "orgId": "development", + "orgName": "产品研发部", + "ownerName": "user3", + "ownerEmail": "user3@test.com" + } +} +``` + +* **返回值 Sample** : 无返回值 + ### 四、错误码说明 正常情况下,接口返回的Http状态码是200,下面列举了Apollo会返回的非200错误码说明。 From 84600a1484a48708f3af84e9dcf462fa77969e17 Mon Sep 17 00:00:00 2001 From: wxq <15523186+Anilople@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:17:49 +0800 Subject: [PATCH 4/5] fix: url link --- docs/zh/usage/apollo-open-api-platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/usage/apollo-open-api-platform.md b/docs/zh/usage/apollo-open-api-platform.md index 6c869a16c00..5abdcf56791 100644 --- a/docs/zh/usage/apollo-open-api-platform.md +++ b/docs/zh/usage/apollo-open-api-platform.md @@ -102,7 +102,7 @@ namespaceName | 所管理的Namespace的名称,如果是非properties格式, - [3.2.14 获取 Namespace 最后一次发布的内容](#_3214-获取某个namespace当前生效的已发布配置接口) - [3.2.15 回滚 Namespace](#_3215-回滚已发布配置接口) - [3.2.16 分页获取配置项](#_3216-分页获取配置项接口) -- [3.2.17 创建App并授权给当前token](#3.2.17 创建App并授权给当前token) +- [3.2.17 创建App并获取管理员权限](#_3217-创建App并获取管理员权限) ##### 3.2.1 获取App的环境,集群信息 From e8be8c4ae1671dc455f7db56b048cd16c8f7f105 Mon Sep 17 00:00:00 2001 From: wxq <15523186+Anilople@users.noreply.github.com> Date: Thu, 21 Dec 2023 21:39:26 +0800 Subject: [PATCH 5/5] remove note duplicate --- docs/en/usage/apollo-open-api-platform.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/en/usage/apollo-open-api-platform.md b/docs/en/usage/apollo-open-api-platform.md index 10d827d6996..69dbd365d41 100644 --- a/docs/en/usage/apollo-open-api-platform.md +++ b/docs/en/usage/apollo-open-api-platform.md @@ -609,8 +609,6 @@ This interface is the interface used to get whether the current namespace is loc App can be created through this interface, -> note: 需要在创建第三方应用时,**勾选允许创建app,否则会触发异常,HTTP状态码401** -> > note: When creating and allowing third-party application, **check the box to Allow app creation, otherwise an exception will be throw, HTTP status code 401** * **URL** : http://{portal_address}/openapi/v1/apps/