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:
|
2021-06-23 10:28:14 +02:00
|
|
|
basic:
|
2018-08-01 00:38:23 +02:00
|
|
|
type: basic
|
|
|
|
security:
|
2021-06-23 10:28:14 +02:00
|
|
|
- basic: []
|
|
|
|
- {}
|
2016-03-10 11:05:12 +01:00
|
|
|
paths:
|
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'
|
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-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.
|
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-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-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
|