Add gc api of regsistryctl to swagger file

The api includes to trigger gc and add/update/delete gc schedule

Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
wang yan 2018-08-17 16:43:51 +08:00
parent 257a728086
commit f2b31b871a

View File

@ -2565,6 +2565,148 @@ paths:
description: Only admin has this authority. description: Only admin has this authority.
'500': '500':
description: Unexpected internal errors. description: Unexpected internal errors.
/system/gc:
get:
summary: Get gc results.
description: This endpoint let user get latest ten gc results.
tags:
- Products
responses:
'200':
description: Get gc results successfully.
schema:
type: array
items:
$ref: '#/definitions/GCResult'
'401':
description: User need to log in first.
'403':
description: User does not have permission of admin role.
'500':
description: Unexpected internal errors.
/system/gc/{id}:
get:
summary: Get gc status.
description: This endpoint let user get gc status filtered by specific ID.
parameters:
- name: id
in: path
type: integer
format: int64
required: true
description: Relevant job ID
tags:
- Products
responses:
'200':
description: Get gc results successfully.
schema:
type: array
items:
$ref: '#/definitions/GCResult'
'401':
description: User need to log in first.
'403':
description: User does not have permission of admin role.
'500':
description: Unexpected internal errors.
/system/gc/{id}/log:
get:
summary: Get gc job log.
description: This endpoint let user get gc job logs filtered by specific ID.
parameters:
- name: id
in: path
type: integer
format: int64
required: true
description: Relevant job ID
tags:
- Products
responses:
'200':
description: Get job log successfully.
'400':
description: Illegal format of provided ID value.
'401':
description: User need to log in first.
'403':
description: User does not have permission of admin role.
'404':
description: The specific gc ID's log does not exist.
'500':
description: Unexpected internal errors.
/system/gc/schedule:
get:
summary: Get gc's schedule.
description: This endpoint is for get schedule of gc job.
tags:
- Products
responses:
'200':
description: Get gc's schedule.
schema:
type: array
items:
$ref: '#/definitions/GCSchedule'
'401':
description: User need to log in first.
'403':
description: Only admin has this authority.
'500':
description: Unexpected internal errors.
put:
summary: Update gc's schedule.
description: |
This endpoint is for update gc schedule.
parameters:
- name: schedule
in: body
required: true
schema:
$ref: '#/definitions/GCSchedule'
description: Updates of gs's schedule.
tags:
- Products
responses:
'200':
description: Updated replication's target successfully.
'400':
description: The target is associated with policy which is enabled.
'401':
description: User need to log in first.
'403':
description: User does not have permission of admin role.
'404':
description: Target ID does not exist.
'500':
description: Unexpected internal errors.
post:
summary: Create a gc schedule.
description: |
This endpoint is for update gc schedule.
parameters:
- name: schedule
in: body
required: true
schema:
$ref: '#/definitions/GCSchedule'
description: Updates of gs's schedule.
tags:
- Products
responses:
'200':
description: Updated replication's target successfully.
'400':
description: The target is associated with policy which is enabled.
'401':
description: User need to log in first.
'403':
description: User does not have permission of admin role.
'404':
description: Target ID does not exist.
'500':
description: Unexpected internal errors.
/configurations: /configurations:
get: get:
summary: Get system configurations. summary: Get system configurations.
@ -2698,6 +2840,41 @@ paths:
$ref: '#/definitions/InternalChartAPIError' $ref: '#/definitions/InternalChartAPIError'
'200': '200':
$ref: '#/definitions/ChartInfoList' $ref: '#/definitions/ChartInfoList'
post:
summary: Upload a chart file to the specified project.
description: Upload a chart file to the specified project. With this API, the corresponding provance file can be uploaded together with chart file at once.
tags:
- Products
- Chart Repository
consumes:
- multipart/form-data
parameters:
- name: repo
in: path
type: string
required: true
description: The project name
- name: chart
in: formData
type: file
required: true
description: The chart file
- name: prov
in: formData
type: file
required: false
description: The provance file
responses:
'401':
$ref: '#/definitions/UnauthorizedChartAPIError'
'403':
$ref: '#/definitions/ForbiddenChartAPIError'
'500':
$ref: '#/definitions/InternalChartAPIError'
'507':
$ref: '#/definitions/InsufficientStorageChartAPIError'
'201':
description: The specified chart is successfully uploaded.
/chartrepo/{repo}/charts/{name}: /chartrepo/{repo}/charts/{name}:
get: get:
summary: Get all the versions of the specified chart summary: Get all the versions of the specified chart
@ -2794,42 +2971,6 @@ paths:
$ref: '#/definitions/InternalChartAPIError' $ref: '#/definitions/InternalChartAPIError'
'200': '200':
description: The specified chart entry is successfully deleted. description: The specified chart entry is successfully deleted.
/chartrepo/{repo}/charts:
post:
summary: Upload a chart file to the specified project.
description: Upload a chart file to the specified project. With this API, the corresponding provance file can be uploaded together with chart file at once.
tags:
- Products
- Chart Repository
consumes:
- multipart/form-data
parameters:
- name: repo
in: path
type: string
required: true
description: The project name
- name: chart
in: formData
type: file
required: true
description: The chart file
- name: prov
in: formData
type: file
required: false
description: The provance file
responses:
'401':
$ref: '#/definitions/UnauthorizedChartAPIError'
'403':
$ref: '#/definitions/ForbiddenChartAPIError'
'500':
$ref: '#/definitions/InternalChartAPIError'
'507':
$ref: '#/definitions/InsufficientStorageChartAPIError'
'201':
description: The specified chart is successfully uploaded.
/chartrepo/{repo}/prov: /chartrepo/{repo}/prov:
post: post:
summary: Upload a provance file to the specified project. summary: Upload a provance file to the specified project.
@ -4278,7 +4419,35 @@ definitions:
type: object type: object
additionalProperties: additionalProperties:
type: string type: string
GCResult:
type: object
properties:
status:
type: boolean
description: the result of gc job.
msg:
type: string
description: the details of gc job.
starttime:
type: string
description: the start time of gc job.
endtime:
type: string
description: the end time of gc job.
GCSchedule:
type: object
properties:
type:
type: string
description: The schedule type. The valid values are daily weekly and None. 'None' means to cancel the schedule.
weekday:
type: integer
format: int8
description: 'Optional, only used when the type is weekly. The valid values are 1-7.'
offtime:
type: integer
format: int64
description: 'The time offset with the UTC 00:00 in seconds.'