Skip to main content

prometheus_rule_groups

Creates, updates, deletes, gets or lists a prometheus_rule_groups resource.

Overview

Nameprometheus_rule_groups
TypeResource
Idazure.alerts_management.prometheus_rule_groups

Fields

NameDatatypeDescription
descriptiontextfield from the properties object
cluster_nametextfield from the properties object
enabledtextfield from the properties object
intervaltextfield from the properties object
locationtextThe geo-location where the resource lives
resourceGroupNametextfield from the properties object
ruleGroupNametextfield from the properties object
rulestextfield from the properties object
scopestextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, ruleGroupName, subscriptionIdRetrieve a Prometheus rule group definition.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdRetrieve Prometheus rule group definitions in a resource group.
list_by_subscriptionSELECTsubscriptionIdRetrieve Prometheus all rule group definitions in a subscription.
create_or_updateINSERTresourceGroupName, ruleGroupName, subscriptionId, data__propertiesCreate or update a Prometheus rule group definition.
deleteDELETEresourceGroupName, ruleGroupName, subscriptionIdDelete a Prometheus rule group definition.
updateUPDATEresourceGroupName, ruleGroupName, subscriptionIdUpdate an Prometheus rule group definition.

SELECT examples

Retrieve Prometheus all rule group definitions in a subscription.

SELECT
description,
cluster_name,
enabled,
interval,
location,
resourceGroupName,
ruleGroupName,
rules,
scopes,
subscriptionId,
tags
FROM azure.alerts_management.vw_prometheus_rule_groups
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new prometheus_rule_groups resource.

/*+ 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 }}'
;

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 }}';