openapi: 3.2.0 info: title: Test Observer Environments 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: Environments paths: /v1/environments/reported-issues: get: tags: - Environments summary: Get Reported Issues operationId: get_reported_issues_v1_environments_reported_issues_get parameters: - name: is_confirmed in: query required: false schema: anyOf: - type: boolean - type: 'null' title: Is Confirmed responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/EnvironmentReportedIssueResponse' title: Response Get Reported Issues V1 Environments Reported Issues Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_environment_reported_issue post: tags: - Environments summary: Create Reported Issue operationId: create_reported_issue_v1_environments_reported_issues_post requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/EnvironmentReportedIssueRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/EnvironmentReportedIssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_environment_reported_issue /v1/environments/reported-issues/{issue_id}: put: tags: - Environments summary: Update Reported Issue operationId: update_reported_issue_v1_environments_reported_issues__issue_id__put parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/EnvironmentReportedIssueRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/EnvironmentReportedIssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_environment_reported_issue delete: tags: - Environments summary: Delete Reported Issue operationId: delete_reported_issue_v1_environments_reported_issues__issue_id__delete parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_environment_reported_issue /v1/environments: get: tags: - Environments summary: Get Environments description: 'Returns list of distinct environments that have been used in test executions. Supports pagination and search filtering.' operationId: get_environments_v1_environments_get parameters: - name: q in: query required: false schema: anyOf: - type: string - type: 'null' description: Search term for environment names title: Q description: Search term for environment 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/EnvironmentsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_test components: schemas: 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 EnvironmentReportedIssueResponse: properties: id: type: integer title: Id environment_name: type: string title: Environment Name description: type: string title: Description url: anyOf: - type: string maxLength: 2083 minLength: 1 format: uri - type: 'null' title: Url is_confirmed: type: boolean title: Is Confirmed created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At type: object required: - id - environment_name - description - url - is_confirmed - created_at - updated_at title: EnvironmentReportedIssueResponse FamilyName: type: string enum: - snap - deb - charm - image - solution title: FamilyName EnvironmentReportedIssueRequest: properties: environment_name: type: string title: Environment Name description: type: string title: Description url: anyOf: - type: string maxLength: 2083 minLength: 1 format: uri - type: 'null' title: Url is_confirmed: type: boolean title: Is Confirmed type: object required: - environment_name - description - is_confirmed title: EnvironmentReportedIssueRequest HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError EnvironmentsResponse: properties: environments: items: type: string type: array title: Environments count: type: integer title: Count limit: type: integer title: Limit offset: type: integer title: Offset type: object required: - environments - count - limit - offset title: EnvironmentsResponse description: Response model for environments endpoint