prometheus_rule_groups
Creates, updates, deletes, gets or lists a prometheus_rule_groups
resource.
Overview
Name | prometheus_rule_groups |
Type | Resource |
Id | azure.alerts_management.prometheus_rule_groups |
Fields
- vw_prometheus_rule_groups
- prometheus_rule_groups
Name | Datatype | Description |
---|---|---|
description | text | field from the properties object |
cluster_name | text | field from the properties object |
enabled | text | field from the properties object |
interval | text | field from the properties object |
location | text | The geo-location where the resource lives |
resourceGroupName | text | field from the properties object |
ruleGroupName | text | field from the properties object |
rules | text | field from the properties object |
scopes | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
Name | Datatype | Description |
---|---|---|
location | string | The geo-location where the resource lives |
properties | object | An Azure Prometheus rule group. |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, ruleGroupName, subscriptionId | Retrieve a Prometheus rule group definition. |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | Retrieve Prometheus rule group definitions in a resource group. |
list_by_subscription | SELECT | subscriptionId | Retrieve Prometheus all rule group definitions in a subscription. |
create_or_update | INSERT | resourceGroupName, ruleGroupName, subscriptionId, data__properties | Create or update a Prometheus rule group definition. |
delete | DELETE | resourceGroupName, ruleGroupName, subscriptionId | Delete a Prometheus rule group definition. |
update | UPDATE | resourceGroupName, ruleGroupName, subscriptionId | Update an Prometheus rule group definition. |
SELECT
examples
Retrieve Prometheus all rule group definitions in a subscription.
- vw_prometheus_rule_groups
- prometheus_rule_groups
SELECT
description,
cluster_name,
enabled,
interval,
location,
resourceGroupName,
ruleGroupName,
rules,
scopes,
subscriptionId,
tags
FROM azure.alerts_management.vw_prometheus_rule_groups
WHERE subscriptionId = '{{ subscriptionId }}';
SELECT
location,
properties,
tags
FROM azure.alerts_management.prometheus_rule_groups
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new prometheus_rule_groups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.alerts_management.prometheus_rule_groups (
resourceGroupName,
ruleGroupName,
subscriptionId,
data__properties,
tags,
location,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ ruleGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ tags }}',
'{{ location }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: tags
value: object
- name: location
value: string
- name: properties
value:
- name: description
value: string
- name: enabled
value: boolean
- name: clusterName
value: string
- name: scopes
value:
- string
- name: interval
value: string
- name: rules
value:
- - name: record
value: string
- name: alert
value: string
- name: enabled
value: boolean
- name: expression
value: string
- name: labels
value: object
- name: severity
value: integer
- name: for
value: string
- name: annotations
value: object
- name: actions
value: []
- name: resolveConfiguration
value:
- name: autoResolved
value: boolean
- name: timeToResolve
value: string
UPDATE
example
Updates a prometheus_rule_groups
resource.
/*+ update */
UPDATE azure.alerts_management.prometheus_rule_groups
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND ruleGroupName = '{{ ruleGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified prometheus_rule_groups
resource.
/*+ delete */
DELETE FROM azure.alerts_management.prometheus_rule_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND ruleGroupName = '{{ ruleGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';