openapi: 3.2.0 info: title: Harbor Immutable API description: These APIs provide services for manipulating Harbor project. version: '2.0' servers: - url: http://localhost/api/v2.0 - url: https://localhost/api/v2.0 security: - basic: [] - {} tags: - name: immutable paths: /projects/{project_name_or_id}/immutabletagrules: get: summary: List all immutable tag rules of current project description: This endpoint returns the immutable tag rules of a project tags: - immutable operationId: ListImmuRules parameters: - $ref: '#/components/parameters/requestId' - $ref: '#/components/parameters/isResourceName' - $ref: '#/components/parameters/projectNameOrId' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/query' - $ref: '#/components/parameters/sort' responses: '200': description: Success headers: X-Total-Count: description: The total count of immutable tag schema: type: integer Link: description: Link refers to the previous page and next page schema: type: string content: application/json: schema: type: array items: $ref: '#/components/schemas/ImmutableRule' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '500': $ref: '#/components/responses/500' post: summary: Add an immutable tag rule to current project description: This endpoint add an immutable tag rule to the project tags: - immutable operationId: CreateImmuRule parameters: - $ref: '#/components/parameters/requestId' - $ref: '#/components/parameters/isResourceName' - $ref: '#/components/parameters/projectNameOrId' responses: '201': $ref: '#/components/responses/201' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '500': $ref: '#/components/responses/500' requestBody: content: application/json: schema: $ref: '#/components/schemas/ImmutableRule' required: true /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}: put: summary: Update the immutable tag rule or enable or disable the rule description: Update or toggle the specified immutable tag rule within the project. Returns 404 if the project or rule is not found. tags: - immutable operationId: UpdateImmuRule parameters: - $ref: '#/components/parameters/requestId' - $ref: '#/components/parameters/isResourceName' - $ref: '#/components/parameters/projectNameOrId' - $ref: '#/components/parameters/immutableRuleId' responses: '200': $ref: '#/components/responses/200' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '500': $ref: '#/components/responses/500' requestBody: content: application/json: schema: $ref: '#/components/schemas/ImmutableRule' required: true delete: summary: Delete the immutable tag rule description: Delete the specified immutable tag rule from the project. Returns 404 if the project or rule is not found. tags: - immutable operationId: DeleteImmuRule parameters: - $ref: '#/components/parameters/requestId' - $ref: '#/components/parameters/isResourceName' - $ref: '#/components/parameters/projectNameOrId' - $ref: '#/components/parameters/immutableRuleId' responses: '200': $ref: '#/components/responses/200' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '500': $ref: '#/components/responses/500' components: responses: '500': description: Internal server error. Inspect the `errors` array in the response body for details. headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string content: application/json: schema: $ref: '#/components/schemas/Errors' '201': description: Created headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string Location: description: The location of the resource schema: type: string '403': description: Forbidden. The caller does not have sufficient permission to perform the requested operation. headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string content: application/json: schema: $ref: '#/components/schemas/Errors' '200': description: Success headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string '401': description: Unauthorized. Authentication is required to access this resource. headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string content: application/json: schema: $ref: '#/components/schemas/Errors' '404': description: Not found. The requested resource does not exist. headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string content: application/json: schema: $ref: '#/components/schemas/Errors' '400': description: Bad request. The request body or query parameters are invalid. Inspect the `errors` array in the response body for details. headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string content: application/json: schema: $ref: '#/components/schemas/Errors' parameters: isResourceName: name: X-Is-Resource-Name description: The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. in: header required: false schema: type: boolean default: false sort: name: sort description: Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending order and field2 in descending order with "sort=field1,-field2" in: query required: false schema: type: string immutableRuleId: name: immutable_rule_id in: path description: The ID of the immutable rule required: true schema: type: integer format: int64 requestId: name: X-Request-Id description: An unique ID for the request in: header required: false schema: type: string minLength: 1 pageSize: name: page_size in: query required: false description: The size of per page schema: type: integer format: int64 default: 10 maximum: 100 page: name: page in: query required: false description: The page number schema: type: integer format: int64 default: 1 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 required: false schema: type: string projectNameOrId: name: project_name_or_id in: path description: The name or id of the project required: true schema: type: string schemas: Error: description: a model for all the error response coming from harbor type: object properties: code: type: string description: The error code message: type: string description: The error message example: code: NOT_FOUND message: artifact library/hello-world:latest not found ImmutableSelector: type: object properties: kind: type: string decoration: type: string pattern: type: string extras: type: string Errors: description: The error array that describe the errors got during the handling of request type: object properties: errors: type: array items: $ref: '#/components/schemas/Error' ImmutableRule: type: object properties: id: type: integer priority: type: integer disabled: type: boolean action: type: string template: type: string params: type: object additionalProperties: type: object tag_selectors: type: array items: $ref: '#/components/schemas/ImmutableSelector' scope_selectors: type: object additionalProperties: type: array items: $ref: '#/components/schemas/ImmutableSelector' securitySchemes: basic: type: http scheme: basic