-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
nobodyiam
merged 7 commits into
apolloconfig:master
from
Anilople:docs/openapi-create-app
Dec 22, 2023
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c4fb407
docs: openapi 3.2.17 Create App And grant administrative privileges
Anilople 9c94bbf
fix: url link
Anilople dc0c0e1
docs: openapi 3.2.17 Create App And grant administrative privileges
Anilople 84600a1
fix: url link
Anilople 30e8686
Merge branch 'docs/openapi-create-app' of https://github.com/Anilople…
Anilople e8be8c4
remove note duplicate
Anilople 60255f7
Merge branch 'master' into docs/openapi-create-app
nobodyiam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "[email protected]" | ||
} | ||
} | ||
``` | ||
|
||
* **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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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的环境,集群信息 | ||
|
||
|
@@ -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": "[email protected]" | ||
} | ||
} | ||
``` | ||
|
||
* **返回值 Sample** : 无返回值 | ||
|
||
### 四、错误码说明 | ||
|
||
正常情况下,接口返回的Http状态码是200,下面列举了Apollo会返回的非200错误码说明。 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this line be deleted?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.