openapi: 3.0.0
info:
  description: Aura configuration atria agents base API definition.
  version: 1.0.0
  title: Aura configuration atria agents base API Swagger
  contact:
    email: auradev@tid.es
servers:
  - url: https://localhost:8999
paths:
  /aura-services/v2/configuration/agents-base/{agentBaseId}:
    get:
      tags:
        - AgentsBase
      summary: Gets all the info associated to one agent base
      description: Returns channel info by agentBaseId
      operationId: getAgentBaseById
      security:
        - apiKeyHeader: []
      parameters:
        - name: agentBaseId
          in: path
          description: Unique Aura agent base identifier
          required: true
          schema:
            type: string
        - name: excludeFields
          description: Filters to exclude some keys from the returned object. Only root values of agentBaseConfiguration can be filtered
          in: query
          required: false
          schema:
            type: string
        - name: includeFields
          description: Set all the keys returned in the result object. Only root values of agentBaseConfiguration can be filtered
          in: query
          required: false
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: Successfully retrieved
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentBaseConfigurationPartial"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    put:
      tags:
        - AgentsBase
      summary: Updates all the info associated to one agent base
      description: Updates all agent base info
      operationId: updateAgentBase
      security:
        - apiKeyHeader: []
      parameters:
        - name: agentBaseId
          in: path
          description: Unique Aura agent base identifier
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        description: Input agentBase data to update
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentBaseConfiguration"
      responses:
        "204":
          description: Successfully updated
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    patch:
      tags:
        - AgentsBase
      summary: Updates some info associated to one agent base
      description: Updates some fields of agent base info
      operationId: modifyAgentBase
      security:
        - apiKeyHeader: []
      parameters:
        - name: agentBaseId
          in: path
          description: Unique Aura agent base identifier
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        description: Input channelData to add
        required: true
        content:
          application/json:
            schema:              
              $ref: "#/components/schemas/AgentBaseConfigurationPartial"
      responses:
        "204":
          description: Successfully updated
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    delete:
      tags:
        - AgentsBase
      summary: Delete one agent base 
      description: Delete agent base info by id
      operationId: deleteAgentBaseById
      security:
        - apiKeyHeader: []
      parameters:
        - name: agentBaseId
          in: path
          description: Unique Aura agent base identifier
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: Successfully deleted
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
  /aura-services/v2/configuration/agents-base:
    get:
      tags:
        - AgentsBase
      summary: Gets all agents base info
      description: Returns agents base info
      operationId: getAllAgentsBase
      security:
        - apiKeyHeader: []
      parameters:
        - name: excludeFields
          description: Filters to exclude some keys from the returned object. Only root values of agentBaseConfiguration can be filtered
          in: query
          required: false
          schema:
            type: string
        - name: includeFields
          description: Set all the keys returned in the result object. Properties of private properties can't be filtered
          in: query
          required: false
          schema:
            type: string
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
        - name: filter
          description: A list of key:value strings, comma separated to filter returned applications.
          in: query
          required: false
          schema:
            type: string
          example: deploymentName:my-deploy
      responses:
        "200":
          description: Successfully retrieved
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/AgentBaseConfigurationPartial"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
    post:
      tags:
        - AgentsBase
      summary: Adds a new agent base 
      description: Adds a new agent base
      operationId: addAgentBase
      security:
        - apiKeyHeader: []
      parameters:
        - name: correlator
          in: header
          description:
            Unique identifier of a request to be used as correlator in all
            systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        description: Input agentBase data to add
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentBaseConfiguration"
      responses:
        "201":
          description: Successfully gathered
          headers:
            correlator:
              description: Correlation id for the different services
              schema:
                type: string
            location:
              description: URI to access this channel configuration
              schema:
                type: string
                format: url
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "409":
          $ref: "#/components/responses/Conflict"
        "500":
          $ref: "#/components/responses/InternalError"
      x-swagger-router-controller: "modules"
components:
  responses:
    InvalidRequest:
      description: Incoming HTTP request format is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    Unauthorized:
      description: Incoming HTTP request authorization is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    Conflict:
      description:
        The request could not be completed due to a conflict with the current
        state of the target resource.
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    TooManyRequests:
      description: The user has sent too many requests in a given amount of time
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    InternalError:
      description: Unexpected internal error
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    NotFound:
      description: Request resource not found
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    AgentBaseConfigurationPartial:
      type: object
      required:
        - id
      additionalProperties: false
      properties:
        description:
          type: string
          description: Contains the description of the agent base.  
          pattern: '^\S.*$'
          minLength: 1   
        id:
          type: string
          format: uuid
          description: Contains the UUID that identifies the agent base univocally in Aura.
        language:
          type: string
          description: Contains the language type that the agent base is associated with.
          enum:
            - python
        name:
          type: string
          description: Contains the name that identifies the agent base univocally in Aura.
          pattern: '^\S.*$'
          minLength: 1
        tags:
          type: array
          description: Contains the tags that the agent base is associated with.
          items:
            type: string
            pattern: '^\S.*$'
            minLength: 1
        version:
          type: string
          description: Contains the version of the agent base.
        metadata:
          $ref: '#/components/schemas/DocumentMetadata'
    AgentBaseConfiguration:
      type: object
      allOf:
        - $ref: '#/components/schemas/AgentBaseConfigurationPartial'
        - required:
            - description
            - id
            - language
            - name
            - version
    AuraError:
      type: object
      description: Error response
      additionalProperties: false
      properties:
        code:
          type: string
          description: Unique id of the error
        message:
          type: string
          description: Specific and descriptive text of the error
        errors:
          description: With validation error. Swagger error information
          type: array
          items:
            type: object
    DocumentMetadata:
      type: object
      description: Metadata for configuration-api docs
      additionalProperties: true
      properties:
        version:
          type: string
          description: Version when document was created
        createdAt:
          type: string
          description: Date when the content was created
          format: date-time
        updatedAt:
          type: string
          description: Date when the content was updated
          format: date-time