Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: openapi 3.2.17 Create App And grant administrative privileges #5046

Merged
merged 7 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
43 changes: 42 additions & 1 deletion docs/en/usage/apollo-open-api-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> note: 需要在创建第三方应用时,**勾选允许创建app,否则会触发异常,HTTP状态码401**

Should this line be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to prompt user, some users maybe use 'old token' to call this openapi method and get the failed result.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur. My suggestion is to remove the line in Chinese since it's already duplicated in English below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. Remove it already.

>
> 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.
Expand Down
40 changes: 40 additions & 0 deletions docs/zh/usage/apollo-open-api-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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并获取管理员权限](#_3217-创建App并获取管理员权限)

##### 3.2.1 获取App的环境,集群信息

Expand Down Expand Up @@ -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错误码说明。
Expand Down
Loading