diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/UpdateMetricAlert.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/UpdateMetricAlert.json new file mode 100644 index 000000000000..e613029a2077 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/UpdateMetricAlert.json @@ -0,0 +1,90 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "api-version": "2018-03-01", + "parameters": { + "tags": {}, + "properties": { + "description": "This is the description of the rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin", + "type": "Microsoft.Insights/metricAlerts", + "location": "global", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "This is the description of the rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/createOrUpdateMetricAlert.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/createOrUpdateMetricAlert.json new file mode 100644 index 000000000000..d74cb3b9b49d --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/createOrUpdateMetricAlert.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "api-version": "2018-03-01", + "parameters": { + "location": "global", + "tags": {}, + "properties": { + "description": "This is the description of the rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin", + "type": "Microsoft.Insights/metricAlerts", + "location": "global", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "This is the description of the rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/deleteMetricAlert.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/deleteMetricAlert.json new file mode 100644 index 000000000000..79076b517119 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/deleteMetricAlert.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": null + }, + "204": { + "headers": {}, + "body": null + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlert.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlert.json new file mode 100644 index 000000000000..7c71d90e8512 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlert.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin", + "type": "Microsoft.Insights/metricAlerts", + "location": "global", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "This is the description of the rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlertStatus.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlertStatus.json new file mode 100644 index 000000000000..a3d593e53669 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlertStatus.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "chiricutin", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/LeoAlert_custom1", + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json new file mode 100644 index 000000000000..7bd82721d5f6 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "subscriptionId": "009f6022-67ec-423e-9aa7-691182870588", + "resourceGroupName": "EastUs", + "ruleName": "custom1", + "statusName": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/custom1", + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/listMetricAlert.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/listMetricAlert.json new file mode 100644 index 000000000000..555c127d7f0e --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/examples/listMetricAlert.json @@ -0,0 +1,98 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/highcpu", + "type": "Microsoft.Insights/metricAlerts", + "location": "global", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "This is the description of the rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "CustomMetric_\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + }, + { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/mediumcpu", + "type": "Microsoft.Insights/metricAlerts", + "location": "global", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "Med cpu alert", + "severity": 4, + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "Medium_CPU_50", + "metricName": "CustomMetric_\\Processor(_Total)\\% Processor Time", + "dimensions": [ + ], + "operator": "GreaterThan", + "threshold": 50.50, + "timeAggregation": "Average" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webhookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/metricAlert_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/metricAlert_API.json new file mode 100644 index 000000000000..a29933af8323 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-03-01/metricAlert_API.json @@ -0,0 +1,945 @@ +{ + "swagger": "2.0", + "info": { + "version": "2018-03-01", + "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "description": "Azure Monitor client to create/update/delete metric based alerts." + }, + "host": "management.azure.com", + "schemes": [ "https" ], + "consumes": [ "application/json" ], + "produces": [ "application/json" ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "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.Insight/metricAlerts": { + "get": { + "tags": [ "MetricAlerts" ], + "description": "Retrieve alert rule definitions in a subscription.", + "operationId": "MetricAlerts_ListBySubscription", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" } + ], + "responses": { + "200": { + "description": "Successful request for a list of metric alerts", + "schema": { + "$ref": "#/definitions/MetricAlertResourceCollection" + }, + "examples": { + "application/json": { + "value": [ + { + "location": "global", + "tags": { + "key1": "value1", + "key2": "value2" + }, + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/test/providers/microsoft.insights/metricalerts/storageTest", + "name": "storageTest", + "properties": { + "description": "This is the description of the xstore multidim rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/testmultidim/blobServices/default" + ], + "evaluationFrequency": "PT1M", + "windowSize": "PT15M", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "HowManyBytes", + "metricName": "BlobCapacity", + "dimensions": [ + { + "name": "BlobType", + "operator": "Include", + "values": [ + "BlockBlob", + "PageBlob" + ] + } + ], + "operator": "GreaterThanOrEqual", + "threshold": 5.0, + "timeAggregation": "Maximum" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/test/providers/microsoft.insights/actionGroups/testActionGroup" + } + ] + } + } + ] + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "List metric alert rules": { "$ref": "./examples/listMetricAlert.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts": { + "get": { + "tags": [ "MetricAlerts" ], + "description": "Retrieve alert rule defintions in a resource group.", + "operationId": "MetricAlerts_ListByResourceGroup", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" } + ], + "responses": { + "200": { + "description": "Successful request for a list of metric alerts", + "schema": { + "$ref": "#/definitions/MetricAlertResourceCollection" + }, + "examples": { + "application/json": { + "value": [ + { + "location": "global", + "tags": { + "key1": "value1", + "key2": "value2" + }, + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/test/providers/microsoft.insights/metricalerts/storageTest", + "name": "storageTest", + "properties": { + "description": "This is the description of the xstore multidim rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/testmultidim/blobServices/default" + ], + "evaluationFrequency": "PT1M", + "windowSize": "PT15M", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "HowManyBytes", + "metricName": "BlobCapacity", + "dimensions": [ + { + "name": "BlobType", + "operator": "Include", + "values": [ + "BlockBlob", + "PageBlob" + ] + } + ], + "operator": "GreaterThanOrEqual", + "threshold": 5.0, + "timeAggregation": "Maximum" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/test/providers/microsoft.insights/actionGroups/testActionGroup" + } + ] + } + } + ] + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "List metric alert rules": { "$ref": "./examples/listMetricAlert.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}": { + "get": { + "tags": [ "MetricAlerts" ], + "description": "Retrieve an alert rule definiton.", + "operationId": "MetricAlerts_Get", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" } + ], + "responses": { + "200": { + "description": "Successful request for a list of metric alerts", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + }, + "examples": { + "application/json": { + "location": "global", + "tags": { + "key1": "value1", + "key2": "value2" + }, + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/test/providers/microsoft.insights/metricalerts/storageTest", + "name": "storageTest", + "properties": { + "description": "This is the description of the xstore multidim rule1", + "severity": 3, + "enabled": true, + "scopes": [ + "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/testmultidim/blobServices/default" + ], + "evaluationFrequency": "PT1M", + "windowSize": "PT15M", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "HowManyBytes", + "metricName": "BlobCapacity", + "dimensions": [ + { + "name": "BlobType", + "operator": "Include", + "values": [ + "BlockBlob", + "PageBlob" + ] + } + ], + "operator": "GreaterThanOrEqual", + "threshold": 5.0, + "timeAggregation": "Maximum" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/test/providers/microsoft.insights/actionGroups/testActionGroup" + } + ] + } + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Get an alert rule": { "$ref": "./examples/getMetricAlert.json" } + } + }, + "put": { + "tags": [ "MetricAlerts" ], + "description": "Create or update an metric alert definition.", + "operationId": "MetricAlerts_CreateOrUpdate", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricAlertResource" + }, + "description": "The parameters of the rule to create or update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + }, + "examples": { + "application/json": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/metricalerts/chiricutin", + "name": "chiricutin", + "type": "Microsoft.Insights/metricalerts", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "This is the description of the rule1", + "severity": 0, + "enabled": true, + "scopes": [ + "/subscriptions/3b7f8a43-4372-4be1-9853-9e51f243d9be/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testVmLin" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "Percentage CPU", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Total" + }, + { + "name": "High_Disk_50", + "metricName": "Disk Write Operations/Sec", + "dimensions": [], + "operator": "GreaterThanOrEqual", + "threshold": 0.55, + "timeAggregation": "Maximum" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/3b7f8a43-4372-4be1-9853-9e51f243d9be/resourceGroups/test/providers/microsoft.insights/actionGroups/TestActionGroup", + "webhookProperties": { + "key01": "value01", + "key02": "value02" + } + } + ] + } + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Create or update an alert rule": { "$ref": "./examples/createOrUpdateMetricAlert.json" } + } + }, + "patch": { + "tags": [ "MetricAlerts" ], + "description": "Update an metric alert definition.", + "operationId": "MetricAlerts_Update", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricAlertResourcePatch" + }, + "description": "The parameters of the rule to update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MetricAlertResource" + }, + "examples": { + "application/json": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/metricalerts/chiricutin", + "name": "chiricutin", + "type": "Microsoft.Insights/metricalerts", + "location": "global", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource" + }, + "properties": { + "description": "This is the description of the rule1", + "severity": 0, + "enabled": true, + "scopes": [ + "/subscriptions/3b7f8a43-4372-4be1-9853-9e51f243d9be/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testVmLin" + ], + "evaluationFrequency": "Pt1m", + "windowSize": "Pt15m", + "criteria": { + "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "allOf": [ + { + "name": "High_CPU_80", + "metricName": "Percentage CPU", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 80.50, + "timeAggregation": "Total" + }, + { + "name": "High_Disk_50", + "metricName": "Disk Write Operations/Sec", + "dimensions": [], + "operator": "GreaterThanOrEqual", + "threshold": 0.55, + "timeAggregation": "Maximum" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/3b7f8a43-4372-4be1-9853-9e51f243d9be/resourceGroups/test/providers/microsoft.insights/actionGroups/TestActionGroup", + "webhookProperties": { + "key01": "value01", + "key02": "value02" + } + } + ] + } + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Create or update an alert rule": { "$ref": "./examples/UpdateMetricAlert.json" } + } + }, + "delete": { + "tags": [ "MetricAlerts" ], + "description": "Delete an alert rule defitiniton.", + "operationId": "MetricAlerts_Delete", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" } + ], + "responses": { + "204": { + "description": "No content: the request was successful, but the response is empty" + }, + "200": { + "description": "Successful request to delete an metric alert rule" + } + }, + "x-ms-examples": { + "Delete an alert rule": { "$ref": "./examples/deleteMetricAlert.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}/status": { + "get": { + "tags": [ "MetricAlertsStatus" ], + "description": "Retrieve an alert rule status.", + "operationId": "MetricAlertsStatus_List", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" } + ], + "responses": { + "200": { + "description": "Successful request for a list of metric alerts", + "schema": { + "$ref": "#/definitions/MetricAlertStatusCollection" + }, + "examples": { + "application/json": { + "value": [ + { + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/LeoAlert_custom1", + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Get an alert rule status": { "$ref": "./examples/getMetricAlertStatus.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}/status/{statusName}": { + "get": { + "tags": [ "MetricAlertsStatus" ], + "description": "Retrieve an alert rule status.", + "operationId": "MetricAlertsStatus_ListByName", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/StatusNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" } + ], + "responses": { + "200": { + "description": "Successful request for a list of metric alerts", + "schema": { + "$ref": "#/definitions/MetricAlertStatusCollection" + }, + "examples": { + "application/json": { + "value": [ + { + "id": "/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/LeoAlert_custom1", + "name": "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", + "type": "Microsoft.Insights/metricAlerts/status", + "properties": { + "dimensions": { + "resourceId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + }, + "status": "Healthy", + "timestamp": "2018-01-17T20:17:25.6293237Z" + } + } + ] + } + } + }, + "default": { + "description": "BadRequest", + "schema": { "$ref": "../../stable/2016-03-01/alertRules_API.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Get an alert rule status": { "$ref": "./examples/getMetricAlertStatusByName.json" } + } + } + } + }, + "definitions": { + "Resource": { + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ], + "x-ms-azure-resource": true, + "description": "An azure resource object" + }, + "Action": { + "description": "An alert action.", + "properties": { + "actionGroupId": { + "type": "string", + "description": "the id of the action group to use." + }, + "webhookProperties": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload." + } + } + } + }, + "MetricAlertProperties": { + "required": [ + "enabled", + "description", + "severity", + "evaluationFrequency", + "windowSize", + "criteria" + ], + "properties": { + "description": { + "type": "string", + "description": "the description of the metric alert that will be included in the alert email." + }, + "severity": { + "type": "integer", + "description": "Alert severity {0, 1, 2, 3, 4}" + }, + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the metric alert is enabled." + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the list of resource id's that this metric alert is scoped to." + }, + "evaluationFrequency": { + "type": "string", + "format": "duration", + "description": "how often the metric alert is evaluated represented in ISO 8601 duration format." + }, + "windowSize": { + "type": "string", + "format": "duration", + "description": "the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold." + }, + "criteria": { + "$ref": "#/definitions/MetricAlertCriteria", + "description": "defines the specific alert criteria information." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/Action" + }, + "description": "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved." + }, + "lastUpdatedTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "Last time the rule was updated in ISO8601 format." + } + }, + "description": "An alert rule." + }, + "MetricAlertResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/MetricAlertProperties", + "description": "The alert rule properties of the resource." + } + }, + "description": "The metric alert resource." + }, + "MetricAlertResourcePatch": { + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/MetricAlertProperties", + "description": "The alert rule properties of the resource." + } + }, + "description": "The metric alert resource for patch operations." + }, + "MetricAlertResourceCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricAlertResource" + }, + "description": "the values for the alert rule resources." + } + }, + "description": "Represents a collection of alert rule resources." + }, + "MetricAlertStatusCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricAlertStatus" + }, + "description": "the values for the alert rule resources." + } + }, + "description": "Represents a collection of alert rule resources." + }, + "MetricAlertStatusProperties": { + "description": "An alert status properties.", + "properties": { + "dimensions": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "status": { + "type": "string", + "description": "status value" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "UTC time when the status was checked." + } + } + }, + "MetricAlertStatus": { + "description": "An alert status.", + "properties": { + "name": { + "type": "string", + "description": "The status name." + }, + "id": { + "type": "string", + "description": "The alert rule arm id." + }, + "type": { + "type": "string", + "description": "The extended resource type name." + }, + "properties": { + "x-ms-client-flatten": false, + "$ref": "#/definitions/MetricAlertStatusProperties", + "description": "The alert status properties of the metric alert status." + } + } + }, + "MetricAlertCriteria": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "discriminator": "odata.type", + "properties": { + "odata.type": { + "enum": [ + "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "Microsoft.Azure.Monitor.DefaultCriteria" + ], + "x-ms-enum": { + "name": "odatatype", + "modelAsString": true + }, + "description": "specifies the type of the alert criteria." + } + }, + "required": [ "odata.type" ], + "description": "The rule criteria that defines the conditions of the alert rule." + }, + "MetricAlertSingleResourceMultipleMetricCriteria": { + "x-ms-discriminator-value": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MetricAlertCriteria" + } + ], + "properties": { + "allOf": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricCriteria" + }, + "description": "The list of metric criteria for this 'all of' operation. " + } + }, + "description": "Specifies the metric alert criteria for a single resource that has multiple metric criteria." + }, + "MetricCriteria": { + "required": [ + "name", + "metricName", + "operator", + "timeAggregation", + "threshold" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the criteria." + }, + "metricName": { + "type": "string", + "description": "Name of the metric." + }, + "metricNamespace": { + "type": "string", + "description": "Namespace of the metric." + }, + "operator": { + "enum": [ + "Equals", + "NotEquals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ], + "x-ms-enum": { + "name": "Operator", + "modelAsString": true + }, + "description": "the criteria operator." + }, + "timeAggregation": { + "enum": [ + "Average", + "Minimum", + "Maximum", + "Total" + ], + "x-ms-enum": { + "name": "AggregationType", + "modelAsString": true + }, + "description": "the criteria time aggregation types." + }, + "threshold": { + "type": "number", + "format": "double", + "description": "the criteria threshold value that activates the alert." + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricDimension" + }, + "description": "List of dimension conditions." + } + } + }, + "MetricDimension": { + "required": [ + "name", + "operator", + "values" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the dimension." + }, + "operator": { + "type": "string", + "description": "the dimension operator." + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of dimension values." + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "RuleNameParameter": { + "name": "ruleName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the rule.", + "x-ms-parameter-location": "method" + }, + "StatusNameParameter": { + "name": "statusName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the status.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 6f999a412edd..1b44479b2021 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -28,8 +28,34 @@ These are the global settings for the MonitorClient API. title: MonitorClient description: Monitor Management Client openapi-type: arm -tag: package-2018-02-preview +tag: package-2018-03 ``` +### Tag: package-2018-03 + +These settings apply only when `--tag=package-2018-03` is specified on the command line. + +``` yaml $(tag) == 'package-2018-03' +input-file: +- microsoft.insights/stable/2015-04-01/autoscale_API.json +- microsoft.insights/stable/2015-04-01/operations_API.json +- microsoft.insights/stable/2016-03-01/alertRulesIncidents_API.json +- microsoft.insights/stable/2016-03-01/alertRules_API.json +- microsoft.insights/stable/2016-03-01/logProfiles_API.json +- microsoft.insights/preview/2017-05-01-preview/diagnosticsSettings_API.json +- microsoft.insights/preview/2017-05-01-preview/diagnosticsSettingsCategories_API.json +- microsoft.insights/stable/2017-04-01/actionGroups_API.json +- microsoft.insights/stable/2017-04-01/activityLogAlerts_API.json +- microsoft.insights/stable/2015-04-01/activityLogs_API.json +- microsoft.insights/stable/2015-04-01/eventCategories_API.json +- microsoft.insights/stable/2015-04-01/tenantActivityLogs_API.json +- microsoft.insights/stable/2018-01-01/metricDefinitions_API.json +- microsoft.insights/stable/2018-01-01/metrics_API.json +- microsoft.insights/preview/2017-11-01-preview/baseline_API.json +- microsoft.insights/preview/2017-11-01-preview/calculateBaseline_API.json +- microsoft.insights/stable/2018-03-01/metricAlert_API.json +``` + + ### Tag: package-2018-02-preview These settings apply only when `--tag=package-2018-02-preview` is specified on the command line. @@ -54,6 +80,31 @@ input-file: - microsoft.insights/preview/2017-11-01-preview/calculateBaseline_API.json ``` + +### Tag: package-2017-12 + +These settings apply only when `--tag=package-2017-12` is specified on the command line. + +``` yaml $(tag) == 'package-2017-12' +input-file: +- microsoft.insights/stable/2015-04-01/autoscale_API.json +- microsoft.insights/stable/2015-04-01/operations_API.json +- microsoft.insights/stable/2016-03-01/alertRulesIncidents_API.json +- microsoft.insights/stable/2016-03-01/alertRules_API.json +- microsoft.insights/stable/2016-03-01/logProfiles_API.json +- microsoft.insights/preview/2017-05-01-preview/diagnosticsSettings_API.json +- microsoft.insights/preview/2017-05-01-preview/diagnosticsSettingsCategories_API.json +- microsoft.insights/stable/2017-04-01/actionGroups_API.json +- microsoft.insights/stable/2017-04-01/activityLogAlerts_API.json +- microsoft.insights/stable/2015-04-01/activityLogs_API.json +- microsoft.insights/stable/2015-04-01/eventCategories_API.json +- microsoft.insights/stable/2015-04-01/tenantActivityLogs_API.json +- microsoft.insights/preview/2017-05-01-preview/metricDefinitions_API.json +- microsoft.insights/preview/2017-05-01-preview/metrics_API.json +- microsoft.insights/preview/2017-11-01-preview/baseline_API.json +- microsoft.insights/preview/2017-11-01-preview/calculateBaseline_API.json +``` + ### Tag: package-2017-09 These settings apply only when `--tag=package-2017-09` is specified on the command line.