openapi: 3.2.0 info: title: Harbor Scan All 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: scanAll paths: /scans/all/metrics: get: summary: Get the metrics of the latest scan all process tags: - scanAll operationId: getLatestScanAllMetrics parameters: - $ref: '#/components/parameters/requestId' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Stats' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '412': $ref: '#/components/responses/412' '500': $ref: '#/components/responses/500' /scans/schedule/metrics: get: summary: Get the metrics of the latest scheduled scan all process tags: - scanAll operationId: getLatestScheduledScanAllMetrics deprecated: true parameters: - $ref: '#/components/parameters/requestId' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Stats' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '412': $ref: '#/components/responses/412' '500': $ref: '#/components/responses/500' /system/scanAll/schedule: get: summary: Get scan all's schedule description: This endpoint is for getting a schedule for the scan all job, which scans all of images in Harbor. tags: - scanAll operationId: getScanAllSchedule parameters: - $ref: '#/components/parameters/requestId' responses: '200': description: Get a schedule for the scan all job, which scans all of images in Harbor. content: application/json: schema: $ref: '#/components/schemas/Schedule' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '412': $ref: '#/components/responses/412' '500': $ref: '#/components/responses/500' put: summary: Update scan all's schedule description: This endpoint is for updating the schedule of scan all job, which scans all of images in Harbor. parameters: - $ref: '#/components/parameters/requestId' tags: - scanAll operationId: updateScanAllSchedule responses: '200': $ref: '#/components/responses/200' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '412': $ref: '#/components/responses/412' '500': $ref: '#/components/responses/500' requestBody: content: application/json: schema: $ref: '#/components/schemas/Schedule' description: Updates the schedule of scan all job, which scans all of images in Harbor. required: true post: summary: Create a schedule or a manual trigger for the scan all job description: This endpoint is for creating a schedule or a manual trigger for the scan all job, which scans all of images in Harbor. parameters: - $ref: '#/components/parameters/requestId' tags: - scanAll operationId: createScanAllSchedule responses: '201': $ref: '#/components/responses/201' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '409': $ref: '#/components/responses/409' '412': $ref: '#/components/responses/412' '500': $ref: '#/components/responses/500' requestBody: content: application/json: schema: $ref: '#/components/schemas/Schedule' description: Create a schedule or a manual trigger for the scan all job. required: true /system/scanAll/stop: post: summary: Stop scanAll job execution parameters: - $ref: '#/components/parameters/requestId' tags: - scanAll operationId: stopScanAll responses: '202': $ref: '#/components/responses/202' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '500': $ref: '#/components/responses/500' components: responses: '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' '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 '409': description: Conflict. The resource already exists or the current state prevents the 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' '412': description: Precondition failed. A dependency or policy check failed; inspect the `errors` array for the constraint that was violated. 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' '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' '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' '200': description: Success headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string '202': description: Accepted headers: X-Request-Id: description: The ID of the corresponding request for the response schema: type: string schemas: 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' 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 Stats: type: object description: Stats provides the overall progress of the scan all process. properties: total: type: integer format: int description: The total number of scan processes triggered by the scan all action example: 100 x-omitempty: false completed: type: integer format: int description: The number of the finished scan processes triggered by the scan all action example: 90 x-omitempty: false metrics: type: object description: The metrics data for the each status additionalProperties: type: integer format: int example: 10 example: Success: 5 Error: 2 Running: 3 ongoing: type: boolean description: A flag indicating job status of scan all. x-omitempty: false trigger: type: string description: The trigger of the scan all job. enum: - Manual - Schedule - Event ScheduleObj: type: object properties: type: type: string description: 'The schedule type. The valid values are ''Hourly'', ''Daily'', ''Weekly'', ''Custom'', ''Manual'', ''None'' and ''Schedule''. ''Manual'' means to trigger it right away, ''Schedule'' means to trigger it by a specified cron schedule and ''None'' means to cancel the schedule. ' enum: - Hourly - Daily - Weekly - Custom - Manual - None - Schedule cron: type: string description: A cron expression, a time-based job scheduler. next_scheduled_time: type: string format: date-time description: The next time to schedule to run the job. Schedule: type: object properties: id: type: integer description: The id of the schedule. readOnly: true status: type: string description: The status of the schedule. readOnly: true creation_time: type: string format: date-time description: the creation time of the schedule. readOnly: true update_time: type: string format: date-time description: the update time of the schedule. readOnly: true schedule: $ref: '#/components/schemas/ScheduleObj' parameters: type: object description: The parameters of schedule job additionalProperties: type: object parameters: requestId: name: X-Request-Id description: An unique ID for the request in: header required: false schema: type: string minLength: 1 securitySchemes: basic: type: http scheme: basic