{ "swagger": "2.0", "info": { "title": "Azure Alerts Management Service Resource Provider", "version": "2021-08-08", "description": "APIs for Azure alert processing rules CRUD operations.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "host": "management.azure.com", "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, "tags": [ { "name": "AlertProcessingRules" } ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/actionRules": { "get": { "operationId": "AlertProcessingRules_ListBySubscription", "tags": [ "AlertProcessingRules" ], "description": "List all alert processing rules in a subscription.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AlertProcessingRulesList" }, "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "GetAlertProcessingRulesSubscriptionWide": { "$ref": "./examples/AlertProcessingRules_List_Subscription.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules": { "get": { "operationId": "AlertProcessingRules_ListByResourceGroup", "tags": [ "AlertProcessingRules" ], "description": "List all alert processing rules in a resource group.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AlertProcessingRulesList" }, "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "GetAlertProcessingRulesResourceGroupWide": { "$ref": "./examples/AlertProcessingRules_List_ResourceGroup.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}": { "get": { "operationId": "AlertProcessingRules_GetByName", "tags": [ "AlertProcessingRules" ], "description": "Get an alert processing rule by name.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "alertProcessingRuleName", "in": "path", "description": "The name of the alert processing rule that needs to be fetched.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AlertProcessingRule" }, "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "GetAlertProcessingRuleById": { "$ref": "./examples/AlertProcessingRules_GetById.json" } } }, "put": { "operationId": "AlertProcessingRules_CreateOrUpdate", "tags": [ "AlertProcessingRules" ], "description": "Create or update an alert processing rule.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "alertProcessingRuleName", "in": "path", "description": "The name of the alert processing rule that needs to be fetched.", "required": true, "type": "string" }, { "name": "alertProcessingRule", "in": "body", "description": "Alert processing rule to be created/updated.", "required": true, "schema": { "$ref": "#/definitions/AlertProcessingRule" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AlertProcessingRule" }, "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/AlertProcessingRule" }, "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Create or update a rule that adds an action group to all alerts in a subscription": { "$ref": "./examples/AlertProcessingRules_Create_or_update_add_action_group_all_alerts_in_subscription.json" }, "Create or update a rule that adds two action groups to all Sev0 and Sev1 alerts in two resource groups": { "$ref": "./examples/AlertProcessingRules_Create_or_update_add_two_action_groups_all_Sev0_Sev1_two_resource_groups.json" }, "Create or update a rule that removes all action groups from alerts on a specific VM during a one-off maintenance window (1800-2000 at a specific date, Pacific Standard Time)": { "$ref": "./examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_specific_VM_one-off_maintenance_window.json" }, "Create or update a rule that removes all action groups from all alerts in a subscription coming from a specific alert rule": { "$ref": "./examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_from_specific_alert_rule.json" }, "Create or update a rule that removes all action groups from all alerts on any VM in two resource groups during a recurring maintenance window (2200-0400 every Sat and Sun, India Standard Time)": { "$ref": "./examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_recurring_maintenance_window.json" }, "Create or update a rule that removes all action groups outside business hours (Mon-Fri 09:00-17:00, Eastern Standard Time)": { "$ref": "./examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_outside_business_hours.json" } } }, "patch": { "operationId": "AlertProcessingRules_Update", "tags": [ "AlertProcessingRules" ], "description": "Enable, disable, or update tags for an alert processing rule.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "alertProcessingRuleName", "in": "path", "description": "The name of the alert processing rule that needs to be fetched.", "required": true, "type": "string" }, { "name": "alertProcessingRulePatch", "in": "body", "description": "Parameters supplied to the operation.", "required": true, "schema": { "$ref": "#/definitions/PatchObject" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AlertProcessingRule" }, "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "PatchAlertProcessingRule": { "$ref": "./examples/AlertProcessingRules_Patch.json" } } }, "delete": { "operationId": "AlertProcessingRules_Delete", "tags": [ "AlertProcessingRules" ], "description": "Delete an alert processing rule.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "alertProcessingRuleName", "in": "path", "description": "The name of the alert processing rule that needs to be fetched.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "204": { "description": "There is no content to send for this request, but the headers may be useful. ", "headers": { "x-ms-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, server-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeleteAlertProcessingRule": { "$ref": "./examples/AlertProcessingRules_Delete.json" } } } } }, "definitions": { "Action": { "type": "object", "description": "Action to be applied.", "properties": { "actionType": { "$ref": "#/definitions/ActionType", "description": "Action that should be applied." } }, "discriminator": "actionType", "required": [ "actionType" ] }, "ActionType": { "type": "string", "description": "Action that should be applied.", "enum": [ "AddActionGroups", "RemoveAllActionGroups" ], "x-ms-enum": { "name": "ActionType", "modelAsString": true, "values": [ { "name": "AddActionGroups", "value": "AddActionGroups", "description": "AddActionGroups" }, { "name": "RemoveAllActionGroups", "value": "RemoveAllActionGroups", "description": "RemoveAllActionGroups" } ] } }, "AddActionGroups": { "type": "object", "description": "Add action groups to alert processing rule.", "properties": { "actionGroupIds": { "type": "array", "description": "List of action group Ids to add to alert processing rule.", "items": { "type": "string" } } }, "required": [ "actionGroupIds" ], "allOf": [ { "$ref": "#/definitions/Action" } ], "x-ms-discriminator-value": "AddActionGroups" }, "AlertProcessingRule": { "type": "object", "description": "Alert processing rule object containing target scopes, conditions and scheduling logic.", "properties": { "properties": { "$ref": "#/definitions/AlertProcessingRuleProperties", "description": "Alert processing rule properties." } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" } ] }, "AlertProcessingRuleProperties": { "type": "object", "description": "Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule.", "properties": { "scopes": { "type": "array", "description": "Scopes on which alert processing rule will apply.", "items": { "type": "string" } }, "conditions": { "type": "array", "description": "Conditions on which alerts will be filtered.", "items": { "$ref": "#/definitions/Condition" }, "x-ms-identifiers": [] }, "schedule": { "$ref": "#/definitions/Schedule", "description": "Scheduling for alert processing rule." }, "actions": { "type": "array", "description": "Actions to be applied.", "items": { "$ref": "#/definitions/Action" }, "x-ms-identifiers": [] }, "description": { "type": "string", "description": "Actions to be applied.Description of alert processing rule." }, "enabled": { "type": "boolean", "description": "Indicates if the given alert processing rule is enabled or disabled.", "default": true } }, "required": [ "scopes", "actions" ] }, "AlertProcessingRulesList": { "type": "object", "description": "List of alert processing rules.", "properties": { "value": { "type": "array", "description": "The AlertProcessingRule items on this page", "items": { "$ref": "#/definitions/AlertProcessingRule" } }, "nextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "value" ] }, "Condition": { "type": "object", "description": "Condition to trigger an alert processing rule.", "properties": { "field": { "$ref": "#/definitions/Field", "description": "Field for a given condition." }, "operator": { "$ref": "#/definitions/Operator", "description": "Operator for a given condition." }, "values": { "type": "array", "description": "List of values to match for a given condition.", "items": { "type": "string" } } } }, "CreatedByType": { "type": "string", "description": "The type of identity that created the resource.", "enum": [ "User", "Application", "ManagedIdentity", "Key" ], "x-ms-enum": { "name": "CreatedByType", "modelAsString": true, "values": [ { "name": "User", "value": "User", "description": "User" }, { "name": "Application", "value": "Application", "description": "Application" }, { "name": "ManagedIdentity", "value": "ManagedIdentity", "description": "ManagedIdentity" }, { "name": "Key", "value": "Key", "description": "Key" } ] } }, "DailyRecurrence": { "type": "object", "description": "Daily recurrence object.", "allOf": [ { "$ref": "#/definitions/Recurrence" } ], "x-ms-discriminator-value": "Daily" }, "DaysOfWeek": { "type": "string", "description": "Days of week.", "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "x-ms-enum": { "name": "DaysOfWeek", "modelAsString": true, "values": [ { "name": "Sunday", "value": "Sunday", "description": "Sunday" }, { "name": "Monday", "value": "Monday", "description": "Monday" }, { "name": "Tuesday", "value": "Tuesday", "description": "Tuesday" }, { "name": "Wednesday", "value": "Wednesday", "description": "Wednesday" }, { "name": "Thursday", "value": "Thursday", "description": "Thursday" }, { "name": "Friday", "value": "Friday", "description": "Friday" }, { "name": "Saturday", "value": "Saturday", "description": "Saturday" } ] } }, "ErrorResponse": { "type": "object", "description": "An error response from the service.", "properties": { "error": { "$ref": "#/definitions/ErrorResponseBody", "description": "Details of error response." } } }, "ErrorResponseBody": { "type": "object", "description": "Details of error response.", "properties": { "code": { "type": "string", "description": "Error code, intended to be consumed programmatically." }, "message": { "type": "string", "description": "Description of the error, intended for display in user interface." }, "target": { "type": "string", "description": "Target of the particular error, for example name of the property." }, "details": { "type": "array", "description": "A list of additional details about the error.", "items": { "$ref": "#/definitions/ErrorResponseBody" }, "x-ms-identifiers": [] } } }, "Field": { "type": "string", "description": "Field for a given condition.", "enum": [ "Severity", "MonitorService", "MonitorCondition", "SignalType", "TargetResourceType", "TargetResource", "TargetResourceGroup", "AlertRuleId", "AlertRuleName", "Description", "AlertContext" ], "x-ms-enum": { "name": "Field", "modelAsString": true, "values": [ { "name": "Severity", "value": "Severity", "description": "Severity" }, { "name": "MonitorService", "value": "MonitorService", "description": "MonitorService" }, { "name": "MonitorCondition", "value": "MonitorCondition", "description": "MonitorCondition" }, { "name": "SignalType", "value": "SignalType", "description": "SignalType" }, { "name": "TargetResourceType", "value": "TargetResourceType", "description": "TargetResourceType" }, { "name": "TargetResource", "value": "TargetResource", "description": "TargetResource" }, { "name": "TargetResourceGroup", "value": "TargetResourceGroup", "description": "TargetResourceGroup" }, { "name": "AlertRuleId", "value": "AlertRuleId", "description": "AlertRuleId" }, { "name": "AlertRuleName", "value": "AlertRuleName", "description": "AlertRuleName" }, { "name": "Description", "value": "Description", "description": "Description" }, { "name": "AlertContext", "value": "AlertContext", "description": "AlertContext" } ] } }, "ManagedResource": { "type": "object", "description": "An azure managed resource object.", "properties": { "location": { "type": "string", "description": "Resource location", "x-ms-mutability": [ "read", "create" ] }, "tags": { "type": "object", "description": "Resource tags", "additionalProperties": { "type": "string" } } }, "required": [ "location" ], "allOf": [ { "$ref": "#/definitions/Resource" } ] }, "MonthlyRecurrence": { "type": "object", "description": "Monthly recurrence object.", "properties": { "daysOfMonth": { "type": "array", "description": "Specifies the values for monthly recurrence pattern.", "items": { "type": "integer", "format": "int32" } } }, "required": [ "daysOfMonth" ], "allOf": [ { "$ref": "#/definitions/Recurrence" } ], "x-ms-discriminator-value": "Monthly" }, "Operator": { "type": "string", "description": "Operator for a given condition.", "enum": [ "Equals", "NotEquals", "Contains", "DoesNotContain" ], "x-ms-enum": { "name": "Operator", "modelAsString": true, "values": [ { "name": "Equals", "value": "Equals", "description": "Equals" }, { "name": "NotEquals", "value": "NotEquals", "description": "NotEquals" }, { "name": "Contains", "value": "Contains", "description": "Contains" }, { "name": "DoesNotContain", "value": "DoesNotContain", "description": "DoesNotContain" } ] } }, "PatchObject": { "type": "object", "description": "Data contract for patch.", "properties": { "properties": { "$ref": "#/definitions/PatchProperties", "description": "Properties supported by patch operation.", "x-ms-client-flatten": true }, "tags": { "type": "object", "description": "Tags to be updated.", "additionalProperties": { "type": "string" } } } }, "PatchProperties": { "type": "object", "description": "Alert processing rule properties supported by patch.", "properties": { "enabled": { "type": "boolean", "description": "Indicates if the given alert processing rule is enabled or disabled." } } }, "Recurrence": { "type": "object", "description": "Recurrence object.", "properties": { "recurrenceType": { "$ref": "#/definitions/RecurrenceType", "description": "Specifies when the recurrence should be applied." }, "startTime": { "type": "string", "description": "Start time for recurrence." }, "endTime": { "type": "string", "description": "End time for recurrence." } }, "discriminator": "recurrenceType", "required": [ "recurrenceType" ] }, "RecurrenceType": { "type": "string", "description": "Specifies when the recurrence should be applied.", "enum": [ "Daily", "Weekly", "Monthly" ], "x-ms-enum": { "name": "RecurrenceType", "modelAsString": true, "values": [ { "name": "Daily", "value": "Daily", "description": "Daily" }, { "name": "Weekly", "value": "Weekly", "description": "Weekly" }, { "name": "Monthly", "value": "Monthly", "description": "Monthly" } ] } }, "RemoveAllActionGroups": { "type": "object", "description": "Indicates if all action groups should be removed.", "allOf": [ { "$ref": "#/definitions/Action" } ], "x-ms-discriminator-value": "RemoveAllActionGroups" }, "Resource": { "type": "object", "description": "An azure resource object", "properties": { "id": { "type": "string", "description": "Azure resource Id", "readOnly": true }, "type": { "type": "string", "description": "Azure resource type", "readOnly": true }, "name": { "type": "string", "description": "Azure resource name", "readOnly": true } } }, "Schedule": { "type": "object", "description": "Scheduling configuration for a given alert processing rule.", "properties": { "effectiveFrom": { "type": "string", "description": "Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix.", "pattern": "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$" }, "effectiveUntil": { "type": "string", "description": "Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix.", "pattern": "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$" }, "timeZone": { "type": "string", "description": "Scheduling time zone." }, "recurrences": { "type": "array", "description": "List of recurrences.", "items": { "$ref": "#/definitions/Recurrence" }, "x-ms-identifiers": [] } } }, "WeeklyRecurrence": { "type": "object", "description": "Weekly recurrence object.", "properties": { "daysOfWeek": { "type": "array", "description": "Specifies the values for weekly recurrence pattern.", "items": { "$ref": "#/definitions/DaysOfWeek" } } }, "required": [ "daysOfWeek" ], "allOf": [ { "$ref": "#/definitions/Recurrence" } ], "x-ms-discriminator-value": "Weekly" } }, "parameters": {} }