diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/PrometheusRuleGroupResource.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/PrometheusRuleGroupResource.tsp new file mode 100644 index 000000000000..beebf6cb3801 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/PrometheusRuleGroupResource.tsp @@ -0,0 +1,81 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.AlertsManagement; +/** + * The Prometheus rule group resource. + */ +model PrometheusRuleGroupResource + is Azure.ResourceManager.TrackedResource< + PrometheusRuleGroupProperties, + false + > { + ...ResourceNameParameter< + Resource = PrometheusRuleGroupResource, + KeyName = "ruleGroupName", + SegmentName = "prometheusRuleGroups", + NamePattern = "^[^:@/#{}%&+*<>?]+$" + >; +} + +@armResourceOperations +interface PrometheusRuleGroupResources { + /** + * Retrieve a Prometheus rule group definition. + */ + get is ArmResourceRead; + + /** + * Create or update a Prometheus rule group definition. + */ + createOrUpdate is ArmResourceCreateOrReplaceSync; + + /** + * Update an Prometheus rule group definition. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync< + PrometheusRuleGroupResource, + PatchModel = PrometheusRuleGroupResourcePatchParameters + >; + + /** + * Delete a Prometheus rule group definition. + */ + delete is ArmResourceDeleteSync; + + /** + * Retrieve Prometheus rule group definitions in a resource group. + */ + listByResourceGroup is ArmResourceListByParent< + PrometheusRuleGroupResource, + Response = ArmResponse + >; + + /** + * Retrieve Prometheus all rule group definitions in a subscription. + */ + listBySubscription is ArmListBySubscription< + PrometheusRuleGroupResource, + Response = ArmResponse + >; +} + +@@doc(PrometheusRuleGroupResource.name, "The name of the rule group."); +@@doc(PrometheusRuleGroupResource.properties, + "The Prometheus rule group properties of the resource." +); +@@doc(PrometheusRuleGroupResources.createOrUpdate::parameters.resource, + "The parameters of the rule group to create or update." +); +@@doc(PrometheusRuleGroupResources.update::parameters.properties, + "The parameters of the rule group to update." +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/back-compatible.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/back-compatible.tsp new file mode 100644 index 000000000000..ea8589cdeb26 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/back-compatible.tsp @@ -0,0 +1,28 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.AlertsManagement; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@Legacy.flattenProperty(PrometheusRuleGroupResourcePatchParameters.properties); + +@@clientLocation(PrometheusRuleGroupResources.get, "PrometheusRuleGroups"); +@@clientLocation(PrometheusRuleGroupResources.createOrUpdate, + "PrometheusRuleGroups" +); +@@clientName(PrometheusRuleGroupResources.createOrUpdate::parameters.resource, + "parameters" +); +@@clientLocation(PrometheusRuleGroupResources.update, "PrometheusRuleGroups"); +@@clientName(PrometheusRuleGroupResources.update::parameters.properties, + "parameters" +); +@@clientLocation(PrometheusRuleGroupResources.delete, "PrometheusRuleGroups"); +@@clientLocation(PrometheusRuleGroupResources.listByResourceGroup, + "PrometheusRuleGroups" +); +@@clientLocation(PrometheusRuleGroupResources.listBySubscription, + "PrometheusRuleGroups" +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@Legacy.flattenProperty(PrometheusRuleGroupResource.properties); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/client.tsp new file mode 100644 index 000000000000..a4d3166b3100 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/client.tsp @@ -0,0 +1,9 @@ +import "./main.tsp"; +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; + +@@clientName(Microsoft.AlertsManagement, + "PrometheusRuleGroupsMgmtClient", + "python" +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/createOrUpdateClusterCentricRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/createOrUpdateClusterCentricRuleGroup.json new file mode 100644 index 000000000000..35d0679f45b9 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/createOrUpdateClusterCentricRuleGroup.json @@ -0,0 +1,118 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "parameters": { + "location": "East US", + "properties": { + "description": "This is a rule group with culster centric configuration", + "clusterName": "myClusterName", + "interval": "PT10M", + "rules": [ + { + "actions": [], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" + ] + } + }, + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is a rule group with culster centric configuration", + "clusterName": "myClusterName", + "interval": "PT10M", + "rules": [ + { + "actions": [], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is a rule group with culster centric configuration", + "clusterName": "myClusterName", + "interval": "PT10M", + "rules": [ + { + "actions": [], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" + ] + } + }, + "headers": {} + } + }, + "operationId": "PrometheusRuleGroups_CreateOrUpdate", + "title": "Create or Update a cluster centric PrometheusRuleGroup" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/createOrUpdatePrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/createOrUpdatePrometheusRuleGroup.json new file mode 100644 index 000000000000..77ee6e093308 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/createOrUpdatePrometheusRuleGroup.json @@ -0,0 +1,184 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "parameters": { + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + }, + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + }, + "headers": {} + } + }, + "operationId": "PrometheusRuleGroups_CreateOrUpdate", + "title": "Create or Update a PrometheusRuleGroup" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/deletePrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/deletePrometheusRuleGroup.json new file mode 100644 index 000000000000..5c548dee50ef --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/deletePrometheusRuleGroup.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": {}, + "204": {} + }, + "operationId": "PrometheusRuleGroups_Delete", + "title": "Delete a PrometheusRuleGroup" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/getPrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/getPrometheusRuleGroup.json new file mode 100644 index 000000000000..3959bedea8f0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/getPrometheusRuleGroup.json @@ -0,0 +1,71 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + }, + "headers": {} + } + }, + "operationId": "PrometheusRuleGroups_Get", + "title": "Get a PrometheusRuleGroup" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/listPrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/listPrometheusRuleGroups.json new file mode 100644 index 000000000000..9110b66440f1 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/listPrometheusRuleGroups.json @@ -0,0 +1,130 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "resourceGroupName": "promResourceGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName1", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + }, + { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName2", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PrometheusRuleGroups_ListByResourceGroup", + "title": "List Resource group PrometheusRuleGroups" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/listSubscriptionPrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/listSubscriptionPrometheusRuleGroups.json new file mode 100644 index 000000000000..38d8a25d3e97 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/listSubscriptionPrometheusRuleGroups.json @@ -0,0 +1,130 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "resourceGroupName": "promResourceGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourceGroupName1/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + }, + { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourceGroupName2/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": true, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PrometheusRuleGroups_ListBySubscription", + "title": "List Subscription Resource PrometheusRuleGroups" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/patchPrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/patchPrometheusRuleGroup.json new file mode 100644 index 000000000000..05ee9ea0b42c --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/examples/2023-03-01/patchPrometheusRuleGroup.json @@ -0,0 +1,82 @@ +{ + "parameters": { + "api-version": "2023-03-01", + "parameters": { + "properties": { + "enabled": false + }, + "tags": { + "tag1": "tagValueFromPatch" + } + }, + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" + }, + "responses": { + "200": { + "body": { + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "location": "East US", + "properties": { + "description": "This is the description of the following rule group", + "clusterName": "myClusterName", + "enabled": false, + "interval": "PT10M", + "rules": [ + { + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", + "labels": { + "team": "prod" + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" + }, + { + "actions": [ + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + }, + { + "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", + "actionProperties": { + "key21": "value21", + "key22": "value22" + } + } + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 + } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" + ] + }, + "tags": { + "tag1": "tagValueFromPatch" + } + }, + "headers": {} + } + }, + "operationId": "PrometheusRuleGroups_Update", + "title": "Patch a PrometheusRuleGroup" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/main.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/main.tsp new file mode 100644 index 000000000000..8550e50db26a --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/main.tsp @@ -0,0 +1,42 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.12 + * Date: 2025-12-09T05:58:24.807Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./PrometheusRuleGroupResource.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@armProviderNamespace +@service(#{ title: "Azure Alerts Management Service Resource Provider" }) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) +namespace Microsoft.AlertsManagement; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2023-03-01 API version. + */ + v2023_03_01: "2023-03-01", +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/models.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/models.tsp new file mode 100644 index 000000000000..3ac3f5dec2d0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/models.tsp @@ -0,0 +1,202 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.AlertsManagement; + +/** + * The type of identity that created the resource. + */ +union CreatedByType { + string, + + /** + * User + */ + User: "User", + + /** + * Application + */ + Application: "Application", + + /** + * ManagedIdentity + */ + ManagedIdentity: "ManagedIdentity", + + /** + * Key + */ + Key: "Key", +} + +/** + * Represents a collection of alert rule resources. + */ +model PrometheusRuleGroupResourceCollection { + /** + * the values for the alert rule resources. + */ + @pageItems + value?: PrometheusRuleGroupResource[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @nextLink + nextLink?: string; +} + +/** + * An Azure Prometheus rule group. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PrometheusRuleGroupProperties { + /** + * Rule group description. + */ + description?: string; + + /** + * Enable/disable rule group. + */ + enabled?: boolean; + + /** + * Apply rule to data from a specific cluster. + */ + clusterName?: string; + + /** + * Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future. + */ + scopes: string[]; + + /** + * The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes + */ + interval?: duration; + + /** + * Defines the rules in the Prometheus rule group. + */ + @identifiers(#[]) + rules: PrometheusRule[]; +} + +/** + * An Azure Prometheus alerting or recording rule. + */ +model PrometheusRule { + /** + * Recorded metrics name. + */ + record?: string; + + /** + * Alert rule name. + */ + alert?: string; + + /** + * Enable/disable rule. + */ + enabled?: boolean; + + /** + * The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'. + */ + expression: string; + + /** + * Labels to add or overwrite before storing the result. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + labels?: Record; + + /** + * The severity of the alerts fired by the rule. Must be between 0 and 4. + */ + severity?: int32; + + /** + * The amount of time alert must be active before firing. + */ + for?: duration; + + /** + * The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + annotations?: Record; + + /** + * Actions that are performed when the alert rule becomes active, and when an alert condition is resolved. + */ + @identifiers(#[]) + actions?: PrometheusRuleGroupAction[]; + + /** + * Defines the configuration for resolving fired alerts. Only relevant for alerts. + */ + resolveConfiguration?: PrometheusRuleResolveConfiguration; +} + +/** + * An alert action. Only relevant for alerts. + */ +model PrometheusRuleGroupAction { + /** + * The resource id of the action group to use. + */ + actionGroupId?: string; + + /** + * The properties of an action group object. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + actionProperties?: Record; +} + +/** + * Specifies the Prometheus alert rule configuration. + */ +model PrometheusRuleResolveConfiguration { + /** + * Enable alert auto-resolution. + */ + autoResolved?: boolean; + + /** + * Alert auto-resolution timeout. + */ + timeToResolve?: duration; +} + +/** + * The Prometheus rule group resource for patch operations. + */ +model PrometheusRuleGroupResourcePatchParameters { + /** + * Resource tags + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tags?: Record; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: PrometheusRuleGroupResourcePatchParametersProperties; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PrometheusRuleGroupResourcePatchParametersProperties { + /** + * the flag that indicates whether the Prometheus rule group is enabled. + */ + enabled?: boolean; +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/PrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/PrometheusRuleGroups.json index fadc2f44d5f4..32a2200c4f5a 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/PrometheusRuleGroups.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/PrometheusRuleGroups.json @@ -1,143 +1,165 @@ { "swagger": "2.0", "info": { - "version": "2023-03-01", "title": "Azure Alerts Management Service Resource Provider", - "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." + "version": "2023-03-01", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] }, - "host": "management.azure.com", "schemes": [ "https" ], - "consumes": [ + "host": "management.azure.com", + "produces": [ "application/json" ], - "produces": [ + "consumes": [ "application/json" ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], "securityDefinitions": { "azure_auth": { "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, + "tags": [ + { + "name": "PrometheusRuleGroupResources" + } + ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/prometheusRuleGroups": { "get": { + "operationId": "PrometheusRuleGroups_ListBySubscription", "tags": [ - "PrometheusRuleGroups" + "PrometheusRuleGroupResources" ], "description": "Retrieve Prometheus all rule group definitions in a subscription.", - "operationId": "PrometheusRuleGroups_ListBySubscription", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { - "description": "Successful request for a list of Prometheus rule groups", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PrometheusRuleGroupResourceCollection" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": null - }, "x-ms-examples": { "List Subscription Resource PrometheusRuleGroups": { "$ref": "./examples/listSubscriptionPrometheusRuleGroups.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/prometheusRuleGroups": { "get": { + "operationId": "PrometheusRuleGroups_ListByResourceGroup", "tags": [ - "PrometheusRuleGroups" + "PrometheusRuleGroupResources" ], "description": "Retrieve Prometheus rule group definitions in a resource group.", - "operationId": "PrometheusRuleGroups_ListByResourceGroup", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" } ], "responses": { "200": { - "description": "Successful request for a list of Prometheus rule groups", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PrometheusRuleGroupResourceCollection" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": null - }, "x-ms-examples": { "List Resource group PrometheusRuleGroups": { "$ref": "./examples/listPrometheusRuleGroups.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/prometheusRuleGroups/{ruleGroupName}": { "get": { + "operationId": "PrometheusRuleGroups_Get", "tags": [ - "PrometheusRuleGroups" + "PrometheusRuleGroupResources" ], "description": "Retrieve a Prometheus rule group definition.", - "operationId": "PrometheusRuleGroups_Get", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "#/parameters/RuleGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "name": "ruleGroupName", + "in": "path", + "description": "The name of the rule group.", + "required": true, + "type": "string", + "pattern": "^[^:@/#{}%&+*<>?]+$" } ], "responses": { "200": { - "description": "Successful request for a list of Prometheus rule groups", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PrometheusRuleGroupResource" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } @@ -150,49 +172,54 @@ } }, "put": { + "operationId": "PrometheusRuleGroups_CreateOrUpdate", "tags": [ - "PrometheusRuleGroups" + "PrometheusRuleGroupResources" ], "description": "Create or update a Prometheus rule group definition.", - "operationId": "PrometheusRuleGroups_CreateOrUpdate", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "#/parameters/RuleGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "name": "ruleGroupName", + "in": "path", + "description": "The name of the rule group.", + "required": true, + "type": "string", + "pattern": "^[^:@/#{}%&+*<>?]+$" }, { "name": "parameters", "in": "body", + "description": "The parameters of the rule group to create or update.", "required": true, "schema": { "$ref": "#/definitions/PrometheusRuleGroupResource" - }, - "description": "The parameters of the rule group to create or update." + } } ], "responses": { "200": { - "description": "OK (Updated).", + "description": "Resource 'PrometheusRuleGroupResource' update operation succeeded", "schema": { "$ref": "#/definitions/PrometheusRuleGroupResource" } }, "201": { - "description": "Created (New Alert rule was created).", + "description": "Resource 'PrometheusRuleGroupResource' create operation succeeded", "schema": { "$ref": "#/definitions/PrometheusRuleGroupResource" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } @@ -208,43 +235,48 @@ } }, "patch": { + "operationId": "PrometheusRuleGroups_Update", "tags": [ - "PrometheusRuleGroups" + "PrometheusRuleGroupResources" ], "description": "Update an Prometheus rule group definition.", - "operationId": "PrometheusRuleGroups_Update", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "#/parameters/RuleGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "name": "ruleGroupName", + "in": "path", + "description": "The name of the rule group.", + "required": true, + "type": "string", + "pattern": "^[^:@/#{}%&+*<>?]+$" }, { "name": "parameters", "in": "body", + "description": "The parameters of the rule group to update.", "required": true, "schema": { "$ref": "#/definitions/PrometheusRuleGroupResourcePatchParameters" - }, - "description": "The parameters of the rule group to update." + } } ], "responses": { "200": { - "description": "OK", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PrometheusRuleGroupResource" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } @@ -257,34 +289,39 @@ } }, "delete": { + "operationId": "PrometheusRuleGroups_Delete", "tags": [ - "PrometheusRuleGroups" + "PrometheusRuleGroupResources" ], "description": "Delete a Prometheus rule group definition.", - "operationId": "PrometheusRuleGroups_Delete", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "#/parameters/RuleGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "name": "ruleGroupName", + "in": "path", + "description": "The name of the rule group.", + "required": true, + "type": "string", + "pattern": "^[^:@/#{}%&+*<>?]+$" } ], "responses": { "200": { - "description": "Successful request to delete a Prometheus rule group" + "description": "Resource deleted successfully." }, "204": { - "description": "No content: the request was successful, but the response is empty" + "description": "Resource does not exist." }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } @@ -299,68 +336,87 @@ } }, "definitions": { - "PrometheusRuleGroupResource": { - "type": "object", - "allOf": [ - { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/PrometheusRuleGroupProperties", - "description": "The Prometheus rule group properties of the resource." - } - }, - "description": "The Prometheus rule group resource." - }, - "PrometheusRuleGroupResourcePatchParameters": { + "PrometheusRule": { "type": "object", + "description": "An Azure Prometheus alerting or recording rule.", "properties": { - "tags": { + "record": { + "type": "string", + "description": "Recorded metrics name." + }, + "alert": { + "type": "string", + "description": "Alert rule name." + }, + "enabled": { + "type": "boolean", + "description": "Enable/disable rule." + }, + "expression": { + "type": "string", + "description": "The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'." + }, + "labels": { "type": "object", + "description": "Labels to add or overwrite before storing the result.", "additionalProperties": { "type": "string" - }, - "description": "Resource tags" + } }, - "properties": { + "severity": { + "type": "integer", + "format": "int32", + "description": "The severity of the alerts fired by the rule. Must be between 0 and 4." + }, + "for": { + "type": "string", + "format": "duration", + "description": "The amount of time alert must be active before firing." + }, + "annotations": { "type": "object", - "x-ms-client-flatten": true, - "properties": { - "enabled": { - "type": "boolean", - "description": "the flag that indicates whether the Prometheus rule group is enabled." - } + "description": "The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated.", + "additionalProperties": { + "type": "string" } + }, + "actions": { + "type": "array", + "description": "Actions that are performed when the alert rule becomes active, and when an alert condition is resolved.", + "items": { + "$ref": "#/definitions/PrometheusRuleGroupAction" + }, + "x-ms-identifiers": [] + }, + "resolveConfiguration": { + "$ref": "#/definitions/PrometheusRuleResolveConfiguration", + "description": "Defines the configuration for resolving fired alerts. Only relevant for alerts." } }, - "description": "The Prometheus rule group resource for patch operations." + "required": [ + "expression" + ] }, - "PrometheusRuleGroupResourceCollection": { + "PrometheusRuleGroupAction": { "type": "object", + "description": "An alert action. Only relevant for alerts.", "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/PrometheusRuleGroupResource" - }, - "description": "the values for the alert rule resources." + "actionGroupId": { + "type": "string", + "description": "The resource id of the action group to use." + }, + "actionProperties": { + "type": "object", + "description": "The properties of an action group object.", + "additionalProperties": { + "type": "string" + } } - }, - "description": "Represents a collection of alert rule resources." + } }, "PrometheusRuleGroupProperties": { - "description": "An Azure Prometheus rule group.", "type": "object", - "required": [ - "scopes", - "rules" - ], + "description": "An Azure Prometheus rule group.", "properties": { "description": { "type": "string", @@ -376,105 +432,88 @@ }, "scopes": { "type": "array", + "description": "Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future.", "items": { "type": "string" - }, - "description": "Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future." + } }, "interval": { "type": "string", - "description": "The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes", - "format": "duration" + "format": "duration", + "description": "The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes" }, "rules": { "type": "array", + "description": "Defines the rules in the Prometheus rule group.", "items": { "$ref": "#/definitions/PrometheusRule" }, - "description": "Defines the rules in the Prometheus rule group.", "x-ms-identifiers": [] } - } + }, + "required": [ + "scopes", + "rules" + ] }, - "PrometheusRule": { + "PrometheusRuleGroupResource": { "type": "object", - "description": "An Azure Prometheus alerting or recording rule.", + "description": "The Prometheus rule group resource.", + "properties": { + "properties": { + "$ref": "#/definitions/PrometheusRuleGroupProperties", + "description": "The Prometheus rule group properties of the resource.", + "x-ms-client-flatten": true + } + }, "required": [ - "expression" + "properties" ], + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "PrometheusRuleGroupResourceCollection": { + "type": "object", + "description": "Represents a collection of alert rule resources.", "properties": { - "record": { - "description": "Recorded metrics name.", - "type": "string" - }, - "alert": { - "description": "Alert rule name.", - "type": "string" - }, - "enabled": { - "type": "boolean", - "description": "Enable/disable rule." + "value": { + "type": "array", + "description": "the values for the alert rule resources.", + "items": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + } }, - "expression": { - "description": "The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'.", + "nextLink": { "type": "string" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Labels to add or overwrite before storing the result." - }, - "severity": { - "type": "integer", - "format": "int32", - "description": "The severity of the alerts fired by the rule. Must be between 0 and 4." - }, - "for": { - "type": "string", - "description": "The amount of time alert must be active before firing.", - "format": "duration" - }, - "annotations": { + } + } + }, + "PrometheusRuleGroupResourcePatchParameters": { + "type": "object", + "description": "The Prometheus rule group resource for patch operations.", + "properties": { + "tags": { "type": "object", + "description": "Resource tags", "additionalProperties": { "type": "string" - }, - "description": "The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated." - }, - "actions": { - "$ref": "#/definitions/PrometheusRuleGroupActions", - "description": "Actions that are performed when the alert rule becomes active, and when an alert condition is resolved." + } }, - "resolveConfiguration": { - "$ref": "#/definitions/PrometheusRuleResolveConfiguration", - "description": "Defines the configuration for resolving fired alerts. Only relevant for alerts." + "properties": { + "$ref": "#/definitions/PrometheusRuleGroupResourcePatchParametersProperties", + "x-ms-client-flatten": true } } }, - "PrometheusRuleGroupActions": { - "type": "array", - "items": { - "$ref": "#/definitions/PrometheusRuleGroupAction" - }, - "x-ms-identifiers": [], - "description": "The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Only relevant for alerts." - }, - "PrometheusRuleGroupAction": { + "PrometheusRuleGroupResourcePatchParametersProperties": { "type": "object", - "description": "An alert action. Only relevant for alerts.", "properties": { - "actionGroupId": { - "type": "string", - "description": "The resource id of the action group to use." - }, - "actionProperties": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "The properties of an action group object." + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the Prometheus rule group is enabled." } } }, @@ -488,21 +527,11 @@ }, "timeToResolve": { "type": "string", - "description": "Alert auto-resolution timeout.", - "format": "duration" + "format": "duration", + "description": "Alert auto-resolution timeout." } } } }, - "parameters": { - "RuleGroupNameParameter": { - "name": "ruleGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the rule group.", - "x-ms-parameter-location": "method", - "pattern": "^[^:@/#{}%&+*<>?]+$" - } - } + "parameters": {} } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdateClusterCentricRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdateClusterCentricRuleGroup.json index bb66d432792e..35d0679f45b9 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdateClusterCentricRuleGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdateClusterCentricRuleGroup.json @@ -1,116 +1,118 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", - "resourceGroupName": "promResourceGroup", - "ruleGroupName": "myPrometheusRuleGroup", "api-version": "2023-03-01", "parameters": { "location": "East US", "properties": { "description": "This is a rule group with culster centric configuration", - "interval": "PT10M", "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" - ], + "interval": "PT10M", "rules": [ { + "actions": [], "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "annotations": { + "annotationName1": "annotationValue1" + }, "enabled": true, - "severity": 2, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", "for": "PT5M", "labels": { "team": "prod" }, - "annotations": { - "annotationName1": "annotationValue1" - }, "resolveConfiguration": { "autoResolved": true, "timeToResolve": "PT10M" }, - "actions": [] + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" ] } - } + }, + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is a rule group with culster centric configuration", - "interval": "PT10M", "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" - ], + "interval": "PT10M", "rules": [ { + "actions": [], "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "annotations": { + "annotationName1": "annotationValue1" + }, "enabled": true, - "severity": 2, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", "for": "PT5M", "labels": { "team": "prod" }, - "annotations": { - "annotationName1": "annotationValue1" - }, "resolveConfiguration": { "autoResolved": true, "timeToResolve": "PT10M" }, - "actions": [] + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" ] } - } + }, + "headers": {} }, "201": { - "headers": {}, "body": { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is a rule group with culster centric configuration", - "interval": "PT10M", "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" - ], + "interval": "PT10M", "rules": [ { + "actions": [], "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "annotations": { + "annotationName1": "annotationValue1" + }, "enabled": true, - "severity": 2, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", "for": "PT5M", "labels": { "team": "prod" }, - "annotations": { - "annotationName1": "annotationValue1" - }, "resolveConfiguration": { "autoResolved": true, "timeToResolve": "PT10M" }, - "actions": [] + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myClusterName" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PrometheusRuleGroups_CreateOrUpdate", + "title": "Create or Update a cluster centric PrometheusRuleGroup" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdatePrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdatePrometheusRuleGroup.json index b171d60c2e23..77ee6e093308 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdatePrometheusRuleGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/createOrUpdatePrometheusRuleGroup.json @@ -1,43 +1,22 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", - "resourceGroupName": "promResourceGroup", - "ruleGroupName": "myPrometheusRuleGroup", "api-version": "2023-03-01", "parameters": { "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -53,51 +32,53 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } - } + }, + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -113,50 +94,50 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } - } + }, + "headers": {} }, "201": { - "headers": {}, "body": { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -172,11 +153,32 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PrometheusRuleGroups_CreateOrUpdate", + "title": "Create or Update a PrometheusRuleGroup" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/deletePrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/deletePrometheusRuleGroup.json index 628faa44efbb..5c548dee50ef 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/deletePrometheusRuleGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/deletePrometheusRuleGroup.json @@ -1,12 +1,14 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "api-version": "2023-03-01", "resourceGroupName": "promResourceGroup", "ruleGroupName": "myPrometheusRuleGroup", - "api-version": "2023-03-01" + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": {}, "204": {} - } + }, + "operationId": "PrometheusRuleGroups_Delete", + "title": "Delete a PrometheusRuleGroup" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/getPrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/getPrometheusRuleGroup.json index 6049bfe774df..3959bedea8f0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/getPrometheusRuleGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/getPrometheusRuleGroup.json @@ -1,49 +1,30 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "api-version": "2023-03-01", "resourceGroupName": "promResourceGroup", "ruleGroupName": "myPrometheusRuleGroup", - "api-version": "2023-03-01" + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -59,11 +40,32 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PrometheusRuleGroups_Get", + "title": "Get a PrometheusRuleGroup" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listPrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listPrometheusRuleGroups.json index e5a78806703e..9110b66440f1 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listPrometheusRuleGroups.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listPrometheusRuleGroups.json @@ -1,50 +1,31 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "api-version": "2023-03-01", "resourceGroupName": "promResourceGroup", - "api-version": "2023-03-01" + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName1", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName1", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -60,47 +41,47 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } }, { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName2", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName2", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -116,13 +97,34 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PrometheusRuleGroups_ListByResourceGroup", + "title": "List Resource group PrometheusRuleGroups" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listSubscriptionPrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listSubscriptionPrometheusRuleGroups.json index 9d38d8020606..38d8a25d3e97 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listSubscriptionPrometheusRuleGroups.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/listSubscriptionPrometheusRuleGroups.json @@ -1,50 +1,31 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "api-version": "2023-03-01", "resourceGroupName": "promResourceGroup", - "api-version": "2023-03-01" + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourceGroupName1/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourceGroupName1/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -60,47 +41,47 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } }, { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourceGroupName2/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourceGroupName2/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": true, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -116,13 +97,34 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PrometheusRuleGroups_ListBySubscription", + "title": "List Subscription Resource PrometheusRuleGroups" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/patchPrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/patchPrometheusRuleGroup.json index 7821ba112736..05ee9ea0b42c 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/patchPrometheusRuleGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/stable/2023-03-01/examples/patchPrometheusRuleGroup.json @@ -1,57 +1,38 @@ { "parameters": { - "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", - "resourceGroupName": "promResourceGroup", - "ruleGroupName": "myPrometheusRuleGroup", "api-version": "2023-03-01", "parameters": { - "tags": { - "tag1": "tagValueFromPatch" - }, "properties": { "enabled": false + }, + "tags": { + "tag1": "tagValueFromPatch" } - } + }, + "resourceGroupName": "promResourceGroup", + "ruleGroupName": "myPrometheusRuleGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", "location": "East US", "properties": { "description": "This is the description of the following rule group", + "clusterName": "myClusterName", "enabled": false, "interval": "PT10M", - "clusterName": "myClusterName", - "scopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" - ], "rules": [ { - "record": "job_type:billing_jobs_duration_seconds:99p5m", "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", "labels": { "team": "prod" - } + }, + "record": "job_type:billing_jobs_duration_seconds:99p5m" }, { - "alert": "Billing_Processing_Very_Slow", - "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", - "enabled": true, - "severity": 2, - "for": "PT5M", - "labels": { - "team": "prod" - }, - "annotations": { - "annotationName1": "annotationValue1" - }, - "resolveConfiguration": { - "autoResolved": true, - "timeToResolve": "PT10M" - }, "actions": [ { "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", @@ -67,14 +48,35 @@ "key22": "value22" } } - ] + ], + "alert": "Billing_Processing_Very_Slow", + "annotations": { + "annotationName1": "annotationValue1" + }, + "enabled": true, + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "for": "PT5M", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "severity": 2 } + ], + "scopes": [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" ] }, "tags": { "tag1": "tagValueFromPatch" } - } + }, + "headers": {} } - } + }, + "operationId": "PrometheusRuleGroups_Update", + "title": "Patch a PrometheusRuleGroup" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/suppressions.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/suppressions.yaml index d2695fc801c2..171aaa9022e2 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/suppressions.yaml +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/suppressions.yaml @@ -1,6 +1,3 @@ - tool: TypeSpecRequirement path: ./preview/2021-07-22-preview/*.json - reason: Brownfield service not ready to migrate -- tool: TypeSpecRequirement - path: ./stable/2023-03-01/*.json - reason: Brownfield service not ready to migrate + reason: Brownfield service not ready to migrate \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/tspconfig.yaml new file mode 100644 index 000000000000..c9fa0ce10c5c --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PrometheusRuleGroups/tspconfig.yaml @@ -0,0 +1,48 @@ +parameters: + "service-dir": + default: "sdk/prometheusrulegroups" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: true + emitter-output-dir: "{project-root}" + azure-resource-provider-folder: "resource-manager" + output-file: "{version-status}/{version}/PrometheusRuleGroups.json" + arm-types-dir: "{project-root}/../../../../common-types/resource-management" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" + "@azure-tools/typespec-python": + service-dir: "sdk/alertsmanagement" + package-dir: "azure-mgmt-prometheusrulegroups" + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-prometheusrulegroups" + namespace: "azure.mgmt.prometheusrulegroups" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + package-dir: "azure-resourcemanager-prometheusrulegroups" + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-prometheusrulegroups" + namespace: "com.azure.resourcemanager.prometheusrulegroups" + service-name: "PrometheusRuleGroups" # human-readable service name, whitespace allowed + flavor: azure + "@azure-tools/typespec-ts": + service-dir: sdk/prometheusrulegroups + emitter-output-dir: "{output-dir}/{service-dir}/arm-prometheusrulegroups" + flavor: "azure" + experimental-extensible-enums: true + package-details: + name: "@azure/arm-prometheusrulegroups" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/prometheusrulegroups" + emitter-output-dir: "{output-dir}/{service-dir}/armprometheusrulegroups" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armprometheusrulegroups" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager"