Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Type

Required

Default

Description

userstringyes
User name
passwordstringyes
Password should be 8-20 characters long with at least 1 uppercase, 1 lowercase and 1 number.
phonestringyes
Phone number
isAdminboolyes
true: general administrator, false: general user
realNamestringyes
Real name

Response code

状态码Code

说明Description

200

Success

500

Unexpected internal errors

422Parameter validation error

...

Code

Description

200

Success

500

Unexpected internal errors

422Parameter validation error

Example

Code Block
title请求示例Example
collapsetrue
PUT /v1/user 
body: 
{ 
	"oldPassword": "xxx0", 
	"password": "xxx" 
} 
Response: 
{ 
	"code": 200, 
	"message": "success" 
}

...

Code

Description

200

Success

500

Unexpected internal errors

422Parameter validation error

Example

Code Block
title请求示例Example
collapsetrue
DELETE /v1/admin/user/1 
Response: 
{ 
	"code": 200, 
	"message": "success" 
}

...

Code

Description

200

Success

500

Unexpected internal errors

422Parameter validation error

Example

Code Block
title请求示例Example
collapsetrue
PUT /v1/admin/user/1/password 
Body: 
{ 
	"password": "xxx" 
} 
Response: 
{
	"code": 200, 
	"message": "success" 
}

...

Name

Type

Description

id
intUser id
user
stringUser name
statusint

Status  

0: Pending

1: Approved

2: Not Approved

3: Forbidden

realNamestringReal name
phonestringPhone number
totalintTotal number of users

createTime

int

Create time of user

updateTime

int

Update time of user

Example

Code Block
title使用示例Example
collapsetrue
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

422Parameter validation error

Example

Code Block
title请求示例Example
collapsetrue
PUT /v1/admin/user/1
body: 
{ 
	"status": 0 
} 
Response: 
{ 
	"code": 200, 
	"message": "success" 
}

...

Code

Description

200

Success

500

Unexpected internal errors

422Parameter validation error

Example

Code Block
title请求示例Example
collapsetrue
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.

enableAlertboolFlag to indicate if the alert information is enabled.

enableAdminAutoDeploy

bool

Allow deployment that admin submits run automatically without audit.

Example

Code Block
title请求示例Example
collapsetrue
GET /v1/authorization 
Response: 
{ 
	"data": 
	{ 
		"displayName": "ote_test1", 
		"hasRepoAccount": true, 
		"role": 4, 
		"privateProject": true, 
		"enableIngress": false, 
		"enableAlert": true, 
		"enableAdminAutoDeploy": true 
	},
	"code": 200, 
	"message": "Success" 
}

...

NameTypeRequiredDefaultDescription
namestringyes
Business name
introducestringyes
Introduction of business
objectivestringyes
purpose for creating business
scalestringyes
the scale of resources excepted to use

Example

Code Block
title请求示例Example
collapsetrue
POST /v1/business
{
"name": "name",
"introduce": "intrduce",
"objective": "objective",
"scale": "scale"
}

...

parameters

NameTypeRequiredDefault意义Description
pageintno1page
pageSizeintno10page size
orderBystringnoidorderBy allows sorting by id.
orderstringnoascsort order: asc, desc
namestringno
business name filter

...

NameTypeRequiredDescription
namestringyesbusiness name
userIdintyesuser id
commentstringyesaudit comment
statusint8yes

status

0: pending

1: approved

2: disapproved

3: deleted

Example

Code Block
titleExample
collapsetrue
GET /v1/business
{
	"data": [
	{
   	 	"name": "name",
   	 	"userId": 123,
   	 	"comment": "comment",
   	 	"id": 1,
   	 	"status": 0,
   	 	"createTime": 1590062196,
   	 	"updateTime": 1590062196
	}
  	],
	"total": 1,
	"code":200,
	"message": "Success"
}

...