API

Bork has two main endpoints which are used for communication with the Orion Context Broker.

POST /agent

Endpoint that handles incoming Agent entities of the corresponding subscription made by Bork.

For instance:

{
    "subscriptionId": "57458eb60962ef754e7c0998",
    "data": [
        {
            "id": "IML:SAN-123a",
            "type": "Agent",
            "category": "SAN",
            "capabilities": ["pressure" , "temperature"],
            "refHeartbeat": {
                "id": "IML:SAN-123a-Heart",
                "type": "Heartbeat",
                "servicePath": "/iml",
                "service": "t_01"
            },
            "monitorProperty": {
                "isMonitoringCapable": true,
                "wantsToBeAvailable": true,
                "minimalNotifyInterval": 1.0,
                "maximalNotifyInterval": 60.5,
                "supportsNotifyIntervalChange": true,
                "detectionTimeUpperBound": 29.98,
                "mistakeRecurrenceTimeLowerBound": 2592000.0,
                "mistakeDurationUpperBound": 60.0,
                "currentNotifyInterval": 9.76
            },
            "dateModified": "2016-11-30T07:00:00.00Z",
            "dateCreated": "2016-11-30T07:00:00.00Z"
        },
        {...}
    ]
}

Response codes:

  • 200 - OK
  • 400 - Parsing failed, refHeartbeat is a required property, Additional properties are not allowed, The entity has no type attribute, detectionTimeUpperBound is not of type number, or similar
  • 500 or 504 - Timed out

Note: Responses with status code 400 have a JSON-Body with an Array that represents the success of processing the respective entities in the order in which they appear in the request. For example like ["Parsing failed", "processed successfully"].

POST /heartbeat

Endpoint that handles incoming Heartbeat entities of the corresponding subscriptions made by Bork.

For instance:

{
    "subscriptionId": "57458eb60962ef754e7c0999",
    "data": [
        {
            "id": "IML:SAN-123a-Heart",
            "type": "Heartbeat",
            "refAgent": {
                "id": "IML:SAN-123a",
                "type": "Agent",
                "servicePath": "/iml",
                "service": "t_01"
            },
            "dateSent": "2016-11-30T07:00:00.00Z",
            "sequenceNumber": 42,
            "dateModified": "2016-11-30T07:00:00.00Z",
            "dateCreated": "2016-11-30T07:00:00.00Z"
        }
    ]
}

Response codes:

  • 200 - OK
  • 400 - Parsing failed, refAgent is a required property, Additional properties are not allowed, The entity has no type attribute, sequenceNumber is not of type number, or similar
  • 500 or 504 - Timed out