Service Bus API

Service Bus API Reference

Service Bus API Examples

Create the bearer_token and store in a file in a secure local directory with 0600 permissions.

Service Bus Sources Creation

The svcbussources endpoint allows subscribing to an Azure Service Bus Queue and receiving events when a device changes state.

The state changes are then recorded in the RKVST system.

Warning: The connection string used is for the servicebus and not for the servicebus queue.

Define the svcbussource parameters and store in /path/to/jsonfile:

{
    "display_name": "RKVST",
    "connection_string": "Endpoint=sb://rkvst-dev.servicebus.windows.net/;SharedAccessKeyName=rkvst-listener;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "queue_name": "rkvst-listener"
}

Post to the endpoint:

curl -v -X POST \
    -H "@$BEARER_TOKEN_FILE" \
    -H "Content-type: application/json" \
    -d "@/path/to/jsonfile" \
    https://app.rkvst.io/archivist/v1/svcbussources

The response is:

{
    "identity": "svcbussources/08838336-c357-460d-902a-3aba9528dd22",
    "display_name": "RKVST",
    "queue_name": "rkvst-listener"
}

Service Bus Sources Deletion

The svcbussources endpoint allows subscribing to the Azure Service Bus Queue and receiving events when a device changes state.

The state changes are recorded in the RKVST system.

Delete the endpoint:

curl -v -X DELETE \
    -H "@$BEARER_TOKEN_FILE" \
    https://app.rkvst.io/archivist/v1/svcbussources/08838336-c357-460d-902a-3aba9528dd22

The response is:

{
    "identity": "svcbussources/08838336-c357-460d-902a-3aba9528dd22",
    "display_name": "RKVST",

}

Service Bus OpenAPI Docs

API to manage service bus sources.

get  /archivist/v1/svcbussources

List all SvcBusSources

Description: List all SvcBusSources, the results will not contain secrets

[
  {
    "display_name": "Jitsuin",
    "identity": "svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359"
  },
  {
    "display_name": "Archivist",
    "identity": "svcbussources/31d08053-980d-571b-ae67-5c02bcc21350"
  }
]
Response Parameter Type Description
sources array Service bus
Responses Description
200A successful response.
401Returned when the user is not authenticated to the system.
403Returned when the user is not authorized to list SvcBusSources.
defaultAn unexpected error response.

post  /archivist/v1/svcbussources

Create new SvcBusSource

Description: Create a connection to service bus endpoint - archivist will store credentials provided and sync events

{
  "connection_string": "Endpoint=sb://svcbussource-ns-jitsuin-te-1521552-cbcab4b965.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=;EntityPath=jitsuin-test-iot-hub",
  "display_name": "Jitsuin",
  "queue_name": "iothub"
}
Parameter Type Description
connection_string string Connection String to Service bus endpoint
display_name string The displayable name of the subscription.
queue_name string Service bus queue name

{
  "display_name": "Jitsuin",
  "identity": "svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359"
}
Response Parameter Type Description
display_name string The displayable name of the subscription.
identity string Relative resource name for the subscription. e.g. svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359
queue_name string Service bus queue name
status string Service bus subscription status
Responses Description
200A successful response.
401Returned when the user is not authenticated to the system.
403Returned when the user is not authorized to create SvcBusSource.
429Returned when the number of concurrent subscriptions exceeds capacity (default=2).
defaultAn unexpected error response.

delete  /archivist/v1/svcbussources/{uuid}

Delete SvcBusSource

Description: Delete SvcBusSource with provided connection_identity

{
  "display_name": "Jitsuin",
  "identity": "svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359"
}
Response Parameter Type Description
display_name string The displayable name of the subscription.
identity string Relative resource name for the subscription. e.g. svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359
queue_name string Service bus queue name
status string Service bus subscription status
Responses Description
200A successful response.
401Returned when the user is not authenticated to the system.
403Returned when the user is not authorized to delete SvcBusSources.
defaultAn unexpected error response.

get  /archivist/v1/svcbussources/{uuid}

Get SvcBusSource with provided identity

Description: Get SvcBusSource with provided identity, response will not include the secret

{
  "display_name": "Jitsuin",
  "identity": "svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359"
}
Response Parameter Type Description
display_name string The displayable name of the subscription.
identity string Relative resource name for the subscription. e.g. svcbussources/20c97f42-87fc-482c-9d58-4d11abd33359
queue_name string Service bus queue name
status string Service bus subscription status
Responses Description
200A successful response.
401Returned when the user is not authenticated to the system.
403Returned when the user is not authorized to get SvcBusSource.
defaultAn unexpected error response.

Edit this page on GitHub