post https://api.superwise.ai/v1/policies
Creates a new Policy
- payload (PolicySchema): Required. The policy data to be created:
- name (str): A descriptive name for this 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.
- time_range_config: (TimeRangeConfig): Time range configuration for the query.
- cron_expression (str): Cron expression for policy evaluation.
- condition_above_value (float or None): Condition above value.
- condition_below_value (float or None): Condition below value.
- destination_ids (list of UUID): List of communication channels to get notified through.
- alert_on_status (AlertOnStatusDirection): Trigger policy action if the value is above/below.
- alert_on_policy_level (bool): Trigger policy action on a single group/entire groups.
- dataset_id (str): The dataset this policy is monitoring.