Skip to content

Instantly share code, notes, and snippets.

@nishitpatel01
Created October 12, 2022 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nishitpatel01/0b5b4f3a8c6bd7f6bab26dd157f07957 to your computer and use it in GitHub Desktop.
Save nishitpatel01/0b5b4f3a8c6bd7f6bab26dd157f07957 to your computer and use it in GitHub Desktop.
evaluateSlice method sample payload
evaluate_slice_payload = {
"detectionTime": "2021-08-09T21:31:54+00:00",
"pinnedDimensions": [
{
"name": "measure",
"stringVal": "LTTH"
}
],
"timeseriesParams": {
"forecastHistory": "259200s",
"granularity": "1800s",
"metric": "temp"
},
"forecastParams": {
"seasonalityHint": "DAILY"
},
}
dataset = "sensor-data"
query_ds_endpt = f'https://timeseriesinsights.googleapis.com/v1/projects/{PROJECT_ID}/datasets/{dataset}:evaluateSlice'
res = query_ts(method="POST", endpoint=query_ds_endpt, data=evaluate_slice_payload, auth_token=token_array[0])
res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment