Managing Subscriptions
You can manage your subscriptions using the following API endpoints.
Prerequisites
- 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.
Get Your Subscriptions
To return a list of all your streaming subscriptions, send a GET
request to the /smartview/v2/streaming/subscriptions
endpoint.
Sample cURL Request:
curl -X
GET 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'authorization: Bearer <token>'
Sample Response:
[
{
"id": "606349eca6171829c70d8777",
"status": "PENDING",
"messageType": {
"asset": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"assetClassification": [
"MECHANICAL"
],
"assetId": [
"string"
]
}
],
"environmental": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"level": [
"ZONE"
]
}
],
"power": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"meteredPower": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"systemAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"customAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"user": "abc"
}
]
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com"
}
},
"orgId": "123",
"createdBy": "abc",
"createdDateTime": "2019-08-24T14:15:22Z",
"updatedBy": "abc",
"updatedDateTime": "2019-08-24T14:15:22Z"
}
]
Get a Subscriptions Details
To get the details of a specified subscription, send a GET
request to the /smartview/v2/streaming/subscriptions/{id}
endpoint.
Sample cURL Request:
curl -X
GET 'https://api.equinix.com/smartview/v2/streaming/subscriptions/606349eca6171829c70d8777'
-H 'authorization: Bearer <token>'
Sample Response:
{
"id": "606349eca6171829c70d8777",
"status": "ACTIVE",
"messageType": {
"asset": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"assetClassification": [
"MECHANICAL"
],
"assetId": [
"string"
]
}
],
"environmental": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"level": [
"ZONE"
]
}
],
"power": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"meteredPower": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"systemAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"customAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"user": "abc"
}
]
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com"
}
},
"orgId": "123",
"createdBy": "abc",
"createdDateTime": "2019-08-24T14:15:22Z",
"updatedBy": "abc",
"updatedDateTime": "2019-08-24T14:15:22Z"
}
Update a Subscription
To modify a subscription, send a PUT
request to the /smartview/v2/streaming/subscriptions/{id}
endpoint. The new request body replaces current subscription configuration.
Sample cURL Request:
curl -X
PUT 'https://api.equinix.com/smartview/v2/streaming/subscriptions/{id}'
-H 'authorization: Bearer <token>'
-d '{
"messageType": {
"asset": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"assetClassification": [
"MECHANICAL"
],
"assetId": [
"string"
]
}
],
"environmental": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"level": [
"ZONE"
]
}
],
"power": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"meteredPower": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"systemAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"customAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"user": "abc"
}
]
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com"
}
}
}'
Delete a Subscription
To delete a subscription, send a DELETE
request to the /smartview/v2/streaming/subscriptions/{id}
endpoint. Events will no longer be available for the subscription once a delete request is received.
Sample cURL Request:
curl -X
DELETE 'https://api.equinix.com/smartview/v2/streaming/subscriptions/606349eca6171829c70d8777'
-H 'authorization: Bearer <token>'