Announcements

Help us improve the Equinix Community by completing a quick survey

Discussions

Is there a best practice to fetch all CIRCUIT,SENSOR data?

Is there a best practice to fetch all CIRCUIT,SENSOR data?

API_User
Level 9

Hello, I have a question.


## Question.
Is there a best practice to get all CIRCUIT,SENSOR data?


## Background
We are developing and operating a monitoring system for current and temperature sensors in a Datacenter.
We would like to import data from Smartview into our monitoring system and are considering using the API.
We need data for each CIRCUIT and SENSOR, but if we use the following API, we can only get summary data for the specified unit.


=== e.g. Current (Power_v1) request

❯ curl --request GET \
--url 'https://api.equinix.com/power/v1/current?accountNo={accountNo}&ibx={ibx}&levelType=ibx&levelValue={ibx}' \
--header 'accept: application/json' \
--header 'authorization: Bearer {bearer}' \
--header 'content-type: application/json'


Next, we considered how to obtain a list of CIRCUIT,SENSOR from the HierarchyAPI and request one of each.
However, we found that the API limits the number of requests to 1,000 per day.
We have more than 1,000 CIRCUITs and SENSORs that we want to retrieve and cannot monitor with 1,000 requests/day.
ref: https://developer.equinix.com/forum/power-api-interval-queries

Is there a better way to get all CIRCUIT,SENSOR values using Smartview API?

Thank you.

Replies 4 4

API_User
Level 9
Hi,
please refer to the below API call and endpoint to fetch all circuit and sensor data through a single API call.
Fetch all Circuit data:
curl -X
POST "https://api.equinix.com/power/v1/current
-H "content-type: application/json"
-H "authorization: Bearer "
-d '{
"accountNo": "",
"ibx": "",
"levelType": "circuit"
}'

Fetch all customer owned sensor data:
curl -X
GET 'https://api.equinix.com/environment/v1/listCurrent?accountNo=&ibx=&levelType=SENSOR'
-H 'Authorization: Bearer
-H 'Content-Type: application/json'

Thanks

API_User
Level 9
Expected data were obtained. Thank you so much!!

API_User
Level 9
Expected data were obtained. Thank you so much!!

API_User
Level 9
Hi! We tried API call you advised to get our owned sensor data.The payload only show 10 sensor data, but in OS1 we have more than 20 sensor installed.
Could you advise the reason and solution?
Our account number is 135611, IBX is OS1.
API call you advised.
curl -X
GET 'https://api.equinix.com/environment/v1/listCurrent?accountNo=&ibx=&levelType=SENSOR'
-H 'Authorization: Bearer
-H 'Content-Type: application/json'