Update policy by ID.
- payload (PolicyUpdate): Required. The updated policy information with:
- name (str or None): The updated name of the policy.
- data_config: Configuration relevant to the retrieval of data for this policy:
for compare distribution policy:- query_a (Query): Cube.js query.
- query_b (Query): Cube.js query.
- query_a_time_range_config: (TimeRangeConfig or None): Time range configuration for query A.
- query_b_time_range_config: (TimeRangeConfig or None): Time range configuration for query B.
- distance_function (DistanceFunction): Distance function to use.
for statistics policy: - query (Query): Cube.js query.
- cron_expression (str or None): The updated cron expression for the policy evaluation.
- condition_above_value (float or None): The updated condition above value.
- condition_below_value (float or None): The updated condition below value.
- destination_ids (list of UUID or None): The updated list of communication channels to get notified through.
- alert_on_status (AlertOnStatusDirection or None): The updated trigger policy action if the value is above/below.
- alert_on_policy_level (bool or None): The updated trigger policy action on a single group/entire groups.
- dataset_id (str or None): The updated dataset this policy is monitoring.
- policy_id (UUID): Required. The ID of the policy to be updated.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Updates a policy and returns it. You can change its name, description, data configuration, threshold settings, cron schedule, destinations, alert settings, and datasets.
When to use it
Use it to tune a policy's threshold or schedule, or to change where its alerts go.
Required parameters
policy_id(path): the ID of the policy.
Optional body fields: name, data_config, cron_expression, destination_ids, alert_on_status, alert_on_policy_level, dataset_id, dataset_b_id, threshold_settings, initialize_with_historic_data, description.
Response
A successful call returns 200 OK with the PolicyResponse object, including id, name, status, data_config, threshold_settings, cron_expression, destination_ids, last_evaluation, and next_evaluation.
Related: Get a policy, Trigger a policy, Delete a policy
404Not Found
500Internal Server Error