Infra Destinations API

The Destinations API from Infra — 3 operation(s) for destinations.

OpenAPI Specification

infra-destinations-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: Infra API
  license:
    name: Elastic License v2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Infra Authentication Destinations API
  version: 0.0.0
servers:
- url: https://api.infrahq.com
tags:
- name: Destinations
paths:
  /api/destinations:
    get:
      description: ListDestinations
      operationId: ListDestinations
      parameters:
      - in: header
        name: Infra-Version
        required: true
        schema:
          description: Version of the API being requested
          example: 0.0.0
          format: \d+\.\d+\(.\d+)?(-.\w(+\w)?)?
          type: string
      - in: header
        name: Authorization
        required: true
        schema:
          description: Bearer followed by your access key
          example: Bearer ACCESSKEY
          format: Bearer [\da-zA-Z]{10}\.[\da-zA-Z]{24}
          type: string
      - description: Name of the destination
        example: production-cluster
        in: query
        name: name
        schema:
          description: Name of the destination
          example: production-cluster
          type: string
      - description: Kind of destination. eg. kubernetes or ssh or postgres
        example: kubernetes
        in: query
        name: kind
        schema:
          description: Kind of destination. eg. kubernetes or ssh or postgres
          example: kubernetes
          type: string
      - description: Unique ID generated by the connector
        example: 94c2c570a20311180ec325fd56
        in: query
        name: unique_id
        schema:
          description: Unique ID generated by the connector
          example: 94c2c570a20311180ec325fd56
          type: string
      - description: Page number to retrieve
        example: '1'
        in: query
        name: page
        schema:
          description: Page number to retrieve
          example: '1'
          format: int
          minimum: 0
          type: integer
      - description: Number of objects to retrieve per page (up to 1000)
        example: '100'
        in: query
        name: limit
        schema:
          description: Number of objects to retrieve per page (up to 1000)
          example: '100'
          format: int
          maximum: 1000
          minimum: 0
          type: integer
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized: Requestor is not authenticated'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden: Requestor does not have the right permissions'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Duplicate Record
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResponse_Destination'
          description: Success
      summary: ListDestinations
      tags:
      - Destinations
    post:
      description: CreateDestination
      operationId: CreateDestination
      parameters:
      - in: header
        name: Infra-Version
        required: true
        schema:
          description: Version of the API being requested
          example: 0.0.0
          format: \d+\.\d+\(.\d+)?(-.\w(+\w)?)?
          type: string
      - in: header
        name: Authorization
        required: true
        schema:
          description: Bearer followed by your access key
          example: Bearer ACCESSKEY
          format: Bearer [\da-zA-Z]{10}\.[\da-zA-Z]{24}
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                connection:
                  description: Object that includes the URL and CA for the destination
                  properties:
                    ca:
                      example: '-----BEGIN CERTIFICATE-----

                        MIIDNTCCAh2gAwIBAgIRALRetnpcTo9O3V2fAK3ix+c

                        -----END CERTIFICATE-----

                        '
                      type: string
                    url:
                      example: aa60eexample.us-west-2.elb.amazonaws.com
                      type: string
                  required:
                  - ca
                  type: object
                kind:
                  description: Kind of destination. eg. kubernetes or ssh or postgres
                  enum:
                  - kubernetes
                  - ssh
                  - ''
                  example: kubernetes
                  type: string
                name:
                  description: Name of the destination
                  example: production-cluster
                  format: '[a-zA-Z0-9\-_]'
                  maxLength: 256
                  minLength: 2
                  type: string
                resources:
                  items:
                    type: string
                  type: array
                roles:
                  items:
                    type: string
                  type: array
                uniqueID:
                  description: Unique ID used to identify this specific destination
                  example: 94c2c570a20311180ec325fd56
                  type: string
                version:
                  description: Application version of the connector for this destination
                  type: string
              required:
              - name
              type: object
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized: Requestor is not authenticated'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden: Requestor does not have the right permissions'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Duplicate Record
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Destination'
          description: Success
      summary: CreateDestination
      tags:
      - Destinations
  /api/destinations/{id}:
    delete:
      description: DeleteDestination
      operationId: DeleteDestination
      parameters:
      - in: header
        name: Infra-Version
        required: true
        schema:
          description: Version of the API being requested
          example: 0.0.0
          format: \d+\.\d+\(.\d+)?(-.\w(+\w)?)?
          type: string
      - in: header
        name: Authorization
        required: true
        schema:
          description: Bearer followed by your access key
          example: Bearer ACCESSKEY
          format: Bearer [\da-zA-Z]{10}\.[\da-zA-Z]{24}
          type: string
      - in: path
        name: id
        required: true
        schema:
          example: 4yJ3n3D8E2
          format: uid
          pattern: '[1-9a-km-zA-HJ-NP-Z]{1,11}'
          type: string
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized: Requestor is not authenticated'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden: Requestor does not have the right permissions'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Duplicate Record
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
          description: Success
      summary: DeleteDestination
      tags:
      - Destinations
    get:
      description: GetDestination
      operationId: GetDestination
      parameters:
      - in: header
        name: Infra-Version
        required: true
        schema:
          description: Version of the API being requested
          example: 0.0.0
          format: \d+\.\d+\(.\d+)?(-.\w(+\w)?)?
          type: string
      - in: header
        name: Authorization
        required: true
        schema:
          description: Bearer followed by your access key
          example: Bearer ACCESSKEY
          format: Bearer [\da-zA-Z]{10}\.[\da-zA-Z]{24}
          type: string
      - in: path
        name: id
        required: true
        schema:
          example: 4yJ3n3D8E2
          format: uid
          pattern: '[1-9a-km-zA-HJ-NP-Z]{1,11}'
          type: string
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized: Requestor is not authenticated'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden: Requestor does not have the right permissions'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Duplicate Record
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Destination'
          description: Success
      summary: GetDestination
      tags:
      - Destinations
    put:
      description: UpdateDestination
      operationId: UpdateDestination
      parameters:
      - in: header
        name: Infra-Version
        required: true
        schema:
          description: Version of the API being requested
          example: 0.0.0
          format: \d+\.\d+\(.\d+)?(-.\w(+\w)?)?
          type: string
      - in: header
        name: Authorization
        required: true
        schema:
          description: Bearer followed by your access key
          example: Bearer ACCESSKEY
          format: Bearer [\da-zA-Z]{10}\.[\da-zA-Z]{24}
          type: string
      - description: ID of the destination
        example: 7a1b26b33F
        in: path
        name: id
        required: true
        schema:
          description: ID of the destination
          example: 7a1b26b33F
          format: uid
          pattern: '[1-9a-km-zA-HJ-NP-Z]{1,11}'
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                connection:
                  description: Object that includes the URL and CA for the destination
                  properties:
                    ca:
                      example: '-----BEGIN CERTIFICATE-----

                        MIIDNTCCAh2gAwIBAgIRALRetnpcTo9O3V2fAK3ix+c

                        -----END CERTIFICATE-----

                        '
                      type: string
                    url:
                      example: aa60eexample.us-west-2.elb.amazonaws.com
                      type: string
                  required:
                  - ca
                  type: object
                name:
                  description: Name of the destination
                  example: production-cluster
                  format: '[a-zA-Z0-9\-_]'
                  maxLength: 256
                  minLength: 2
                  type: string
                resources:
                  items:
                    type: string
                  type: array
                roles:
                  items:
                    type: string
                  type: array
                uniqueID:
                  description: Unique ID generated by the connector
                  example: 94c2c570a20311180ec325fd56
                  type: string
                version:
                  description: Application version of the connector for this destination
                  type: string
              required:
              - name
              type: object
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized: Requestor is not authenticated'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden: Requestor does not have the right permissions'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Duplicate Record
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Destination'
          description: Success
      summary: UpdateDestination
      tags:
      - Destinations
  /api/tokens:
    post:
      description: CreateToken
      operationId: CreateToken
      parameters:
      - in: header
        name: Infra-Version
        required: true
        schema:
          description: Version of the API being requested
          example: 0.0.0
          format: \d+\.\d+\(.\d+)?(-.\w(+\w)?)?
          type: string
      - in: header
        name: Authorization
        required: true
        schema:
          description: Bearer followed by your access key
          example: Bearer ACCESSKEY
          format: Bearer [\da-zA-Z]{10}\.[\da-zA-Z]{24}
          type: string
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unauthorized: Requestor is not authenticated'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden: Requestor does not have the right permissions'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Duplicate Record
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTokenResponse'
          description: Success
      summary: CreateToken
      tags:
      - Destinations
components:
  schemas:
    ListResponse_Destination:
      properties:
        count:
          description: Total number of items on the current page
          example: '100'
          format: int
          type: integer
        items:
          items:
            properties:
              connected:
                description: Shows if the destination is currently connected
                example: 'true'
                type: boolean
              connection:
                description: Object that includes the URL and CA for the destination
                properties:
                  ca:
                    example: '-----BEGIN CERTIFICATE-----

                      MIIDNTCCAh2gAwIBAgIRALRetnpcTo9O3V2fAK3ix+c

                      -----END CERTIFICATE-----

                      '
                    type: string
                  url:
                    example: aa60eexample.us-west-2.elb.amazonaws.com
                    type: string
                required:
                - ca
                type: object
              created:
                description: Time destination was created
                example: '2022-11-10T23:35:22Z'
                format: date-time
                type: string
              id:
                description: ID of the destination
                example: 7a1b26b33F
                format: uid
                pattern: '[1-9a-km-zA-HJ-NP-Z]{1,11}'
                type: string
              kind:
                description: Kind of destination. eg. kubernetes or ssh or postgres
                example: kubernetes
                type: string
              lastSeen:
                description: formatted as an RFC3339 date-time
                example: '2022-03-14T09:48:00Z'
                format: date-time
                type: string
              name:
                description: Name of the destination
                example: production-cluster
                type: string
              resources:
                description: Destination specific. For Kubernetes, it is the list of namespaces
                example: '[''default'', ''kube-system'']'
                items:
                  description: Destination specific. For Kubernetes, it is the list of namespaces
                  example: '[''default'', ''kube-system'']'
                  type: string
                type: array
              roles:
                description: Destination specific. For Kubernetes, it is the list of cluster roles available on that cluster
                example: '[''cluster-admin'', ''admin'', ''edit'', ''view'', ''exec'', ''logs'', ''port-forward'']'
                items:
                  description: Destination specific. For Kubernetes, it is the list of cluster roles available on that cluster
                  example: '[''cluster-admin'', ''admin'', ''edit'', ''view'', ''exec'', ''logs'', ''port-forward'']'
                  type: string
                type: array
              uniqueID:
                description: Unique ID generated by the connector
                example: 94c2c570a20311180ec325fd56
                type: string
              updated:
                description: Time destination was updated
                example: '2022-12-01T19:48:55Z'
                format: date-time
                type: string
              version:
                description: Application version of the connector for this destination
                type: string
            type: object
          type: array
        limit:
          description: Number of objects per page
          example: '100'
          format: int
          type: integer
        page:
          description: Page number retrieved
          example: '1'
          format: int
          type: integer
        totalCount:
          description: Total number of objects
          example: '485'
          format: int
          type: integer
        totalPages:
          description: Total number of pages
          example: '5'
          format: int
          type: integer
    Destination:
      properties:
        connected:
          description: Shows if the destination is currently connected
          example: 'true'
          type: boolean
        connection:
          description: Object that includes the URL and CA for the destination
          properties:
            ca:
              example: '-----BEGIN CERTIFICATE-----

                MIIDNTCCAh2gAwIBAgIRALRetnpcTo9O3V2fAK3ix+c

                -----END CERTIFICATE-----

                '
              type: string
            url:
              example: aa60eexample.us-west-2.elb.amazonaws.com
              type: string
          required:
          - ca
          type: object
        created:
          description: Time destination was created
          example: '2022-11-10T23:35:22Z'
          format: date-time
          type: string
        id:
          description: ID of the destination
          example: 7a1b26b33F
          format: uid
          pattern: '[1-9a-km-zA-HJ-NP-Z]{1,11}'
          type: string
        kind:
          description: Kind of destination. eg. kubernetes or ssh or postgres
          example: kubernetes
          type: string
        lastSeen:
          description: formatted as an RFC3339 date-time
          example: '2022-03-14T09:48:00Z'
          format: date-time
          type: string
        name:
          description: Name of the destination
          example: production-cluster
          type: string
        resources:
          description: Destination specific. For Kubernetes, it is the list of namespaces
          example: '[''default'', ''kube-system'']'
          items:
            description: Destination specific. For Kubernetes, it is the list of namespaces
            example: '[''default'', ''kube-system'']'
            type: string
          type: array
        roles:
          description: Destination specific. For Kubernetes, it is the list of cluster roles available on that cluster
          example: '[''cluster-admin'', ''admin'', ''edit'', ''view'', ''exec'', ''logs'', ''port-forward'']'
          items:
            description: Destination specific. For Kubernetes, it is the list of cluster roles available on that cluster
            example: '[''cluster-admin'', ''admin'', ''edit'', ''view'', ''exec'', ''logs'', ''port-forward'']'
            type: string
          type: array
        uniqueID:
          description: Unique ID generated by the connector
          example: 94c2c570a20311180ec325fd56
          type: string
        updated:
          description: Time destination was updated
          example: '2022-12-01T19:48:55Z'
          format: date-time
          type: string
        version:
          description: Application version of the connector for this destination
          type: string
    Error:
      properties:
        code:
          format: int32
          type: integer
        fieldErrors:
          items:
            properties:
              errors:
                items:
                  type: string
                type: array
              fieldName:
                type: string
            type: object
          type: array
        message:
          type: string
    EmptyResponse: {}
    CreateTokenResponse:
      properties:
        expires:
          description: formatted as an RFC3339 date-time
          example: '2022-03-14T09:48:00Z'
          format: date-time
          type: string
        token:
          type: string