diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/PrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/PrometheusRuleGroups.json new file mode 100644 index 000000000000..1caf4906694b --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/PrometheusRuleGroups.json @@ -0,0 +1,497 @@ +{ + "swagger": "2.0", + "info": { + "version": "2021-07-22-preview", + "title": "Azure Alerts Management Service Resource Provider", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/prometheusRuleGroups": { + "get": { + "tags": [ + "PrometheusRuleGroups" + ], + "description": "Retrieve Prometheus 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" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of Prometheus rule groups", + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResourceCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "ListSubscriptionResourcePrometheusRuleGroups": { + "$ref": "./examples/listSubscriptionPrometheusRuleGroups.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/prometheusRuleGroups": { + "get": { + "tags": [ + "PrometheusRuleGroups" + ], + "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/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of Prometheus rule groups", + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResourceCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "ListResourcePrometheusRuleGroups": { + "$ref": "./examples/listPrometheusRuleGroups.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/prometheusRuleGroups/{ruleGroupName}": { + "get": { + "tags": [ + "PrometheusRuleGroups" + ], + "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/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of Prometheus rule groups", + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "GetPrometheusRuleGroup": { + "$ref": "./examples/getPrometheusRuleGroup.json" + } + } + }, + "put": { + "tags": [ + "PrometheusRuleGroups" + ], + "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/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + }, + "description": "The parameters of the rule group to create or update." + } + ], + "responses": { + "200": { + "description": "OK (Updated).", + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + } + }, + "201": { + "description": "Created (New Alert rule was created).", + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "CreatePrometheusRuleGroup": { + "$ref": "./examples/createOrUpdatePrometheusRuleGroup.json" + } + } + }, + "patch": { + "tags": [ + "PrometheusRuleGroups" + ], + "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/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResourcePatch" + }, + "description": "The parameters of the rule group to update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "PatchPrometheusRuleGroup": { + "$ref": "./examples/patchPrometheusRuleGroup.json" + } + } + }, + "delete": { + "tags": [ + "PrometheusRuleGroups" + ], + "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/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request to delete a Prometheus rule group" + }, + "204": { + "description": "No content: the request was successful, but the response is empty" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "DeletePrometheusRuleGroup": { + "$ref": "./examples/deletePrometheusRuleGroup.json" + } + } + } + } + }, + "definitions": { + "PrometheusRuleGroupAction": { + "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 dictionary of custom properties for the action." + }, + "description": "The properties of an action group object." + } + } + }, + "PrometheusRuleGroupProperties": { + "type": "object", + "required": [ + "scopes", + "rules" + ], + "properties": { + "description": { + "type": "string", + "description": "the description of the Prometheus rule group that will be included in the alert email." + }, + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the Prometheus rule group is enabled." + }, + "clusterName": { + "type": "string", + "description": "the cluster name of the rule group evaluation." + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "x-ms-identifiers": [], + "description": "the list of resource id's that this rule group is scoped to." + }, + "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" + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/definitions/PrometheusRule" + }, + "x-ms-identifiers": [], + "description": "defines the rules in the Prometheus rule group." + } + }, + "description": "An alert rule." + }, + "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." + }, + "PrometheusRuleGroupResourcePatch": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the Prometheus rule group is enabled." + } + } + } + }, + "description": "The Prometheus rule group resource for patch operations." + }, + "PrometheusRuleGroupResourceCollection": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/PrometheusRuleGroupResource" + }, + "description": "the values for the alert rule resources." + } + }, + "description": "Represents a collection of alert rule resources." + }, + "PrometheusRule": { + "type": "object", + "required": [ + "expression" + ], + "properties": { + "record": { + "type": "string", + "description": "the name of the recording rule." + }, + "alert": { + "type": "string", + "description": "the name of the alert rule." + }, + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the Prometheus rule is enabled." + }, + "expression": { + "type": "string", + "description": "the expression to run for the rule." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "the severity of the alerts fired by the rule. Only relevant for alerts." + }, + "for": { + "type": "string", + "description": "the amount of time alert must be active before firing. Only relevant for alerts." + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "labels for rule group. Only relevant for alerts." + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "annotations for rule group. Only relevant for alerts." + }, + "actions": { + "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." + }, + "resolveConfiguration": { + "$ref": "#/definitions/PrometheusRuleResolveConfiguration", + "description": "defines the configuration for resolving fired alerts. Only relevant for alerts." + } + } + }, + "PrometheusRuleResolveConfiguration": { + "type": "object", + "properties": { + "autoResolved": { + "type": "boolean", + "description": "the flag that indicates whether or not to auto resolve a fired alert." + }, + "timeToResolve": { + "type": "string", + "description": "the duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO 8601 duration format. Should be between 1 and 15 minutes" + } + }, + "description": "Specifies the Prometheus alert rule configuration." + } + }, + "parameters": { + "RuleGroupNameParameter": { + "name": "ruleGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the rule group.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/createOrUpdatePrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/createOrUpdatePrometheusRuleGroup.json new file mode 100644 index 000000000000..88480a3f70f2 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/createOrUpdatePrometheusRuleGroup.json @@ -0,0 +1,158 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "giladstest", + "ruleGroupName": "myPrometheusRuleGroup", + "api-version": "2021-07-22-preview", + "parameters": { + "location": "East US", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "PT5M", + "labels": { + "team": "prod" + }, + "annotations": { + "annotationName1": "annotationValue1" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/giladstest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "East US", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "interval": "PT5M", + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "PT5M", + "labels": { + "team": "prod" + }, + "annotations": { + "annotationName1": "annotationValue1" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/giladstest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:09Z" + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "East US", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "interval": "PT5M", + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "PT5M", + "labels": { + "team": "prod" + }, + "annotations": { + "annotationName1": "annotationValue1" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "PT10M" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/giladstest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:09Z" + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/deletePrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/deletePrometheusRuleGroup.json new file mode 100644 index 000000000000..5c08be786219 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/deletePrometheusRuleGroup.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "giladsteset", + "ruleGroupName": "myPrometheusRuleGroup", + "api-version": "2021-07-22-preview" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/getPrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/getPrometheusRuleGroup.json new file mode 100644 index 000000000000..f9d0ce5de0de --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/getPrometheusRuleGroup.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "giladstest", + "ruleGroupName": "myPrometheusRuleGroup", + "api-version": "2021-07-22-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "global", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "5m", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "10m" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/giladstest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:09Z" + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/listPrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/listPrometheusRuleGroups.json new file mode 100644 index 000000000000..e67d474e1c44 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/listPrometheusRuleGroups.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "giladstest", + "api-version": "2021-07-22-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "East US", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "5m", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "10m" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:09Z" + } + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/listSubscriptionPrometheusRuleGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/listSubscriptionPrometheusRuleGroups.json new file mode 100644 index 000000000000..b5f99a0c8d92 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/listSubscriptionPrometheusRuleGroups.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "api-version": "2021-07-22-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "East US", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "5m", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "10m" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:09Z" + } + }, + { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/rg-2/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup2", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "East US", + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/rg-2/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "5m", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "10m" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:13Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:13Z" + } + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/patchPrometheusRuleGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/patchPrometheusRuleGroup.json new file mode 100644 index 000000000000..3e898aecd84d --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-07-22-preview/examples/patchPrometheusRuleGroup.json @@ -0,0 +1,72 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "giladstest", + "ruleGroupName": "myPrometheusRuleGroup", + "api-version": "2021-07-22-preview", + "parameters": { + "tags": { + "tag1": "value1" + }, + "properties": { + "enabled": false + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", + "location": "East US", + "tags": { + "tag1": "value1" + }, + "properties": { + "description": "This is the description of the first rule group", + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/giladstest/providers/Microsoft.Observability/monitoringAcount/myMonitoringAccount" + ], + "enabled": false, + "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))" + }, + { + "alert": "Billing_Processing_Very_Slow", + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", + "severity": 2, + "for": "5m", + "labels": { + "team": "prod" + }, + "resolveConfiguration": { + "autoResolved": true, + "timeToResolve": "10m" + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/giladstest/providers/microsoft.insights/notificationgroups/group2", + "actionProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + ] + }, + "systemData": { + "createdBy": "abc@microsoft.com", + "createdByType": "User", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedBy": "xyz@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2018-06-12T22:05:09Z" + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/Operations_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/Operations_List.json index bd2a412411c0..56dbd44f7357 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/Operations_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/Operations_List.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview" + "api-version": "2019-03-01" }, "responses": { "200": { @@ -203,6 +203,33 @@ "operation": "Read operations", "description": "Reads the operations provided" } + }, + { + "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Write", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups", + "operation": "Creates or updates the prometheusRuleGroups", + "description": "Set prometheusRuleGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Delete", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups", + "operation": "Deletes the prometheusRuleGroups", + "description": "Delete prometheusRuleGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups", + "operation": "Reads the prometheusRuleGroups", + "description": "Read prometheusRuleGroups" + } } ] } diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 4932f2175370..81ebea9dc031 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -45,7 +45,6 @@ tag: package-2021-08 ``` - ### Tag: package-2021-08 These settings apply only when `--tag=package-2021-08` is specified on the command line. @@ -53,6 +52,7 @@ These settings apply only when `--tag=package-2021-08` is specified on the comma ```yaml $(tag) == 'package-2021-08' input-file: - Microsoft.AlertsManagement/stable/2021-08-08/AlertProcessingRules.json + - Microsoft.AlertsManagement/preview/2021-07-22-preview/PrometheusRuleGroups.json - Microsoft.AlertsManagement/preview/2019-05-05-preview/AlertsManagement.json - Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json ``` @@ -68,6 +68,15 @@ input-file: - Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json ``` +### Tag: package-preview-2021-07 + +These settings apply only when `--tag=package-preview-2021-07` is specified on the command line. + +```yaml $(tag) == 'package-preview-2021-07' +input-file: + - Microsoft.AlertsManagement/preview/2021-07-22-preview/PrometheusRuleGroups.json +``` + ### Tag: package-2021-04-only These settings apply only when `--tag=package-2021-04-only` is specified on the command line.