openapi: 3.2.0 info: title: Harbor Auditlog 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: Audit Log paths: /audit-logs: get: summary: Get recent logs of projects which the user is a member with project admin role… description: This endpoint let the user see the recent operation logs of projects which the user is a member with project admin role,, or return all audit logs for system admin user, it only query the audit log in previous version. tags: - Audit Log operationId: listAuditLogs parameters: - $ref: '#/components/parameters/requestId' - $ref: '#/components/parameters/query' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/pageSize' responses: '200': description: Success headers: X-Total-Count: description: The total count of auditlogs 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/AuditLog' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '500': $ref: '#/components/responses/500' /auditlog-exts: get: summary: Get recent logs of the projects which the user is a member with project_admin… description: This endpoint let user see the recent operation logs of the projects which he is member with project_admin role, or return all audit logs for system admin user. tags: - Audit Log operationId: listAuditLogExts parameters: - $ref: '#/components/parameters/requestId' - $ref: '#/components/parameters/query' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/pageSize' responses: '200': description: Success headers: X-Total-Count: description: The total count of auditlogs 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/AuditLogExt' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '500': $ref: '#/components/responses/500' /auditlog-exts/events: get: summary: Get all event types of audit log tags: - Audit Log operationId: listAuditLogEventTypes parameters: - $ref: '#/components/parameters/requestId' responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/AuditLogEventType' '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' '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' schemas: AuditLog: type: object properties: id: type: integer description: The ID of the audit log entry. username: type: string description: Username of the user in this log entry. resource: type: string description: Name of the repository in this log entry. resource_type: type: string description: Tag of the repository in this log entry. operation: type: string description: The operation against the repository in this log entry. op_time: type: string format: date-time example: '2006-01-02T15:04:05Z' description: The time when this operation is triggered. 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 AuditLogExt: type: object properties: id: type: integer description: The ID of the audit log entry. username: type: string description: The username of the operator in this log entry. resource: type: string description: Name of the resource in this log entry. resource_type: type: string description: Type of the resource in this log entry. operation: type: string description: The operation against the resource in this log entry. operation_description: type: string description: The operation's detail description operation_result: type: boolean x-omitempty: false description: the operation's result, true for success, false for fail op_time: type: string format: date-time example: '2006-01-02T15:04:05Z' description: The time when this operation is triggered. AuditLogEventType: type: object properties: event_type: type: string description: the event type, such as create_user. example: create_user parameters: 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 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 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 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