[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request goharbor#14400 from ywk253100/210226_registry
Browse files Browse the repository at this point in the history
Refeactor replication policy APIs
  • Loading branch information
ywk253100 committed Mar 22, 2021
2 parents a2b0844 + 3d7fd07 commit b2f0a1f
Show file tree
Hide file tree
Showing 62 changed files with 3,322 additions and 3,475 deletions.
233 changes: 0 additions & 233 deletions api/v2.0/legacy_swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -716,172 +716,6 @@ paths:
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.
/replication/policies:
get:
summary: List replication policies
description: |
This endpoint let user list replication policies
parameters:
- name: name
in: query
type: string
required: false
description: The replication policy name.
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
tags:
- Products
responses:
'200':
description: Get policy successfully.
schema:
type: array
items:
$ref: '#/definitions/ReplicationPolicy'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
$ref: '#/responses/BadRequest'
'401':
$ref: '#/responses/Unauthorized'
'403':
$ref: '#/responses/Forbidden'
'500':
$ref: '#/responses/InternalServerError'
post:
summary: Create a replication policy
description: |
This endpoint let user create a replication policy
parameters:
- name: policy
in: body
description: The policy model.
required: true
schema:
$ref: '#/definitions/ReplicationPolicy'
tags:
- Products
responses:
'201':
$ref: '#/responses/Created'
'400':
$ref: '#/responses/BadRequest'
'401':
$ref: '#/responses/Unauthorized'
'403':
$ref: '#/responses/Forbidden'
'409':
$ref: '#/responses/Conflict'
'415':
$ref: '#/responses/UnsupportedMediaType'
'500':
$ref: '#/responses/InternalServerError'
'/replication/policies/{id}':
get:
summary: Get replication policy.
description: |
This endpoint let user get replication policy by specific ID.
parameters:
- name: id
in: path
type: integer
format: int64
required: true
description: policy ID
tags:
- Products
responses:
'200':
description: Get the replication policy successfully.
schema:
$ref: '#/definitions/ReplicationPolicy'
'400':
$ref: '#/responses/BadRequest'
'401':
$ref: '#/responses/Unauthorized'
'403':
$ref: '#/responses/Forbidden'
'404':
$ref: '#/responses/NotFound'
'500':
$ref: '#/responses/InternalServerError'
put:
summary: Update the replication policy
description: |
This endpoint let user update policy.
parameters:
- name: id
in: path
type: integer
format: int64
required: true
description: policy ID
- name: policy
in: body
description: The replication policy model.
required: true
schema:
$ref: '#/definitions/ReplicationPolicy'
tags:
- Products
responses:
'200':
$ref: '#/responses/OK'
'400':
$ref: '#/responses/BadRequest'
'401':
$ref: '#/responses/Unauthorized'
'403':
$ref: '#/responses/Forbidden'
'404':
$ref: '#/responses/NotFound'
'409':
$ref: '#/responses/Conflict'
'500':
$ref: '#/responses/InternalServerError'
delete:
summary: Delete the replication policy specified by ID.
description: |
Delete the replication policy specified by ID.
parameters:
- name: id
in: path
type: integer
format: int64
required: true
description: Replication policy ID
tags:
- Products
responses:
'200':
$ref: '#/responses/OK'
'400':
$ref: '#/responses/BadRequest'
'401':
$ref: '#/responses/Unauthorized'
'403':
$ref: '#/responses/Forbidden'
'404':
$ref: '#/responses/NotFound'
'412':
$ref: '#/responses/PreconditionFailed'
'500':
$ref: '#/responses/InternalServerError'
/labels:
get:
summary: List labels according to the query strings.
Expand Down Expand Up @@ -2090,73 +1924,6 @@ definitions:
type: integer
format: int32
description: 'The count of the total repositories, only be seen when the user is admin.'
ReplicationPolicy:
type: object
properties:
id:
type: integer
format: int64
description: The policy ID.
name:
type: string
description: The policy name.
description:
type: string
description: The description of the policy.
src_registry:
description: The source registry.
$ref: '#/definitions/Registry'
dest_registry:
description: The destination registry.
$ref: '#/definitions/Registry'
dest_namespace:
type: string
description: The destination namespace.
trigger:
$ref: '#/definitions/ReplicationTrigger'
filters:
type: array
description: The replication policy filter array.
items:
$ref: '#/definitions/ReplicationFilter'
deletion:
type: boolean
description: Whether to replicate the deletion operation.
override:
type: boolean
description: Whether to override the resources on the destination registry.
enabled:
type: boolean
description: Whether the policy is enabled or not.
creation_time:
type: string
description: The create time of the policy.
update_time:
type: string
description: The update time of the policy.
ReplicationTrigger:
type: object
properties:
type:
type: string
description: 'The replication policy trigger type. The valid values are manual, event_based and scheduled.'
trigger_settings:
$ref: '#/definitions/TriggerSettings'
TriggerSettings:
type: object
properties:
cron:
type: string
description: The cron string for scheduled trigger
ReplicationFilter:
type: object
properties:
type:
type: string
description: 'The replication policy filter type.'
value:
type: string
description: 'The value of replication policy filter.'
RegistryCredential:
type: object
properties:
Expand Down
Loading

0 comments on commit b2f0a1f

Please sign in to comment.