Get Operating Information in Near Real-Time with API Plus
Enable near real-time access to environmental and operating information using API Plus.
AWS IoT Core
Step 1: Download and Register Equinix Certificate
To authorize Equinix API Plus service to send events to an AWS IoT Core topic, you must download Equinix Certificate and register it in IoT Core console. For details, see Download and Register Equinix Certificate.
Step 2: Authenticate
Submit your Client ID and Client Secret to obtain authorization token.
curl -X
POST 'https://api.equinix.com/oauth2/v1/token'
-H 'content-type: application/json'
-d '{
"grant_type": "client_credentials",
"client_id": "ABCDE12345",
"client_secret": "shhDontTell"
}'
Refer to Generating Client ID and Client Secret under Getting Access Token section for instructions on how to create client ID and client secret.
Refer to Requesting Access and Refresh tokens for more information on how to authorize your API calls.
If you are unaware of your user credentials for Equinix Smart View, contact your local Equinix Service Desk.
Step 3: Create Subscription
Use the Create Subscription API request to define a streaming subscription instance.
Sample curl request - create Amazon IoT Core communication channel for temperature and humidity readings
curl -X
POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'authorization: Bearer asxQMSbBwcNzI2fCCNwSwTh3phV2'
-d '{
"messageType": {
"asset": [],
"environmental": [
{
"accountNumber": "116710",
"ibx": [
"LD9"
],
"level": [
"CAGE"
]
}
],
"power": [],
"meteredPower": [],
"systemAlert": [],
"customAlert": []
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://z3z1k7yl79260o-ats.iot.eu-west-2.amazonaws.com"
}
}
}'
Parameter | Descriptions |
---|---|
messageType object REQUIRED | Message type for the subscription that defines the IBX details from which to expect events |
asset array[object] OPTIONAL | List of asset message type to subscribe. |
environmental array[object] OPTIONAL | List of environmental type events to subscribe. |
accountNumber string REQUIRED | Customer account number. Example: 135888 |
ibx string REQUIRED | IBX data center identifier. Example: DE2 |
level string OPTIONAL | If not provided in the request, subscription includes all environmental messages at the IBX, zone, and cage levels. Applicable values:
|
power array[object] OPTIONAL | List of power message type to subscribe. |
meteredPower array[object] OPTIONAL | List of metered power message type to subscribe. |
systemAlert array[object] OPTIONAL | List of system alert type events to subscribe. |
customAlert array[object] OPTIONAL | List of custom alert type events to subscribe. |
channel object OPTIONAL | Defines the event messages destination. |
channelType string REQUIRED | Type of communication channel used for the subscription. Applicable values:
|
awsIotCoreChannelConfiguration object OPTIONAL | AWS IoT Core channel configuration. |
url string REQUIRED | AWS IoT Core device endpoint URL. Example: https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com |
Step 4: Consume Real-Time Feed
Subscribe to the AWS IoT Core topic and consume messages. For details, refer to AWS IoT Core documentation.
You can also use Get Subscription Data API request to retrieve your streaming channel messages.
REST
Step 1: Authenticate
Submit your Client ID and Client Secret to obtain authorization token.
curl -X
POST 'https://api.equinix.com/oauth2/v1/token'
-H 'content-type: application/json'
-d '{
"grant_type": "client_credentials",
"client_id": "ABCDE12345",
"client_secret": "shhDontTell"
}'
Refer to Generating Client ID and Client Secret under Getting Access Token section for instructions on how to create client ID and client secret.
Refer to Requesting Access and Refresh tokens for more information on how to authorize your API calls.
If you are unaware of your user credentials for Equinix Smart View, contact your local Equinix Service Desk.
Step 2: Create Subscription
Use the Create Subscription API request to define a streaming subscription instance.
Sample curl request - create REST communication channel for power consumption readings
curl -X
POST 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'authorization: Bearer asxQMSbBwcNzI2fCCNwSwTh3phV2'
-d '{
"messageType": {
"asset": [],
"environmental": [],
"power": [
{
"accountNumber": "1",
"ibx": [
"LD9"
]
}
],
"meteredPower": [],
"systemAlert": [],
"customAlert": []
},
"channel": {
"channelType": "REST",
"restChannelConfiguration": {
}
}
}'
Parameter | Descriptions |
---|---|
messageType object REQUIRED | Message type for the subscription that defines the IBX details from which to expect events |
asset array[object] OPTIONAL | List of asset message type to subscribe. |
environmental array[object] OPTIONAL | List of environmental type events to subscribe. |
power array[object] OPTIONAL | List of power message type to subscribe. |
accountNumber string REQUIRED | Customer account number. Example: 135888 |
ibx string REQUIRED | IBX data center identifier. Example: DE2 |
meteredPower array[object] OPTIONAL | List of metered power message type to subscribe. |
systemAlert array[object] OPTIONAL | List of system alert type events to subscribe. |
customAlert array[object] OPTIONAL | List of custom alert type events to subscribe. |
channel object OPTIONAL | Defines the event messages destination. |
channelType string REQUIRED | Type of communication channel used for the subscription. Applicable values:
|
restChannelConfiguration object OPTIONAL | REST channel configuration. |
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 identifier required to consume the real-time feed.
Step 3: Consume Events
Use the Get Subscription Data API request to retrieve your REST streaming channel messages.
Sample curl request
curl -X
GET 'https://api.equinix.com/smartview/v2/streaming/subscriptionData/0f6bdb36-e130-4924-b038-ee1785fad999'
If you don't know the subscription instance identifier, use the Get All Subscriptions to retrieve your subscriptions and determine the subscription instance identifier.
Sample response
{
"alarmMessageData": [],
"alertMessageData": [],
"environmentMessageData": [],
"meteredPowerMessageData": [],
"powerMessageData": [
{
"type": "power",
"data": {
"streamId": "20409808",
"ibx": "LD9",
"asset": {
"id": "20409808",
"type": "CIRCUIT"
},
"cage": "LD9:0G:0Z10BB",
"cabinet": "LD9:0G:0Z10BB:0109",
"accountNumber": "116710",
"description": "32-amp 230v Single Phase Primary AC Power",
"oid": "1.3.6.1.2.1.299.36.10.4442",
"realPower": {
"value": "0.000",
"unit": "kW"
},
"apparentPower": {
"value": "0.000",
"unit": "kVA"
},
"current": {
"value": "0.000",
"unit": "A"
},
"powerFactor": {
"value": "0.000",
"unit": "pf"
},
"soldCurrent": {
"value": "32.000",
"unit": "A"
},
"soldPower": {
"value": "7.360",
"unit": "kVA"
},
"powerConsumptionToContractual": {
"value": "0.000",
"unit": "PERCENT"
},
"peakLastSevenDays": {
"value": "0.000",
"unit": "kVA"
},
"peakLastSevenDaysRatio": {
"value": "0.000",
"unit": "PERCENT"
},
"peakLastSevenDaysContractualPower": {
"value": "7.360",
"unit": "kVA"
},
"peakLastSevenDaysTime": "2023-12-06T05:45:00",
"lastUpdated": "2023-12-07T15:49:00",
"readingTime": "2023-12-07T15:45:00"
}
},
{
"type": "power",
"data": {
"streamId": "20409809",
"ibx": "LD9",
"asset": {
"id": "20409809",
"type": "CIRCUIT"
},
"cage": "LD9:0G:0Z10BB",
"cabinet": "LD9:0G:0Z10BB:0109",
"accountNumber": "116710",
"description": "32-amp 230v Single Phase Redundant AC Power",
"oid": "1.3.6.1.2.1.299.36.10.4443",
"realPower": {
"value": "0.000",
"unit": "kW"
},
"apparentPower": {
"value": "0.000",
"unit": "kVA"
},
"current": {
"value": "0.000",
"unit": "A"
},
"powerFactor": {
"value": "0.000",
"unit": "pf"
},
"soldCurrent": {
"value": "32.000",
"unit": "A"
},
"soldPower": {
"value": "7.360",
"unit": "kVA"
},
"powerConsumptionToContractual": {
"value": "0.000",
"unit": "PERCENT"
},
"peakLastSevenDays": {
"value": "0.000",
"unit": "kVA"
},
"peakLastSevenDaysRatio": {
"value": "-1.000",
"unit": "PERCENT"
},
"peakLastSevenDaysContractualPower": {
"value": "0.000",
"unit": "kVA"
},
"peakLastSevenDaysTime": "2023-12-06T22:15:00",
"lastUpdated": "2023-12-07T15:49:00",
"readingTime": "2023-12-07T15:45:00"
}
}
],
"tagPointMessageData": [],
"pagination": {
"offset": 0,
"limit": 250,
"total": 46,
"next": null,
"previous": "?offset=0&limit=250"
}
}