GoHarbor Purge API

The purge API from GoHarbor — 4 operation(s) for purge.

Operations 7

GET /system/purgeaudit Get purge job results #
GET /system/purgeaudit/{purge_id} Get purge job status #
PUT /system/purgeaudit/{purge_id} Stop the specific purge audit log execution #
GET /system/purgeaudit/{purge_id}/log Get purge job log #
GET /system/purgeaudit/schedule Get purge's schedule #
POST /system/purgeaudit/schedule Create a purge job schedule #
PUT /system/purgeaudit/schedule Update purge job's schedule #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/goharbor-purge-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

goharbor-purge-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Harbor Purge 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: Purge
paths:
  /system/purgeaudit:
    get:
      summary: Get purge job results
      description: get purge job execution history.
      tags:
      - Purge
      operationId: getPurgeHistory
      parameters:
      - $ref: '#/components/parameters/requestId'
      - $ref: '#/components/parameters/query'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/pageSize'
      responses:
        '200':
          description: Get purge job results successfully.
          headers:
            X-Total-Count:
              description: The total count of history
              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/ExecHistory'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /system/purgeaudit/{purge_id}:
    get:
      summary: Get purge job status
      description: This endpoint let user get purge job status filtered by specific ID.
      operationId: getPurgeJob
      parameters:
      - $ref: '#/components/parameters/requestId'
      - $ref: '#/components/parameters/purgeId'
      tags:
      - Purge
      responses:
        '200':
          description: Get purge job results successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecHistory'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Stop the specific purge audit log execution
      description: Stop the purge audit log execution specified by ID
      tags:
      - Purge
      operationId: stopPurge
      parameters:
      - $ref: '#/components/parameters/requestId'
      - $ref: '#/components/parameters/purgeId'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /system/purgeaudit/{purge_id}/log:
    get:
      summary: Get purge job log
      description: This endpoint let user get purge job logs filtered by specific ID.
      operationId: getPurgeJobLog
      parameters:
      - $ref: '#/components/parameters/requestId'
      - $ref: '#/components/parameters/purgeId'
      tags:
      - Purge
      responses:
        '200':
          description: Get successfully.
          content:
            text/plain:
              schema:
                type: string
        '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'
  /system/purgeaudit/schedule:
    get:
      summary: Get purge's schedule
      description: This endpoint is for get schedule of purge job.
      operationId: getPurgeSchedule
      tags:
      - Purge
      parameters:
      - $ref: '#/components/parameters/requestId'
      responses:
        '200':
          description: Get purge job's schedule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecHistory'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Create a purge job schedule
      description: This endpoint is for update purge job schedule.
      operationId: createPurgeSchedule
      parameters:
      - $ref: '#/components/parameters/requestId'
      tags:
      - Purge
      responses:
        '201':
          $ref: '#/components/responses/201'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Schedule'
        description: 'The purge job''s schedule, it is a json object. |

          The sample format is |

          {"parameters":{"audit_retention_hour":168,"dry_run":true,"include_event_types":"create_artifact,delete_artifact,pull_artifact"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} |

          the include_operation should be a comma separated string, e.g. create,delete,pull, if it is empty, no operation will be purged.

          '
        required: true
    put:
      summary: Update purge job's schedule
      description: This endpoint is for update purge job schedule.
      operationId: updatePurgeSchedule
      parameters:
      - $ref: '#/components/parameters/requestId'
      tags:
      - Purge
      responses:
        '200':
          description: Updated purge's schedule successfully.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Schedule'
        description: 'The purge job''s schedule, it is a json object. |

          The sample format is |

          {"parameters":{"audit_retention_hour":168,"dry_run":true,"include_event_types":"create_artifact,delete_artifact,pull_artifact"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} |

          the include_operation should be a comma separated string, e.g. create,delete,pull, if it is empty, no operation will be purged.

          '
        required: true
components:
  responses:
    '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'
    '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'
    '200':
      description: Success
      headers:
        X-Request-Id:
          description: The ID of the corresponding request for the response
          schema:
            type: string
    '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'
    '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
    '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'
    '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'
  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'
    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.
    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
    ExecHistory:
      type: object
      properties:
        id:
          type: integer
          description: the id of purge job.
        job_name:
          type: string
          description: the job name of purge job.
        job_kind:
          type: string
          description: the job kind of purge job.
        job_parameters:
          type: string
          description: the job parameters of purge job.
        schedule:
          $ref: '#/components/schemas/ScheduleObj'
        job_status:
          type: string
          description: the status of purge job.
        deleted:
          type: boolean
          description: if purge job was deleted.
        creation_time:
          type: string
          format: date-time
          description: the creation time of purge job.
        update_time:
          type: string
          format: date-time
          description: the update time of purge 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:
    pageSize:
      name: page_size
      in: query
      required: false
      description: The size of per page
      schema:
        type: integer
        format: int64
        default: 10
        maximum: 100
    requestId:
      name: X-Request-Id
      description: An unique ID for the request
      in: header
      required: false
      schema:
        type: string
        minLength: 1
    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
    purgeId:
      name: purge_id
      in: path
      description: The ID of the purge log
      required: true
      schema:
        type: integer
        format: int64
    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
  securitySchemes:
    basic:
      type: http
      scheme: basic