openapi: '3.0.1'
info:
  title: MindConnect API
  description: |

    MindConnect API provides following data ingestion functionalities:

    # Data Point Mappings

    Creating and managing mappings between an agent's data points and an entity's dynamic property to be able to upload TimeSeries data.

    Each agent has data points with unique ids. The mapping is between to this id to an entity's dynamic property set's property.

    - A data point can be mapped to many property of many property set of many
      entities.

    - A data point can not be mapped to multiple properties within same property set under same entity.

    - A property set can have mappings from many agents' many data points to its
      properties.

    - The type of the datapoint has to be same with the type of the property.

    Whenever data source configuration of an agent is updated via Agent Management API; all mappings with __keepMapping__ attribute set gets their validity attribute updated and all mappings with __keepMapping__ attribute unset are deleted.

    # Event Mappings

    Creating and managing mappings for agent's events to assets.

    An event uploaded by an agent will be checked against the event mappings to determine the asset the event will be stored in.

    If there are no event mappings matching an event, that event will be stored in the agent asset.

    Multiple mappings can match for an event uploaded. In such a case, all matching mappings will be applied for the event.

    Multiple event mappings can be directed to the same asset.

    Maximum 50 event mappings can be created per agent.

    Maximum 5 event mappings can be created per agent, which are mapped to a single event type resource.

    # Exchange

    Exchanging time series, events, files and data source configuration data. Combination of different data types can be uploaded via exchange endpoint within multipart body. Maximum size of exchange body is 10MBs.

    # Diagnostic Activations

    Management of Diagnostic Activations and querying Diagnostic Messages of time series, event, file and data source configuration requests.

    - Maximum 5 agents per tenant can be activated for data ingestion tracking.

    - For non-agents, the required permission allows to manage diagnostic activation resources of agents in the same tenant as in the token.

    - For agents, only the diagnostic activation related to the agent can be managed. Agents are forbidden to view/change the resources of other agents in the same tenant.

    - Agents are allowed to update activation for itself only. Users with sufficient scopes are allowed

  version: '3.7.0'
  x-visibility: external

servers:
  - url: https://api.eu1.siemens.app/mindconnect-1000001700/v3
    description: Xcelerator compliant URL

tags:
  - name: Mappings
    description: Mapping Operations
  - name: EventMappings
    description: Event Mapping Operations
  - name: Exchange
    description: Exchange Operations
  - name: Diagnostic Activations
    description: Diagnostic Activations Operations
  - name: Record Recovery
    description: Record Recovery Operations
  - name: Diagnostic Information
    description: Diagnostic Information Operations

paths:
  /dataPointMappings:
    post:
      tags:
        - Mappings
      summary: Create single mapping
      description: |
        Creates a single mapping.
      security:
        - mappings:
            - map.c
      requestBody:
        description: Object describing new mapping resource.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mapping'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mapping'
        '400':
          description: Bad Request. Request validations failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conflict'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

    get:
      tags:
        - Mappings
      summary: Get mappings.
      description: |
        Retrieves a list of mappings.
      security:
        - mappings:
            - map.r
      parameters:
        - name: filter
          in: query
          description: Filter as JSON object.
          required: false
          schema:
            type: string
        - name: size
          in: query
          description: The maximum number of elements in a page.
          required: false
          schema:
            type: integer
            default: 20
            format: int32
        - name: page
          in: query
          description: The (0-based) index of page.
          required: false
          schema:
            type: integer
            default: 0
            format: int32
        - name: sort
          in: query
          description: |
            The order of returned elements.
            Multiple fields could be used separated by commas (e.g. ''field1,field2'').
            Descending order could be requested by appending '',desc'' at the end of parameter.(e.g. ''field1,field2,desc'')'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedMapping'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /dataPointMappings/{id}:
    get:
      tags:
        - Mappings
      summary: Get a mapping by id
      description: |
        Gets a mapping by given id.
      security:
        - mappings:
            - map.r
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the mapping resource.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mapping'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Mapping not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

    delete:
      tags:
        - Mappings
      summary: Delete a mapping
      description: |
        Deletes a mapping.
      security:
        - mappings:
            - map.d
      parameters:
        - name: id
          in: path
          description: Unique identifier of the mapping resource.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Deleted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Mapping not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /eventMappings:
    post:
      tags:
        - EventMappings
      summary: Create single mapping
      description: |
        Creates a single mapping.
      security:
        - eventMappings:
            - evt.map.c
      requestBody:
        description: Object describing new mapping resource.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventMapping'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMappingOptional'
        '400':
          description: Bad Request. Request validations failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

    get:
      tags:
        - EventMappings
      summary: Get mappings
      description: |
        Retrieves a list of mappings.
      security:
        - eventMappings:
            - evt.map.r
      parameters:
        - name: filter
          in: query
          description: Filter as stringified JSON object with agentId as the key.
          required: false
          schema:
            type: string
        - name: size
          in: query
          description: The maximum number of elements in a page.
          required: false
          schema:
            type: integer
            default: 20
            format: int32
        - name: page
          in: query
          description: The (0-based) index of page.
          required: false
          schema:
            type: integer
            default: 0
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedEventMapping'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

  /eventMappings/{id}:
    get:
      tags:
        - EventMappings
      summary: Get a mapping by id
      description: |
        Gets a mapping by given id.
      security:
        - eventMappings:
            - evt.map.r
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the mapping resource.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMapping'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: Mapping not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

    patch:
      tags:
        - EventMappings
      summary: Update a mapping
      description: |
        Updates a mapping.
      security:
        - eventMappings:
            - evt.map.u
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the mapping resource.
          schema:
            type: string
        - in: header
          name: If-Match
          description: ETag number of resource.
          required: true
          schema:
            type: string
      requestBody:
        description: Object describing new values of the attributes of the mapping.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventMappingOptional'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMappingOptional'
        '400':
          description: Bad Request. Request validations failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

    delete:
      tags:
        - EventMappings
      summary: Delete a mapping
      description: |
        Deletes a mapping.
      security:
        - eventMappings:
            - evt.map.d
      parameters:
        - name: id
          in: path
          description: Unique identifier of the mapping resource.
          required: true
          schema:
            type: string
        - in: header
          name: If-Match
          description: ETag number of resource.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Deleted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: Mapping not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'

  /exchange:
    post:
      tags:
        - Exchange
      security:
        - exchange:
            - exc.w
      requestBody:
        required: true
        description: Multipart message.
        content:
          multipart/mixed:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: OK
        '400':
          description: 'bad request, e.g. multi part body is not well formatted.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '413':
          description: Payload Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/payLoadTooLarge'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /diagnosticInformation:
    get:
      deprecated: true
      description: |
        This operation is deprecated! Use "/diagnosticActivations/{id}/messages" instead.
        Gets Diagnostic Information.
      tags:
        - Diagnostic Information
      summary: Get Diagnostic Information
      security:
        - diagnosticInformation:
            - di.r
      parameters:
        - name: filter
          in: query
          description: |
            JSON based filter. Diagnostic information can be filtered by the following fields
             - `agentId`
             - `correlationId`
             - `message`
             - `source`
             - `timestamp`
             - `severity`
          required: false
          schema:
            type: string
        - name: size
          in: query
          description: The maximum number of elements in a page.
          required: false
          schema:
            type: integer
            default: 20
            format: int32
        - name: page
          in: query
          description: The (0-based) index of page.
          required: false
          schema:
            type: integer
            default: 0
            format: int32
        - name: sort
          in: query
          description: |
            The order of returned elements.
            Multiple fields could be used separated by commas (e.g. ''field1,field2'').
            Descending order could be requested by appending '',desc'' at the end of parameter.(e.g. ''field1,field2,desc'')'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedDiagnosticInformation'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /diagnosticActivations:
    post:
      tags:
        - Diagnostic Activations
      summary: |
        Creates a new diagnostic activation
      description: |
        Create a new diagnostic activation.
        Agents are allowed to create activation for itself only. Users with sufficient scopes are allowed to create activations of the agents in the same tenant as in the token.
      security:
        - diagnosticActivations:
            - da.c
      requestBody:
        description: Object describing new diagnostic activation resource.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiagnosticActivation'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiagnosticActivation'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '409':
          description: Resource is already available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conflict'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

    get:
      tags:
        - Diagnostic Activations
      summary: |
        Gets diagnostic activations
      description: |
        Get diagnostic activations. Agents are allowed to get their own activation. Users with sufficient scopes are allowed to get all activations in the same tenant as in the token.
      security:
        - diagnosticActivations:
            - da.r
      parameters:
        - name: size
          in: query
          description: The maximum number of elements in a page.
          required: false
          schema:
            type: integer
            default: 20
            format: int32
        - name: page
          in: query
          description: The (0-based) index of page.
          required: false
          schema:
            type: integer
            default: 0
            format: int32
        - name: sort
          in: query
          description: |
            The order of returned elements.
            Multiple fields could be used separated by commas (e.g. ''field1,field2'').
            Descending order could be requested by appending '',desc'' at the end of parameter.(e.g. ''field1,field2,desc'')'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedDiagnosticActivation'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /diagnosticActivations/{id}:
    put:
      tags:
        - Diagnostic Activations
      summary: |
        Update status of Diagnostic Activation
      description: |
        Updates status of Diagnostic Activation.
      security:
        - diagnosticActivations:
            - da.u
      parameters:
        - name: id
          in: path
          description: Unique identifier of diagnostic activation resource.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Object describing updated diagnostic activation status.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiagnosticActivationStatus'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiagnosticActivation'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

    get:
      tags:
        - Diagnostic Activations
      summary: |
        Gets a diagnostic activation.
      description: |
        Get a diagnostic activation with given id.  Agents are allowed to get their own activation. Users with sufficient scopes are allowed to get any activation in the same tenant as in the token.
      security:
        - diagnosticActivations:
            - da.r
      parameters:
        - name: id
          in: path
          description: Unique identifier of diagnostic activation resource.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiagnosticActivation'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

    delete:
      tags:
        - Diagnostic Activations
      summary: |
        Deletes a diagnostic activation
      description: |
        Delete a diagnostic activation. Agents are allowed to delete their own activation. Users with sufficient scopes are allowed to delete any activation in the same tenant as in the token.
      security:
        - diagnosticActivations:
            - da.d
      parameters:
        - name: id
          in: path
          description: Unique identifier of diagnostic activation resource.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /diagnosticActivations/{id}/messages:
    get:
      tags:
        - Diagnostic Activations
      summary: |
        Get a diagnostic messages of specific activation resource
      description: |
        Get a diagnostic messages of specific activation resource. Agents are allowed to get their own activations' messages. Users with sufficient scopes are allowed to get any activations messages in the same tenant as in the token.
      security:
        - diagnosticActivations:
            - da.m.r
      parameters:
        - name: id
          in: path
          description: Unique identifier of diagnostic activation resource.
          required: true
          schema:
            type: string
        - name: filter
          in: query
          description: |
            JSON based filter. Diagnostic messages can be filtered by the following fields
             - `correlationId`
             - `message`
             - `source`
             - `timestamp`
             - `severity`
          required: false
          schema:
            type: string
        - name: size
          in: query
          description: The maximum number of elements in a page.
          required: false
          schema:
            type: integer
            default: 20
            format: int32
        - name: page
          in: query
          description: The (0-based) index of page.
          required: false
          schema:
            type: integer
            default: 0
            format: int32
        - name: sort
          in: query
          description: |
            The order of returned elements.
            Multiple fields could be used separated by commas (e.g. ''field1,field2'').
            Descending order could be requested by appending '',desc'' at the end of parameter.(e.g. ''field1,field2,desc'')'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedDiagnosticInformationMessages'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /recoverableRecords/{id}/replay:
    post:
      tags:
        - Record Recovery
      summary: Re-play a recoverable record
      description: |
        Re-play a recoverable record.
      security:
        - recordRecovery:
            - rec.c
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the recoverable record.
          schema:
            type: string
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /recoverableRecords/{id}/downloadLink:
    get:
      tags:
        - Record Recovery
      summary: Get download link of record payload.
      description: |
        Gets download link of record payload
      security:
        - recordRecovery:
            - rec.r
      parameters:
        - name: id
          in: path
          description: Unique identifier of the recoverable record.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
                example: 'https://bucketname-s3.eu-central-1.amazonaws.com/c9bcd-44ab-4cfa-a87e-d81e727d9af4?X'
                format: uri
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /recoverableRecords/{id}:
    delete:
      tags:
        - Record Recovery
      summary: Delete a recoverable record
      description: |
        Deletes a recoverable record.
      security:
        - recordRecovery:
            - rec.d
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the recoverable record.
          schema:
            type: string
      responses:
        '204':
          description: Deleted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        '404':
          description: Recoverable record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

  /recoverableRecords:
    get:
      tags:
        - Record Recovery
      summary: Get all recoverable records
      description: |
        Gets all recoverable records
      security:
        - recordRecovery:
            - rec.r
      parameters:
        - name: filter
          in: query
          description: JSON based filter.
          required: false
          schema:
            type: string
        - name: size
          in: query
          description: The maximum number of elements in a page.
          required: false
          schema:
            type: integer
            default: 20
            format: int32
        - name: page
          in: query
          description: The (0-based) index of page.
          required: false
          schema:
            type: integer
            default: 0
            format: int32
        - name: sort
          in: query
          description: |
            The order of returned elements.
            Multiple fields could be used separated by commas (e.g. ''field1,field2'').
            Descending order could be requested by appending '',desc'' at the end of parameter.(e.g. ''field1,field2,desc'')'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedRecoverableRecords'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badrequest'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forbidden'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'

components:
  securitySchemes:
    mappings:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            map.c: Permission to create a mapping
            map.r: Permission to read mapping(s).
            map.d: Permission to delete a mapping

    eventMappings:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            evt.map.c: Permission to create a mapping
            evt.map.r: Permission to read mapping(s)
            evt.map.u: Permission to update mapping
            evt.map.d: Permission to delete a mapping

    exchange:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            exc.w: Permission to exchange data.

    diagnosticActivations:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            da.c: Permission to create a diagnostic activation.
            da.r: Permission to read a/all diagnostic activation.
            da.u: Permission to update a diagnostic activation.
            da.d: Permission to delete a diagnostic activation.
            da.m.r: Permission to read a/all diagnostic messages of specific activation resource.

    diagnosticInformation:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            di.r: Permission to read diagnostic information.

    recordRecovery:
      type: oauth2
      description: |
        For **Xcelerator** compliance, please use **authorizationUrl** = https://1000001700.eu1.sws.siemens.com/oauth/authorize and **tokenUrl** = https://1000001700.eu1.sws.siemens.com/oauth/token
      flows:
        authorizationCode:
          authorizationUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/authorize'
          tokenUrl: 'https://1000001700.eu1.sws.siemens.com/oauth/token'
          scopes:
            rec.c: Permission to replay recoverable record.
            rec.r: Permission to read recoverable record.
            rec.d: Permission to delete recoverable record.

  schemas:
    Mapping:
      required:
        - agentId
        - dataPointId
        - entityId
        - propertySetName
        - propertyName
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          example: '4fad6258-5def-4d84-a4c2-1481b209c116'
          maxLength: 36
          description: Unique identifier of the mapping resource
        agentId:
          type: string
          format: uuid
          example: '11961bc396cd4a87a9b26b723f5b7ba0'
          description: Unique identifier of the agent
          maxLength: 36
        dataPointId:
          type: string
          example: 'DP0001'
          maxLength: 36
          description: Unique identifier of the data point
        dataPointUnit:
          type: string
          readOnly: true
          example: '%'
          maxLength: 32
          description: Unit of the data point
        dataPointType:
          type: string
          readOnly: true
          enum:
            - INT
            - LONG
            - DOUBLE
            - BOOLEAN
            - STRING
            - BIG_STRING
            - TIMESTAMP
          description: Type of the data point
        entityId:
          type: string
          format: uuid
          example: '83e78008eadf453bae4f5c7bef3db550'
          maxLength: 36
          description: Unique identifier of the entity
        propertySetName:
          type: string
          example: 'ElectricalProperties'
          maxLength: 256
        propertyName:
          type: string
          example: 'Voltage'
          maxLength: 256
        propertyUnit:
          type: string
          example: '%'
          maxLength: 32
          readOnly: true
        propertyType:
          type: string
          readOnly: true
          enum:
            - INT
            - LONG
            - DOUBLE
            - BOOLEAN
            - STRING
            - BIG_STRING
            - TIMESTAMP
        qualityEnabled:
          type: boolean
          readOnly: true
        keepMapping:
          type: boolean
          example: false
          default: false
          description: Identifies auto deleting mapping or keeping mapping.
        validity:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/Validity'

    EventMapping:
      required:
        - agentId
        - assetId
        - eventTypeId
        - eventTypeName
        - eventTypeFieldName
        - eventTypeFieldValue
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          example: '2d94ba61-3e16-415c-a5c0-d428b8d92d42'
          maxLength: 36
          description: Unique identifier of the mapping resource
        agentId:
          type: string
          example: '11961bc396cd4a87a9b26b723f5b7ba0'
          description: Unique identifier of the agent
          maxLength: 32
        assetId:
          type: string
          example: '2196dbc396cd4a87a9bd6b723fsb7baz'
          maxLength: 32
          description: Unique identifier of the asset
        eventTypeId:
          type: string
          example: 'mytenant.connectivity.event.type.TestEventType'
          maxLength: 64
          description: Unique identifier of the event type
        eventTypeName:
          type: string
          example: 'TestEventType'
          maxLength: 64
          description: Name of event type
        eventTypeFieldName:
          type: string
          example: 'source'
          maxLength: 64
          description: Name of a field of the event type
        eventTypeFieldValue:
          type: string
          example: 'Machine_1'
          maxLength: 255
          description: |
            Value of the field of the event type
        eTag:
          type: string
          readOnly: true
          example: '1'

    EventMappingOptional:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          example: '2d94ba61-3e16-415c-a5c0-d428b8d92d42'
          maxLength: 36
          description: Unique identifier of the mapping resource
        agentId:
          type: string
          example: '11961bc396cd4a87a9b26b723f5b7ba0'
          description: Unique identifier of the agent
          maxLength: 32
        assetId:
          type: string
          example: '2196dbc396cd4a87a9bd6b723fsb7baz'
          maxLength: 32
          description: Unique identifier of the asset
        eventTypeId:
          type: string
          example: 'mytenant.connectivity.event.type.TestEventType'
          maxLength: 64
          description: Unique identifier of the event type
        eventTypeName:
          type: string
          example: 'TestEventType'
          maxLength: 64
          description: Name of event type
        eventTypeFieldName:
          type: string
          example: 'source'
          maxLength: 64
          description: Name of a field of the event type
        eventTypeFieldValue:
          type: string
          example: 'Machine_1'
          maxLength: 255
          description: |
            Value of the field of the event type
        eTag:
          type: string
          example: '1'

    Validity:
      type: object
      required:
        - status
        - reasons
      properties:
        status:
          type: string
          enum:
            - VALID
            - INVALID
          example: INVALID
        reasons:
          type: array
          items:
            type: string
            enum:
              - MISSING_DATAPOINT
              - MISSING_PROPERTY
              - INVALID_TYPE
              - INVALID_UNIT
          example:
            - MISSING_DATAPOINT

    PagedMapping:
      type: object
      required:
        - content
        - totalPages
        - totalElements
        - last
        - numberOfElements
        - first
        - sort
        - size
        - number
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Mapping'
        last:
          description: Whether the current item is the last one.
          type: boolean
          example: true
        totalPages:
          description: The number of total pages.
          type: integer
          example: 1
        totalElements:
          description: The total amount of elements.
          type: integer
          example: 1
        numberOfElements:
          description: The number of elements currently on this page.
          type: integer
          example: 1
        first:
          description: Whether the current item is the first one.
          type: boolean
          example: true
        sort:
          description: The sorting parameters for the page.
          type: array
          items:
            $ref: '#/components/schemas/Order'
          example: null
        size:
          description: The size of the page.
          type: integer
          example: 20
        number:
          description: The number of the current item.
          type: integer
          example: 0

    PagedEventMapping:
      type: object
      required:
        - content
        - totalPages
        - totalElements
        - last
        - numberOfElements
        - first
        - sort
        - size
        - number
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/EventMapping'
        last:
          description: Whether the current item is the last one.
          type: boolean
          example: true
        totalPages:
          description: The number of total pages.
          type: integer
          example: 1
        totalElements:
          description: The total amount of elements.
          type: integer
          example: 1
        numberOfElements:
          description: The number of elements currently on this page.
          type: integer
          example: 1
        first:
          description: Whether the current item is the first one.
          type: boolean
          example: true
        sort:
          description: The sorting parameters for the page.
          type: array
          items:
            $ref: '#/components/schemas/Order'
          example: null
        size:
          description: The size of the page.
          type: integer
          example: 20
        number:
          description: The number of the current item.
          type: integer
          example: 0

    Order:
      type: object
      properties:
        direction:
          description: The order the property shall be sorted for.
          type: string
          enum:
            - ASC
            - DESC
        property:
          description: The property to order for.
          type: string
        ignoreCase:
          description: Whether or not the sort will be case sensitive.
          type: boolean
        nullHandling:
          type: string
          enum:
            - NATIVE
            - NULLS_FIRST
            - NULLS_LAST
        descending:
          description: Whether sorting for this property shall be descending.
          type: boolean
        ascending:
          description: Whether sorting for this property shall be ascending.
          type: boolean

    DiagnosticActivation:
      type: object
      required:
        - agentId
      properties:
        id:
          type: string
          description: Unique identifier of diagnostic activation resource
          readOnly: true
          maxLength: 36
          example: '8f273818-e975-11e8-9f32-f2801f1b9fd1'
        agentId:
          type: string
          description: Unique identifier of the agent
          maxLength: 36
          example: '3b27818ea09a46b48c7eb3fbd878349f'
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
          description: Status of the activation
          example: 'ACTIVE'

    DiagnosticActivationStatus:
      type: object
      required:
        - agentId
        - status
      properties:
        agentId:
          type: string
          description: Unique identifier of the agent
          maxLength: 36
          example: '3b27818ea09a46b48c7eb3fbd878349f'
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
          description: Status of the activation
          example: 'ACTIVE'

    DiagnosticInformation:
      type: object
      properties:
        agentId:
          type: string
          maxLength: 36
          example: '3b27818ea09a46b48c7eb3fbd878349f'
        correlationId:
          type: string
          maxLength: 36
          example: '3fcf2a5ecc7611e7abc4cec278b6b50a'
        severity:
          type: string
          enum:
            - INFO
            - WARN
            - ERROR
        message:
          type: string
          maxLength: 4096
          example: '[Finished] TimeSeries upload completed, <1> samplings and <1> properties in <1> requests>. <0> values are dropped.'
        source:
          type: string
          example: 'TIMESERIES'
          description: Source of diagnostic information.
        state:
          type: string
          enum:
            - ACCEPTED
            - RETRYING
            - DROPPED
            - PROCESSING
            - FINISHED
          description: State of diagnostic information.
        timestamp:
          type: string
          example: '2018-08-27T16:40:11.235Z'
          format: date-time
          description: Diagnostic information creation date.

    DiagnosticInformationMessage:
      type: object
      properties:
        correlationId:
          type: string
          maxLength: 36
          example: '3fcf2a5ecc7611e7abc4cec278b6b50a'
        severity:
          type: string
          enum:
            - INFO
            - WARN
            - ERROR
        message:
          type: string
          maxLength: 4096
          example: '[Finished] TimeSeries upload completed, <1> samplings and <1> properties in <1> requests>. <0> values are dropped.'
        source:
          type: string
          example: 'TIMESERIES'
          description: Source of diagnostic information.
        state:
          type: string
          enum:
            - ACCEPTED
            - RETRYING
            - DROPPED
            - PROCESSING
            - FINISHED
          description: State of diagnostic information.
        timestamp:
          type: string
          example: '2018-08-27T16:40:11.235Z'
          format: date-time
          description: Diagnostic information creation date.

    PagedDiagnosticActivation:
      type: object
      required:
        - content
        - totalPages
        - totalElements
        - last
        - numberOfElements
        - first
        - sort
        - size
        - number
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DiagnosticActivation'
        last:
          description: Whether the current item is the last one.
          type: boolean
          example: true
        totalPages:
          description: The number of total pages.
          type: integer
          example: 1
        totalElements:
          description: The total amount of elements.
          type: integer
          example: 1
        numberOfElements:
          description: The number of elements currently on this page.
          type: integer
          example: 1
        first:
          description: Whether the current item is the first one.
          type: boolean
          example: true
        sort:
          description: The sorting parameters for the page.
          type: array
          items:
            $ref: '#/components/schemas/Order'
          example: null
        size:
          description: The size of the page.
          type: integer
          example: 20
        number:
          description: The number of the current item.
          type: integer
          example: 0

    PagedDiagnosticInformation:
      type: object
      required:
        - content
        - totalPages
        - totalElements
        - last
        - numberOfElements
        - first
        - sort
        - size
        - number
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DiagnosticInformation'
        last:
          description: Whether the current item is the last one.
          type: boolean
          example: true
        totalPages:
          description: The number of total pages.
          type: integer
          example: 1
        totalElements:
          description: The total amount of elements.
          type: integer
          example: 1
        numberOfElements:
          description: The number of elements currently on this page.
          type: integer
          example: 1
        first:
          description: Whether the current item is the first one.
          type: boolean
          example: true
        sort:
          description: The sorting parameters for the page.
          type: array
          items:
            $ref: '#/components/schemas/Order'
          example: null
        size:
          description: The size of the page.
          type: integer
          example: 20
        number:
          description: The number of the current item.
          type: integer
          example: 0

    PagedDiagnosticInformationMessages:
      type: object
      required:
        - content
        - totalPages
        - totalElements
        - last
        - numberOfElements
        - first
        - sort
        - size
        - number
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DiagnosticInformationMessage'
        last:
          description: Whether the current item is the last one.
          type: boolean
          example: true
        totalPages:
          description: The number of total pages.
          type: integer
          example: 1
        totalElements:
          description: The total amount of elements.
          type: integer
          example: 1
        numberOfElements:
          description: The number of elements currently on this page.
          type: integer
          example: 1
        first:
          description: Whether the current item is the first one.
          type: boolean
          example: true
        sort:
          description: The sorting parameters for the page.
          type: array
          items:
            $ref: '#/components/schemas/Order'
          example: null
        size:
          description: The size of the page.
          type: integer
          example: 20
        number:
          description: The number of the current item.
          type: integer
          example: 0

    RecoverableRecords:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          example: '4fad6258-5def-4d84-a4c2-1481b209c116'
          maxLength: 36
          description: Unique identifier of the record
        correlationId:
          type: string
          format: uuid
          readOnly: true
          example: '7had568-5def-4d84-a4c2-1481b209c116'
          maxLength: 36
          description: Unique identifier of the record
        agentId:
          type: string
          readOnly: true
          example: '33238f98784711e8adc0fa7ae01bbebc'
          maxLength: 36
          description: agentId
        requestTime:
          type: string
          example: '2018-08-27T16:40:11.235Z'
          format: date-time
          description: Ingestion date of the data.
        dropReason:
          type: string
          readOnly: true
          example: ' <[Dropped] TimeSeries Data is dropped. Validation failed for reason <Pre-processing of <153000> data points ended with <60600> valid and <92400> dropped data points. Following issues found: Data point with no mapping count is <92400>, including <[variable101, variable102, variable103, variable104, variable105, variable106, variable107, variable108, variable109, variable110]>.>>'
          maxLength: 1024
          description: Drop reason of data

    PagedRecoverableRecords:
      type: object
      required:
        - content
        - totalPages
        - totalElements
        - last
        - numberOfElements
        - first
        - sort
        - size
        - number
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/RecoverableRecords'
        last:
          description: Whether the current item is the last one.
          type: boolean
          example: true
        totalPages:
          description: The number of total pages.
          type: integer
          example: 1
        totalElements:
          description: The total amount of elements.
          type: integer
          example: 1
        numberOfElements:
          description: The number of elements currently on this page.
          type: integer
          example: 1
        first:
          description: Whether the current item is the first one.
          type: boolean
          example: true
        sort:
          description: The sorting parameters for the page.
          type: array
          items:
            $ref: '#/components/schemas/Order'
          example: null
        size:
          description: The size of the page.
          type: integer
          example: 20
        number:
          description: The number of the current item.
          type: integer
          example: 0

    unauthorized:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
          example: Not authorized to access this resource.

    badrequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
          example: The request is not valid.

    forbidden:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
          example: Insufficient authorization for this resource.

    payLoadTooLarge:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
          example: The request is too large.

    notfound:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
          example: Resource not found.

    conflict:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
          example: A newer resource version is available.

    error:
      type: object
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string

    Errors:
      type: object
      description: Error response body model.
      properties:
        errors:
          type: array
          description: Concrete error codes and messages are defined at operation error response descriptions in this API specification.
          items:
            type: object
            properties:
              code:
                type: string
                description: Unique error code. Every code is bound to one (parametrized) message.
                format: mdsp.conn.mindconnect.<suffix>
                example: mdsp.conn.mindconnect.exampleCode
              logref:
                type: string
                description: Logging correlation ID for debugging purposes.
                example: 0bff7e7a-cd25-4576-9908-4180ef086174
              message:
                type: string
                description: Human readable error message in English.
                example: Example error message with parameter value 100