diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/TenantActivityLogAlertResource.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/TenantActivityLogAlertResource.tsp new file mode 100644 index 000000000000..7827142453bd --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/TenantActivityLogAlertResource.tsp @@ -0,0 +1,93 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.AlertsManagement; +/** + * A Tenant Activity Log Alert rule resource. + */ +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model TenantActivityLogAlertResource + is Azure.ResourceManager.Legacy.TrackedResourceWithOptionalLocation< + AlertRuleProperties, + false + > { + ...ResourceNameParameter< + Resource = TenantActivityLogAlertResource, + KeyName = "alertRuleName", + SegmentName = "tenantActivityLogAlerts", + NamePattern = "^[-\\w\\._\\(\\)]+$" + >; +} + +@armResourceOperations +interface TenantActivityLogAlertResources { + /** + * Get a list of all Tenant Activity Log Alert rules in the tenant. + */ + listByTenant is Extension.ListByTarget< + Extension.Tenant, + TenantActivityLogAlertResource, + Response = ArmResponse + >; + + /** + * Get Tenant Activity Log Alert rule. + */ + get is Extension.Read; + + /** + * Create a new Tenant Activity Log Alert rule or update an existing one. + */ + createOrUpdate is Extension.CreateOrReplaceSync< + ManagementGroup, + TenantActivityLogAlertResource + >; + + /** + * Updates 'tags' and 'enabled' fields in an existing Tenant 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. + */ + @patch(#{ implicitOptionality: false }) + update is Extension.CustomPatchSync< + ManagementGroup, + TenantActivityLogAlertResource, + PatchModel = TenantAlertRulePatchObject + >; + + /** + * Delete a Tenant Activity Log Alert rule. + */ + delete is Extension.DeleteSync< + ManagementGroup, + TenantActivityLogAlertResource + >; + + /** + * Get a list of all Tenant Activity Log Alert rules in a management group. + */ + listByManagementGroup is Extension.ListByTarget< + ManagementGroup, + TenantActivityLogAlertResource, + Response = ArmResponse + >; +} + +@@doc(TenantActivityLogAlertResource.name, + "The name of the Tenant Activity Log Alert rule." +); +@@doc(TenantActivityLogAlertResource.properties, + "The Activity Log Alert rule properties of the resource." +); +@@doc(TenantActivityLogAlertResources.createOrUpdate::parameters.resource, + "The Tenant Activity Log Alert rule to create or use for the update." +); +@@doc(TenantActivityLogAlertResources.update::parameters.properties, + "Parameters supplied to the operation." +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/back-compatible.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/back-compatible.tsp new file mode 100644 index 000000000000..6e6e15680b3f --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/back-compatible.tsp @@ -0,0 +1,34 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.AlertsManagement; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@Legacy.flattenProperty(TenantAlertRulePatchObject.properties); + +@@clientLocation(TenantActivityLogAlertResources.get, + "TenantActivityLogAlerts" +); +@@clientLocation(TenantActivityLogAlertResources.createOrUpdate, + "TenantActivityLogAlerts" +); +@@clientName(TenantActivityLogAlertResources.createOrUpdate::parameters.resource, + "tenantActivityLogAlertRule" +); +@@clientLocation(TenantActivityLogAlertResources.update, + "TenantActivityLogAlerts" +); +@@clientName(TenantActivityLogAlertResources.update::parameters.properties, + "tenantActivityLogAlertRulePatch" +); +@@clientLocation(TenantActivityLogAlertResources.delete, + "TenantActivityLogAlerts" +); +@@clientLocation(TenantActivityLogAlertResources.listByManagementGroup, + "TenantActivityLogAlerts" +); +@@clientLocation(TenantActivityLogAlertResources.listByTenant, + "TenantActivityLogAlerts" +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@Legacy.flattenProperty(TenantActivityLogAlertResource.properties); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/client.tsp new file mode 100644 index 000000000000..e0164170e72d --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/client.tsp @@ -0,0 +1,9 @@ +import "./main.tsp"; +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; + +@@clientName(Microsoft.AlertsManagement, + "TenantActivityLogAlertsMgmtClient", + "python" +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_CreateOrUpdate.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_CreateOrUpdate.json new file mode 100644 index 000000000000..58df35d11f20 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_CreateOrUpdate.json @@ -0,0 +1,113 @@ +{ + "parameters": { + "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "tenantActivityLogAlertRule": { + "location": "Global", + "properties": { + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "actionProperties": { + "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + } + } + ] + }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, + "enabled": true, + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + } + }, + "responses": { + "200": { + "body": { + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "properties": { + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "actionProperties": { + "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + } + } + ] + }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, + "enabled": true, + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + }, + "headers": {} + }, + "201": { + "body": { + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "properties": { + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "actionProperties": { + "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + } + } + ] + }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, + "enabled": true, + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + }, + "headers": {} + } + }, + "operationId": "TenantActivityLogAlerts_CreateOrUpdate", + "title": "Create or update a Tenant Activity Log Alert rule for tenant level events" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_DeleteRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_DeleteRule.json new file mode 100644 index 000000000000..6175109d3f61 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_DeleteRule.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "responses": { + "200": {}, + "204": {} + }, + "operationId": "TenantActivityLogAlerts_Delete", + "title": "Delete a Tenant Activity Log Alert rule" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_GetRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_GetRule.json new file mode 100644 index 000000000000..022b30999563 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_GetRule.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "responses": { + "200": { + "body": { + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "properties": { + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "actionProperties": { + "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + } + } + ] + }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, + "enabled": true, + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + }, + "headers": {} + } + }, + "operationId": "TenantActivityLogAlerts_Get", + "title": "Get a Tenant Activity Log Alert rule" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_ListByManagementGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_ListByManagementGroup.json new file mode 100644 index 000000000000..4858d8094ea8 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_ListByManagementGroup.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "properties": { + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "actionProperties": { + "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + } + } + ] + }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, + "enabled": true, + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + } + ] + }, + "headers": {} + } + }, + "operationId": "TenantActivityLogAlerts_ListByManagementGroup", + "title": "List Activity Log Alerts by management group" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_ListByTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_ListByTenant.json new file mode 100644 index 000000000000..bb81cdae6a5a --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_ListByTenant.json @@ -0,0 +1,82 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "tags": {}, + "properties": { + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/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." + } + }, + { + "id": "/providers/Microsoft.Management/ManagementGroups/MyManagementGroup/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "tags": {}, + "properties": { + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "condition": { + "allOf": [ + { + "field": "category", + "equals": "ServiceHealth" + } + ] + }, + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/MyManagementGroup/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." + } + } + ] + } + } + }, + "operationId": "TenantActivityLogAlerts_ListByTenant", + "title": "List Activity Log Alerts by tenant" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_UpdateRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_UpdateRule.json new file mode 100644 index 000000000000..290caedfd4a0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/examples/2023-04-01-preview/TenantActivityLogAlertRule_UpdateRule.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "tenantActivityLogAlertRulePatch": { + "properties": { + "enabled": false + }, + "tags": { + "key1": "value1", + "key2": "value2" + } + } + }, + "responses": { + "200": { + "body": { + "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", + "location": "Global", + "properties": { + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", + "actions": { + "actionGroups": [ + { + "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", + "actionProperties": { + "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" + } + } + ] + }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, + "enabled": false, + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": { + "key1": "value1", + "key2": "value2" + } + }, + "headers": {} + } + }, + "operationId": "TenantActivityLogAlerts_Update", + "title": "Patch a Tenant Activity Log Alert rule" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/main.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/main.tsp new file mode 100644 index 000000000000..8581edd08522 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/main.tsp @@ -0,0 +1,44 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.12 + * Date: 2025-12-09T08:20:16.730Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./TenantActivityLogAlertResource.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * Tenant Level Activity Log Alert Rules provides rules creation on management group level. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@armProviderNamespace +@service(#{ + title: "Tenant Level Activity Log Alert Rules in AlertsManagement Resource Provider", +}) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) +namespace Microsoft.AlertsManagement; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2023-04-01-preview API version. + */ + v2023_04_01_preview: "2023-04-01-preview", +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/models.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/models.tsp new file mode 100644 index 000000000000..9000a795e37e --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/models.tsp @@ -0,0 +1,211 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-azure-core"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.AlertsManagement; + +@tenantResource +@armVirtualResource("Microsoft.Management") +model ManagementGroup { + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + @minLength(1) + @maxLength(90) + @segment("managementGroups") + @key(ParameterName) + @doc("The management group ID.") + name: string; +} + +/** + * An Azure Activity Log Alert rule. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertRuleProperties { + /** + * The tenant GUID. Must be provided for tenant-level and management group events rules. + */ + tenantScope?: string; + + /** + * 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. + */ + scopes?: string[]; + + /** + * The condition that will cause this alert to activate. + */ + condition: AlertRuleAllOfCondition; + + /** + * The actions that will activate when the condition is met. + */ + actions: ActionList; + + /** + * 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. + */ + enabled?: boolean = true; + + /** + * A description of this Activity Log Alert rule. + */ + description?: string; +} + +/** + * An Activity Log Alert rule condition that is met when all its member conditions are met. + */ +model AlertRuleAllOfCondition { + /** + * The list of Activity Log Alert rule conditions. + */ + @identifiers(#[]) + allOf: AlertRuleAnyOfOrLeafCondition[]; +} + +/** + * An Activity Log Alert rule condition that is met when all its member conditions are met. + * Each condition can be of one of the following types: + * __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. + * * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. + * _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ + * * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions). + * _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ + * + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertRuleAnyOfOrLeafCondition extends AlertRuleLeafCondition { + /** + * An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + */ + @identifiers(#[]) + anyOf?: AlertRuleLeafCondition[]; +} + +/** + * An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event. + * This condition must contain 'field' and either 'equals' or 'containsAny'. + */ +model AlertRuleLeafCondition { + /** + * The name of the Activity Log event's field that this condition will examine. + * The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + */ + field?: string; + + /** + * The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. + */ + equals?: string; + + /** + * 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. + */ + containsAny?: string[]; +} + +/** + * A list of Activity Log Alert rule actions. + */ +model ActionList { + /** + * The list of the Action Groups. + */ + @identifiers(#["actionGroupId"]) + actionGroups?: ActionGroup[]; +} + +/** + * A pointer to an Azure Action Group. + */ +model ActionGroup { + /** + * The resource ID of the Action Group. This cannot be null or empty. + */ + actionGroupId: string; + + /** + * the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + webhookProperties?: Record; + + /** + * Predefined list of properties and configuration items for the action group. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + actionProperties?: Record; +} + +/** + * An Azure resource object. + */ +model AzureResource { + /** + * The resource Id. + */ + @visibility(Lifecycle.Read) + id?: string; + + /** + * The name of the resource. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * The type of the resource. + */ + @visibility(Lifecycle.Read) + type?: string; + + /** + * The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + location?: string = "global"; + + /** + * The tags of the resource. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tags?: Record; +} + +/** + * An Activity Log Alert rule object for the body of patch operations. + */ +model TenantAlertRulePatchObject { + /** + * The resource tags + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tags?: Record; + + /** + * The activity log alert settings for an update operation. + */ + properties?: TenantAlertRulePatchProperties; +} + +/** + * An Activity Log Alert rule properties for patch operations. + */ +model TenantAlertRulePatchProperties { + /** + * 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. + */ + enabled?: boolean = true; +} + +/** + * A list of Tenant Activity Log Alert rules. + */ +model TenantAlertRuleList is Azure.Core.Page; diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/TenantActivityLogAlerts.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/TenantActivityLogAlerts.json index 66c8d4dd325c..03508254c6b1 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/TenantActivityLogAlerts.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/TenantActivityLogAlerts.json @@ -1,18 +1,23 @@ { "swagger": "2.0", "info": { - "version": "2023-04-01-preview", "title": "Tenant Level Activity Log Alert Rules in AlertsManagement Resource Provider", - "description": "Tenant Level Activity Log Alert Rules provides rules creation on management group level." + "version": "2023-04-01-preview", + "description": "Tenant Level Activity Log Alert Rules provides rules creation on management group level.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] }, - "host": "management.azure.com", "schemes": [ "https" ], - "consumes": [ + "host": "management.azure.com", + "produces": [ "application/json" ], - "produces": [ + "consumes": [ "application/json" ], "security": [ @@ -25,370 +30,371 @@ "securityDefinitions": { "azure_auth": { "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, + "tags": [ + { + "name": "TenantActivityLogAlertResources" + } + ], "paths": { - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.AlertsManagement/tenantActivityLogAlerts/{alertRuleName}": { - "put": { - "description": "Create a new Tenant Activity Log Alert rule or update an existing one.", - "operationId": "TenantActivityLogAlerts_CreateOrUpdate", - "x-ms-examples": { - "Create or update a Tenant Activity Log Alert rule for tenant level events": { - "$ref": "./examples/TenantActivityLogAlertRule_CreateOrUpdate.json" - } - }, + "/providers/Microsoft.AlertsManagement/tenantActivityLogAlerts": { + "get": { + "operationId": "TenantActivityLogAlerts_ListByTenant", + "tags": [ + "TenantActivityLogAlertResources" + ], + "description": "Get a list of all Tenant Activity Log Alert rules in the tenant.", "parameters": [ - { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/TenantActivityLogAlertNameParameter" - }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "tenantActivityLogAlertRule", - "description": "The Tenant Activity Log Alert rule to create or use for the update.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TenantActivityLogAlertResource" - } } ], "responses": { "200": { - "description": "An existing Tenant Activity Log Alert rule was successfully updated.", - "schema": { - "$ref": "#/definitions/TenantActivityLogAlertResource" - } - }, - "201": { - "description": "A new Tenant Activity Log Alert rule was successfully created.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/TenantActivityLogAlertResource" + "$ref": "#/definitions/TenantAlertRuleList" } }, "default": { - "description": "An error occurred and the Activity Log Alert rule could not be created or updated.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - } - }, - "get": { - "description": "Get Tenant Activity Log Alert rule.", - "operationId": "TenantActivityLogAlerts_Get", + }, "x-ms-examples": { - "Get a Tenant Activity Log Alert rule": { - "$ref": "./examples/TenantActivityLogAlertRule_GetRule.json" + "List Activity Log Alerts by tenant": { + "$ref": "./examples/TenantActivityLogAlertRule_ListByTenant.json" } }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.AlertsManagement/tenantActivityLogAlerts": { + "get": { + "operationId": "TenantActivityLogAlerts_ListByManagementGroup", + "tags": [ + "TenantActivityLogAlertResources" + ], + "description": "Get a list of all Tenant Activity Log Alert rules in a management group.", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/TenantActivityLogAlertNameParameter" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "name": "managementGroupName", + "in": "path", + "description": "The management group ID.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 } ], "responses": { "200": { - "description": "The request succeeded.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/TenantActivityLogAlertResource" + "$ref": "#/definitions/TenantAlertRuleList" } }, "default": { - "description": "An error occurred and the Activity Log Alert rule could not be retrieved.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - } - }, - "delete": { - "description": "Delete a Tenant Activity Log Alert rule.", - "operationId": "TenantActivityLogAlerts_Delete", + }, "x-ms-examples": { - "Delete a Tenant Activity Log Alert rule": { - "$ref": "./examples/TenantActivityLogAlertRule_DeleteRule.json" + "List Activity Log Alerts by management group": { + "$ref": "./examples/TenantActivityLogAlertRule_ListByManagementGroup.json" } }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.AlertsManagement/tenantActivityLogAlerts/{alertRuleName}": { + "get": { + "operationId": "TenantActivityLogAlerts_Get", + "tags": [ + "TenantActivityLogAlertResources" + ], + "description": "Get Tenant Activity Log Alert rule.", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/TenantActivityLogAlertNameParameter" + "name": "managementGroupName", + "in": "path", + "description": "The management group ID.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 }, { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "name": "alertRuleName", + "in": "path", + "description": "The name of the Tenant Activity Log Alert rule.", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$" } ], "responses": { "200": { - "description": "The Tenant Activity Log Alert rule was successfully deleted." - }, - "204": { - "description": "The Tenant Activity Log Alert rule does not exist. It may have already been deleted." + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/TenantActivityLogAlertResource" + } }, "default": { - "description": "An error occurred and the Activity Log Alert rule could not be deleted.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - } - }, - "patch": { - "description": "Updates 'tags' and 'enabled' fields in an existing Tenant 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": "TenantActivityLogAlerts_Update", + }, "x-ms-examples": { - "Patch a Tenant Activity Log Alert rule": { - "$ref": "./examples/TenantActivityLogAlertRule_UpdateRule.json" + "Get a Tenant Activity Log Alert rule": { + "$ref": "./examples/TenantActivityLogAlertRule_GetRule.json" } - }, + } + }, + "put": { + "operationId": "TenantActivityLogAlerts_CreateOrUpdate", + "tags": [ + "TenantActivityLogAlertResources" + ], + "description": "Create a new Tenant Activity Log Alert rule or update an existing one.", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/TenantActivityLogAlertNameParameter" + "name": "managementGroupName", + "in": "path", + "description": "The management group ID.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 }, { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "name": "alertRuleName", + "in": "path", + "description": "The name of the Tenant Activity Log Alert rule.", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$" }, { - "name": "tenantActivityLogAlertRulePatch", + "name": "tenantActivityLogAlertRule", "in": "body", + "description": "The Tenant Activity Log Alert rule to create or use for the update.", "required": true, "schema": { - "$ref": "#/definitions/TenantAlertRulePatchObject" - }, - "description": "Parameters supplied to the operation." + "$ref": "#/definitions/TenantActivityLogAlertResource" + } } ], "responses": { "200": { - "description": "An existing Activity Log Alert rule was successfully updated.", + "description": "Resource 'TenantActivityLogAlertResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/TenantActivityLogAlertResource" + } + }, + "201": { + "description": "Resource 'TenantActivityLogAlertResource' create operation succeeded", "schema": { "$ref": "#/definitions/TenantActivityLogAlertResource" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - } - } - }, - "/providers/Microsoft.AlertsManagement/tenantActivityLogAlerts": { - "get": { - "description": "Get a list of all Tenant Activity Log Alert rules in the tenant.", - "operationId": "TenantActivityLogAlerts_ListByTenant", + }, "x-ms-examples": { - "List Activity Log Alerts by tenant": { - "$ref": "./examples/TenantActivityLogAlertRule_ListByTenant.json" + "Create or update a Tenant Activity Log Alert rule for tenant level events": { + "$ref": "./examples/TenantActivityLogAlertRule_CreateOrUpdate.json" } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, + } + }, + "patch": { + "operationId": "TenantActivityLogAlerts_Update", + "tags": [ + "TenantActivityLogAlertResources" + ], + "description": "Updates 'tags' and 'enabled' fields in an existing Tenant 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.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The management group ID.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 + }, + { + "name": "alertRuleName", + "in": "path", + "description": "The name of the Tenant Activity Log Alert rule.", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$" + }, + { + "name": "tenantActivityLogAlertRulePatch", + "in": "body", + "description": "Parameters supplied to the operation.", + "required": true, + "schema": { + "$ref": "#/definitions/TenantAlertRulePatchObject" + } } ], "responses": { "200": { - "description": "The request succeeded.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/TenantAlertRuleList" + "$ref": "#/definitions/TenantActivityLogAlertResource" } }, "default": { - "description": "An error occurred and the list of Activity Log Alert rules could not be retrieved.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.AlertsManagement/tenantActivityLogAlerts": { - "get": { - "description": "Get a list of all Tenant Activity Log Alert rules in a management group.", - "operationId": "TenantActivityLogAlerts_ListByManagementGroup", + }, "x-ms-examples": { - "List Activity Log Alerts by management group": { - "$ref": "./examples/TenantActivityLogAlertRule_ListByManagementGroup.json" + "Patch a Tenant Activity Log Alert rule": { + "$ref": "./examples/TenantActivityLogAlertRule_UpdateRule.json" } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, + } + }, + "delete": { + "operationId": "TenantActivityLogAlerts_Delete", + "tags": [ + "TenantActivityLogAlertResources" + ], + "description": "Delete a Tenant Activity Log Alert rule.", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "name": "managementGroupName", + "in": "path", + "description": "The management group ID.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 + }, + { + "name": "alertRuleName", + "in": "path", + "description": "The name of the Tenant Activity Log Alert rule.", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$" } ], "responses": { "200": { - "description": "The request succeeded.", - "schema": { - "$ref": "#/definitions/TenantAlertRuleList" - } + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." }, "default": { - "description": "An error occurred and the list of Activity Log Alert rules could not be retrieved.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Delete a Tenant Activity Log Alert rule": { + "$ref": "./examples/TenantActivityLogAlertRule_DeleteRule.json" + } } } } }, "definitions": { - "AzureResource": { - "description": "An Azure resource object.", - "x-ms-azure-resource": true, + "ActionGroup": { "type": "object", + "description": "A pointer to an Azure Action Group.", "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.", + "actionGroupId": { "type": "string", - "readOnly": true + "description": "The resource ID of the Action Group. This cannot be null or empty." }, - "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" - ] + "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" + } }, - "tags": { - "description": "The tags of the resource.", + "actionProperties": { "type": "object", + "description": "Predefined list of properties and configuration items for the action group.", "additionalProperties": { "type": "string" } } - } - }, - "TenantActivityLogAlertResource": { - "type": "object", - "description": "A Tenant Activity Log Alert rule resource.", + }, "required": [ - "properties" - ], - "allOf": [ - { - "$ref": "#/definitions/AzureResource" - } - ], - "properties": { - "properties": { - "description": "The Activity Log Alert rule properties of the resource.", - "x-ms-client-flatten": true, - "$ref": "#/definitions/AlertRuleProperties" - } - } + "actionGroupId" + ] }, - "TenantAlertRuleList": { + "ActionList": { "type": "object", - "description": "A list of Tenant Activity Log Alert rules.", + "description": "A list of Activity Log Alert rule actions.", "properties": { - "value": { - "description": "The list of Tenant Activity Log Alert rules.", + "actionGroups": { "type": "array", + "description": "The list of the Action Groups.", "items": { - "$ref": "#/definitions/TenantActivityLogAlertResource" + "$ref": "#/definitions/ActionGroup" }, "x-ms-identifiers": [ - "id" + "actionGroupId" ] - }, - "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", + "description": "An Activity Log Alert rule condition that is met when all its member conditions are met.", "properties": { "allOf": { - "description": "The list of Activity Log Alert rule conditions.", "type": "array", + "description": "The list of Activity Log Alert rule conditions.", "items": { "$ref": "#/definitions/AlertRuleAnyOfOrLeafCondition" }, @@ -400,87 +406,173 @@ ] }, "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" - } - ], + "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._", "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", + "description": "An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met.", "items": { "$ref": "#/definitions/AlertRuleLeafCondition" }, "x-ms-identifiers": [] } - } + }, + "allOf": [ + { + "$ref": "#/definitions/AlertRuleLeafCondition" + } + ] }, "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", + "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'.", "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" + "type": "string", + "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'." }, "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" + "type": "string", + "description": "The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met." }, "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", + "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.", "items": { "type": "string" } } } }, - "ActionList": { + "AlertRuleProperties": { "type": "object", - "description": "A list of Activity Log Alert rule actions.", + "description": "An Azure Activity Log Alert rule.", "properties": { - "actionGroups": { - "description": "The list of the Action Groups.", + "tenantScope": { + "type": "string", + "description": "The tenant GUID. Must be provided for tenant-level and management group events rules." + }, + "scopes": { "type": "array", + "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.", "items": { - "$ref": "#/definitions/ActionGroup" - }, - "x-ms-identifiers": [ - "actionGroupId" - ] + "type": "string" + } + }, + "condition": { + "$ref": "#/definitions/AlertRuleAllOfCondition", + "description": "The condition that will cause this alert to activate." + }, + "actions": { + "$ref": "#/definitions/ActionList", + "description": "The actions that will activate when the condition is met." + }, + "enabled": { + "type": "boolean", + "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.", + "default": true + }, + "description": { + "type": "string", + "description": "A description of this Activity Log Alert rule." } - } + }, + "required": [ + "condition", + "actions" + ] }, - "ActionGroup": { + "AzureResource": { "type": "object", - "description": "A pointer to an Azure Action Group.", + "description": "An Azure resource object.", "properties": { - "actionGroupId": { - "description": "The resource ID of the Action Group. This cannot be null or empty.", - "type": "string" + "id": { + "type": "string", + "description": "The resource Id.", + "readOnly": true }, - "webhookProperties": { + "name": { + "type": "string", + "description": "The name of the resource.", + "readOnly": true + }, + "type": { + "type": "string", + "description": "The type of the resource.", + "readOnly": true + }, + "location": { + "type": "string", + "description": "The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.", + "default": "global", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "tags": { "type": "object", - "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.", + "description": "The tags of the resource.", "additionalProperties": { "type": "string" } + } + } + }, + "TenantActivityLogAlertResource": { + "type": "object", + "description": "A Tenant Activity Log Alert rule resource.", + "properties": { + "properties": { + "$ref": "#/definitions/AlertRuleProperties", + "description": "The Activity Log Alert rule properties of the resource.", + "x-ms-client-flatten": true }, - "actionProperties": { + "tags": { "type": "object", + "description": "Resource tags.", "additionalProperties": { "type": "string" - }, - "description": "Predefined list of properties and configuration items for the action group." + } + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives", + "x-ms-mutability": [ + "read", + "create" + ] } }, "required": [ - "actionGroupId" + "properties" + ], + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/Resource" + } + ] + }, + "TenantAlertRuleList": { + "type": "object", + "description": "A list of Tenant Activity Log Alert rules.", + "properties": { + "value": { + "type": "array", + "description": "The TenantActivityLogAlertResource items on this page", + "items": { + "$ref": "#/definitions/TenantActivityLogAlertResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" ] }, "TenantAlertRulePatchObject": { @@ -495,9 +587,9 @@ } }, "properties": { - "x-ms-client-flatten": true, "$ref": "#/definitions/TenantAlertRulePatchProperties", - "description": "The activity log alert settings for an update operation." + "description": "The activity log alert settings for an update operation.", + "x-ms-client-flatten": true } } }, @@ -506,22 +598,12 @@ "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", + "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.", "default": true } } } }, - "parameters": { - "TenantActivityLogAlertNameParameter": { - "name": "alertRuleName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[-\\w\\._\\(\\)]+$", - "description": "The name of the Tenant Activity Log Alert rule.", - "x-ms-parameter-location": "method" - } - } + "parameters": {} } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_CreateOrUpdate.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_CreateOrUpdate.json index c2805d096873..58df35d11f20 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_CreateOrUpdate.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_CreateOrUpdate.json @@ -1,111 +1,113 @@ { "parameters": { - "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", "tenantActivityLogAlertRule": { "location": "Global", - "tags": {}, "properties": { - "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "condition": { - "allOf": [ - { - "field": "category", - "equals": "ServiceHealth" - } - ] - }, + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", "actions": { "actionGroups": [ { "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - "webhookProperties": { - "sampleWebhookProperty": "SamplePropertyValue" - }, "actionProperties": { "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" } } ] }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, "enabled": true, - "description": "Description of sample Activity Log Alert service health rule on tenant level events." - } + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} } }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", - "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", "location": "Global", - "tags": {}, "properties": { - "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "condition": { - "allOf": [ - { - "field": "category", - "equals": "ServiceHealth" - } - ] - }, + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", "actions": { "actionGroups": [ { "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - "webhookProperties": { - "sampleWebhookProperty": "SamplePropertyValue" - }, "actionProperties": { "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" } } ] }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, "enabled": true, - "description": "Description of sample Activity Log Alert service health rule on tenant level events." - } - } + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + }, + "headers": {} }, "201": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", - "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", "location": "Global", - "tags": {}, "properties": { - "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "condition": { - "allOf": [ - { - "field": "category", - "equals": "ServiceHealth" - } - ] - }, + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", "actions": { "actionGroups": [ { "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - "webhookProperties": { - "sampleWebhookProperty": "SamplePropertyValue" - }, "actionProperties": { "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" } } ] }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, "enabled": true, - "description": "Description of sample Activity Log Alert service health rule on tenant level events." - } - } + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + }, + "headers": {} } - } + }, + "operationId": "TenantActivityLogAlerts_CreateOrUpdate", + "title": "Create or update a Tenant Activity Log Alert rule for tenant level events" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_DeleteRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_DeleteRule.json index 47636ffe097d..6175109d3f61 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_DeleteRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_DeleteRule.json @@ -1,11 +1,13 @@ { "parameters": { - "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", - "api-version": "2023-04-01-preview" + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, "responses": { "200": {}, "204": {} - } + }, + "operationId": "TenantActivityLogAlerts_Delete", + "title": "Delete a Tenant Activity Log Alert rule" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_GetRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_GetRule.json index b98a9d242e7c..022b30999563 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_GetRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_GetRule.json @@ -1,45 +1,47 @@ { "parameters": { - "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", - "api-version": "2023-04-01-preview" + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", - "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", "location": "Global", - "tags": {}, "properties": { - "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "condition": { - "allOf": [ - { - "field": "category", - "equals": "ServiceHealth" - } - ] - }, + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", "actions": { "actionGroups": [ { "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - "webhookProperties": { - "sampleWebhookProperty": "SamplePropertyValue" - }, "actionProperties": { "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" } } ] }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, "enabled": true, - "description": "Description of sample Activity Log Alert service health rule on tenant level events." - } - } + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} + }, + "headers": {} } - } + }, + "operationId": "TenantActivityLogAlerts_Get", + "title": "Get a Tenant Activity Log Alert rule" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByManagementGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByManagementGroup.json index 377088e3df1b..4858d8094ea8 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByManagementGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByManagementGroup.json @@ -1,48 +1,50 @@ { "parameters": { - "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "api-version": "2023-04-01-preview" + "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", - "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", "location": "Global", - "tags": {}, "properties": { - "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "condition": { - "allOf": [ - { - "field": "category", - "equals": "ServiceHealth" - } - ] - }, + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", "actions": { "actionGroups": [ { "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - "webhookProperties": { - "sampleWebhookProperty": "SamplePropertyValue" - }, "actionProperties": { "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" } } ] }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, "enabled": true, - "description": "Description of sample Activity Log Alert service health rule on tenant level events." - } + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {} } ] - } + }, + "headers": {} } - } + }, + "operationId": "TenantActivityLogAlerts_ListByManagementGroup", + "title": "List Activity Log Alerts by management group" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByTenant.json index 8a692b5494ae..bb81cdae6a5a 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByTenant.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_ListByTenant.json @@ -76,5 +76,7 @@ ] } } - } + }, + "operationId": "TenantActivityLogAlerts_ListByTenant", + "title": "List Activity Log Alerts by tenant" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_UpdateRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_UpdateRule.json index 6b4b3acd73f8..290caedfd4a0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_UpdateRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/preview/2023-04-01-preview/examples/TenantActivityLogAlertRule_UpdateRule.json @@ -1,57 +1,59 @@ { "parameters": { - "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", "alertRuleName": "SampleActivityLogAlertSHRuleOnTenantLevel", "api-version": "2023-04-01-preview", + "managementGroupName": "72f988bf-86f1-41af-91ab-2d7cd011db47", "tenantActivityLogAlertRulePatch": { + "properties": { + "enabled": false + }, "tags": { "key1": "value1", "key2": "value2" - }, - "properties": { - "enabled": false } } }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", - "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", "name": "SampleActivityLogAlertSHRuleOnTenantLevel", + "type": "Microsoft.AlertsManagement/TenantActivityLogAlerts", + "id": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.AlertsManagement/TenantActivityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel", "location": "Global", - "tags": { - "key1": "value1", - "key2": "value2" - }, "properties": { - "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "condition": { - "allOf": [ - { - "field": "category", - "equals": "ServiceHealth" - } - ] - }, + "description": "Description of sample Activity Log Alert service health rule on tenant level events.", "actions": { "actionGroups": [ { "actionGroupId": "/providers/Microsoft.Management/ManagementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - "webhookProperties": { - "sampleWebhookProperty": "SamplePropertyValue" - }, "actionProperties": { "Email.Title": "my email title" + }, + "webhookProperties": { + "sampleWebhookProperty": "SamplePropertyValue" } } ] }, + "condition": { + "allOf": [ + { + "equals": "ServiceHealth", + "field": "category" + } + ] + }, "enabled": false, - "description": "Description of sample Activity Log Alert service health rule on tenant level events." + "tenantScope": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": { + "key1": "value1", + "key2": "value2" } - } + }, + "headers": {} } - } + }, + "operationId": "TenantActivityLogAlerts_Update", + "title": "Patch a Tenant Activity Log Alert rule" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/suppressions.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/suppressions.yaml deleted file mode 100644 index 1e5700c55ccb..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/suppressions.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- tool: TypeSpecRequirement - path: ./preview/2023-04-01-preview/*.json - reason: Brownfield service not ready to migrate diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/tspconfig.yaml new file mode 100644 index 000000000000..46dfad2a6627 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/TenantActivityLogAlerts/tspconfig.yaml @@ -0,0 +1,46 @@ +parameters: + "service-dir": + default: "sdk/tenantactivitylogalerts" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: false + emitter-output-dir: "{project-root}/" + azure-resource-provider-folder: "resource-manager" + output-file: "{version-status}/{version}/TenantActivityLogAlerts.json" + arm-types-dir: "{project-root}/../../../../common-types/resource-management" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" + "@azure-tools/typespec-python": + service-dir: "sdk/alertsmanagement" + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-tenantactivitylogalerts" + namespace: "azure.mgmt.tenantactivitylogalerts" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-tenantactivitylogalerts" + namespace: "com.azure.resourcemanager.tenantactivitylogalerts" + service-name: "TenantActivityLogAlerts" # human-readable service name, whitespace allowed + flavor: azure + "@azure-tools/typespec-ts": + service-dir: sdk/tenantactivitylogalerts + emitter-output-dir: "{output-dir}/{service-dir}/arm-tenantactivitylogalerts" + flavor: "azure" + experimental-extensible-enums: true + package-details: + name: "@azure/arm-tenantactivitylogalerts" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/tenantactivitylogalerts" + emitter-output-dir: "{output-dir}/{service-dir}/armtenantactivitylogalerts" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armtenantactivitylogalerts" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager"