...
Name | Type | Required | Default | Description |
---|---|---|---|---|
user | string | yes | User name | |
password | string | yes | Password should be 8-20 characters long with at least 1 uppercase, 1 lowercase and 1 number. | |
phone | string | yes | Phone number | |
isAdmin | bool | yes | true: general administrator, false: general user | |
realName | string | yes | Real name |
Response code
状态码Code | 说明Description |
---|---|
200 | Success |
500 | Unexpected internal errors |
422 | Parameter validation error |
...
Code | Description |
---|---|
200 | Success |
500 | Unexpected internal errors |
422 | Parameter validation error |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
PUT /v1/user body: { "oldPassword": "xxx0", "password": "xxx" } Response: { "code": 200, "message": "success" } |
...
Code | Description |
---|---|
200 | Success |
500 | Unexpected internal errors |
422 | Parameter validation error |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
DELETE /v1/admin/user/1 Response: { "code": 200, "message": "success" } |
...
Code | Description |
---|---|
200 | Success |
500 | Unexpected internal errors |
422 | Parameter validation error |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
PUT /v1/admin/user/1/password Body: { "password": "xxx" } Response: { "code": 200, "message": "success" } |
...
Name | Type | Description |
---|---|---|
id | int | User id |
user | string | User name |
status | int | Status 0: Pending 1: Approved 2: Not Approved 3: Forbidden |
realName | string | Real name |
phone | string | Phone number |
total | int | Total number of users |
createTime | int | Create time of user |
updateTime | int | Update time of user |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
GET /v1/admin/user Response: { "data": [ {"id":1, "user":"user1", "status":3, "realName":"user1", "phone":"18923441163", "createTime":1551758321, "updateTime":1551758321 }, {"id":2, "user":"user2", "status":3, "realName":"user2", "phone":"18923441123", "createTime":1551758321, "updateTime":1551758321 } ], "total": 2, "code": 200, "message": "Success" } |
...
Code | Description |
---|---|
200 | Success |
500 | Unexpected internal errors |
422 | Parameter validation error |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
PUT /v1/admin/user/1 body: { "status": 0 } Response: { "code": 200, "message": "success" } |
...
Code | Description |
---|---|
200 | Success |
500 | Unexpected internal errors |
422 | Parameter validation error |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
DELETE /v1/authorizations Header: Authorization: eyxxxxxxxxxxxxxx Response: { "code": 200, "message": "Success" } |
...
Name | Type | Description |
---|---|---|
displayName | string | User name |
hasRepoAccount | bool | Whether or not the user has created a harbor account |
role | int | User role: 0: register user that waiting for approval 1:approved user that do not has business namespace 2:general user 3:business administrator 4:system administrator |
privateProject | bool | Flag to indicate if the project is private. |
enableIngress | bool | Flag to indicate if the ingress is enabled. |
enableAlert | bool | Flag to indicate if the alert information is enabled. |
enableAdminAutoDeploy | bool | Allow deployment that admin submits run automatically without audit. |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
GET /v1/authorization Response: { "data": { "displayName": "ote_test1", "hasRepoAccount": true, "role": 4, "privateProject": true, "enableIngress": false, "enableAlert": true, "enableAdminAutoDeploy": true }, "code": 200, "message": "Success" } |
...
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | string | yes | Business name | |
introduce | string | yes | Introduction of business | |
objective | string | yes | purpose for creating business | |
scale | string | yes | the scale of resources excepted to use |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
POST /v1/business { "name": "name", "introduce": "intrduce", "objective": "objective", "scale": "scale" } |
...
parameters
Name | Type | Required | Default | 意义Description |
---|---|---|---|---|
page | int | no | 1 | page |
pageSize | int | no | 10 | page size |
orderBy | string | no | id | orderBy allows sorting by id. |
order | string | no | asc | sort order: asc, desc |
name | string | no | business name filter |
...
Name | Type | Required | Description |
---|---|---|---|
name | string | yes | business name |
userId | int | yes | user id |
comment | string | yes | audit comment |
status | int8 | yes | status 0: pending 1: approved 2: disapproved 3: deleted |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
GET /v1/business { "data": [ { "name": "name", "userId": 123, "comment": "comment", "id": 1, "status": 0, "createTime": 1590062196, "updateTime": 1590062196 } ], "total": 1, "code":200, "message": "Success" } |
...