swagger: '2.0'
info:
  description: This describes the HTTP RPC API for the TrendMiner Connector.
  version: '1.0'
  title: TrendMiner Connector API
  termsOfService: 'urn:tos'
  contact:
    name: support@trendminer.com
  license:
    name: Commercial
host: localhost
basePath: /api
tags:
  - name: informational
    description: Informational endpoints for the connector.
  - name: configuration
    description: Endpoints for managing configuration of historian connections.
  - name: tags
    description: Endpoints for retrieving tag metadata and searching for tag values.
  - name: af
    description: Endpoints for retrieving asset information.
  - name: ef
    description: Endpoints for retrieving event frame information.
  - name: assets
    description: Endpoints for retrieving asset information.
  - name: support
    description: Endpoints for support of historian connector application.
  - name: context
    description: Endpoints for retrieving context item information.
  - name: provider
    description: Endpoints for retrieving capabilities and properties metadata.
paths:
  /version:
    get:
      tags:
        - informational
      summary: Returns the version of the TrendMiner historian connector.
      consumes:
        - '*/*'
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            type: object
            properties:
              version:
                type: string
                description: The version string of the connector.
            required:
              - version
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        default:
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /database:
    get:
      tags:
        - configuration
      summary: Retrieve all the configured historian connections.
      operationId: GetConcreteHistorian
      consumes:
        - '*/*'
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/HistorianConnection'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
    post:
      tags:
        - configuration
      summary: Creates a new historian connection configuration on the central connector.
      consumes:
        - application/json
      produces:
        - text/plain
        - application/json
      parameters:
        - name: historianConnection
          in: body
          description: The connection to add to the connector API. You can provide an ID, but this will be ignored. A unique ID is assigned and returned by the API.
          required: true
          schema:
            $ref: '#/definitions/HistorianConnection'
      responses:
        '200':
          description: Created. Returns the ID of the new connection configuration.
          schema:
            type: string
            description: The ID of the new connection configuration.
        '400':
          description: Bad Request. When validation errors occur.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /database/{id}:
    get:
      tags:
        - configuration
      summary: Retrieve the configured historian connection with the given ID.
      consumes:
        - '*/*'
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: The ID of the connection to retrieve.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/HistorianConnection'
        '400':
          description: Bad Request. When validation errors occur.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
    put:
      tags:
        - configuration
      summary: Update the configured historian connection with the given ID.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: The ID of the group to update.
          required: true
          type: string
        - name: connection
          in: body
          description: The connection configuration to update. You can provide an ID, but this will be ignored, the ID specified in the path will be used.
          required: true
          schema:
            $ref: '#/definitions/HistorianConnection'
      responses:
        '200':
          description: OK
          schema:
            type: string
            description: The ID of the new connection configuration.
        '400':
          description: Bad Request. When validation errors occur.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
    delete:
      tags:
        - configuration
      summary: Deletes the configured historian connection with the given ID.
      consumes:
        - '*/*'
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: The ID of the group to delete.
          required: true
          type: string
      responses:
        '200':
          description: OK. Deleted.
          schema:
            type: string
            description: The ID of the deleted connection configuration.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /database/{id}/test:
    get:
      tags:
        - configuration
      summary: Test the historian connection with the given ID.
      consumes:
        - '*/*'
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: The ID of the connection to retrieve.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/HistorianConnection'
        '400':
          description: Error opening configured connection.
          schema:
            type: object
            properties:
              message:
                type: string
                description: The error message, describes details of why the connection failed.
            required:
              - message
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /log:
    get:
      tags:
        - support
      summary: Get the log file content.
      consumes:
        - '*/*'
      produces:
        - text/plain
      responses:
        '200':
          description: Log file as attachment.
          content:
            text/plain:
              schema:
                type: string
                format: text
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
    put:
      tags:
        - support
      summary: Changes log level, e.g. INFO, DEBUG, ERROR, WARN, TRACE.
      consumes:
        - '*/*'
      produces:
        - text/plain
      parameters:
        - name: level
          in: query
          description: NLog Level name.
          required: true
          type: string
          enum:
            - INFO
            - DEBUG
            - ERROR
            - WARN
            - TRACE
      responses:
        '200':
          description: Sucessfully changed log level.
          content:
            text/plain:
              schema:
                type: string
                format: text
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
    delete:
      tags:
        - support
      summary: Deletes all files in the logs folder.
      consumes:
        - '*/*'
      responses:
        204:
          description: Sucessfully deleted all files on the logs folder.
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /v2/tags:
    parameters:
      - name: historianName
        in: query
        description: The name of the historian to list tags of.
        required: true
        type: string
    get:
      tags:
        - tags
      summary: Returns all tags for specified historian.
      consumes:
        - '*/*'
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/TagDetails'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /v2/tags/rawvalues:
    get:
      tags:
        - tags
      summary: Returns tag raw values for specified period.
      consumes:
        - '*/*'
      parameters:
        - name: historianName
          in: query
          description: The name of the historian of the tag to fetch values.
          required: true
          type: string
        - name: tagName
          in: query
          description: The name of the tag to search in.
          required: true
          type: string
        - name: startDate
          in: query
          description: "The start date of the period to search. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: endDate
          in: query
          description: "The end date of the period to search. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/TimeSeriesEntry'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /v2/tags/plotvalues:
    get:
      tags:
        - tags
      summary: Returns tag values for specified period for plotting purposes.
      consumes:
        - '*/*'
      parameters:
        - name: historianName
          in: query
          description: The name of the historian of the tag to fetch values.
          required: true
          type: string
        - name: tagName
          in: query
          description: The name of the tag to search in.
          required: true
          type: string
        - name: tagType
          in: query
          description: The type of tag.
          required: true
          type: string
          enum:
            - ANALOG
            - DIGITAL
            - DISCRETE
            - STRING
        - name: interpolationType
          in: query
          description: The interpolation type of the tag.
          required: true
          type: string
          enum:
            - LINEAR
            - STEPPED
            - DEFAULT
        - name: startDate
          in: query
          description: "The start date of the period to search. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: endDate
          in: query
          description: "The end date of the period to search. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: numberOfIntervals
          in: query
          description: The number of intervals to return data for, this determines the resolution of the data.
          required: true
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/TimeSeriesEntry'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /v2/tags/indexvalues:
    get:
      tags:
        - tags
      summary: Returns tag values for specified period for indexing purposes.
      consumes:
        - '*/*'
      parameters:
        - name: historianName
          in: query
          description: The name of the historian of the tag to fetch values.
          required: true
          type: string
        - name: tagName
          in: query
          description: The name of the tag to search in.
          required: true
          type: string
        - name: tagType
          in: query
          description: The type of tag.
          required: true
          type: string
          enum:
            - ANALOG
            - DIGITAL
            - DISCRETE
            - STRING
        - name: interpolationType
          in: query
          description: The interpolation type of the tag.
          required: true
          type: string
          enum:
            - LINEAR
            - STEPPED
            - DEFAULT
        - name: startDate
          in: query
          description: "The start date of the period to search. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: endDate
          in: query
          description: "The end date of the period to search. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: numberOfIntervals
          in: query
          description: The number of intervals to return data for, this determines the resolution of the data.
          required: true
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/TimeSeriesEntry'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /v2/tags/digitalstates:
    get:
      tags:
        - tags
      summary: List all digital states of a tag.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: historianName
          in: query
          description: The historian name to which the tag belongs to.
          required: true
          type: string
        - name: tagName
          in: query
          description: The tag name.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/State'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /v2/tags/lastvalues:
    post:
      tags:
        - tags
      summary: Returns the last values of multiple tags for the last specified seconds.
      consumes:
        - 'application/json'
      produces:
        - 'application/json'
      parameters:
        - name: historianName
          in: query
          description: The historian name to which the tag belongs to.
          required: true
          type: string
        - name: tagRequest
          in: body
          description: The tags to fetch the last values.
          required: true
          schema:
            type: object
            $ref: '#/definitions/TagLastValuesRequest'
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/Tag'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /af:
    get:
      tags:
        - af
      summary: Returns the root assets with their details. WARNING - this endpoint is deprecated. Please use /assets.
      deprecated: true
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the AF database to connect to.
          required: false
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/AFAssetNode'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /af/{id}:
    get:
      tags:
        - af
      summary: Returns details for the specified asset. WARNING - this endpoint is deprecated. Please use /assets.
      deprecated: true
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: id
          in: path
          description: The id of the asset.
          required: true
          type: string
        - name: databaseName
          in: query
          description: The name of the AF database to connect to.
          required: false
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/AFAssetNode'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /af/{nodeId}/attribute/{attributeId}:
    get:
      tags:
        - af
      summary: Returns details for the attribute of a specified asset. WARNING - this endpoint is deprecated. Please use /assets.
      deprecated: true
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: nodeId
          in: path
          description: The id of the asset.
          required: true
          type: string
        - name: attributeId
          in: path
          description: The id of the attribute.
          required: true
          type: string
        - name: databaseName
          in: query
          description: The name of the AF database to connect to.
          required: false
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/AFAssetAttribute'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /ef:
    get:
      tags:
        - ef
      summary: Returns a list of event frames found in the first configured asset framework. WARNING - this endpoint is deprecated. Please use /context.
      deprecated: true
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: startDate
          in: query
          description: The start date of the query period, defaults to one day ago.
          required: false
          type: string
          format: date-time
        - name: endDate
          in: query
          description: The end date of the query period, defaults to now.
          required: false
          type: string
          format: date-time
        - name: databaseName
          in: query
          description: The name of the AF database to connect to.
          required: false
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/EventFrame'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /assets:
    get:
      tags:
        - assets
      summary: Returns details for the root assets in the hierarchy.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Assets database to connect to.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/AssetNode'
        '400':
          description: Bad Request. When validation errors occur.
        '404':
          description: Not Found. When the specified database does not exist.
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
    post:
      tags:
        - assets
      summary: Returns details for the assets with the specified ids.
      consumes:
        - 'application/json'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Assets database to connect to.
          required: true
          type: string
        - name: ids
          in: body
          description: The ids of the assets.
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Returns an array with the details of the specified assets.
          schema:
            type: array
            items:
              $ref: '#/definitions/AssetNode'
        '400':
          description: Bad Request. When validation errors occur.
        '404':
          description: Not Found. When the specified database does not exist.
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
  /assets/{id}:
    get:
      tags:
        - assets
      summary: Returns details for the specified asset.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: id
          in: path
          description: The id of the asset.
          required: true
          type: string
        - name: databaseName
          in: query
          description: The name of the Assets database to connect to.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/AssetNode'
        '400':
          description: Bad Request. When validation errors occur.
        '404':
          description: Not Found. When the specified database or asset does not exist.
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
  /context/:
    get:
      tags:
        - context
      summary: Returns a list of the available context items in the source system.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
        - name: startDate
          in: query
          description: "The start date of the query period. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: endDate
          in: query
          description: "The end date of the query period. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: true
          type: string
          format: date-time
        - name: createdAfter
          in: query
          description: "Getting only items created after this date. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: false
          type: string
          format: date-time
        - name: page
          in: query
          description: The page number.
          required: false
          type: number
          format: int32
        - name: size
          in: query
          description: The size of the page.
          required: false
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/ContextItemPagedResponse'
        '400':
          description: Bad Request. When validation errors occur.
          schema:
            $ref: '#/definitions/ContextException'
        '404':
          description: Not Found. When the specified af database name or context items cannot be found.
          schema:
            $ref: '#/definitions/ContextException'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
          schema:
            $ref: '#/definitions/ContextException'
    post:
      tags:
        - context
      summary: Returns a list of the available context items by identifiers.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
        - name: ids
          in: body
          description: The ids of the context items.
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/ContextItemListResponse'
        '400':
          description: Bad Request. When validation errors occur.
          schema:
            $ref: '#/definitions/ContextException'
        '404':
          description: Not Found. When the specified af database name or context items cannot be found.
          schema:
            $ref: '#/definitions/ContextException'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
          schema:
            $ref: '#/definitions/ContextException'
  /context/{id}:
    get:
      tags:
        - context
      summary: Returns a specific context item by identifier.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: id
          in: path
          description: The ID of the connection to retrieve.
          required: true
          type: string
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/ContextItem'
        '400':
          description: Bad Request. When validation errors occur.
          schema:
            $ref: '#/definitions/ContextException'
        '404':
          description: Not Found. When the specified af database name or context items cannot be found.
          schema:
            $ref: '#/definitions/ContextException'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
          schema:
            $ref: '#/definitions/ContextException'
  /context/changes:
    get:
      tags:
        - context
      summary: Returns a list of changed context items in the source system as well as the type of change that happened.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
        - name: since
          in: query
          description: "The start date of the query period. Internet DateTime format, see RFC3339 e.g.: '2012-01-01T00:00:00Z'."
          required: false
          type: string
          format: date-time
        - name: page
          in: query
          description: The page to get. This is a cookie that is returned by a previous call to the /changes endpoint.
          required: false
          type: string
        - name: size
          in: query
          description: The maximum number of returned items.
          required: false
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/ContextItemChangeStreamedResponse'
        '400':
          description: Bad Request. When validation errors occur.
          schema:
            $ref: '#/definitions/ContextException'
        '404':
          description: Not Found. When the specified af database name cannot be found.
          schema:
            $ref: '#/definitions/ContextException'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
        '502':
          description: Bad Gateway. The connector received an invalid response from the historian.
          schema:
            $ref: '#/definitions/ContextException'
  /context/type:
    get:
      tags:
        - context
      summary: Returns a list of the available types in the source system.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
        - name: page
          in: query
          description: The page number.
          required: false
          type: number
          format: int32
        - name: size
          in: query
          description: The size of the page.
          required: false
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/TypePagedResponse'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /context/workflow:
    get:
      tags:
        - context
      summary: Returns a list of the available workflows in the source system.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
        - name: page
          in: query
          description: The page number.
          required: false
          type: number
          format: int32
        - name: size
          in: query
          description: The size of the page.
          required: false
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/WorkflowPagedResponse'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /context/field:
    get:
      tags:
        - context
      summary: Returns a list of the available fields in the source system.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      parameters:
        - name: databaseName
          in: query
          description: The name of the Context database to connect to.
          required: true
          type: string
        - name: page
          in: query
          description: The page number.
          required: false
          type: number
          format: int32
        - name: size
          in: query
          description: The size of the page.
          required: false
          type: number
          format: int32
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/FieldPagedResponse'
        '500':
          description: Server Error
          schema:
            $ref: '#/definitions/SystemException'
  /provider:
    get:
      tags:
        - provider
      summary: Returns provider capabilities.
      consumes:
        - '*/*'
      produces:
        - 'application/json'
      responses:
        '200':
          description: OK
          schema:
            type: object
            $ref: '#/definitions/ProviderCapabilities'
definitions:
  TagDetails:
    description: All details for a tag.
    properties:
      Name:
        type: string
      Description:
        type: string
      Historian:
        type: number
        format: int32
      Units:
        type: string
      Type:
        type: string
        enum:
          - ANALOG
          - DIGITAL
          - DISCRETE
          - STRING
    required:
      - Name
      - Description
      - Historian
      - Units
      - Type
  HistorianConnection:
    description: All the configuration parameters for a historian connection defined for the TrendMiner central connector API.
    properties:
      DbId:
        type: number
        format: int32
      Name:
        type: string
      Prefix:
        type: string
        pattern: "[A-Za-z0-9]{1,5}"
      Provider:
        type: string
      DataSource:
        type: string
      UserId:
        type: string
      Password:
        type: string
      Version:
        type: string
        default: "other"
      TagFilter:
        type: string
        format: regex
      OnlySupportsRawValues:
        type: boolean
      Properties:
        type: array
        items:
          $ref: '#/definitions/HistorianDatabaseProperty'
    required:
      - Name
      - Provider
      - DataSource
      - Prefix
  HistorianDatabaseProperty:
    description: The configuration properties.
    properties:
      key:
        type: string
      value:
        type: string
    required:
      - key
  TimeSeriesEntry:
    description: A single timeseries entry.
    properties:
      Ts:
        type: string
        format: date-time
      Value:
        type: string
    required:
      - Ts
      - Value
  State:
    description: A State
    properties:
      Code:
        type: number
      Offset:
        type: number
      Name:
        type: string
    required:
      - Code
      - Offset
      - Name
  Tag:
    description: A response object for a single tag values.
    properties:
      Name:
        type: string
      Historian:
        type: string
      Entries:
        type: array
        items:
          $ref: '#/definitions/TimeSeriesEntry'
    required:
      - Name
      - Historian
      - Entries
  TagLastValuesRequest:
    description: A request object to retrieve values from tags for the specified last seconds.
    properties:
      LastSeconds:
        type: number
        format: int32
      TagNames:
        type: array
        items:
          type: string
    required:
      - LastSeconds
      - TagNames
  SystemException:
    description: A generic exception object used when an unspecified server error occurs.
    properties:
      Message:
        type: string
      ExceptionMessage:
        type: string
      ExceptionType:
        type: string
      StackTrace:
        type: string
  ContextException:
    description: A generic exception object used when a context error occurs.
    properties:
      message:
        type: string
      errorCode:
        type: string
      timestamp:
        type: string
      httpStatus:
        type: number
        format: int32
      details:
        type: array
        items:
          type: string
          example:
            fieldName: "errorMessage"
  AFAssetNodeReference:
    description: An object that represents an asset child.
    properties:
      Id:
        type: string
      Name:
        type: string
    required:
      - Id
      - Name
  AFAssetNodeAttribute:
    description: An object that represents an asset attribute.
    properties:
      Description:
        type: string
      Template:
        type: object
        $ref: '#/definitions/AFAssetNodeReference'
      PIPoint:
        type: string
      Id:
        type: string
      Name:
        type: string
    required:
      - PIPoint
      - Id
      - Name
  AFAssetNode:
    description: An object that represents an asset node details.
    properties:
      Id:
        type: string
      Name:
        type: string
      Description:
        type: string
      Children:
        type: array
        items:
          $ref: '#/definitions/AFAssetNodeReference'
      Template:
        type: object
        $ref: '#/definitions/AFAssetNodeReference'
      Attributes:
        type: array
        items:
          $ref: '#/definitions/AFAssetNodeAttribute'
    required:
      - Id
      - Name
  AFAssetAttribute:
    description: An object that represents an asset attribute.
    properties:
      Id:
        type: string
      Name:
        type: string
      Description:
        type: string
      Template:
        type: object
        $ref: '#/definitions/AFAssetNodeReference'
      Attributes:
        type: array
        items:
          $ref: '#/definitions/AFAssetNodeAttribute'
    required:
      - Id
      - Name
  EventFrame:
    description: An event frame.
    properties:
      Id:
        type: string
      Name:
        type: string
      Template:
        type: string
      ElementId:
        type: string
      StartDate:
        type: string
        format: date-time
      EndDate:
        type: string
        format: date-time
  AssetNode:
    description: An object that represents an asset node details.
    properties:
      identifier:
        type: string
      parentIdentifier:
        type: string
      type:
        type: string
        enum:
          - ASSET
          - ATTRIBUTE
      name:
        type: string
      description:
        type: string
      children:
        type: array
        items:
          $ref: '#/definitions/AssetNodeReference'
      template:
        type: object
        $ref: '#/definitions/TemplateReference'
      data:
        type: string
      dataType:
        type: string
        enum:
          - DATAREFERENCE
          - NUMERIC
          - STRING
  AssetNodeReference:
    description: An object that represents a reference to an asset.
    properties:
      identifier:
        type: string
      type:
        type: string
        enum:
          - ASSET
          - ATTRIBUTE
  TemplateReference:
    description: An object that represents a reference to a template.
    properties:
      identifier:
        type: string
      name:
        type: string
  ContextItem:
    description: An object that represents a context item details.
    properties:
      identifier:
        type: string
      name:
        type: string
      description:
        type: string
      events:
        type: array
        items:
          $ref: '#/definitions/Event'
      components:
        type: array
        items:
          $ref: '#/definitions/Component'
      type:
        type: object
        $ref: '#/definitions/ContextDataType'
      fields:
        type: array
        items:
          type: object
          additionalProperties:
            type: string
          example:
            fieldId: "fieldValue"
      keywords:
        type: array
        items:
          type: string
      lastModifiedDate:
        type: string
  ContextItemChange:
    description: An object that represents a context item change details.
    properties:
      changedItem:
        type: object
        $ref: '#/definitions/ContextItem'
      changeType:
        type: string
        enum:
          - ADD
          - MODIFY
          - DELETE
  Event:
    description: An object that represents an event.
    properties:
      identifier:
        type: string
      occured:
        type: string
        format: date-time
      state:
        type: string
  Component:
    description: An object that represents a component.
    properties:
      identifier:
        type: string
      type:
        type: string
        enum:
          - ASSET
          - ATTRIBUTE
          - TAG
  ContextDataType:
    description: An object that represents an embedded context data type.
    properties:
      identifier:
        type: string
      name:
        type: string
      workflowIdentifier:
        type: string
  ReferenceById:
    description: An object that represents a reference by id.
    properties:
      identifier:
        type: string
  Page:
    description: An object that represents a page information.
    properties:
      size:
        type: number
        format: int32
      totalElements:
        type: number
        format: int32
      totalPages:
        type: number
        format: int32
      number:
        type: number
        format: int32
  ContextItemPagedResponse:
    description: An object that represents a list of context items along with page information.
    properties:
      content:
        type: array
        items:
          $ref: '#/definitions/ContextItem'
      page:
        type: object
        $ref: '#/definitions/Page'
  ContextItemListResponse:
    description: An object that represents a list of context items.
    properties:
      type: array
      items:
        $ref: '#/definitions/ContextItem'
  ContextItemChangeStreamedResponse:
    description: An object that represents a list of context item changes along with next page cookie.
    properties:
      content:
        type: array
        items:
          $ref: '#/definitions/ContextItemChange'
      nextPage:
        type: string
  StringStreamedResponse:
    description: An object that represents a list of strings along with next page cookie.
    properties:
      content:
        type: array
        items:
          type: string
      nextPage:
        type: string
  TypePagedResponse:
    description: An object that represents a list of context data types along with page information.
    properties:
      content:
        type: array
        items:
          $ref: '#/definitions/Type'
      page:
        type: object
        $ref: '#/definitions/Page'
  WorkflowPagedResponse:
    description: An object that represents a list of workflows along with page information.
    properties:
      content:
        type: array
        items:
          $ref: '#/definitions/Workflow'
      page:
        type: object
        $ref: '#/definitions/Page'
  FieldPagedResponse:
    description: An object that represents a list of fields along with page information.
    properties:
      content:
        type: array
        items:
          $ref: '#/definitions/Field'
      page:
        type: object
        $ref: '#/definitions/Page'
  Workflow:
    description: An object that represents a workflow.
    properties:
      identifier:
        type: string
      name:
        type: string
      startState:
        type: string
      endState:
        type: string
      states:
        type: array
        items:
          type: string
  Field:
    description: An object that represents a field.
    properties:
      identifier:
        type: string
      name:
        type: string
      type:
        type: string
        enum:
          - STRING
          - ENUMERATION
          - NUMERIC
      placeholder:
        type: string
      options:
        type: array
        items:
          type: string
  Type:
    description: An object that represents a context data type.
    properties:
      identifier:
        type: string
      name:
        type: string
      workflow:
        type: object
        $ref: '#/definitions/ReferenceById'
      color:
        type: string
      fields:
        type: array
        items:
          $ref: '#/definitions/ReferenceById'
  ProviderCapabilities:
    description: An object that represents a provider capabilities.
    properties:
      provider:
        type: string
      experimental:
        type: boolean
      capabilities:
        type: array
        items:
          type: string
      properties:
        type: array
        items:
          $ref: '#/definitions/ProviderCapabilitiesProperty'
  ProviderCapabilitiesProperty:
    description: An object that represents a provider capabilities propery.
    properties:
      name:
        type: string
      type:
        type: string
      capabilities:
        type: array
        items:
          type: string
      required:
        type: boolean
