asyncapi: 2.0.0
info:
  version: 3.0.1
  x-visibility: external
  title: IoT Time Series Data Arrival Notification Async API  
  description: |
    Notification for IoT Time Series Data Arrival Async API provides messaging operations for receiving notifications of the time series data arrival.

    User will receive notifications of Time Series data arrival after subscribing to the given channel. These notifications will be sent to the subscribed tenant at most once every minute.
    
    The notication message will contain information like asset, aspect and timestamp. The tenant and aspecttype will be provided as header for the message. Sample message payload can be found in the examples section below.
    
    **Limitations:**
    * The size of network message is limited (256KB). In case the message is larger than 256KB it will splitted and will be sent with the same header.
    
    Please see the 'Time Series Data Arrival Notification' section in the MindSphere Developer Documentation page to get more details.
    
defaultContentType: application/json

channels:
  mdsp.core.timeseries.v1.pubsub.data.ingest:
    description: The topic on which Time Series data arrival notification will be received.
    subscribe:
      summary: Subscribe to this channel to receive Time Series data arrival notification message.
      message:
        $ref: '#/components/messages/notificationData'

components:
  messages:
    notificationData:
      title: Time Series data arrival notification
      summary: Inform about arrival of Time Series data.
      contentType: application/json
      payload:
        $ref: "#/components/schemas/notificationPayload"

  schemas:
    notificationPayload:
      type: object
      properties:
        header:
          type: object
          description: The message payload will be grouped based upon the tenant and aspect type as per the asset model.
          properties:
            topic:
              type: string
              description: Topic name to which the tenant is subscribed
              example: mdsp.core.timeseries.v1.pubsub.data.ingest
            aspectType:
              type: string
              description: An Aspect Type is a template for creating multiple aspects with the same variables
              example: siemens.MechanicalMetrics

        ingests:
          type: array
          minimum: 1
          description: Combination of asset & aspect which is ingesting data at a particular device timestamp in configured time window (default 1 minute).
          items:
              type: object
              properties:
                assetId:
                  type: string
                  description: Unique identifier of the asset (entity) i.e. a machine, or any object, from which data is collected
                  example: 93019b1bd7043883c8cc82a4160a548a
                aspectId:
                  type: string
                  description: Id of the aspect (property set) which is a group related data points based on their logical association.
                  example: mR42o1hW85Wt8DBc0x3idw0xBbn6FBcb
                timestamp:
                  type: string
                  description: Timestamp of the latest data point in last 1 minute.
                  example: 2017-11-02T00:00:00.001Z
        
