diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/SmartDetectorAlertRulesApi.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/SmartDetectorAlertRulesApi.json index bedb658c0631..73b161a5f7de 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/SmartDetectorAlertRulesApi.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/SmartDetectorAlertRulesApi.json @@ -214,6 +214,55 @@ } } }, + "patch": { + "tags": [ + "SmartDetectorAlertRules" + ], + "operationId": "SmartDetectorAlertRules_Patch", + "description": "Patch a specific Smart Detector alert rule.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/AlertRuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "description": "Parameters supplied to the operation.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AlertRulePatchObject" + } + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/SmartDetectorErrorResponse" + } + }, + "200": { + "description": "Successful request to patch Smart Detector alert rule.", + "schema": { + "$ref": "#/definitions/AlertRule" + } + } + }, + "x-ms-examples": { + "Patch alert rules": { + "$ref": "./examples/SmartDetectorAlertRule_Patch.json" + } + } + }, "delete": { "tags": [ "SmartDetectorAlertRules" @@ -357,6 +406,36 @@ } } }, + "AlertRulePatchObject": { + "properties": { + "id": { + "description": "The resource ID.", + "readOnly": true, + "type": "string" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "The resource type." + }, + "name": { + "type": "string", + "readOnly": true, + "description": "The resource name." + }, + "tags": { + "type": "object", + "description": "The resource tags." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AlertRulePatchProperties", + "description": "The properties of the alert rule.", + "minProperties": 1 + } + }, + "description": "The alert rule patch information" + }, "Detector": { "properties": { "id": { @@ -465,6 +544,55 @@ "actionGroups" ], "description": "The alert rule properties." + }, + "AlertRulePatchProperties": { + "properties": { + "description": { + "description": "The alert rule description.", + "type": "string" + }, + "state": { + "description": "The alert rule state.", + "type": "string", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "AlertRuleState", + "modelAsString": true + } + }, + "severity": { + "description": "The alert rule severity.", + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + } + }, + "frequency": { + "description": "The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes.", + "type": "string", + "format": "duration" + }, + "actionGroups": { + "description": "The alert rule actions.", + "$ref": "#/definitions/ActionGroupsInformation" + }, + "throttling": { + "description": "The alert rule throttling information.", + "$ref": "#/definitions/ThrottlingInformation" + } + }, + "description": "The alert rule properties." } }, "parameters": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/SmartDetectorAlertRule_Patch.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/SmartDetectorAlertRule_Patch.json new file mode 100644 index 000000000000..1e3980b5382c --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2019-03-01/examples/SmartDetectorAlertRule_Patch.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "subscriptionId": "b368ca2f-e298-46b7-b0ab-012281956afa", + "resourceGroupName": "MyAlertRules", + "alertRuleName": "MyAlertRule", + "api-version": "2019-03-01", + "parameters": { + "tags": { + "newKey": "newVal" + }, + "properties": { + "description": "New description for patching", + "frequency": "PT1M" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule", + "type": "Microsoft.AlertsManagement/smartDetectorAlertRules", + "name": "MyAlertRule", + "properties": { + "description": "New description for patching", + "state": "Enabled", + "severity": "Sev3", + "frequency": "PT1M", + "detector": { + "id": "VMMemoryLeak" + }, + "scope": [ + "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyVms/providers/Microsoft.Compute/virtualMachines/vm1" + ], + "actionGroups": [ + { + "actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/actionGroups/providers/microsoft.insights/actiongroups/MyActionGroup" + } + ], + "throttling": { + "duration": "PT20M" + } + } + } + } + } +}