'API request on Atlas mongodb ISO 8601 granularity=Pxxx&period=Pxxx

Trying the below API request to get the CPU usage metric for last 30 days everyday at 10:30 PM. The below command is working , But on adjusting granularity & period it is giving "errorCode" : "INVALID_PERIOD" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

curl --user "xxxxxxx:yyyyyyy" --digest
--header "Content-Type: application/json"
--include
--request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/gggggg/processes/servername:27017/measurements?m=MAX_PROCESS_CPU_USER&granularity=P1D&period=P30D&pretty=true"

On the web page https://en.wikipedia.org/wiki/ISO_8601 it is giving some formats. I tried like &granularity=PT1H&period=P2DT1H& and more, but I am not getting the output I am looking for. My requirement is to get the metrics at 10:30PM every day for last 30 days. Anyone know how can I pass the specific time and 30 days to get the metric out with out error.

Thanks Thomas



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source