OpsMill Query API

The Query API from OpsMill — 1 operation(s) for query.

OpenAPI Specification

opsmill-query-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Infrahub Artifact Query API
  version: 1.10.0
tags:
- name: Query
paths:
  /api/query/{query_id}:
    post:
      summary: Graphql Query Post
      operationId: graphql_query_post_api_query__query_id__post
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      parameters:
      - name: query_id
        in: path
        required: true
        schema:
          type: string
          description: ID or Name of the GraphQL query to execute
          title: Query Id
        description: ID or Name of the GraphQL query to execute
      - name: subscribers
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          description: List of subscribers to attach to the CoreGraphQLQueryGroup
          default: []
          title: Subscribers
        description: List of subscribers to attach to the CoreGraphQLQueryGroup
      - name: update_group
        in: query
        required: false
        schema:
          type: boolean
          description: When True create or update a CoreGraphQLQueryGroup with all nodes related to this query.
          default: false
          title: Update Group
        description: When True create or update a CoreGraphQLQueryGroup with all nodes related to this query.
      - name: branch
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Name of the branch to use for the query
          title: Branch
        description: Name of the branch to use for the query
      - name: at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Time to use for the query, in absolute or relative format
          title: At
        description: Time to use for the query, in absolute or relative format
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryPayload'
              description: Payload of the request, must be used to provide the variables
              default:
                variables: {}
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Graphql Query Post Api Query  Query Id  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Query
    get:
      summary: Graphql Query Get
      operationId: graphql_query_get_api_query__query_id__get
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      parameters:
      - name: query_id
        in: path
        required: true
        schema:
          type: string
          description: ID or Name of the GraphQL query to execute
          title: Query Id
        description: ID or Name of the GraphQL query to execute
      - name: subscribers
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          description: List of subscribers to attach to the CoreGraphQLQueryGroup
          default: []
          title: Subscribers
        description: List of subscribers to attach to the CoreGraphQLQueryGroup
      - name: update_group
        in: query
        required: false
        schema:
          type: boolean
          description: When True create or update a CoreGraphQLQueryGroup with all nodes related to this query.
          default: false
          title: Update Group
        description: When True create or update a CoreGraphQLQueryGroup with all nodes related to this query.
      - name: branch
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Name of the branch to use for the query
          title: Branch
        description: Name of the branch to use for the query
      - name: at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Time to use for the query, in absolute or relative format
          title: At
        description: Time to use for the query, in absolute or relative format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Graphql Query Get Api Query  Query Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Query
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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    QueryPayload:
      properties:
        variables:
          additionalProperties: true
          type: object
          title: Variables
      type: object
      title: QueryPayload
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-INFRAHUB-KEY