diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/activityLogAlerts_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/activityLogAlerts_API.json new file mode 100644 index 000000000000..7018d590053f --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/activityLogAlerts_API.json @@ -0,0 +1,570 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Activity Log Alerts API", + "description": "API for Azure Activity Log Alert rules CRUD operations.", + "version": "2023-01-01-preview", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + } + }, + "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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}": { + "put": { + "description": "Create a new Activity Log Alert rule or update an existing one.", + "operationId": "ActivityLogAlerts_CreateOrUpdate", + "x-ms-examples": { + "Create or update an Activity Log Alert rule": { + "$ref": "./examples/ActivityLogAlertRule_CreateOrUpdate.json" + }, + "Create or update an Activity Log Alert rule with 'anyOf' condition": { + "$ref": "./examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json" + }, + "Create or update an Activity Log Alert rule with 'containsAny'": { + "$ref": "./examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json" + }, + "Create or update an Activity Log Alert rule for tenant level events": { + "$ref": "./examples/ActivityLogAlertRule_CreateOrUpdateTenantLevelServiceHealthRule.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ActivityLogAlertNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "activityLogAlertRule", + "description": "The Activity Log Alert rule to create or use for the update.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ActivityLogAlertResource" + } + } + ], + "responses": { + "200": { + "description": "An existing Activity Log Alert rule was successfully updated.", + "schema": { + "$ref": "#/definitions/ActivityLogAlertResource" + } + }, + "201": { + "description": "A new Activity Log Alert rule was successfully created.", + "schema": { + "$ref": "#/definitions/ActivityLogAlertResource" + } + }, + "default": { + "description": "An error occurred and the Activity Log Alert rule could not be created or updated.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "description": "Get an Activity Log Alert rule.", + "operationId": "ActivityLogAlerts_Get", + "x-ms-examples": { + "Get an Activity Log Alert rule": { + "$ref": "./examples/ActivityLogAlertRule_Get.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ActivityLogAlertNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/ActivityLogAlertResource" + } + }, + "default": { + "description": "An error occurred and the Activity Log Alert rule could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "description": "Delete an Activity Log Alert rule.", + "operationId": "ActivityLogAlerts_Delete", + "x-ms-examples": { + "Delete an Activity Log Alert rule": { + "$ref": "./examples/ActivityLogAlertRule_Delete.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ActivityLogAlertNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Activity Log Alert rule was successfully deleted." + }, + "204": { + "description": "The Activity Log Alert rule does not exist. It may have already been deleted." + }, + "default": { + "description": "An error occurred and the Activity Log Alert rule could not be deleted.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "description": "Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.", + "operationId": "ActivityLogAlerts_Update", + "x-ms-examples": { + "Patch an Activity Log Alert rule": { + "$ref": "./examples/ActivityLogAlertRule_Update.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ActivityLogAlertNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "activityLogAlertRulePatch", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AlertRulePatchObject" + }, + "description": "Parameters supplied to the operation." + } + ], + "responses": { + "200": { + "description": "An existing Activity Log Alert rule was successfully updated.", + "schema": { + "$ref": "#/definitions/ActivityLogAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts": { + "get": { + "description": "Get a list of all Activity Log Alert rules in a subscription.", + "operationId": "ActivityLogAlerts_ListBySubscriptionId", + "x-ms-examples": { + "Get list of all Activity Log Alert rules under a subscription": { + "$ref": "./examples/ActivityLogAlertRule_ListBySubscriptionId.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/AlertRuleList" + } + }, + "default": { + "description": "An error occurred and the list of Activity Log Alert rules could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts": { + "get": { + "description": "Get a list of all Activity Log Alert rules in a resource group.", + "operationId": "ActivityLogAlerts_ListByResourceGroup", + "x-ms-examples": { + "List activity log alerts": { + "$ref": "./examples/ActivityLogAlertRule_ListByResourceGroupName.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/AlertRuleList" + } + }, + "default": { + "description": "An error occurred and the list of Activity Log Alert rules could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "AzureResource": { + "description": "An Azure resource object.", + "x-ms-azure-resource": true, + "type": "object", + "properties": { + "id": { + "description": "The resource Id.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "The name of the resource.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The type of the resource.", + "type": "string", + "readOnly": true + }, + "location": { + "description": "The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.", + "type": "string", + "default": "global", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "tags": { + "description": "The tags of the resource.", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ActivityLogAlertResource": { + "type": "object", + "description": "An Activity Log Alert rule resource.", + "allOf": [ + { + "$ref": "#/definitions/AzureResource" + } + ], + "properties": { + "properties": { + "description": "The Activity Log Alert rule properties of the resource.", + "x-ms-client-flatten": true, + "$ref": "#/definitions/AlertRuleProperties" + } + } + }, + "AlertRuleList": { + "type": "object", + "description": "A list of Activity Log Alert rules.", + "properties": { + "value": { + "description": "The list of Activity Log Alert rules.", + "type": "array", + "items": { + "$ref": "#/definitions/ActivityLogAlertResource" + }, + "x-ms-identifiers": [ + "id" + ] + }, + "nextLink": { + "description": "Provides the link to retrieve the next set of elements.", + "type": "string" + } + } + }, + "AlertRuleProperties": { + "description": "An Azure Activity Log Alert rule.", + "type": "object", + "properties": { + "tenantScope": { + "description": "The tenant GUID. Must be provided for tenant-level and management group events rules.", + "type": "string" + }, + "scopes": { + "description": "A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", + "type": "array", + "items": { + "type": "string" + } + }, + "condition": { + "description": "The condition that will cause this alert to activate.", + "$ref": "#/definitions/AlertRuleAllOfCondition" + }, + "actions": { + "description": "The actions that will activate when the condition is met.", + "$ref": "#/definitions/ActionList" + }, + "enabled": { + "description": "Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", + "type": "boolean", + "default": true + }, + "description": { + "description": "A description of this Activity Log Alert rule.", + "type": "string" + } + }, + "required": [ + "condition", + "actions" + ] + }, + "AlertRuleAllOfCondition": { + "description": "An Activity Log Alert rule condition that is met when all its member conditions are met.", + "type": "object", + "properties": { + "allOf": { + "description": "The list of Activity Log Alert rule conditions.", + "type": "array", + "items": { + "$ref": "#/definitions/AlertRuleAnyOfOrLeafCondition" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "allOf" + ] + }, + "AlertRuleAnyOfOrLeafCondition": { + "description": "An Activity Log Alert rule condition that is met when all its member conditions are met.\nEach condition can be of one of the following types:\n__Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition.\n * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'.\n _Please note, 'anyOf' should __not__ be set in a Leaf Condition._\n * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions).\n _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._\n", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/AlertRuleLeafCondition" + } + ], + "properties": { + "anyOf": { + "title": "An Activity Log Alert rule 'anyOf' condition.", + "description": "An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met.", + "type": "array", + "items": { + "$ref": "#/definitions/AlertRuleLeafCondition" + }, + "x-ms-identifiers": [] + } + } + }, + "AlertRuleLeafCondition": { + "description": "An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event.\nThis condition must contain 'field' and either 'equals' or 'containsAny'.", + "type": "object", + "properties": { + "field": { + "description": "The name of the Activity Log event's field that this condition will examine.\nThe possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.", + "type": "string" + }, + "equals": { + "description": "The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.", + "type": "string" + }, + "containsAny": { + "description": "The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ActionList": { + "type": "object", + "description": "A list of Activity Log Alert rule actions.", + "properties": { + "actionGroups": { + "description": "The list of the Action Groups.", + "type": "array", + "items": { + "$ref": "#/definitions/ActionGroup" + }, + "x-ms-identifiers": [ + "actionGroupId" + ] + } + } + }, + "ActionGroup": { + "type": "object", + "description": "A pointer to an Azure Action Group.", + "properties": { + "actionGroupId": { + "description": "The resource ID of the Action Group. This cannot be null or empty.", + "type": "string" + }, + "webhookProperties": { + "type": "object", + "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.", + "additionalProperties": { + "type": "string" + } + }, + "actionProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Predefined list of properties and configuration items for the action group." + } + }, + "required": [ + "actionGroupId" + ] + }, + "AlertRulePatchObject": { + "type": "object", + "description": "An Activity Log Alert rule object for the body of patch operations.", + "properties": { + "tags": { + "type": "object", + "description": "The resource tags", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AlertRulePatchProperties", + "description": "The activity log alert settings for an update operation." + } + } + }, + "AlertRulePatchProperties": { + "type": "object", + "description": "An Activity Log Alert rule properties for patch operations.", + "properties": { + "enabled": { + "description": "Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", + "type": "boolean", + "default": true + } + } + }, + "ErrorResponse": { + "description": "The error response.", + "type": "object", + "properties": { + "code": { + "description": "The error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "The error message indicating why the operation failed.", + "type": "string", + "readOnly": true + } + } + } + }, + "parameters": { + "ActivityLogAlertNameParameter": { + "name": "activityLogAlertName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$", + "description": "The name of the Activity Log Alert rule.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdate.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdate.json new file mode 100644 index 000000000000..d69dec9778e5 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdate.json @@ -0,0 +1,130 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertRule", + "api-version": "2023-01-01-preview", + "activityLogAlertRule": { + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "/subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "Category", + "equals": "Administrative" + }, + { + "field": "Level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "Category", + "equals": "Administrative" + }, + { + "field": "Level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json new file mode 100644 index 000000000000..5e6ac6312f27 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json @@ -0,0 +1,154 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertRuleWithAnyOfCondition", + "api-version": "2023-01-01-preview", + "activityLogAlertRule": { + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + }, + { + "anyOf": [ + { + "field": "properties.incidentType", + "equals": "Incident" + }, + { + "field": "properties.incidentType", + "equals": "Maintenance" + } + ] + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule with 'anyOf' condition." + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRuleWithAnyOfCondition", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRuleWithAnyOfCondition", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + }, + { + "anyOf": [ + { + "field": "properties.incidentType", + "equals": "Incident" + }, + { + "field": "properties.incidentType", + "equals": "Maintenance" + } + ] + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule with 'anyOf' condition." + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRuleWithAnyOfCondition", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRuleWithAnyOfCondition", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + }, + { + "anyOf": [ + { + "field": "properties.incidentType", + "equals": "Incident" + }, + { + "field": "properties.incidentType", + "equals": "Maintenance" + } + ] + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule with 'anyOf' condition." + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json new file mode 100644 index 000000000000..7f0b58bef4be --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json @@ -0,0 +1,139 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertRuleWithContainsAny", + "api-version": "2023-01-01-preview", + "activityLogAlertRule": { + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + }, + { + "field": "properties.impactedServices[*].ImpactedRegions[*].RegionName", + "containsAny": [ + "North Europe", + "West Europe" + ] + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule with 'containsAny'." + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRuleWithContainsAny", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRuleWithContainsAny", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + }, + { + "field": "properties.impactedServices[*].ImpactedRegions[*].RegionName", + "containsAny": [ + "North Europe", + "West Europe" + ] + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule with 'containsAny'." + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRuleWithContainsAny", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRuleWithContainsAny", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + }, + { + "field": "properties.impactedServices[*].ImpactedRegions[*].RegionName", + "containsAny": [ + "North Europe", + "West Europe" + ] + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule with 'containsAny'." + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateTenantLevelServiceHealthRule.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateTenantLevelServiceHealthRule.json new file mode 100644 index 000000000000..69d4456d2b31 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_CreateOrUpdateTenantLevelServiceHealthRule.json @@ -0,0 +1,112 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertSHRuleOnTenantLevel", + "api-version": "2023-01-01-preview", + "activityLogAlertRule": { + "location": "Global", + "tags": {}, + "properties": { + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert service health rule on tenant level events." + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "tags": {}, + "properties": { + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert service health rule on tenant level events." + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "tags": {}, + "properties": { + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert service health rule on tenant level events." + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Delete.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Delete.json new file mode 100644 index 000000000000..a2f15cafa3d2 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Delete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertRule", + "api-version": "2023-01-01-preview" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Get.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Get.json new file mode 100644 index 000000000000..5a070a3e63b1 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Get.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertRule", + "api-version": "2023-01-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_ListByResourceGroupName.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_ListByResourceGroupName.json new file mode 100644 index 000000000000..17d1efaaac2b --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_ListByResourceGroupName.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "api-version": "2023-01-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule1", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule1", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + }, + { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule2", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule2", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "status", + "equals": "Succeeded" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": {}, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + } + ] + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_ListBySubscriptionId.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_ListBySubscriptionId.json new file mode 100644 index 000000000000..e341e99a3bbd --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_ListBySubscriptionId.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "api-version": "2023-01-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup1/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule1", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule1", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup1/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + }, + { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule2", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule2", + "location": "Global", + "tags": {}, + "properties": { + "scopes": [ + "subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "status", + "equals": "Succeeded" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": {}, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": true, + "description": "Description of sample Activity Log Alert rule." + } + } + ] + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Update.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Update.json new file mode 100644 index 000000000000..2d94230208a3 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-01-01-preview/examples/ActivityLogAlertRule_Update.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "MyResourceGroup", + "activityLogAlertName": "SampleActivityLogAlertRule", + "api-version": "2023-01-01-preview", + "activityLogAlertRulePatch": { + "tags": { + "key1": "value1", + "key2": "value2" + }, + "properties": { + "enabled": false + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule", + "type": "Microsoft.Insights/ActivityLogAlerts", + "name": "SampleActivityLogAlertRule", + "location": "Global", + "tags": { + "key1": "value1", + "key2": "value2" + }, + "properties": { + "scopes": [ + "/subscriptions/187f412d-1758-44d9-b052-169e2564721d" + ], + "condition": { + "allOf": [ + { + "field": "category", + "equals": "Administrative" + }, + { + "field": "level", + "equals": "Error" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup", + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + }, + "actionProperties": { + "Email.Title": "my email title" + } + } + ] + }, + "enabled": false, + "description": "Description of sample Activity Log Alert rule." + } + } + } + } +} diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 9409ddda6128..29f5088ec130 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -53,6 +53,15 @@ input-file: - Microsoft.Insights/stable/2023-01-01/actionGroups_API.json ``` + +### Tag: package-preview-2023-01 + +These settings apply only when `--tag=package-preview-2023-01` is specified on the command line. + +```yaml $(tag) == 'package-preview-2023-01' +input-file: + - Microsoft.Insights/preview/2023-01-01-preview/activityLogAlerts_API.json +``` ### Tag: package-2022-08-01-preview-only These settings apply only when `--tag=package-2022-08-01-preview-only` is specified on the command line @@ -99,7 +108,7 @@ input-file: These settings apply only when `--tag=package-preview-2022-08` is specified on the command line. -```yaml $(tag) == 'package-preview-2022-08' +``` yaml $(tag) == 'package-preview-2022-08' input-file: - Microsoft.Insights/stable/2022-10-01/autoscale_API.json - Microsoft.Insights/stable/2015-04-01/operations_API.json @@ -127,6 +136,7 @@ input-file: - Microsoft.Monitor/preview/2021-06-03-preview/monitoringAccounts_API.json - Microsoft.Monitor/preview/2021-06-03-preview/operations_API.json ``` + ### Tag: package-composite-v1 These settings apply only when `--tag=package-composite-v1` is specified on the command line.