I am trying to make a change to a Looker alert via API, but I am encountering the following error:
PUT /alerts/49 (422: Unprocessable Entity) Seconds: 0.271
Body (325 bytes)
{
"message": "Validation Failed",
"errors": [
{
"field": "alert",
"code": "invalid",
"message": "field_selection_filter must contain :field_name",
"documentation_url": "https://cloud.google.com/looker/docs/r/err/4.0/422/put/alerts/:alert_id"
}
],
"documentation_url": "https://cloud.google.com/looker/docs/r/err/4.0/422/put/alerts/:alert_id"
}
My code:
{
"applied_dashboard_filters": [
{}
],
"comparison_type": "GREATER_THAN",
"cron": "1 4 * * *",
"custom_url_base": "",
"custom_url_params": "",
"custom_url_label": "",
"show_custom_url": false,
"custom_title": "",
"dashboard_element_id": "4300",
"description": "",
"destinations": [
{
"destination_type": "EMAIL",
"email_address": "[email protected]"
}
],
"field": {
"title": "Qualquer Contagem de Is Anomaly (Yes / No)",
"name": "contagem_de_is_anomaly_yes_no",
"filter": [
{}
]
},
"followed": true,
"followable": false,
"is_disabled": false,
"disabled_reason": "",
"is_public": false,
"investigative_content_type": "",
"investigative_content_id": "",
"lookml_dashboard_id": "",
"lookml_link_id": null,
"owner_id": "11",
"owner_display_name": "Janderson",
"threshold": 0,
"time_series_condition_state": {
"previous_time_series_id": "",
"latest_time_series_id": ""
}
}
This field called field_selection_filter does not appear in the example provided by Looker and I don’t know how to use it. Does anyone know how this field is passed in the request?
I followed the steps that were described in the Looker Update an Alert API documentation. After encountering the problem described, I did a Google search to find out what the field_selection_filter field is, which apparently is a field that is used to specify which data should be considered or filtered when creating or updating an alert. However, I could not find an example or explanation of how to use this field anywhere. I tried putting it inside the field, outside the field, and even inside applied_dashboard_filters, all without success.
I hope to find an example or explanation of how to use this field in the Looker request.
Janderson Sebastio do Carmo Ro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.