Create a Subscription
Once you have set up and configured your data collector, create a subscription to stream your colocation data to it.
You can use only one communication channel type in your organization. For example, if you create a subscription with the AWS IoT Core channel, you won't be able to create another subscription using a different channel type.
Only one channel is allowed for a single subscription.
Prerequisites
-
Before calling the Subscription Management APIs, refer to Integrating with a Collector to set up and configure the destination for your data.
-
Submit your user credentials, Client ID, and Client Secret for OAuth2 authentication. Refer to API Authentication for more information on how to authenticate your requests to the Equinix API.
AWS IoT Core
To create a subscription to send data to Amazon IoT Core, send a POST
request to the /smartview/v2/streaming/subscriptions
endpoint. In the body of the request, specify the channelType
as AWS_IOT_CORE
and its URL in awsIotCoreChannelConfiguration
. Specify which data it should receive in the messageType
object.
Sample cURL Request:
curl -X
POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
-d '{
"messageType": {
"asset": [],
"environmental": [
{
"accountNumber": "116710",
"ibx": [
"LD9"
],
"level": [
"CAGE"
]
}
],
"power": [],
"meteredPower": [],
"systemAlert": [],
"customAlert": []
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://<awsIotCoreuri>.amazonaws.com"
}
}
}'
For a complete listing of available options for messageType
, see the API Reference.
Azure Event Hub
To create an Azure channel subscription, please contact support.
Webhook
To create a subscription to send data to a webhook, send a POST
request to the /smartview/v2/streaming/subscriptions
endpoint. In the body of the request, specify the channelType
as WEBHOOK
and its configuration in webhookChannelConfiguration
. Specify which data it should receive in the messageType
object.
Sample cURL Request:
curl -X
POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
-d '{
"messageType": {
"asset": [],
"environmental": [
{
"accountNumber": "116710",
"ibx": [
"LD9"
],
"level": [
"CAGE"
]
}
],
"power": [],
"meteredPower": [],
"systemAlert": [],
"customAlert": []
},
"channel": {
"channelType": "WEBHOOK",
"webhookChannelConfiguration": {
"sslCertificate": "ZkFzZLY1IGRpY31kZXI=...",
"url": "https://<webhook-uri>.com",
"numberOfRetries": 1,
"numberOfConcurrentCalls": 20,
"batchSize": 5
},
}
}'
For a list of webhook configuration options and available options for messageType
, see the API Reference.
Equinix Rest API
To create a subscription to make your data available from the Equinix API, send a POST
request to the /smartview/v2/streaming/subscriptions
endpoint. In the body of the request, specify the channelType
as REST
. Specify which data it should receive in the messageType
object.
Sample cURL Request:
curl -X
POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
-d '{
"messageType": {
"asset": [],
"environmental": [
{
"accountNumber": "116710",
"ibx": [
"LD9"
],
"level": [
"CAGE"
]
}
],
"power": [],
"meteredPower": [],
"systemAlert": [],
"customAlert": []
},
channel": {
"channelType": "REST",
"restChannelConfiguration": {
}
}
}'
For a complete listing of available options for messageType
, see the API Reference.
Sample Response:
HTTP/1.1 201 Created
Location: /smartview/v2/streaming/subscriptions/0f6bdb36-e130-4924-b038-ee1785fad999
The Location
header in the response contains the subscription ID required to consume the real-time feed.