openapi: 3.2.0 info: title: Test Observer Artefacts API description: Test Observer API (see https://github.com/canonical/test_observer) license: name: GNU Affero General Public License v3 url: https://raw.githubusercontent.com/canonical/test_observer/refs/heads/main/backend/LICENSE version: 0.1.0 tags: - name: artefacts paths: /v1/artefacts: get: tags: - artefacts summary: Get Artefacts description: Get latest artefacts optionally by family operationId: get_artefacts_v1_artefacts_get parameters: - name: family in: query required: false schema: anyOf: - $ref: '#/components/schemas/FamilyName' - type: 'null' title: Family responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ArtefactResponse' title: Response Get Artefacts V1 Artefacts Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_artefact /v1/artefacts/search: get: tags: - artefacts summary: Search Artefacts description: 'Search for artefacts by name with pagination support. Returns a list of distinct artefact names that match the search query.' operationId: search_artefacts_v1_artefacts_search_get parameters: - name: q in: query required: false schema: anyOf: - type: string - type: 'null' description: Search term for artefact names title: Q description: Search term for artefact names - name: families in: query required: false schema: anyOf: - type: array items: $ref: '#/components/schemas/FamilyName' - type: 'null' description: Filter by artefact families title: Families description: Filter by artefact families - name: limit in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Maximum number of results (defaults to 50 if not specified) default: 50 title: Limit description: Maximum number of results (defaults to 50 if not specified) - name: offset in: query required: false schema: type: integer minimum: 0 description: Number of results to skip for pagination default: 0 title: Offset description: Number of results to skip for pagination responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ArtefactSearchResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_artefact /v1/artefacts/history: get: tags: - artefacts summary: Get Artefact History description: 'Get the versioning history of an artefact for a given name, family, and track, optionally filtered by stage, with pagination support. Returns a list of artefact versions along with their creation date.' operationId: get_artefact_history_v1_artefacts_history_get parameters: - name: name in: query required: true schema: type: string description: Artefact name title: Name description: Artefact name - name: family in: query required: true schema: $ref: '#/components/schemas/FamilyName' description: Artefact family description: Artefact family - name: track in: query required: false schema: type: string description: Artefact track default: latest title: Track description: Artefact track - name: stage in: query required: false schema: anyOf: - $ref: '#/components/schemas/StageName' - type: 'null' description: Filter by stage title: Stage description: Filter by stage - name: limit in: query required: false schema: type: integer maximum: 500 minimum: 1 description: Maximum number of results (defaults to 10 if not specified) default: 10 title: Limit description: Maximum number of results (defaults to 10 if not specified) - name: offset in: query required: false schema: type: integer minimum: 0 description: Number of results to skip for pagination default: 0 title: Offset description: Number of results to skip for pagination responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ArtefactHistoryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_artefact /v1/artefacts/{artefact_id}: get: tags: - artefacts summary: Get Artefact operationId: get_artefact_v1_artefacts__artefact_id__get parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ArtefactResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_artefact patch: tags: - artefacts summary: Patch Artefact operationId: patch_artefact_v1_artefacts__artefact_id__patch parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ArtefactPatch' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ArtefactResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_artefact /v1/artefacts/{artefact_id}/versions: get: tags: - artefacts summary: Get Artefact Versions operationId: get_artefact_versions_v1_artefacts__artefact_id__versions_get parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ArtefactVersionResponse' title: Response Get Artefact Versions V1 Artefacts Artefact Id Versions Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_artefact /v1/artefacts/{artefact_id}/environment-reviews: get: tags: - artefacts summary: Get Environment Reviews operationId: get_environment_reviews_v1_artefacts__artefact_id__environment_reviews_get parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ArtefactBuildEnvironmentReviewResponse' title: Response Get Environment Reviews V1 Artefacts Artefact Id Environment Reviews Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_environment_review patch: tags: - artefacts summary: Bulk Update Environment Reviews operationId: bulk_update_environment_reviews_v1_artefacts__artefact_id__environment_reviews_patch parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id requestBody: required: true content: application/json: schema: type: array items: $ref: '#/components/schemas/EnvironmentReviewPatch' title: Requests responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ArtefactBuildEnvironmentReviewResponse' title: Response Bulk Update Environment Reviews V1 Artefacts Artefact Id Environment Reviews Patch '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_environment_review /v1/artefacts/{artefact_id}/environment-reviews/{review_id}: patch: tags: - artefacts summary: Update Environment Review operationId: update_environment_review_v1_artefacts__artefact_id__environment_reviews__review_id__patch parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id - name: review_id in: path required: true schema: type: integer title: Review Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/EnvironmentReviewPatch' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ArtefactBuildEnvironmentReviewResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_environment_review /v1/artefacts/{artefact_id}/builds: get: tags: - artefacts summary: Get Artefact Builds description: Get latest artefact builds of an artefact together with their test executions operationId: get_artefact_builds_v1_artefacts__artefact_id__builds_get parameters: - name: artefact_id in: path required: true schema: type: integer title: Artefact Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ArtefactBuildResponse' title: Response Get Artefact Builds V1 Artefacts Artefact Id Builds Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_artefact components: schemas: TestExecutionRelevantLinkResponse: properties: label: type: string title: Label url: type: string maxLength: 2083 minLength: 1 format: uri title: Url id: type: integer title: Id type: object required: - label - url - id title: TestExecutionRelevantLinkResponse ExecutionMetadata: additionalProperties: items: type: string maxLength: 200 minLength: 1 description: Execution Metadata Value type: array propertyNames: maxLength: 200 minLength: 1 description: Execution Metadata Category type: object title: Execution Metadata description: A mapping of string categories to lists of string values. examples: - charm: - postgresql-k8s - mysql-k8s charm:postgresql-k8s:revision: - '495' FamilyName: type: string enum: - snap - deb - charm - image - solution title: FamilyName ReviewerResponse: properties: id: type: integer title: Id launchpad_handle: anyOf: - type: string - type: 'null' title: Launchpad Handle email: type: string title: Email launchpad_email: type: string title: Launchpad Email deprecated: true name: type: string title: Name type: object required: - id - email - launchpad_email - name title: ReviewerResponse EnvironmentResponse: properties: id: type: integer title: Id name: type: string title: Name architecture: type: string title: Architecture type: object required: - id - name - architecture title: EnvironmentResponse HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ArtefactVersionResponse: properties: version: type: string title: Version artefact_id: type: integer title: Artefact Id type: object required: - version - artefact_id title: ArtefactVersionResponse ArtefactBuildEnvironmentReviewDecision: type: string enum: - REJECTED - APPROVED_INCONSISTENT_TEST - APPROVED_UNSTABLE_PHYSICAL_INFRA - APPROVED_CUSTOMER_PREREQUISITE_FAIL - APPROVED_FAULTY_HARDWARE - APPROVED_ALL_TESTS_PASS title: ArtefactBuildEnvironmentReviewDecision ArtefactBuildEnvironmentReviewResponse: properties: id: type: integer title: Id review_decision: items: $ref: '#/components/schemas/ArtefactBuildEnvironmentReviewDecision' type: array title: Review Decision review_comment: type: string title: Review Comment environment: $ref: '#/components/schemas/EnvironmentResponse' artefact_build: $ref: '#/components/schemas/ArtefactBuildMinimalResponse' reviewers: items: $ref: '#/components/schemas/ReviewerResponse' type: array title: Reviewers default: [] type: object required: - id - review_decision - review_comment - environment - artefact_build title: ArtefactBuildEnvironmentReviewResponse ArtefactHistoryResponse: properties: count: type: integer title: Count items: items: $ref: '#/components/schemas/ArtefactHistoryItemResponse' type: array title: Items type: object required: - count - items title: ArtefactHistoryResponse StageName: type: string enum: - proposed - updates - edge - beta - candidate - stable - pending - current title: StageName TestExecutionResponse: properties: id: type: integer title: Id ci_link: anyOf: - type: string - type: 'null' title: Ci Link c3_link: anyOf: - type: string - type: 'null' title: C3 Link relevant_links: items: $ref: '#/components/schemas/TestExecutionRelevantLinkResponse' type: array title: Relevant Links environment: $ref: '#/components/schemas/EnvironmentResponse' status: $ref: '#/components/schemas/TestExecutionStatus' test_plan: type: string title: Test Plan created_at: type: string format: date-time title: Created At execution_metadata: $ref: '#/components/schemas/ExecutionMetadata' is_triaged: type: boolean title: Is Triaged is_rerun_requested: type: boolean title: Is Rerun Requested readOnly: true rerun_priority: anyOf: - type: integer - type: 'null' title: Rerun Priority readOnly: true type: object required: - id - ci_link - c3_link - environment - status - test_plan - created_at - execution_metadata - is_triaged - is_rerun_requested - rerun_priority title: TestExecutionResponse ArtefactBuildMinimalResponse: properties: id: type: integer title: Id architecture: type: string title: Architecture revision: anyOf: - type: integer - type: 'null' title: Revision type: object required: - id - architecture - revision title: ArtefactBuildMinimalResponse ArtefactBuildResponse: properties: id: type: integer title: Id architecture: type: string title: Architecture revision: anyOf: - type: integer - type: 'null' title: Revision test_executions: items: $ref: '#/components/schemas/TestExecutionResponse' type: array title: Test Executions type: object required: - id - architecture - revision - test_executions title: ArtefactBuildResponse ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError ArtefactPatch: properties: status: anyOf: - $ref: '#/components/schemas/ArtefactStatus' - type: 'null' archived: anyOf: - type: boolean - type: 'null' title: Archived stage: anyOf: - $ref: '#/components/schemas/StageName' - type: 'null' comment: anyOf: - type: string - type: 'null' title: Comment jira_issue: anyOf: - type: string - type: 'null' title: Jira Issue attributes: anyOf: - additionalProperties: true type: object - type: 'null' title: Attributes assignee_id: anyOf: - type: integer - type: 'null' title: Assignee Id description: Legacy field. Mapped to reviewer_ids as a single-element list when reviewer_ids/reviewer_emails are not provided. deprecated: true assignee_email: anyOf: - type: string - type: 'null' title: Assignee Email description: Legacy field. Mapped to reviewer_emails as a single-element list when reviewer_ids/reviewer_emails are not provided. deprecated: true reviewer_ids: anyOf: - items: type: integer type: array - type: 'null' title: Reviewer Ids description: Reviewer user IDs. Preferred over legacy assignee_id/assignee_email for setting assignees. reviewer_emails: anyOf: - items: type: string type: array - type: 'null' title: Reviewer Emails description: Reviewer emails. Preferred over legacy assignee_id/assignee_email for setting assignees. type: object title: ArtefactPatch ArtefactResponse: properties: id: type: integer title: Id name: type: string title: Name version: type: string title: Version track: type: string title: Track store: type: string title: Store branch: type: string title: Branch series: type: string title: Series repo: type: string title: Repo source: type: string title: Source os: type: string title: Os release: type: string title: Release owner: type: string title: Owner sha256: type: string title: Sha256 image_url: type: string title: Image Url stage: type: string title: Stage family: type: string title: Family status: $ref: '#/components/schemas/ArtefactStatus' comment: type: string title: Comment attributes: additionalProperties: true type: object title: Attributes archived: type: boolean title: Archived reviewers: items: $ref: '#/components/schemas/ReviewerResponse' type: array title: Reviewers due_date: anyOf: - type: string format: date - type: 'null' title: Due Date created_at: type: string format: date-time title: Created At bug_link: type: string title: Bug Link jira_issue: anyOf: - type: string - type: 'null' title: Jira Issue all_environment_reviews_count: type: integer title: All Environment Reviews Count completed_environment_reviews_count: type: integer title: Completed Environment Reviews Count assignee: anyOf: - $ref: '#/components/schemas/ReviewerResponse' - type: 'null' description: Backward-compatible assignee field. Populated from the first entry in reviewers when present. readOnly: true type: object required: - id - name - version - track - store - branch - series - repo - source - os - release - owner - sha256 - image_url - stage - family - status - comment - attributes - archived - reviewers - due_date - created_at - bug_link - jira_issue - all_environment_reviews_count - completed_environment_reviews_count - assignee title: ArtefactResponse ArtefactHistoryItemResponse: properties: artefact_id: type: integer title: Artefact Id name: type: string title: Name version: type: string title: Version stage: type: string title: Stage created_at: type: string format: date-time title: Created At type: object required: - artefact_id - name - version - stage - created_at title: ArtefactHistoryItemResponse EnvironmentReviewPatch: properties: id: anyOf: - type: integer - type: 'null' title: Id review_decision: anyOf: - items: $ref: '#/components/schemas/ArtefactBuildEnvironmentReviewDecision' type: array - type: 'null' title: Review Decision review_comment: anyOf: - type: string - type: 'null' title: Review Comment type: object title: EnvironmentReviewPatch TestExecutionStatus: type: string enum: - NOT_STARTED - IN_PROGRESS - PASSED - FAILED - NOT_TESTED - ENDED_PREMATURELY title: TestExecutionStatus ArtefactSearchResponse: properties: artefacts: items: type: string type: array title: Artefacts count: type: integer title: Count limit: type: integer title: Limit offset: type: integer title: Offset type: object required: - artefacts - count - limit - offset title: ArtefactSearchResponse ArtefactStatus: type: string enum: - APPROVED - MARKED_AS_FAILED - UNDECIDED title: ArtefactStatus