2016-03-10 11:05:12 +01:00
swagger : '2.0'
info :
title : Harbor API
description : These APIs provide services for manipulating Harbor project.
2020-02-07 08:04:25 +01:00
version : '2.0'
2017-01-20 09:25:03 +01:00
host : localhost
2016-03-10 11:05:12 +01:00
schemes :
- http
2018-08-01 00:38:23 +02:00
- https
2020-02-07 08:04:25 +01:00
basePath : /api/v2.0
2016-03-10 11:05:12 +01:00
produces :
- application/json
- text/plain
consumes :
- application/json
2018-08-01 00:38:23 +02:00
securityDefinitions :
basicAuth :
type : basic
security :
- basicAuth : [ ]
2016-03-10 11:05:12 +01:00
paths :
2019-01-11 05:53:34 +01:00
/health :
get :
summary : 'Health check API'
description : |
The endpoint returns the health stauts of the system.
tags :
- Products
responses :
'200' :
description : The system health status.
schema :
$ref : '#/definitions/OverallHealthStatus'
2017-10-23 08:42:30 +02:00
'/projects/{project_id}/metadatas' :
get :
summary : Get project metadata.
description : |
This endpoint returns metadata of the project specified by project ID.
parameters :
- name : project_id
in : path
description : The ID of project.
required : true
type : integer
format : int64
tags :
- Products
responses :
'200' :
description : Get metadata successfully.
schema :
$ref : '#/definitions/ProjectMetadata'
'401' :
description : User need to login first.
'500' :
description : Internal server errors.
post :
summary : Add metadata for the project.
description : |
This endpoint is aimed to add metadata of a project.
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : Selected project ID.
- name : metadata
in : body
required : true
schema :
$ref : '#/definitions/ProjectMetadata'
description : The metadata of project.
tags :
- Products
responses :
'200' :
description : Add metadata successfully.
'400' :
description : Invalid request.
'401' :
description : User need to log in first.
'403' :
description : User does not have permission to the project.
'404' :
description : Project ID does not exist.
2018-01-28 18:43:03 +01:00
'415' :
$ref : '#/responses/UnsupportedMediaType'
2017-10-23 08:42:30 +02:00
'500' :
description : Internal server errors.
'/projects/{project_id}/metadatas/{meta_name}' :
get :
summary : Get project metadata
description : |
This endpoint returns specified metadata of a project.
parameters :
- name : project_id
in : path
description : Project ID for filtering results.
required : true
type : integer
format : int64
- name : meta_name
in : path
description : The name of metadat.
required : true
type : string
tags :
- Products
responses :
'200' :
description : Get metadata successfully.
schema :
$ref : '#/definitions/ProjectMetadata'
'401' :
description : User need to log in first.
'500' :
description : Internal server errors.
put :
summary : Update metadata of a project.
description : |
This endpoint is aimed to update the metadata of a project.
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : The ID of project.
- name : meta_name
in : path
description : The name of metadat.
required : true
type : string
tags :
- Products
responses :
'200' :
description : Updated metadata successfully.
'400' :
description : Invalid request.
'401' :
description : User need to log in first.
'403' :
description : User does not have permission to the project.
'404' :
description : Project or metadata does not exist.
'500' :
description : Internal server errors.
delete :
summary : Delete metadata of a project
description : |
This endpoint is aimed to delete metadata of a project.
parameters :
- name : project_id
in : path
description : The ID of project.
required : true
type : integer
format : int64
- name : meta_name
in : path
description : The name of metadat.
required : true
type : string
tags :
- Products
responses :
'200' :
description : Metadata is deleted successfully.
'400' :
description : Invalid requst.
'403' :
description : User need to log in first.
'404' :
description : Project or metadata does not exist.
'500' :
description : Internal server errors.
2018-04-11 11:12:33 +02:00
'/projects/{project_id}/members' :
2018-03-26 07:18:52 +02:00
get :
2018-08-15 12:53:49 +02:00
summary : Get all project member information
description : Get all project member information
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : Relevant project ID.
- name : entityname
in : query
type : string
description : The entity name to search.
tags :
- Products
responses :
'200' :
description : Get project members successfully.
schema :
type : array
items :
$ref : '#/definitions/ProjectMemberEntity'
'400' :
description : The project id is invalid.
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the project.
'404' :
description : Project ID does not exist.
'500' :
description : Unexpected internal errors.
2018-03-26 07:18:52 +02:00
post :
summary : Create project member
2018-09-12 13:57:40 +02:00
description : 'Create project member relationship, the member can be one of the user_member and group_member, The user_member need to specify user_id or username. If the user already exist in harbor DB, specify the user_id, If does not exist in harbor DB, it will SearchAndOnBoard the user. The group_member need to specify id or ldap_group_dn. If the group already exist in harbor DB. specify the user group' 's id, If does not exist, it will SearchAndOnBoard the group. '
2018-03-26 07:18:52 +02:00
tags :
2018-08-15 12:53:49 +02:00
- Products
2018-03-26 07:18:52 +02:00
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : Relevant project ID.
- name : project_member
in : body
schema :
$ref : '#/definitions/ProjectMember'
responses :
'201' :
description : Project member created successfully.
2020-09-06 21:06:38 +02:00
headers :
Location :
type : string
description : The URL of the created resource
2018-03-26 07:18:52 +02:00
'400' :
2018-09-12 13:57:40 +02:00
description : 'Illegal format of project member or project id is invalid, or LDAP DN is invalid.'
2018-03-26 07:18:52 +02:00
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the project.
2018-08-03 10:05:09 +02:00
'409' :
2019-07-16 09:38:44 +02:00
description : A user group with same group name already exist or an LDAP user group with same DN already exist.
2018-03-26 07:18:52 +02:00
'500' :
2018-08-15 12:53:49 +02:00
description : Unexpected internal errors.
2018-04-11 11:12:33 +02:00
'/projects/{project_id}/members/{mid}' :
2018-03-26 07:18:52 +02:00
get :
2018-08-15 12:53:49 +02:00
summary : Get the project member information
description : Get the project member information
tags :
- Products
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : Relevant project ID.
- name : mid
in : path
type : integer
format : int64
required : true
description : The member ID
responses :
2018-03-26 07:18:52 +02:00
'200' :
description : Project member retrieved successfully.
schema :
$ref : '#/definitions/ProjectMemberEntity'
'400' :
2018-08-15 12:53:49 +02:00
description : 'Illegal format of project member or invalid project id, member id.'
2018-03-26 07:18:52 +02:00
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the project.
'404' :
description : Project or projet member does not exist.
'500' :
2018-08-15 12:53:49 +02:00
description : Unexpected internal errors.
2018-03-26 07:18:52 +02:00
put :
2018-08-15 12:53:49 +02:00
summary : Update project member
description : Update project member relationship
tags :
2018-03-26 07:18:52 +02:00
- Products
2018-08-15 12:53:49 +02:00
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : Relevant project ID.
- name : mid
in : path
type : integer
format : int64
required : true
description : Member ID.
- name : role
in : body
schema :
$ref : '#/definitions/RoleRequest'
responses :
'200' :
description : Project member updated successfully.
'400' :
2018-09-12 13:57:40 +02:00
description : 'Invalid role id, it should be 1,2 or 3, or invalid project id, or invalid member id.'
2018-08-15 12:53:49 +02:00
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the project.
'404' :
description : project or project member does not exist.
'500' :
description : Unexpected internal errors.
2018-03-26 07:18:52 +02:00
delete :
2018-08-15 12:53:49 +02:00
summary : Delete project member
tags :
- Products
parameters :
- name : project_id
in : path
type : integer
format : int64
required : true
description : Relevant project ID.
- name : mid
in : path
type : integer
format : int64
required : true
description : Member ID.
responses :
'200' :
description : Project member deleted successfully.
'400' :
description : The project id or project member id is invalid.
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the project.
'500' :
description : Unexpected internal errors.
2016-05-26 10:48:49 +02:00
/statistics :
2016-06-07 14:38:56 +02:00
get :
2016-06-08 09:14:41 +02:00
summary : Get projects number and repositories number relevant to the user
2018-09-12 13:57:40 +02:00
description : |
This endpoint is aimed to statistic all of the projects number and repositories number relevant to the logined user, also the public projects number and repositories number. If the user is admin, he can also get total projects number and total repositories number.
2016-06-07 14:38:56 +02:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2018-09-12 13:57:40 +02:00
description : Get the projects number and repositories number relevant to the user successfully.
2016-06-08 09:14:41 +02:00
schema :
2016-06-08 11:00:25 +02:00
$ref : '#/definitions/StatisticMap'
2017-07-20 12:47:46 +02:00
'401' :
2016-05-26 10:48:49 +02:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'500' :
2016-05-26 10:48:49 +02:00
description : Unexpected internal errors.
2016-03-10 11:05:12 +01:00
/users :
get :
summary : Get registered users of Harbor.
2018-09-12 13:57:40 +02:00
description : |
This endpoint is for user to search registered users, support for filtering results with username.Notice, by now this operation is only for administrator.
2016-03-10 11:05:12 +01:00
parameters :
2016-08-11 11:39:36 +02:00
- name : username
2016-03-10 11:05:12 +01:00
in : query
type : string
required : false
description : Username for filtering results.
2017-06-12 11:49:18 +02:00
- name : email
in : query
type : string
required : false
description : Email for filtering results.
- name : page
in : query
type : integer
format : int32
required : false
2019-09-03 09:52:41 +02:00
description : 'The page number, default is 1.'
2017-06-12 11:49:18 +02:00
- name : page_size
in : query
type : integer
format : int32
required : false
description : The size of per page.
2016-03-10 11:05:12 +01:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2016-03-10 11:05:12 +01:00
description : Searched for users of Harbor successfully.
schema :
type : array
items :
$ref : '#/definitions/User'
2020-09-06 21:06:38 +02:00
headers :
X-Total-Count :
description : The total count of available items
type : integer
Link :
description : Link to previous page and next page
type : string
2017-07-20 12:47:46 +02:00
'400' :
2016-03-10 11:05:12 +01:00
description : Invalid user ID.
2017-07-20 12:47:46 +02:00
'401' :
2016-03-10 11:05:12 +01:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'403' :
2016-03-10 11:05:12 +01:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'500' :
2016-03-10 11:05:12 +01:00
description : Unexpected internal errors.
2016-05-03 05:58:50 +02:00
post :
summary : Creates a new user account.
description : |
This endpoint is to create a user if the user does not already exist.
parameters :
2016-05-04 03:27:07 +02:00
- name : user
2016-05-03 05:58:50 +02:00
in : body
2016-05-04 03:27:07 +02:00
description : New created user.
2016-05-03 05:58:50 +02:00
required : true
2016-05-04 03:27:07 +02:00
schema :
$ref : '#/definitions/User'
2016-05-03 05:58:50 +02:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'201' :
2016-05-03 05:58:50 +02:00
description : User created successfully.
2020-09-06 21:06:38 +02:00
headers :
Location :
type : string
description : The URL of the created resource
2017-07-20 12:47:46 +02:00
'400' :
2016-05-03 05:58:50 +02:00
description : Unsatisfied with constraints of the user creation.
2017-07-20 12:47:46 +02:00
'403' :
2018-09-12 13:57:40 +02:00
description : User registration can only be used by admin role user when self-registration is off.
2018-01-28 18:43:03 +01:00
'415' :
$ref : '#/responses/UnsupportedMediaType'
2017-07-20 12:47:46 +02:00
'500' :
2016-05-03 05:58:50 +02:00
description : Unexpected internal errors.
2016-11-18 10:05:11 +01:00
/users/current :
get :
summary : Get current user info.
description : |
2019-01-31 14:49:06 +01:00
This endpoint is to get the current user information.
2016-11-18 10:05:11 +01:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2016-11-18 10:05:11 +01:00
description : Get current user information successfully.
schema :
$ref : '#/definitions/User'
2017-07-20 12:47:46 +02:00
'401' :
2016-11-18 10:05:11 +01:00
description : User need to log in first.
2019-01-28 11:06:52 +01:00
/users/current/permissions :
get :
summary : Get current user permissions.
description : |
This endpoint is to get the current user permissions.
parameters :
- name : scope
in : query
type : string
required : false
description : Get permissions of the scope
- name : relative
in : query
type : boolean
required : false
description : |
If true, the resources in the response are relative to the scope,
eg for resource '/project/1/repository' if relative is 'true' then the resource in response will be 'repository'.
tags :
- Products
responses :
'200' :
description : Get current user permission successfully.
schema :
type : array
items :
$ref : '#/definitions/Permission'
'401' :
description : User need to log in first.
'500' :
description : Internal errors.
2019-03-07 05:47:26 +01:00
/users/search :
get :
2019-09-25 07:32:29 +02:00
summary : Search users by username
2019-03-07 05:47:26 +01:00
description : |
2019-09-25 07:32:29 +02:00
This endpoint is to search the users by username.
2019-03-07 05:47:26 +01:00
parameters :
- name : username
in : query
type : string
2019-09-25 07:32:29 +02:00
required : true
2019-03-07 05:47:26 +01:00
description : Username for filtering results.
- name : page
in : query
type : integer
format : int32
required : false
2019-09-03 09:52:41 +02:00
description : 'The page number, default is 1.'
2019-03-07 05:47:26 +01:00
- name : page_size
in : query
type : integer
format : int32
required : false
description : The size of per page.
tags :
- Products
responses :
'200' :
description : Search users by username, email successfully.
schema :
type : array
items :
$ref : '#/definitions/UserSearch'
2020-09-06 21:06:38 +02:00
headers :
X-Total-Count :
description : The total count of available items
type : integer
Link :
description : Link to previous page and next page
type : string
2019-03-07 05:47:26 +01:00
'500' :
description : Unexpected internal errors.
2017-07-20 12:47:46 +02:00
'/users/{user_id}' :
2017-06-27 12:08:49 +02:00
get :
summary : Get a user's profile.
description : |
2017-07-20 12:47:46 +02:00
Get user's profile with user id.
2017-06-27 12:08:49 +02:00
parameters :
- name : user_id
in : path
type : integer
format : int
required : true
2017-07-20 12:47:46 +02:00
description : Registered user ID
2017-06-27 12:08:49 +02:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2017-06-27 12:08:49 +02:00
description : Get user's profile successfully.
2018-10-24 07:23:09 +02:00
schema :
$ref : '#/definitions/User'
2017-07-20 12:47:46 +02:00
'400' :
2017-06-27 12:08:49 +02:00
description : Invalid user ID.
2017-07-20 12:47:46 +02:00
'401' :
2017-06-27 12:08:49 +02:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'403' :
2017-06-27 12:08:49 +02:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'404' :
2017-06-27 12:08:49 +02:00
description : User ID does not exist.
2017-07-20 12:47:46 +02:00
'500' :
2017-06-27 12:08:49 +02:00
description : Unexpected internal errors.
2016-03-10 11:05:12 +01:00
put :
2016-05-26 10:48:49 +02:00
summary : Update a registered user to change his profile.
2016-03-10 11:05:12 +01:00
description : |
2017-07-20 12:47:46 +02:00
This endpoint let a registered user change his profile.
2016-03-10 11:05:12 +01:00
parameters :
- name : user_id
in : path
type : integer
2016-08-11 11:39:36 +02:00
format : int
2016-03-10 11:05:12 +01:00
required : true
description : Registered user ID
2016-06-07 14:38:56 +02:00
- name : profile
2016-05-27 11:54:25 +02:00
in : body
2017-07-20 12:47:46 +02:00
description : 'Only email, realname and comment can be modified.'
2016-05-27 11:54:25 +02:00
required : true
2016-06-07 14:38:56 +02:00
schema :
2017-07-20 12:47:46 +02:00
$ref : '#/definitions/UserProfile'
2016-03-10 11:05:12 +01:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2017-06-27 12:08:49 +02:00
description : Updated user's profile successfully.
2017-07-20 12:47:46 +02:00
'400' :
2016-03-10 11:05:12 +01:00
description : Invalid user ID.
2017-07-20 12:47:46 +02:00
'401' :
2016-03-10 11:05:12 +01:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'403' :
2016-03-10 11:05:12 +01:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'404' :
2016-03-10 11:05:12 +01:00
description : User ID does not exist.
2017-07-20 12:47:46 +02:00
'500' :
2016-03-10 11:05:12 +01:00
description : Unexpected internal errors.
delete :
summary : Mark a registered user as be removed.
description : |
This endpoint let administrator of Harbor mark a registered user as
be removed.It actually won't be deleted from DB.
parameters :
- name : user_id
in : path
type : integer
2016-08-11 11:39:36 +02:00
format : int
2016-03-10 11:05:12 +01:00
required : true
description : User ID for marking as to be removed.
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2016-03-10 11:05:12 +01:00
description : Marked user as be removed successfully.
2017-07-20 12:47:46 +02:00
'400' :
2016-03-10 11:05:12 +01:00
description : Invalid user ID.
2017-07-20 12:47:46 +02:00
'401' :
2016-03-10 11:05:12 +01:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'403' :
2016-03-10 11:05:12 +01:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'404' :
2016-03-10 11:05:12 +01:00
description : User ID does not exist.
2017-07-20 12:47:46 +02:00
'500' :
2016-03-10 11:05:12 +01:00
description : Unexpected internal errors.
2017-07-20 12:47:46 +02:00
'/users/{user_id}/password' :
2016-05-03 05:58:50 +02:00
put :
summary : Change the password on a user that already exists.
2018-09-12 13:57:40 +02:00
description : |
This endpoint is for user to update password. Users with the admin role can change any user's password. Guest users can change only their own password.
2016-05-03 05:58:50 +02:00
parameters :
- name : user_id
in : path
type : integer
2016-08-11 11:39:36 +02:00
format : int
2016-05-03 05:58:50 +02:00
required : true
description : Registered user ID.
2016-05-04 03:27:07 +02:00
- name : password
2016-05-03 05:58:50 +02:00
in : body
2018-09-12 13:57:40 +02:00
description : Password to be updated, the attribute 'old_password' is optional when the API is called by the system administrator.
2016-05-03 05:58:50 +02:00
required : true
2016-05-04 03:27:07 +02:00
schema :
2017-07-20 12:47:46 +02:00
$ref : '#/definitions/Password'
2016-05-03 05:58:50 +02:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2016-05-03 05:58:50 +02:00
description : Updated password successfully.
2017-07-20 12:47:46 +02:00
'400' :
2016-05-03 06:05:06 +02:00
description : Invalid user ID; Old password is blank; New password is blank.
2017-07-20 12:47:46 +02:00
'401' :
2016-08-11 11:39:36 +02:00
description : Don't have authority to change password. Please check login status.
2017-07-20 12:47:46 +02:00
'403' :
2019-04-19 12:44:24 +02:00
description : The caller does not have permission to update the password of the user with given ID, or the old password in request body is not correct.
2017-07-20 12:47:46 +02:00
'500' :
2016-05-26 10:48:49 +02:00
description : Unexpected internal errors.
2017-07-20 12:47:46 +02:00
'/users/{user_id}/sysadmin' :
put :
2016-05-26 10:48:49 +02:00
summary : Update a registered user to change to be an administrator of Harbor.
description : |
This endpoint let a registered user change to be an administrator
of Harbor.
parameters :
- name : user_id
in : path
type : integer
2016-08-11 11:39:36 +02:00
format : int
2016-05-26 10:48:49 +02:00
required : true
description : Registered user ID
2019-12-11 10:17:18 +01:00
- name : sysadmin_flag
2016-09-22 07:20:10 +02:00
in : body
2017-07-20 12:47:46 +02:00
description : Toggle a user to admin or not.
2016-09-22 07:20:10 +02:00
required : true
schema :
2019-12-11 10:17:18 +01:00
$ref : '#/definitions/SysAdminFlag'
2016-05-26 10:48:49 +02:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2016-05-26 10:48:49 +02:00
description : Updated user's admin role successfully.
2017-07-20 12:47:46 +02:00
'400' :
2016-05-26 10:48:49 +02:00
description : Invalid user ID.
2017-07-20 12:47:46 +02:00
'401' :
2016-05-26 10:48:49 +02:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'403' :
2016-05-26 10:48:49 +02:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'404' :
2016-05-26 10:48:49 +02:00
description : User ID does not exist.
2017-07-20 12:47:46 +02:00
'500' :
2016-05-26 10:48:49 +02:00
description : Unexpected internal errors.
2019-10-10 13:46:30 +02:00
'/users/{user_id}/cli_secret' :
put :
summary : Set CLI secret for a user.
2019-04-19 12:44:24 +02:00
description : |
This endpoint let user generate a new CLI secret for himself. This API only works when auth mode is set to 'OIDC'.
Once this API returns with successful status, the old secret will be invalid, as there will be only one CLI secret
2019-10-10 13:46:30 +02:00
for a user.
2019-04-19 12:44:24 +02:00
parameters :
- name : user_id
in : path
type : integer
format : int
required : true
description : User ID
2019-10-10 13:46:30 +02:00
- name : input_secret
in : body
description : JSON object that includes the new secret
required : true
2019-04-19 12:44:24 +02:00
schema :
type : object
properties :
secret :
type : string
description : The new secret
2019-10-10 13:46:30 +02:00
tags :
- Products
responses :
'200' :
description : The secret is successfully updated
2019-04-19 12:44:24 +02:00
'400' :
2019-10-10 13:46:30 +02:00
description : Invalid user ID. Or user is not onboarded via OIDC authentication. Or the secret does not meet the standard.
2019-04-19 12:44:24 +02:00
'401' :
description : User need to log in first.
'403' :
description : Non-admin user can only generate the cli secret of himself.
'404' :
description : User ID does not exist.
'412' :
description : The auth mode of the system is not "oidc_auth", or the user is not onboarded via OIDC AuthN.
'500' :
description : Unexpected internal errors.
2018-03-07 06:20:28 +01:00
/labels :
get :
summary : List labels according to the query strings.
2018-08-15 12:53:49 +02:00
description : |
2018-03-07 06:20:28 +01:00
This endpoint let user list labels by name, scope and project_id
parameters :
- name : name
in : query
type : string
required : false
description : The label name.
- name : scope
in : query
type : string
required : true
2018-09-12 13:57:40 +02:00
description : The label scope. Valid values are g and p. g for global labels and p for project labels.
2018-03-07 06:20:28 +01:00
- name : project_id
in : query
type : integer
format : int64
required : false
2018-08-15 12:53:49 +02:00
description : 'Relevant project ID, required when scope is p.'
2018-03-07 06:20:28 +01:00
- name : page
in : query
type : integer
format : int32
required : false
2020-09-06 21:06:38 +02:00
description : The page number.
2018-03-07 06:20:28 +01:00
- name : page_size
in : query
type : integer
format : int32
required : false
description : The size of per page.
tags :
- Products
responses :
'200' :
description : Get successfully.
schema :
type : array
items :
$ref : '#/definitions/Label'
2020-09-06 21:06:38 +02:00
headers :
X-Total-Count :
description : The total count of available items
type : integer
Link :
description : Link to previous page and next page
type : string
2018-03-07 06:20:28 +01:00
'400' :
description : Invalid parameters.
'401' :
description : User need to log in first.
'500' :
description : Unexpected internal errors.
post :
summary : Post creates a label
2018-08-15 12:53:49 +02:00
description : |
2018-03-07 06:20:28 +01:00
This endpoint let user creates a label.
parameters :
- name : label
in : body
description : The json object of label.
required : true
schema :
$ref : '#/definitions/Label'
tags :
- Products
responses :
'201' :
description : Create successfully.
2020-09-06 21:06:38 +02:00
headers :
Location :
type : string
description : The URL of the created resource
2018-03-07 06:20:28 +01:00
'400' :
description : Invalid parameters.
'401' :
description : User need to log in first.
'409' :
2018-08-15 12:53:49 +02:00
description : Label with the same name and same scope already exists.
2018-03-07 06:20:28 +01:00
'415' :
$ref : '#/responses/UnsupportedMediaType'
'500' :
description : Unexpected internal errors.
'/labels/{id}' :
get :
summary : Get the label specified by ID.
description : |
This endpoint let user get the label by specific ID.
parameters :
- name : id
in : path
type : integer
format : int64
required : true
description : Label ID
tags :
- Products
responses :
'200' :
description : Get successfully.
schema :
$ref : '#/definitions/Label'
'401' :
description : User need to log in first.
'404' :
description : The resource does not exist.
'500' :
description : Unexpected internal errors.
put :
summary : Update the label properties.
2018-08-15 12:53:49 +02:00
description : |
2018-03-07 06:20:28 +01:00
This endpoint let user update label properties.
parameters :
- name : id
in : path
type : integer
format : int64
required : true
description : Label ID
- name : label
in : body
description : The updated label json object.
required : true
schema :
$ref : '#/definitions/Label'
tags :
- Products
responses :
'200' :
description : Update successfully.
'400' :
description : Invalid parameters.
'401' :
description : User need to log in first.
'404' :
description : The resource does not exist.
'409' :
2018-08-15 12:53:49 +02:00
description : The label with the same name already exists.
2018-03-07 06:20:28 +01:00
'500' :
description : Unexpected internal errors.
delete :
summary : Delete the label specified by ID.
2018-08-15 12:53:49 +02:00
description : |
2018-03-07 06:20:28 +01:00
Delete the label specified by ID.
parameters :
- name : id
in : path
type : integer
format : int64
required : true
description : Label ID
tags :
- Products
responses :
'200' :
description : Delete successfully.
'400' :
description : Invalid parameters.
'401' :
description : User need to log in first.
'404' :
description : The resource does not exist.
'500' :
description : Unexpected internal errors.
2018-03-26 07:18:52 +02:00
/usergroups :
2018-08-15 12:53:49 +02:00
get :
summary : Get all user groups information
description : Get all user groups information
tags :
- Products
responses :
'200' :
description : Get user group successfully.
schema :
type : array
items :
$ref : '#/definitions/UserGroup'
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the user group.
'500' :
description : Unexpected internal errors.
post :
2018-03-26 07:18:52 +02:00
summary : Create user group
description : Create user group information
tags :
2018-08-15 12:53:49 +02:00
- Products
2018-03-26 07:18:52 +02:00
parameters :
- name : usergroup
in : body
schema :
$ref : '#/definitions/UserGroup'
responses :
'201' :
description : User group created successfully.
2020-09-06 21:06:38 +02:00
headers :
Location :
type : string
description : The URL of the created resource
2018-06-13 12:35:54 +02:00
'400' :
description : Invalid LDAP group DN.
2018-03-26 07:18:52 +02:00
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the user group.
'409' :
2019-07-16 09:38:44 +02:00
description : A user group with same group name already exist, or an LDAP user group with same DN already exist.
2018-08-15 12:53:49 +02:00
'500' :
description : Unexpected internal errors.
'/usergroups/{group_id}' :
get :
summary : Get user group information
description : Get user group information
tags :
- Products
parameters :
- name : group_id
in : path
type : integer
format : int64
required : true
description : Group ID
responses :
'200' :
description : User group get successfully.
schema :
$ref : '#/definitions/UserGroup'
'400' :
description : The user group id is invalid.
'401' :
description : User need to log in first.
'403' :
description : User in session does not have permission to the user group.
'404' :
description : User group does not exist.
'500' :
description : Unexpected internal errors.
put :
summary : Update group information
description : Update user group information
tags :
- Products
parameters :
- name : group_id
in : path
type : integer
format : int64
required : true
description : Group ID
- name : usergroup
in : body
required : false
schema :
$ref : '#/definitions/UserGroup'
responses :
'200' :
description : User group updated successfully.
'400' :
description : The user group id is invalid.
'401' :
description : User need to log in first.
'403' :
description : Only admin has this authority.
'404' :
description : User group does not exist.
'500' :
description : Unexpected internal errors.
delete :
summary : Delete user group
description : Delete user group
tags :
- Products
parameters :
- name : group_id
type : integer
in : path
required : true
responses :
'200' :
description : User group deleted successfully.
'400' :
description : The user group id is invalid.
'401' :
description : User need to log in first.
'403' :
description : Only admin has this authority.
'500' :
description : Unexpected internal errors.
2017-02-09 06:58:48 +01:00
/configurations :
get :
summary : Get system configurations.
2018-09-12 13:57:40 +02:00
description : |
This endpoint is for retrieving system configurations that only provides for admin user.
2017-02-09 06:58:48 +01:00
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2017-02-09 06:58:48 +01:00
description : Get system configurations successfully. The response body is a map.
schema :
2018-08-01 00:38:23 +02:00
$ref : '#/definitions/ConfigurationsResponse'
2017-07-20 12:47:46 +02:00
'401' :
2018-08-01 00:38:23 +02:00
description : User need to log in first.ß
2017-07-20 12:47:46 +02:00
'403' :
2017-02-09 06:58:48 +01:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'500' :
2017-02-09 06:58:48 +01:00
description : Unexpected internal errors.
put :
summary : Modify system configurations.
2018-09-12 13:57:40 +02:00
description : |
This endpoint is for modifying system configurations that only provides for admin user.
2017-02-09 06:58:48 +01:00
tags :
- Products
parameters :
- name : configurations
in : body
2017-07-20 12:47:46 +02:00
required : true
2017-02-09 06:58:48 +01:00
schema :
2017-08-30 10:39:54 +02:00
$ref : '#/definitions/Configurations'
2018-09-12 13:57:40 +02:00
description : 'The configuration map can contain a subset of the attributes of the schema, which are to be updated.'
2017-02-09 06:58:48 +01:00
responses :
2017-07-20 12:47:46 +02:00
'200' :
2017-02-09 06:58:48 +01:00
description : Modify system configurations successfully.
2017-07-20 12:47:46 +02:00
'401' :
2017-03-14 05:52:44 +01:00
description : User need to log in first.
2017-07-20 12:47:46 +02:00
'403' :
2017-03-14 05:52:44 +01:00
description : User does not have permission of admin role.
2017-07-20 12:47:46 +02:00
'500' :
2017-03-14 05:52:44 +01:00
description : Unexpected internal errors.
2017-03-03 11:02:08 +01:00
/email/ping :
post :
summary : Test connection and authentication with email server.
description : |
2019-04-19 12:44:24 +02:00
Test connection and authentication with email server.
2017-03-03 11:02:08 +01:00
parameters :
- name : settings
in : body
2018-09-12 13:57:40 +02:00
description : 'Email server settings, if some of the settings are not assigned, they will be read from system configuration.'
2017-03-03 11:02:08 +01:00
required : false
schema :
$ref : '#/definitions/EmailServerSetting'
tags :
- Products
responses :
2017-07-20 12:47:46 +02:00
'200' :
2017-03-03 11:02:08 +01:00
description : Ping email server successfully.
2017-07-20 12:47:46 +02:00
'400' :
2017-03-03 11:02:08 +01:00
description : Inviald email server settings.
2017-07-20 12:47:46 +02:00
'401' :
2017-03-03 11:02:08 +01:00
description : User need to login first.
2017-07-20 12:47:46 +02:00
'403' :
2017-03-03 11:02:08 +01:00
description : Only admin has this authority.
2018-01-28 18:43:03 +01:00
'415' :
2018-03-19 02:22:10 +01:00
$ref : '#/responses/UnsupportedMediaType'
2017-07-20 12:47:46 +02:00
'500' :
description : Unexpected internal errors.
2018-12-12 04:54:22 +01:00
/chartrepo/{repo}/charts/{name}/{version}/labels:
2018-10-11 10:08:34 +02:00
get :
summary : Return the attahced labels of chart.
description : Return the attahced labels of the specified chart version.
tags :
- Products
- Chart Repository
- Label
parameters :
- name : repo
in : path
type : string
required : true
description : The project name
- name : name
in : path
type : string
required : true
description : The chart name
- name : version
in : path
type : string
required : true
description : The chart version
responses :
'200' :
$ref : '#/definitions/Labels'
'401' :
$ref : '#/definitions/UnauthorizedChartAPIError'
'403' :
$ref : '#/definitions/ForbiddenChartAPIError'
'404' :
$ref : '#/definitions/NotFoundChartAPIError'
'500' :
$ref : '#/definitions/InternalChartAPIError'
post :
summary : Mark label to chart.
description : Mark label to the specified chart version.
tags :
- Products
- Chart Repository
- Label
parameters :
- name : repo
in : path
type : string
required : true
description : The project name
- name : name
in : path
type : string
required : true
description : The chart name
- name : version
in : path
type : string
required : true
description : The chart version
- name : label
in : body
required : true
schema :
$ref : '#/definitions/Label'
description : 'The label being marked to the chart version'
responses :
'200' :
description : The label is successfully marked to the chart version.
'400' :
$ref : '#/definitions/BadRequestFormatedError'
'401' :
$ref : '#/definitions/UnauthorizedChartAPIError'
'403' :
$ref : '#/definitions/ForbiddenChartAPIError'
'404' :
$ref : '#/definitions/NotFoundChartAPIError'
'409' :
$ref : '#/definitions/ConflictFormatedError'
'500' :
$ref : '#/definitions/InternalChartAPIError'
2018-12-12 04:54:22 +01:00
/chartrepo/{repo}/charts/{name}/{version}/labels/{id}:
2018-10-11 10:08:34 +02:00
delete :
summary : Remove label from chart.
description : Remove label from the specified chart version.
tags :
- Products
- Chart Repository
- Label
parameters :
- name : repo
in : path
type : string
required : true
description : The project name
- name : name
in : path
type : string
required : true
description : The chart name
- name : version
in : path
type : string
required : true
description : The chart version
- name : id
in : path
type : integer
required : true
description : The label ID
responses :
'200' :
description : The label is successfully unmarked from the chart version.
'400' :
$ref : '#/definitions/BadRequestFormatedError'
'401' :
$ref : '#/definitions/UnauthorizedChartAPIError'
'403' :
$ref : '#/definitions/ForbiddenChartAPIError'
'404' :
$ref : '#/definitions/NotFoundChartAPIError'
'500' :
$ref : '#/definitions/InternalChartAPIError'
2020-06-22 04:34:03 +02:00
'/system/CVEAllowlist' :
2019-06-19 14:51:08 +02:00
get :
2020-06-22 04:34:03 +02:00
summary : Get the system level allowlist of CVE.
description : Get the system level allowlist of CVE. This API can be called by all authenticated users.
2019-06-19 14:51:08 +02:00
tags :
- Products
- System
responses :
'200' :
2020-06-22 04:34:03 +02:00
description : Successfully retrieved the CVE allowlist.
2019-06-19 14:51:08 +02:00
schema :
2020-06-22 04:34:03 +02:00
$ref : "#/definitions/CVEAllowlist"
2019-06-19 14:51:08 +02:00
'401' :
description : User is not authenticated.
'500' :
description : Unexpected internal errors.
put :
2020-06-22 04:34:03 +02:00
summary : Update the system level allowlist of CVE.
description : This API overwrites the system level allowlist of CVE with the list in request body. Only system Admin
2019-06-19 14:51:08 +02:00
has permission to call this API.
tags :
- Products
- System
parameters :
- in : body
2020-06-22 04:34:03 +02:00
name : allowlist
description : The allowlist with new content
2019-06-19 14:51:08 +02:00
schema :
2020-06-22 04:34:03 +02:00
$ref : "#/definitions/CVEAllowlist"
2019-06-19 14:51:08 +02:00
responses :
'200' :
2020-06-22 04:34:03 +02:00
description : Successfully updated the CVE allowlist.
2019-06-19 14:51:08 +02:00
'401' :
description : User is not authenticated.
'403' :
description : User does not have permission to call this API.
'500' :
description : Unexpected internal errors.
2018-01-28 18:43:03 +01:00
responses :
2019-03-04 04:51:34 +01:00
OK :
description : 'Success'
Created :
description : 'Created'
2020-09-12 14:33:16 +02:00
headers :
Location :
type : string
description : The URL of the created resource
2019-03-04 04:51:34 +01:00
BadRequest :
description : 'Bad Request'
Unauthorized :
description : 'Unauthorized'
Forbidden :
description : 'Forbidden'
NotFound :
description : 'Not Found'
Conflict :
description : 'Conflict'
PreconditionFailed :
description : 'Precondition Failed'
2018-08-15 12:53:49 +02:00
UnsupportedMediaType :
2018-09-12 13:57:40 +02:00
description : 'The Media Type of the request is not supported, it has to be "application/json"'
2019-03-04 04:51:34 +01:00
InternalServerError :
description : 'Internal Server Error'
2016-03-10 11:05:12 +01:00
definitions :
2017-09-29 10:37:43 +02:00
ProjectMetadata :
type : object
properties :
public :
2018-06-29 11:32:08 +02:00
type : string
2018-09-12 13:57:40 +02:00
description : 'The public status of the project. The valid values are "true", "false".'
2017-06-22 08:01:17 +02:00
enable_content_trust :
2018-06-29 11:32:08 +02:00
type : string
2019-08-12 19:05:24 +02:00
description : 'Whether content trust is enabled or not. If it is enabled, user can' 't pull unsigned images from this project. The valid values are "true", "false".'
2018-10-24 07:23:09 +02:00
prevent_vul :
2018-06-29 11:32:08 +02:00
type : string
2018-09-12 13:57:40 +02:00
description : 'Whether prevent the vulnerable images from running. The valid values are "true", "false".'
2018-10-24 07:23:09 +02:00
severity :
2017-06-22 08:01:17 +02:00
type : string
2019-11-18 07:36:51 +01:00
description : 'If the vulnerability is high than severity defined here, the images can' 't be pulled. The valid values are "none", "low", "medium", "high", "critical".'
2018-10-24 07:23:09 +02:00
auto_scan :
2018-06-29 11:32:08 +02:00
type : string
2018-09-12 13:57:40 +02:00
description : 'Whether scan images automatically when pushing. The valid values are "true", "false".'
2020-06-22 04:34:03 +02:00
reuse_sys_cve_allowlist :
2019-08-12 19:05:24 +02:00
type : string
2020-06-22 04:34:03 +02:00
description : 'Whether this project reuse the system level CVE allowlist as the allowlist of its own. The valid values are "true", "false".
If it is set to "true" the actual allowlist associate with this project, if any, will be ignored.'
2016-03-10 11:05:12 +01:00
User :
type : object
properties :
user_id :
type : integer
2016-09-02 10:05:55 +02:00
format : int
2016-06-03 12:50:42 +02:00
description : The ID of the user.
2016-03-10 11:05:12 +01:00
username :
type : string
email :
type : string
2016-09-02 10:05:55 +02:00
password :
2016-03-10 11:05:12 +01:00
type : string
2016-09-02 10:05:55 +02:00
realname :
2016-03-10 11:05:12 +01:00
type : string
comment :
type : string
deleted :
2018-08-01 00:38:23 +02:00
type : boolean
2016-09-02 10:05:55 +02:00
role_name :
type : string
role_id :
type : integer
format : int
2019-12-11 10:17:18 +01:00
sysadmin_flag :
2018-10-24 07:23:09 +02:00
type : boolean
2019-12-11 10:17:18 +01:00
admin_role_in_auth :
type : boolean
2020-04-06 19:33:32 +02:00
description : indicate the admin privilege is grant by authenticator (LDAP), is always false unless it is the current login user
2016-09-02 10:05:55 +02:00
reset_uuid :
type : string
Salt :
type : string
creation_time :
type : string
update_time :
type : string
2019-03-07 05:47:26 +01:00
UserSearch :
type : object
properties :
user_id :
type : integer
format : int
description : The ID of the user.
username :
type : string
2016-05-04 03:27:07 +02:00
Password :
type : object
properties :
old_password :
type : string
description : The user's existing password.
new_password :
type : string
2016-09-02 10:05:55 +02:00
description : New password for marking as to be updated.
2016-03-10 11:05:12 +01:00
Role :
type : object
properties :
2017-07-20 12:47:46 +02:00
role_id :
2016-03-10 11:05:12 +01:00
type : integer
format : int32
description : ID in table.
2017-07-20 12:47:46 +02:00
role_code :
2016-03-10 11:05:12 +01:00
type : string
description : Description of permissions for the role.
role_name :
type : string
description : Name the the role.
2016-09-21 04:43:04 +02:00
role_mask :
type : string
2016-03-10 11:05:12 +01:00
RoleParam :
type : object
properties :
roles :
type : array
items :
2017-07-20 12:47:46 +02:00
type : integer
2016-03-10 11:05:12 +01:00
format : int32
description : Role ID for updating project role member.
2016-06-03 12:50:42 +02:00
username :
2016-03-10 11:05:12 +01:00
type : string
description : Username relevant to a project role member.
2016-06-08 09:14:41 +02:00
StatisticMap :
type : object
properties :
2017-07-20 12:47:46 +02:00
private_project_count :
2016-06-08 09:14:41 +02:00
type : integer
format : int32
2017-06-26 08:15:01 +02:00
description : The count of the private projects which the user is a member of.
2017-07-20 12:47:46 +02:00
private_repo_count :
2016-06-08 09:14:41 +02:00
type : integer
format : int32
2018-09-12 13:57:40 +02:00
description : The count of the private repositories belonging to the projects which the user is a member of.
2017-07-20 12:47:46 +02:00
public_project_count :
2016-06-08 09:14:41 +02:00
type : integer
format : int32
description : The count of the public projects.
2017-07-20 12:47:46 +02:00
public_repo_count :
2016-06-08 09:14:41 +02:00
type : integer
format : int32
2018-09-12 13:57:40 +02:00
description : The count of the public repositories belonging to the public projects which the user is a member of.
2017-07-20 12:47:46 +02:00
total_project_count :
2016-06-08 09:14:41 +02:00
type : integer
format : int32
2017-07-20 12:47:46 +02:00
description : 'The count of the total projects, only be seen when the is admin.'
total_repo_count :
2016-06-08 09:14:41 +02:00
type : integer
format : int32
2018-09-12 13:57:40 +02:00
description : 'The count of the total repositories, only be seen when the user is admin.'
2019-12-11 10:17:18 +01:00
SysAdminFlag :
2016-09-22 07:20:10 +02:00
type : object
properties :
2019-12-11 10:17:18 +01:00
sysadmin_flag :
2018-10-24 07:23:09 +02:00
type : boolean
2019-12-11 10:17:18 +01:00
description : 'true-admin, false-not admin.'
2016-09-22 07:20:10 +02:00
UserProfile :
type : object
properties :
email :
type : string
description : The new email.
realname :
type : string
description : The new realname.
comment :
type : string
description : The new comment.
2017-01-09 11:24:31 +01:00
LdapConf :
type : object
properties :
2017-07-20 12:47:46 +02:00
ldap_url :
2017-01-09 11:24:31 +01:00
type : string
description : The url of ldap service.
2017-01-20 09:15:56 +01:00
ldap_search_dn :
2017-01-09 11:24:31 +01:00
type : string
description : The search dn of ldap service.
2017-01-20 09:15:56 +01:00
ldap_search_password :
2017-01-09 11:24:31 +01:00
type : string
description : The search password of ldap service.
2017-01-20 09:15:56 +01:00
ldap_base_dn :
2017-01-09 11:24:31 +01:00
type : string
description : The base dn of ldap service.
ldap_filter :
type : string
description : The serach filter of ldap service.
ldap_uid :
type : string
2017-02-24 11:30:57 +01:00
description : The serach uid from ldap service attributes.
2017-01-09 11:24:31 +01:00
ldap_scope :
type : integer
format : int64
description : The serach scope of ldap service.
2017-01-20 09:15:56 +01:00
ldap_connection_timeout :
2017-01-09 11:24:31 +01:00
type : integer
format : int64
description : The connect timeout of ldap service(second).
2017-02-24 11:30:57 +01:00
LdapUsers :
type : object
properties :
2017-07-20 12:47:46 +02:00
ldap_username :
2017-02-24 11:30:57 +01:00
type : string
description : search ldap user name based on ldapconf.
ldap_realname :
type : string
2018-09-12 13:57:40 +02:00
description : system will try to guess the user realname form "uid" or "cn" attribute.
2017-02-24 11:30:57 +01:00
ldap_email :
type : string
2018-09-12 13:57:40 +02:00
description : system will try to guess the user email address form "mail" or "email" attribute.
2017-02-24 11:30:57 +01:00
LdapImportUsers :
type : object
properties :
ldap_uid_list :
type : array
description : selected uid list
items :
type : string
LdapFailedImportUsers :
type : object
properties :
ldap_uid :
type : string
description : the uid can't add to system.
error :
type : string
description : fail reason.
2017-03-03 11:02:08 +01:00
EmailServerSetting :
type : object
properties :
2017-07-20 12:47:46 +02:00
email_host :
2017-03-03 11:02:08 +01:00
type : string
description : The host of email server.
email_port :
2017-03-16 09:53:40 +01:00
type : integer
2017-03-03 11:02:08 +01:00
description : The port of email server.
email_username :
type : string
description : The username of email server.
email_password :
type : string
description : The password of email server.
email_ssl :
2017-03-16 09:53:40 +01:00
type : boolean
2017-03-03 11:02:08 +01:00
description : Use ssl/tls or not.
email_identity :
type : string
description : The dentity of email server.
2017-06-20 18:15:01 +02:00
ComponentOverviewEntry :
type : object
properties :
severity :
type : integer
2017-07-20 12:47:46 +02:00
description : '1-None/Negligible, 2-Unknown, 3-Low, 4-Medium, 5-High'
2017-06-20 18:15:01 +02:00
count :
type : integer
description : number of the components with certain severity.
2017-08-30 10:39:54 +02:00
Configurations :
type : object
properties :
auth_mode :
type : string
2018-01-28 18:43:03 +01:00
description : 'The auth mode of current system, such as "db_auth", "ldap_auth"'
2019-07-23 17:38:32 +02:00
count_per_project :
type : string
description : The default count quota for the new created projects.
2017-08-30 10:39:54 +02:00
email_from :
type : string
description : The sender name for Email notification.
email_host :
type : string
description : The hostname of SMTP server that sends Email notification.
email_port :
type : integer
description : The port of SMTP server.
email_identity :
type : string
description : By default it's empty so the email_username is picked.
email_username :
type : string
description : The username for authenticate against SMTP server.
email_ssl :
type : boolean
2018-09-12 13:57:40 +02:00
description : 'When it' 's set to true the system will access Email server via TLS by default. If it' 's set to false, it still will handle "STARTTLS" from server side.'
2017-09-04 09:12:54 +02:00
email_insecure :
type : boolean
2018-09-12 13:57:40 +02:00
description : Whether or not the certificate will be verified when Harbor tries to access the email server.
2017-08-30 10:39:54 +02:00
ldap_url :
type : string
description : The URL of LDAP server.
ldap_base_dn :
type : string
description : The Base DN for LDAP binding.
ldap_filter :
type : string
description : The filter for LDAP binding.
ldap_scope :
type : integer
2018-01-28 18:43:03 +01:00
description : '0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE'
2017-08-30 10:39:54 +02:00
ldap_uid :
type : string
2018-09-12 13:57:40 +02:00
description : 'The attribute which is used as identity for the LDAP binding, such as "CN" or "SAMAccountname"'
2017-08-30 10:39:54 +02:00
ldap_search_dn :
type : string
description : The DN of the user to do the search.
ldap_timeout :
type : integer
description : timeout in seconds for connection to LDAP server.
2018-05-03 06:36:16 +02:00
ldap_group_attribute_name :
type : string
2018-09-12 13:57:40 +02:00
description : 'The attribute which is used as identity of the LDAP group, default is cn.'
2018-05-03 06:36:16 +02:00
ldap_group_base_dn :
type : string
description : The base DN to search LDAP group.
ldap_group_search_filter :
type : string
description : The filter to search the ldap group.
ldap_group_search_scope :
type : integer
2018-09-12 13:57:40 +02:00
description : 'The scope to search ldap. ' '0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE' ''
2018-07-01 03:22:25 +02:00
ldap_group_admin_dn :
type : string
2018-09-12 13:57:40 +02:00
description : Specify the ldap group which have the same privilege with Harbor admin.
2019-10-28 11:44:45 +01:00
oidc_client_id :
type : string
description : The client id of the OIDC.
oidc_client_secret :
type : string
description : The client secret of the OIDC.
oidc_endpoint :
type : string
description : The URL of an OIDC-complaint server, must start with 'https://'.
oidc_name :
type : string
description : The name of the OIDC provider.
oidc_scope :
type : string
description : The scope sent to OIDC server during authentication, should be separated by comma. It has to contain “openid”, and “offline_access”. If you are using google, please remove “offline_access” from this field.
oidc_verify_cert :
type : boolean
description : Whether verify your OIDC server certificate, disable it if your OIDC server is hosted via self-hosted certificate.
2017-08-30 10:39:54 +02:00
project_creation_restriction :
type : string
2018-09-12 13:57:40 +02:00
description : This attribute restricts what users have the permission to create project. It can be "everyone" or "adminonly".
2019-08-12 02:02:26 +02:00
quota_per_project_enable :
type : boolean
description : This attribute indicates whether quota per project enabled in harbor
2018-03-23 11:16:08 +01:00
read_only :
type : boolean
2018-08-15 12:53:49 +02:00
description : '' 'docker push' ' is prohibited by Harbor if you set it to true. '
2017-08-30 10:39:54 +02:00
self_registration :
type : boolean
2018-09-12 13:57:40 +02:00
description : 'Whether the Harbor instance supports self-registration. If it' 's set to false, admin need to add user to the instance.'
2019-07-23 17:38:32 +02:00
storage_per_project :
type : string
description : The default storage quota for the new created projects.
2017-08-30 10:39:54 +02:00
token_expiration :
type : integer
2018-01-28 18:43:03 +01:00
description : 'The expiration time of the token for internal Registry, in minutes.'
2017-08-30 10:39:54 +02:00
verify_remote_cert :
type : boolean
2018-09-12 13:57:40 +02:00
description : Whether or not the certificate will be verified when Harbor tries to access a remote Harbor instance for replication.
2017-08-30 10:39:54 +02:00
scan_all_policy :
type : object
properties :
type :
type : string
2018-09-12 13:57:40 +02:00
description : 'The type of scan all policy, currently the valid values are "none" and "daily"'
2017-08-30 10:39:54 +02:00
parameter :
type : object
properties :
daily_time :
type : integer
2019-09-03 09:52:41 +02:00
description : 'The offset in seconds of UTC 0 o' 'clock, only valid when the policy type is "daily"'
2018-09-12 13:57:40 +02:00
description : 'The parameters of the policy, the values are dependant on the type of the policy.'
2018-08-01 00:38:23 +02:00
ConfigurationsResponse :
type : object
properties :
auth_mode :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : 'The auth mode of current system, such as "db_auth", "ldap_auth"'
2019-07-23 17:38:32 +02:00
count_per_project :
$ref : '#/definitions/IntegerConfigItem'
description : The default count quota for the new created projects.
2018-08-01 00:38:23 +02:00
email_from :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-09-12 13:57:40 +02:00
description : The sender name for Email notification.
2018-08-01 00:38:23 +02:00
email_host :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The hostname of SMTP server that sends Email notification.
email_port :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/IntegerConfigItem'
2018-08-01 00:38:23 +02:00
description : The port of SMTP server.
email_identity :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : By default it's empty so the email_username is picked.
email_username :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The username for authenticate against SMTP server.
email_ssl :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/BoolConfigItem'
2018-09-12 13:57:40 +02:00
description : 'When it' 's set to true the system will access Email server via TLS by default. If it' 's set to false, it still will handle "STARTTLS" from server side.'
2018-08-01 00:38:23 +02:00
email_insecure :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/BoolConfigItem'
2018-09-12 13:57:40 +02:00
description : Whether or not the certificate will be verified when Harbor tries to access the email server.
2018-08-01 00:38:23 +02:00
ldap_url :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The URL of LDAP server.
ldap_base_dn :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The Base DN for LDAP binding.
ldap_filter :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The filter for LDAP binding.
ldap_scope :
type : integer
description : '0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE'
ldap_uid :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-09-12 13:57:40 +02:00
description : 'The attribute which is used as identity for the LDAP binding, such as "CN" or "SAMAccountname"'
2018-08-01 00:38:23 +02:00
ldap_search_dn :
type : string
description : The DN of the user to do the search.
ldap_timeout :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/IntegerConfigItem'
2018-08-01 00:38:23 +02:00
description : timeout in seconds for connection to LDAP server.
ldap_group_attribute_name :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-09-12 13:57:40 +02:00
description : 'The attribute which is used as identity of the LDAP group, default is cn.'
2018-08-01 00:38:23 +02:00
ldap_group_base_dn :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The base DN to search LDAP group.
ldap_group_search_filter :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-08-01 00:38:23 +02:00
description : The filter to search the ldap group.
ldap_group_search_scope :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/IntegerConfigItem'
2018-09-12 13:57:40 +02:00
description : 'The scope to search ldap. ' '0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE' ''
2018-08-01 00:38:23 +02:00
ldap_group_admin_dn :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-09-12 13:57:40 +02:00
description : Specify the ldap group which have the same privilege with Harbor admin.
2019-10-28 11:44:45 +01:00
oidc_client_id :
$ref : '#/definitions/StringConfigItem'
description : The client id of the OIDC.
oidc_endpoint :
$ref : '#/definitions/StringConfigItem'
description : The URL of an OIDC-complaint server, must start with 'https://'.
oidc_name :
$ref : '#/definitions/StringConfigItem'
description : The name of the OIDC provider.
oidc_scope :
$ref : '#/definitions/StringConfigItem'
description : The scope sent to OIDC server during authentication, should be separated by comma. It has to contain “openid”, and “offline_access”. If you are using google, please remove “offline_access” from this field.
oidc_verify_cert :
$ref : '#/definitions/BoolConfigItem'
description : Whether verify your OIDC server certificate, disable it if your OIDC server is hosted via self-hosted certificate.
2018-08-01 00:38:23 +02:00
project_creation_restriction :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/StringConfigItem'
2018-09-12 13:57:40 +02:00
description : This attribute restricts what users have the permission to create project. It can be "everyone" or "adminonly".
2019-08-12 02:02:26 +02:00
quota_per_project_enable :
$ref : '#/definitions/BoolConfigItem'
description : This attribute indicates whether quota per project enabled in harbor
2018-08-01 00:38:23 +02:00
read_only :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/BoolConfigItem'
description : '' 'docker push' ' is prohibited by Harbor if you set it to true. '
2018-08-01 00:38:23 +02:00
self_registration :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/BoolConfigItem'
2018-09-12 13:57:40 +02:00
description : 'Whether the Harbor instance supports self-registration. If it' 's set to false, admin need to add user to the instance.'
2019-07-23 17:38:32 +02:00
storage_per_project :
$ref : '#/definitions/IntegerConfigItem'
description : The default storage quota for the new created projects.
2018-08-01 00:38:23 +02:00
token_expiration :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/IntegerConfigItem'
2018-08-01 00:38:23 +02:00
description : 'The expiration time of the token for internal Registry, in minutes.'
verify_remote_cert :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/BoolConfigItem'
2018-09-12 13:57:40 +02:00
description : Whether or not the certificate will be verified when Harbor tries to access a remote Harbor instance for replication.
2018-08-01 00:38:23 +02:00
scan_all_policy :
type : object
properties :
type :
type : string
2018-09-12 13:57:40 +02:00
description : 'The type of scan all policy, currently the valid values are "none" and "daily"'
2018-08-01 00:38:23 +02:00
parameter :
type : object
properties :
daily_time :
type : integer
2019-09-03 09:52:41 +02:00
description : 'The offset in seconds of UTC 0 o' 'clock, only valid when the policy type is "daily"'
2018-09-12 13:57:40 +02:00
description : 'The parameters of the policy, the values are dependant on the type of the policy.'
2018-03-07 06:20:28 +01:00
Label :
type : object
properties :
id :
type : integer
description : The ID of label.
name :
type : string
description : The name of label.
description :
type : string
description : The description of label.
color :
type : string
description : The color of label.
scope :
2018-05-17 09:45:41 +02:00
type : string
2018-08-15 12:53:49 +02:00
description : 'The scope of label, g for global labels and p for project labels.'
2018-03-07 06:20:28 +01:00
project_id :
type : integer
description : The project ID if the label is a project label.
creation_time :
type : string
description : The creation time of label.
update_time :
type : string
description : The update time of label.
2018-06-07 10:05:50 +02:00
deleted :
2018-05-22 10:08:19 +02:00
type : boolean
2018-06-07 10:05:50 +02:00
description : The label is deleted or not.
2018-03-26 07:18:52 +02:00
ProjectMemberEntity :
type : object
properties :
id :
type : integer
description : the project member id
project_id :
type : integer
description : the project id
entity_name :
type : string
2018-08-15 12:53:49 +02:00
description : the name of the group member.
2018-03-26 07:18:52 +02:00
role_name :
type : string
description : the name of the role
2018-08-15 12:53:49 +02:00
role_id :
2018-03-26 07:18:52 +02:00
type : integer
description : the role id
2018-08-15 12:53:49 +02:00
entity_id :
2018-03-26 07:18:52 +02:00
type : integer
2019-08-20 06:28:03 +02:00
description : 'the id of entity, if the member is a user, it is user_id in user table. if the member is a user group, it is the user group' 's ID in user_group table.'
2018-03-26 07:18:52 +02:00
entity_type :
type : string
2018-08-15 12:53:49 +02:00
description : 'the entity' 's type, u for user entity, g for group entity.'
2018-03-26 07:18:52 +02:00
ProjectMember :
type : object
properties :
role_id :
type : integer
2020-07-07 04:16:37 +02:00
description : 'The role id 1 for projectAdmin, 2 for developer, 3 for guest, 4 for maintainer'
2018-03-26 07:18:52 +02:00
member_user :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/UserEntity'
2018-03-26 07:18:52 +02:00
member_group :
2018-08-15 12:53:49 +02:00
$ref : '#/definitions/UserGroup'
2018-03-26 07:18:52 +02:00
RoleRequest :
type : object
properties :
role_id :
type : integer
2020-07-07 04:16:37 +02:00
description : 'The role id 1 for projectAdmin, 2 for developer, 3 for guest, 4 for maintainer'
2018-03-26 07:18:52 +02:00
UserEntity :
type : object
properties :
user_id :
type : integer
description : The ID of the user.
username :
type : string
description : The name of the user.
UserGroup :
type : object
properties :
id :
type : integer
description : The ID of the user group
group_name :
type : string
description : The name of the user group
2018-08-15 12:53:49 +02:00
group_type :
2018-03-26 07:18:52 +02:00
type : integer
2019-07-16 09:38:44 +02:00
description : 'The group type, 1 for LDAP group, 2 for HTTP group.'
2018-03-26 07:18:52 +02:00
ldap_group_dn :
type : string
description : The DN of the LDAP group if group type is 1 (LDAP group).
2018-08-01 00:38:23 +02:00
StringConfigItem :
type : object
properties :
value :
type : string
2018-08-15 12:53:49 +02:00
description : The string value of current config item
2018-08-01 00:38:23 +02:00
editable :
type : boolean
description : The configure item can be updated or not
BoolConfigItem :
type : object
properties :
value :
type : boolean
2018-08-15 12:53:49 +02:00
description : The boolean value of current config item
2018-08-01 00:38:23 +02:00
editable :
type : boolean
description : The configure item can be updated or not
IntegerConfigItem :
type : object
properties :
value :
2018-08-15 12:53:49 +02:00
type : integer
description : The integer value of current config item
2018-08-01 00:38:23 +02:00
editable :
type : boolean
description : The configure item can be updated or not
2018-08-15 12:53:49 +02:00
ChartAPIError :
description : The error object returned by chart repository API
type : object
required :
- error
properties :
error :
type : string
description : The error message returned by the chart API
UnauthorizedChartAPIError :
description : Unauthorized
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
ForbiddenChartAPIError :
2019-08-26 08:47:28 +02:00
description : Operation is forbidden or quota exceeded
2018-08-15 12:53:49 +02:00
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
InternalChartAPIError :
description : Internal server error occurred
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
NotFoundChartAPIError :
description : Not found
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
InsufficientStorageChartAPIError :
description : Insufficient storage
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
2018-10-11 10:08:34 +02:00
BadRequestFormatedError :
description : Bad request
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
ConflictFormatedError :
description : Conflicts
type : object
allOf :
- $ref : '#/definitions/ChartAPIError'
2018-08-15 12:53:49 +02:00
ChartMetadata :
type : object
description : The metadata of chart version
required :
- name
- version
- engine
- icon
- apiVersion
- appVersion
properties :
name :
type : string
description : The name of the chart
home :
type : string
description : The URL to the relevant project page
sources :
type : array
description : The URL to the source code of chart
items :
type : string
version :
type : string
description : A SemVer 2 version of chart
description :
type : string
description : A one-sentence description of chart
keywords :
type : array
description : A list of string keywords
items :
type : string
engine :
type : string
description : The name of template engine
icon :
type : string
description : The URL to an icon file
apiVersion :
type : string
description : The API version of this chart
appVersion :
type : string
description : The version of the application enclosed in the chart
deprecated :
type : boolean
description : Whether or not this chart is deprecated
ChartVersion :
type : object
description : A specified chart entry
allOf :
- $ref : '#/definitions/ChartMetadata'
- type : object
properties :
created :
type : string
description : The created time of the chart entry
removed :
type : boolean
description : A flag to indicate if the chart entry is removed
digest :
type : string
description : The digest value of the chart entry
urls :
type : array
description : The urls of the chart entry
items :
type : string
2018-10-11 10:08:34 +02:00
properties :
labels :
$ref : '#/definitions/Labels'
Labels :
type : array
description : A list of label
items :
2018-12-12 04:54:22 +01:00
$ref : '#/definitions/Label'
2019-01-11 05:53:34 +01:00
OverallHealthStatus :
type : object
description : The system health status
properties :
status :
type : string
2019-04-19 12:44:24 +02:00
description : The overall health status. It is "healthy" only when all the components' status are "healthy"
2019-01-11 05:53:34 +01:00
components :
type : array
items :
$ref : '#/definitions/ComponentHealthStatus'
ComponentHealthStatus :
type : object
description : The health status of component
properties :
name :
type : string
2019-04-19 12:44:24 +02:00
description : The component name
2019-01-11 05:53:34 +01:00
status :
type : string
description : The health status of component
error :
type : string
description : (optional) The error message when the status is "unhealthy"
2019-01-28 11:06:52 +01:00
Permission :
type : object
description : The permission
properties :
resource :
type : string
description : The permission resoruce
action :
type : string
2019-01-30 07:10:26 +01:00
description : The permission action
2019-04-11 17:13:51 +02:00
Namespace :
type : object
description : The namespace of registry
properties :
name :
type : string
description : The name of namespace
metadata :
type : object
2019-06-19 14:51:08 +02:00
description : The metadata of namespace
2020-06-22 04:34:03 +02:00
CVEAllowlist :
2019-06-19 14:51:08 +02:00
type : object
2020-06-22 04:34:03 +02:00
description : The CVE Allowlist for system or project
2019-06-19 14:51:08 +02:00
properties :
id :
type : integer
2020-06-22 04:34:03 +02:00
description : ID of the allowlist
2019-06-19 14:51:08 +02:00
project_id :
type : integer
2020-06-22 04:34:03 +02:00
description : ID of the project which the allowlist belongs to. For system level allowlist this attribute is zero.
2019-06-19 14:51:08 +02:00
expires_at :
type : integer
2020-06-22 04:34:03 +02:00
description : the time for expiration of the allowlist, in the form of seconds since epoch. This is an optional attribute, if it's not set the CVE allowlist does not expire.
2019-06-19 14:51:08 +02:00
items :
type : array
items :
2020-06-22 04:34:03 +02:00
$ref : "#/definitions/CVEAllowlistItem"
CVEAllowlistItem :
2019-06-19 14:51:08 +02:00
type : object
2020-06-22 04:34:03 +02:00
description : The item in CVE allowlist
2019-06-19 14:51:08 +02:00
properties :
cve_id :
type : string
description : The ID of the CVE, such as "CVE-2019-10164"
2019-09-03 09:52:41 +02:00
2019-09-17 08:48:51 +02:00
QuotaSwitcher :
type : object
properties :
enabled :
type : boolean
description : The quota is enable or disable
2019-10-31 16:24:23 +01:00
2020-07-02 11:13:44 +02:00
parameters :
query :
name : q
description : Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3=[min~max]
in : query
type : string
required : false