diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/Alert.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/Alert.tsp new file mode 100644 index 000000000000..a17d359a8b7f --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/Alert.tsp @@ -0,0 +1,422 @@ +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; +/** + * An alert created in alert management service. + */ +@tenantResource +model Alert is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = Alert, + KeyName = "alertId", + SegmentName = "alerts", + NamePattern = "" + >; +} + +alias AlertOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.AlertsManagement"; + }, + {}, + { + /** Unique ID of an alert instance. */ + @path + @segment("alerts") + @key + alertId: string; + } +>; + +@armResourceOperations +interface Alerts { + /** + * Get information related to a specific alert. + */ + @summary("Get a specific alert.") + getByIdTenant is AlertOps.Read< + Alert, + ErrorType = AlertsManagementErrorResponse + >; + + /** + * Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. + */ + @get + @action("history") + getHistoryTenant is AlertOps.ActionSync< + Alert, + void, + ArmResponse, + ErrorType = AlertsManagementErrorResponse + >; + + /** + * Change the state of an alert. + */ + @action("changestate") + changeStateTenant is AlertOps.ActionSync< + Alert, + Comments, + ArmResponse, + Parameters = { + /** + * New state of the alert. + */ + @query("newState") + newState: AlertState; + }, + OptionalRequestBody = true, + ErrorType = AlertsManagementErrorResponse + >; +} +alias AlertOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** undefined */ + @path + @segment("") + @key + scope: string; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.AlertsManagement"; + }, + {}, + { + /** Unique ID of an alert instance. */ + @path + @segment("alerts") + @key + alertId: string; + } +>; + +alias GetAllTenantOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.AlertsManagement"; + }, + {}, + { + /** Unique ID of an alert instance. */ + @path + @segment("alerts") + @key + alertId: string; + } +>; +@armResourceOperations +interface AlertGetAllTenantOperation { + /** + * List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + */ + getAllTenant is GetAllTenantOps.List< + Alert, + Parameters = { + /** + * Filter by target resource( which is full ARM ID) Default value is select all. + */ + @query("targetResource") + targetResource?: string; + + /** + * Filter by target resource type. Default value is select all. + */ + @query("targetResourceType") + targetResourceType?: string; + + /** + * Filter by target resource group name. Default value is select all. + */ + @query("targetResourceGroup") + targetResourceGroup?: string; + + /** + * Filter by monitor service which generates the alert instance. Default value is select all. + */ + @query("monitorService") + monitorService?: MonitorService; + + /** + * Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + */ + @query("monitorCondition") + monitorCondition?: MonitorCondition; + + /** + * Filter by severity. Default value is select all. + */ + @query("severity") + severity?: Severity; + + /** + * Filter by state of the alert instance. Default value is to select all. + */ + @query("alertState") + alertState?: AlertState; + + /** + * Filter by specific alert rule. Default value is to select all. + */ + @query("alertRule") + alertRule?: string; + + /** + * Filter the alerts list by the Smart Group Id. Default value is none. + */ + @query("smartGroupId") + smartGroupId?: string; + + /** + * Include context which has contextual data specific to the monitor service. Default value is false' + */ + @query("includeContext") + includeContext?: boolean; + + /** + * Include egress config which would be used for displaying the content in portal. Default value is 'false'. + */ + @query("includeEgressConfig") + includeEgressConfig?: boolean; + + /** + * Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. + */ + @query("pageCount") + pageCount?: int64; + + /** + * Sort the query results by input field, Default value is 'lastModifiedDateTime'. + */ + @query("sortBy") + sortBy?: AlertsSortByFields; + + /** + * Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. + */ + @query("sortOrder") + sortOrder?: SortOrder; + + /** + * This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section. + */ + @query("select") + select?: string; + + /** + * Filter by time range by below listed values. Default value is 1 day. + */ + @query("timeRange") + timeRange?: TimeRange; + + /** + * Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + */ + @query("customTimeRange") + customTimeRange?: string; + }, + Response = ArmResponse, + ErrorType = AlertsManagementErrorResponse + >; +} + +@armResourceOperations +interface AlertOperationGroup { + /** + * Get information related to a specific alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get alert by id then use parent resource of scope. So in this example get alert by id call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'. + */ + @summary("Get a specific alert.") + getById is AlertOperationGroupOps.Read< + Alert, + ErrorType = AlertsManagementErrorResponse + >; + + /** + * List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + */ + getAll is AlertOperationGroupOps.List< + Alert, + Parameters = { + /** + * Filter by target resource( which is full ARM ID) Default value is select all. + */ + @query("targetResource") + targetResource?: string; + + /** + * Filter by target resource type. Default value is select all. + */ + @query("targetResourceType") + targetResourceType?: string; + + /** + * Filter by target resource group name. Default value is select all. + */ + @query("targetResourceGroup") + targetResourceGroup?: string; + + /** + * Filter by monitor service which generates the alert instance. Default value is select all. + */ + @query("monitorService") + monitorService?: MonitorService; + + /** + * Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + */ + @query("monitorCondition") + monitorCondition?: MonitorCondition; + + /** + * Filter by severity. Default value is select all. + */ + @query("severity") + severity?: Severity; + + /** + * Filter by state of the alert instance. Default value is to select all. + */ + @query("alertState") + alertState?: AlertState; + + /** + * Filter by specific alert rule. Default value is to select all. + */ + @query("alertRule") + alertRule?: string; + + /** + * Filter the alerts list by the Smart Group Id. Default value is none. + */ + @query("smartGroupId") + smartGroupId?: string; + + /** + * Include context which has contextual data specific to the monitor service. Default value is false' + */ + @query("includeContext") + includeContext?: boolean; + + /** + * Include egress config which would be used for displaying the content in portal. Default value is 'false'. + */ + @query("includeEgressConfig") + includeEgressConfig?: boolean; + + /** + * Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. + */ + @query("pageCount") + pageCount?: int64; + + /** + * Sort the query results by input field, Default value is 'lastModifiedDateTime'. + */ + @query("sortBy") + sortBy?: AlertsSortByFields; + + /** + * Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. + */ + @query("sortOrder") + sortOrder?: SortOrder; + + /** + * This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section. + */ + @query("select") + select?: string; + + /** + * Filter by time range by below listed values. Default value is 1 day. + */ + @query("timeRange") + timeRange?: TimeRange; + + /** + * Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + */ + @query("customTimeRange") + customTimeRange?: string; + }, + Response = ArmResponse, + ErrorType = AlertsManagementErrorResponse + >; + + /** + * Change the state of an alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to change state of this particular alert then use parent resource of scope. So in this example change state call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'. + */ + @action("changestate") + changeState is AlertOperationGroupOps.ActionSync< + Alert, + Comments, + ArmResponse, + Parameters = { + /** + * New state of the alert. + */ + @query("newState") + newState: AlertState; + }, + OptionalRequestBody = true, + ErrorType = AlertsManagementErrorResponse + >; + + /** + * Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get history of this particular alert then use parent resource of scope. So in this example get history call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history'. + */ + @get + @action("history") + getHistory is AlertOperationGroupOps.ActionSync< + Alert, + void, + ArmResponse, + ErrorType = AlertsManagementErrorResponse + >; + + /** + * Get the enrichments of an alert. It returns a collection of one object named default. + */ + @list + @get + @action("enrichments") + getEnrichments is AlertOperationGroupOps.ActionSync< + Alert, + void, + ArmResponse + >; +} + +@@doc(Alert.name, "Unique ID of an alert instance."); +@@doc(Alert.properties, "Alert property bag"); +@@doc(Alerts.changeStateTenant::parameters.body, + "reason of change alert state" +); +@@doc(AlertOperationGroup.changeState::parameters.body, + "reason of change alert state" +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/back-compatible.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/back-compatible.tsp new file mode 100644 index 000000000000..43705d34a556 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/back-compatible.tsp @@ -0,0 +1,16 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.AlertsManagement; + +@@clientName(Alerts.changeStateTenant::parameters.body, "comment"); +@@clientLocation(AlertOperationGroup.getById, Alerts); +@@clientLocation(AlertOperationGroup.getAll, Alerts); +@@clientLocation(AlertOperationGroup.changeState, Alerts); +@@clientName(AlertOperationGroup.changeState::parameters.body, "comment"); +@@clientLocation(AlertOperationGroup.getHistory, Alerts); +@@clientLocation(AlertOperationGroup.getEnrichments, Alerts); + +@@clientLocation(AlertsOperationGroup.metaData, Alerts); +@@clientLocation(AlertsOperationGroup.getSummary, Alerts); +@@clientLocation(AlertGetAllTenantOperation.getAllTenant, Alerts); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp new file mode 100644 index 000000000000..b56bd7b4b064 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -0,0 +1,16 @@ +import "@azure-tools/typespec-client-generator-core"; +import "./main.tsp"; + +using Azure.ClientGenerator.Core; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertsClientOptions { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + scope: string; +} + +@@Azure.ClientGenerator.Core.clientInitialization(Microsoft.AlertsManagement, + { + parameters: AlertsClientOptions, + } +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json new file mode 100644 index 000000000000..8213a82a486e --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "api-version": "2025-05-25-preview", + "identifier": "MonitorServiceList" + }, + "responses": { + "200": { + "body": { + "properties": { + "data": [ + { + "name": "ActivityLog Administrative", + "displayName": "Activity Log - Administrative" + }, + { + "name": "ActivityLog Autoscale", + "displayName": "Activity Log - Autoscale" + }, + { + "name": "ActivityLog Policy", + "displayName": "Activity Log - Policy" + }, + { + "name": "ActivityLog Recommendation", + "displayName": "Activity Log - Recommendation" + }, + { + "name": "ActivityLog Security", + "displayName": "Activity Log - Security" + }, + { + "name": "Application Insights", + "displayName": "Application Insights" + }, + { + "name": "Azure Backup", + "displayName": "Azure Backup" + }, + { + "name": "Custom", + "displayName": "Custom" + }, + { + "name": "Data Box Edge", + "displayName": "Data Box Edge" + }, + { + "name": "VM Insights", + "displayName": "VM Insights" + }, + { + "name": "Log Analytics", + "displayName": "Log Analytics" + }, + { + "name": "Nagios", + "displayName": "NAGIOS" + }, + { + "name": "Platform", + "displayName": "Platform" + }, + { + "name": "Resource Health", + "displayName": "Resource Health" + }, + { + "name": "SCOM", + "displayName": "SCOM" + }, + { + "name": "ServiceHealth", + "displayName": "Service Health" + }, + { + "name": "Smart Detector", + "displayName": "SmartDetector" + }, + { + "name": "Zabbix", + "displayName": "ZABBIX" + } + ], + "metadataIdentifier": "MonitorServiceList" + } + } + } + }, + "operationId": "Alerts_MetaData", + "title": "MonService" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeState.json new file mode 100644 index 000000000000..b168748a17b6 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeState.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "body": { + "comment": "Acknowledging alert" + }, + "newState": "Acknowledged", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" + }, + "responses": { + "200": { + "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": {}, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + } + } + }, + "operationId": "Alerts_ChangeState", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json new file mode 100644 index 000000000000..38178c0029a2 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "body": { + "comment": "Acknowledging alert" + }, + "newState": "Acknowledged", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" + }, + "responses": { + "200": { + "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": {}, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + } + } + }, + "operationId": "Alerts_ChangeStateTenant", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetById.json new file mode 100644 index 000000000000..19c767000b5b --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetById.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" + }, + "responses": { + "200": { + "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": {}, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + } + } + }, + "operationId": "Alerts_GetById", + "title": "GetById" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetByIdTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetByIdTenant.json new file mode 100644 index 000000000000..1578aa3d9fda --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetByIdTenant.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" + }, + "responses": { + "200": { + "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": {}, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + } + } + }, + "operationId": "Alerts_GetByIdTenant", + "title": "GetById" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetEnrichments.json new file mode 100644 index 000000000000..6e3efed7b314 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetEnrichments.json @@ -0,0 +1,71 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502101", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "default", + "type": "Microsoft.AlertsManagement/alerts/enrichments", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502101/enrichments/default", + "properties": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502101", + "enrichments": [ + { + "type": "PrometheusInstantQuery", + "description": "Enrichment description", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", + "query": "sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace1'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0", + "status": "Succeeded", + "time": "2015-07-01T20:10:51.781Z", + "title": "Number of OOM killed events by container" + }, + { + "type": "PrometheusRangeQuery", + "description": "Enrichment description", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "end": "2015-07-01T20:20:51.781Z", + "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", + "query": "sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0", + "start": "2015-07-01T20:10:51.781Z", + "status": "Succeeded", + "step": "PT15S", + "title": "Number of OOM killed events by container" + }, + { + "type": "PrometheusRangeQuery", + "description": "Enrichment description", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "end": "2015-07-01T20:20:51.781Z", + "errorMessage": "Calling Prometheus query API failed", + "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", + "query": "sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0", + "start": "2015-07-01T20:10:51.781Z", + "status": "Failed", + "step": "PT15S", + "title": "Number of OOM killed events by container" + } + ] + } + } + ] + } + } + }, + "operationId": "Alerts_GetEnrichments", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json new file mode 100644 index 000000000000..7501dac0ba93 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a" + }, + "responses": { + "200": { + "body": { + "name": "CPU Alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "modifications": [ + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "AlertCreated", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": null + }, + { + "description": "State changed from 'New' to 'Acknowledged'", + "comments": "The alert has been resolved", + "modificationEvent": "StateChange", + "modifiedAt": "2018-06-13T06:14:15.7378737Z", + "modifiedBy": "vikramm@microsoft.com", + "newValue": "Resolved", + "oldValue": "Fired", + "details": { + "type": "PropertyChange", + "comment": "The alert has been resolved", + "newValue": "Resolved", + "oldValue": "Fired" + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsTriggered", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsTriggered", + "actionGroup": { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + }, + "notificationResult": { + "status": "Accepted", + "statusURL": "https://management.azure.com/subscriptions/2a784a95-81bd-41c8-ba8a-362d1098a2b9/resourceGroups/AzNSTest/providers/microsoft.insights/actionGroups/ag2/notificationStatus/00000000000?api-version=2021-09-01" + } + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsSuppressed", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsSuppressed", + "suppressedActionGroups": [ + { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + } + ], + "suppressionActionRules": [ + "ActionRule 1", + "ActionRule 2" + ] + } + } + ] + } + } + } + }, + "operationId": "Alerts_GetHistoryTenant", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_History.json new file mode 100644 index 000000000000..dfde045a4133 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_History.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a" + }, + "responses": { + "200": { + "body": { + "name": "CPU Alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "modifications": [ + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "AlertCreated", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": null + }, + { + "description": "State changed from 'New' to 'Acknowledged'", + "comments": "The alert has been resolved", + "modificationEvent": "StateChange", + "modifiedAt": "2018-06-13T06:14:15.7378737Z", + "modifiedBy": "vikramm@microsoft.com", + "newValue": "Resolved", + "oldValue": "Fired", + "details": { + "type": "PropertyChange", + "comment": "The alert has been resolved", + "newValue": "Resolved", + "oldValue": "Fired" + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsTriggered", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsTriggered", + "actionGroup": { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + }, + "notificationResult": { + "status": "Accepted", + "statusURL": "https://management.azure.com/subscriptions/2a784a95-81bd-41c8-ba8a-362d1098a2b9/resourceGroups/AzNSTest/providers/microsoft.insights/actionGroups/ag2/notificationStatus/00000000000?api-version=2021-09-01" + } + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsSuppressed", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsSuppressed", + "suppressedActionGroups": [ + { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + } + ], + "suppressionActionRules": [ + "ActionRule 1", + "ActionRule 2" + ] + } + } + ] + } + } + } + }, + "operationId": "Alerts_GetHistory", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List.json new file mode 100644 index 000000000000..1d13296a2e0b --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List.json @@ -0,0 +1,139 @@ +{ + "parameters": { + "api-version": "2025-05-25-preview", + "includeContext": true, + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", + "value": [ + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + }, + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "category": "performance", + "environment": "production", + "priority": "high" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "New", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "d1c49c89-ea95-4697-a299-c0f5ebac62f1", + "smartGroupingReason": "Alerts that frequently occur together have been grouped.", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskwcus", + "targetResourceType": "components" + } + } + } + ] + } + } + }, + "operationId": "Alerts_GetAll", + "title": "ListAlerts" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json new file mode 100644 index 000000000000..2509782122b3 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json @@ -0,0 +1,139 @@ +{ + "parameters": { + "api-version": "2025-05-25-preview", + "includeContext": true, + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", + "value": [ + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + }, + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "category": "performance", + "environment": "production", + "priority": "high" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "New", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "d1c49c89-ea95-4697-a299-c0f5ebac62f1", + "smartGroupingReason": "Alerts that frequently occur together have been grouped.", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskwcus", + "targetResourceType": "components" + } + } + } + ] + } + } + }, + "operationId": "Alerts_GetAllTenant", + "title": "ListAlerts" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_Summary.json new file mode 100644 index 000000000000..103116fb97cb --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_Summary.json @@ -0,0 +1,120 @@ +{ + "parameters": { + "api-version": "2025-05-25-preview", + "groupby": "severity,alertState", + "scope": "subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d" + }, + "responses": { + "200": { + "body": { + "name": "current", + "type": "Microsoft.AlertsManagement/alertsSummary", + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current", + "properties": { + "groupedby": "severity", + "smartGroupsCount": 100, + "total": 14189, + "values": [ + { + "name": "Sev0", + "count": 6517, + "groupedby": "alertState", + "values": [ + { + "name": "New", + "count": 6517 + }, + { + "name": "Acknowledged", + "count": 0 + }, + { + "name": "Closed", + "count": 0 + } + ] + }, + { + "name": "Sev1", + "count": 3175, + "groupedby": "alertState", + "values": [ + { + "name": "New", + "count": 3175 + }, + { + "name": "Acknowledged", + "count": 0 + }, + { + "name": "Closed", + "count": 0 + } + ] + }, + { + "name": "Sev2", + "count": 1120, + "groupedby": "alertState", + "values": [ + { + "name": "New", + "count": 1120 + }, + { + "name": "Acknowledged", + "count": 0 + }, + { + "name": "Closed", + "count": 0 + } + ] + }, + { + "name": "Sev3", + "count": 1902, + "groupedby": "alertState", + "values": [ + { + "name": "New", + "count": 1902 + }, + { + "name": "Acknowledged", + "count": 0 + }, + { + "name": "Closed", + "count": 0 + } + ] + }, + { + "name": "Sev4", + "count": 1475, + "groupedby": "alertState", + "values": [ + { + "name": "New", + "count": 1475 + }, + { + "name": "Acknowledged", + "count": 0 + }, + { + "name": "Closed", + "count": 0 + } + ] + } + ] + } + } + } + }, + "operationId": "Alerts_GetSummary", + "title": "Summary" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Operations_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Operations_List.json new file mode 100644 index 000000000000..af0f8cc49a98 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Operations_List.json @@ -0,0 +1,240 @@ +{ + "parameters": { + "api-version": "2025-05-25-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.AlertsManagement/register/action", + "display": { + "description": "Subscription Registration Action", + "operation": "Subscription Registration Action", + "provider": "Microsoft.AlertsManagement", + "resource": "Subscription" + } + }, + { + "name": "Microsoft.AlertsManagement/register/action", + "display": { + "description": "Registers the subscription for the Microsoft Alerts Management", + "operation": "Register subscription", + "provider": "Microsoft.AlertsManagement", + "resource": "register" + } + }, + { + "name": "Microsoft.AlertsManagement/alerts/read", + "display": { + "description": "Get all the alerts for the input filters.", + "operation": "Read alerts", + "provider": "Microsoft.AlertsManagement", + "resource": "alerts" + } + }, + { + "name": "Microsoft.AlertsManagement/alerts/changestate/action", + "display": { + "description": "Change the state of the alert.", + "operation": "Resolve alerts", + "provider": "Microsoft.AlertsManagement", + "resource": "alerts" + } + }, + { + "name": "Microsoft.AlertsManagement/alerts/history/read", + "display": { + "description": "Get history of the alert", + "operation": "Read alert history", + "provider": "Microsoft.AlertsManagement", + "resource": "alerts" + } + }, + { + "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/write", + "display": { + "description": "Create or update Smart Detector alert rule in a given subscription", + "operation": "Create Smart Detector alert rule", + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules" + } + }, + { + "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/read", + "display": { + "description": "Get all the Smart Detector alert rules for the input filters", + "operation": "Read Smart Detector alert rules", + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules" + } + }, + { + "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/delete", + "display": { + "description": "Delete Smart Detector alert rule in a given subscription", + "operation": "Delete Smart Detector alert rule", + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules" + } + }, + { + "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/write", + "display": { + "description": "Create or update Resource Health alert rule in a given subscription", + "operation": "Create Resource Health alert rule", + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules" + } + }, + { + "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/read", + "display": { + "description": "Get all the Resource Health alert rules for the input filters", + "operation": "Read Resource Health alert rules", + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules" + } + }, + { + "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/delete", + "display": { + "description": "Delete Resource Health alert rule in a given subscription", + "operation": "Delete Resource Health alert rule", + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules" + } + }, + { + "name": "Microsoft.AlertsManagement/migrateFromSmartDetection/read", + "display": { + "description": "Get the status of an asynchronous Smart Detection to smart alerts migration process", + "operation": "Get Smart Detection Migration status", + "provider": "Microsoft.AlertsManagement", + "resource": "migrateFromSmartDetection" + } + }, + { + "name": "Microsoft.AlertsManagement/migrateFromSmartDetection/action", + "display": { + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource", + "operation": "Migrate From Smart Detection", + "provider": "Microsoft.AlertsManagement", + "resource": "migrateFromSmartDetection" + } + }, + { + "name": "Microsoft.AlertsManagement/alertsSummary/read", + "display": { + "description": "Get the summary of alerts", + "operation": "Read alerts summary", + "provider": "Microsoft.AlertsManagement", + "resource": "alertsSummary" + } + }, + { + "name": "Microsoft.AlertsManagement/smartGroups/read", + "display": { + "description": "Get all the smart groups for the input filters", + "operation": "Read smart groups", + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/smartGroups/changestate/action", + "display": { + "description": "Change the state of the smart group", + "operation": "Read smart groups", + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/smartGroups/history/read", + "display": { + "description": "Get history of the smart group", + "operation": "Read smart group history", + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/actionRules/read", + "display": { + "description": "Get all the alert processing rules for the input filters.", + "operation": "Read action rules", + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules" + } + }, + { + "name": "Microsoft.AlertsManagement/actionRules/write", + "display": { + "description": "Create or update alert processing rule in a given subscription", + "operation": "Write action rule", + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules" + } + }, + { + "name": "Microsoft.AlertsManagement/actionRules/delete", + "display": { + "description": "Delete alert processing rule in a given subscription.", + "operation": "Delete action rule", + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules" + } + }, + { + "name": "Microsoft.AlertsManagement/alertsMetaData/read", + "display": { + "description": "Get alerts meta data for the input parameter.", + "operation": "Read alerts meta data", + "provider": "Microsoft.AlertsManagement", + "resource": "Microsoft.AlertsManagement/alertsMetaData" + } + }, + { + "name": "Microsoft.AlertsManagement/Operations/read", + "display": { + "description": "Reads the operations provided", + "operation": "Read operations", + "provider": "Microsoft.AlertsManagement", + "resource": "operations" + } + }, + { + "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Write", + "display": { + "description": "Set prometheusRuleGroups", + "operation": "Creates or updates the prometheusRuleGroups", + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Delete", + "display": { + "description": "Delete prometheusRuleGroups", + "operation": "Deletes the prometheusRuleGroups", + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups" + } + }, + { + "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Read", + "display": { + "description": "Read prometheusRuleGroups", + "operation": "Reads the prometheusRuleGroups", + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups" + } + } + ] + } + } + }, + "operationId": "Operations_List", + "title": "ListOperations" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/main.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/main.tsp new file mode 100644 index 000000000000..d483ed3e3e60 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/main.tsp @@ -0,0 +1,47 @@ +/** + * 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-05T01:00:36.549Z + */ +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 "./Alert.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor. + */ +@armProviderNamespace +@service(#{ title: "Azure Alerts Management Service Resource Provider" }) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) +namespace Microsoft.AlertsManagement; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2025-05-25-preview API version. + */ + v2025_05_25_preview: "2025-05-25-preview", +} + +interface Operations extends Azure.ResourceManager.Operations {} +@@doc(Operations.list, + "List all operations available through Azure Alerts Management Resource Provider." +); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp new file mode 100644 index 000000000000..58b849d51c6e --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp @@ -0,0 +1,1220 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.AlertsManagement; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union MonitorService { + string, + + /** + * Application Insights + */ + `Application Insights`: "Application Insights", + + /** + * ActivityLog Administrative + */ + `ActivityLog Administrative`: "ActivityLog Administrative", + + /** + * ActivityLog Security + */ + `ActivityLog Security`: "ActivityLog Security", + + /** + * ActivityLog Recommendation + */ + `ActivityLog Recommendation`: "ActivityLog Recommendation", + + /** + * ActivityLog Policy + */ + `ActivityLog Policy`: "ActivityLog Policy", + + /** + * ActivityLog Autoscale + */ + `ActivityLog Autoscale`: "ActivityLog Autoscale", + + /** + * Log Analytics + */ + `Log Analytics`: "Log Analytics", + + /** + * Nagios + */ + Nagios: "Nagios", + + /** + * Platform + */ + Platform: "Platform", + + /** + * SCOM + */ + SCOM: "SCOM", + + /** + * ServiceHealth + */ + ServiceHealth: "ServiceHealth", + + /** + * SmartDetector + */ + SmartDetector: "SmartDetector", + + /** + * VM Insights + */ + `VM Insights`: "VM Insights", + + /** + * Zabbix + */ + Zabbix: "Zabbix", + + /** + * Resource Health + */ + `Resource Health`: "Resource Health", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union MonitorCondition { + string, + + /** + * Fired + */ + Fired: "Fired", + + /** + * Resolved + */ + Resolved: "Resolved", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union Severity { + string, + + /** + * Sev0 + */ + Sev0: "Sev0", + + /** + * Sev1 + */ + Sev1: "Sev1", + + /** + * Sev2 + */ + Sev2: "Sev2", + + /** + * Sev3 + */ + Sev3: "Sev3", + + /** + * Sev4 + */ + Sev4: "Sev4", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union AlertState { + string, + + /** + * New + */ + New: "New", + + /** + * Acknowledged + */ + Acknowledged: "Acknowledged", + + /** + * Closed + */ + Closed: "Closed", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union AlertsSortByFields { + string, + + /** + * name + */ + name: "name", + + /** + * severity + */ + severity: "severity", + + /** + * alertState + */ + alertState: "alertState", + + /** + * monitorCondition + */ + monitorCondition: "monitorCondition", + + /** + * targetResource + */ + targetResource: "targetResource", + + /** + * targetResourceName + */ + targetResourceName: "targetResourceName", + + /** + * targetResourceGroup + */ + targetResourceGroup: "targetResourceGroup", + + /** + * targetResourceType + */ + targetResourceType: "targetResourceType", + + /** + * startDateTime + */ + startDateTime: "startDateTime", + + /** + * lastModifiedDateTime + */ + lastModifiedDateTime: "lastModifiedDateTime", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union SortOrder { + string, + + /** + * asc + */ + asc: "asc", + + /** + * desc + */ + desc: "desc", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union TimeRange { + string, + + /** + * 1h + */ + `1h`: "1h", + + /** + * 1d + */ + `1d`: "1d", + + /** + * 7d + */ + `7d`: "7d", + + /** + * 30d + */ + `30d`: "30d", +} + +/** + * The type of signal the alert is based on, which could be metrics, logs or activity logs. + */ +union SignalType { + string, + + /** + * Metric + */ + Metric: "Metric", + + /** + * Log + */ + Log: "Log", + + /** + * Unknown + */ + Unknown: "Unknown", +} + +/** + * Type of modification details + */ +union AlertModificationType { + string, + + /** + * PropertyChange + */ + PropertyChange: "PropertyChange", + + /** + * ActionsSuppressed + */ + ActionsSuppressed: "ActionsSuppressed", + + /** + * ActionsTriggered + */ + ActionsTriggered: "ActionsTriggered", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union Identifier { + string, + + /** + * MonitorServiceList + */ + MonitorServiceList: "MonitorServiceList", +} + +/** + * Identification of the information to be retrieved by API call + */ +union MetadataIdentifier { + string, + + /** + * MonitorServiceList + */ + MonitorServiceList: "MonitorServiceList", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union AlertsSummaryGroupByFields { + string, + + /** + * severity + */ + severity: "severity", + + /** + * alertState + */ + alertState: "alertState", + + /** + * monitorCondition + */ + monitorCondition: "monitorCondition", + + /** + * monitorService + */ + monitorService: "monitorService", + + /** + * signalType + */ + signalType: "signalType", + + /** + * alertRule + */ + alertRule: "alertRule", +} + +/** + * The status of the evaluation of the enrichment. + */ +union Status { + string, + + /** + * Succeeded + */ + Succeeded: "Succeeded", + + /** + * Failed + */ + Failed: "Failed", +} + +/** + * The enrichment type. + */ +union Type { + string, + + /** + * PrometheusInstantQuery + */ + PrometheusInstantQuery: "PrometheusInstantQuery", + + /** + * PrometheusRangeQuery + */ + PrometheusRangeQuery: "PrometheusRangeQuery", +} + +/** + * The rule type + */ +union RuleType { + string, + + /** + * AlertRule + */ + AlertRule: "AlertRule", + + /** + * ActionRule + */ + ActionRule: "ActionRule", +} + +/** + * The status of the notification + */ +union ResultStatus { + string, + + /** + * None + */ + None: "None", + + /** + * Inline + */ + Inline: "Inline", + + /** + * Throttled + */ + Throttled: "Throttled", + + /** + * Failed + */ + Failed: "Failed", + + /** + * ThrottledByAlertRule + */ + ThrottledByAlertRule: "ThrottledByAlertRule", + + /** + * ThrottledBySubscription + */ + ThrottledBySubscription: "ThrottledBySubscription", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ApiVersion { + /** + * 2019-03-01 + */ + `2019-03-01`, + + /** + * 2025-05-25-preview + */ + `2025-05-25-preview`, +} + +/** + * Reason for the modification + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AlertModificationEvent { + /** + * AlertCreated + */ + AlertCreated, + + /** + * StateChange + */ + StateChange, + + /** + * SeverityChange + */ + SeverityChange, + + /** + * MonitorConditionChange + */ + MonitorConditionChange, + + /** + * ActionsTriggered + */ + ActionsTriggered, + + /** + * ActionsSuppressed + */ + ActionsSuppressed, +} + +/** + * List the alerts. + */ +model AlertsList is Azure.Core.Page; + +/** + * Alert property bag + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertProperties { + /** + * This object contains consistent fields across different monitor services. + */ + essentials?: Essentials; + + /** + * Information specific to the monitor service that gives more contextual details about the alert. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + context?: unknown; + + /** + * Config which would be used for displaying the data in portal. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + egressConfig?: unknown; + + /** + * Custom properties that can hold any user defined key-value pairs + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + customProperties?: Record; +} + +/** + * This object contains consistent fields across different monitor services. + */ +model Essentials { + /** + * Severity of alert Sev0 being highest and Sev4 being lowest. + */ + @visibility(Lifecycle.Read) + severity?: Severity; + + /** + * The type of signal the alert is based on, which could be metrics, logs or activity logs. + */ + @visibility(Lifecycle.Read) + signalType?: SignalType; + + /** + * Alert object state, which can be modified by the user. + */ + @visibility(Lifecycle.Read) + alertState?: AlertState; + + /** + * Can be 'Fired' or 'Resolved', which represents whether the underlying conditions have crossed the defined alert rule thresholds. + */ + @visibility(Lifecycle.Read) + monitorCondition?: MonitorCondition; + + /** + * Target ARM resource, on which alert got created. + */ + targetResource?: string; + + /** + * Name of the target ARM resource name, on which alert got created. + */ + targetResourceName?: string; + + /** + * Resource group of target ARM resource, on which alert got created. + */ + targetResourceGroup?: string; + + /** + * Resource type of target ARM resource, on which alert got created. + */ + targetResourceType?: string; + + /** + * Monitor service on which the rule(monitor) is set. + */ + @visibility(Lifecycle.Read) + monitorService?: MonitorService; + + /** + * Rule(monitor) which fired alert instance. Depending on the monitor service, this would be ARM id or name of the rule. + */ + @visibility(Lifecycle.Read) + alertRule?: string; + + /** + * Unique Id created by monitor service for each alert instance. This could be used to track the issue at the monitor service, in case of Nagios, Zabbix, SCOM etc. + */ + @visibility(Lifecycle.Read) + sourceCreatedId?: string; + + /** + * Unique Id of the smart group + */ + @visibility(Lifecycle.Read) + smartGroupId?: string; + + /** + * Verbose reason describing the reason why this alert instance is added to a smart group + */ + @visibility(Lifecycle.Read) + smartGroupingReason?: string; + + /** + * Creation time(ISO-8601 format) of alert instance. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startDateTime?: utcDateTime; + + /** + * Last modification time(ISO-8601 format) of alert instance. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastModifiedDateTime?: utcDateTime; + + /** + * Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert instance because the rule condition is no longer met. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + monitorConditionResolvedDateTime?: utcDateTime; + + /** + * User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user. + */ + @visibility(Lifecycle.Read) + lastModifiedUserName?: string; + + /** + * Action status + */ + actionStatus?: ActionStatus; + + /** + * Alert description. + */ + description?: string; +} + +/** + * Action status + */ +model ActionStatus { + /** + * Value indicating whether alert is suppressed. + */ + isSuppressed?: boolean; +} + +/** + * An azure resource object + */ +model ProxyResource { + /** + * Azure resource Id + */ + @visibility(Lifecycle.Read) + id?: string; + + /** + * Azure resource type + */ + @visibility(Lifecycle.Read) + type?: string; + + /** + * Azure resource name + */ + @visibility(Lifecycle.Read) + name?: string; +} + +/** + * An error response from the service. + */ +@error +model AlertsManagementErrorResponse { + /** + * Details of error response. + */ + error?: ErrorResponseBody; +} + +/** + * Details of error response. + */ +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@Azure.ResourceManager.Legacy.armExternalType +model ErrorResponseBody { + /** + * Error code, intended to be consumed programmatically. + */ + code?: string; + + /** + * Description of the error, intended for display in user interface. + */ + message?: string; + + /** + * Target of the particular error, for example name of the property. + */ + target?: string; + + /** + * A list of additional details about the error. + */ + @identifiers(#[]) + details?: ErrorResponseBody[]; +} + +/** + * Alert Modification details + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertModification extends ProxyResource { + /** + * Alert modification history properties. + */ + properties?: AlertModificationProperties; +} + +/** + * Alert modification history properties. + */ +model AlertModificationProperties { + /** + * Unique identifier of the alert. + */ + @visibility(Lifecycle.Read) + alertId?: string; + + /** + * Array of alert modification events. + */ + @identifiers(#[]) + modifications?: AlertModificationItem[]; +} + +/** + * Alert modification item. + */ +model AlertModificationItem { + /** + * Reason for the modification + */ + modificationEvent?: AlertModificationEvent; + + /** + * Old value + */ + oldValue?: string; + + /** + * New value + */ + newValue?: string; + + /** + * Modified date and time + */ + modifiedAt?: string; + + /** + * Modified user details (Principal client name) + */ + modifiedBy?: string; + + /** + * Modification comments + */ + comments?: string; + + /** + * Description of the modification + */ + description?: string; + + /** + * Base details class. + */ + details?: BaseDetails; +} + +/** + * Base details class. + */ +@discriminator("type") +model BaseDetails { + /** + * Type of modification details + */ + type: AlertModificationType; +} + +/** + * Change alert state reason + */ +model Comments { + #suppress "@azure-tools/typespec-client-generator-core/property-name-conflict" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + comments?: string; +} + +/** + * Operation provided by provider + */ +model Operation { + /** + * Name of the operation + */ + name?: string; + + /** + * Properties of the operation + */ + display?: OperationDisplay; + + /** + * Origin of the operation + */ + origin?: string; +} + +/** + * Properties of the operation + */ +model OperationDisplay { + /** + * Provider name + */ + provider?: string; + + /** + * Resource name + */ + resource?: string; + + /** + * Operation name + */ + operation?: string; + + /** + * Description of the operation + */ + description?: string; +} + +/** + * alert meta data information. + */ +model AlertsMetaData { + /** + * alert meta data property bag + */ + properties?: AlertsMetaDataProperties; +} + +/** + * alert meta data property bag + */ +@discriminator("metadataIdentifier") +model AlertsMetaDataProperties { + /** + * Identification of the information to be retrieved by API call + */ + metadataIdentifier: MetadataIdentifier; +} + +/** + * Summary of alerts based on the input filters and 'groupby' parameters. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertsSummary extends ProxyResource { + /** + * Group the result set. + */ + properties?: AlertsSummaryGroup; +} + +/** + * Group the result set. + */ +model AlertsSummaryGroup { + /** + * Total count of the result set. + */ + total?: int64; + + /** + * Total count of the smart groups. + */ + smartGroupsCount?: int64; + + /** + * Name of the field aggregated + */ + groupedby?: string; + + /** + * List of the items + */ + values?: AlertsSummaryGroupItem[]; +} + +/** + * Alerts summary group item + */ +model AlertsSummaryGroupItem { + /** + * Value of the aggregated field + */ + name?: string; + + /** + * Count of the aggregated field + */ + count?: int64; + + /** + * Name of the field aggregated + */ + groupedby?: string; + + /** + * List of the items + */ + values?: AlertsSummaryGroupItem[]; +} + +/** + * List the alert's enrichments. + */ +model AlertEnrichmentsList is Azure.Core.Page; + +/** + * The alert's enrichments. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AlertEnrichmentResponse + extends Azure.ResourceManager.Foundations.ProxyResource { + /** + * Properties of the alert enrichment item. + */ + properties?: AlertEnrichmentProperties; +} + +/** + * Properties of the alert enrichment item. + */ +model AlertEnrichmentProperties { + /** + * Unique Id (GUID) of the alert for which the enrichments are being retrieved. + */ + @visibility(Lifecycle.Read) + alertId?: string; + + /** + * Enrichment details + */ + @identifiers(#[]) + enrichments?: AlertEnrichmentItem[]; +} + +/** + * Alert enrichment item. + */ +@discriminator("type") +model AlertEnrichmentItem { + /** + * The enrichment title. + */ + title: string; + + /** + * The enrichment description. + */ + description: string; + + /** + * The status of the evaluation of the enrichment. + */ + status: Status; + + /** + * The error message. Will be present only if the status is 'Failed'. + */ + errorMessage?: string; + + /** + * The enrichment type. + */ + type: Type; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PropertyChangeDetails extends BaseDetails { + /** + * The value before the change + */ + oldValue?: string; + + /** + * The value after the change + */ + newValue?: string; + + /** + * The comment + */ + comment?: string; + + /** + * Type of modification details + */ + type: "PropertyChange"; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ActionSuppressedDetails extends BaseDetails { + /** + * List of suppression action rules + */ + suppressionActionRules?: string[]; + + /** + * List of suppressed action groups + */ + @identifiers(#[]) + suppressedActionGroups?: TriggeredRule[]; + + /** + * Type of modification details + */ + type: "ActionsSuppressed"; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model TriggeredRule { + /** + * The action group ID + */ + actionGroupId?: string; + + /** + * The rule ID + */ + ruleId?: string; + + /** + * The rule type + */ + ruleType?: RuleType; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ActionTriggeredDetails extends BaseDetails { + /** + * The action group that was triggered + */ + actionGroup?: TriggeredRule; + + /** + * The result of the notification delivery + */ + notificationResult?: NotificationResult; + + /** + * Type of modification details + */ + type: "ActionsTriggered"; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model NotificationResult { + /** + * URL endpoint for checking notification delivery status. Only populated when status is 'Inline'. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + statusURL?: string; + + /** + * The status of the notification + */ + status?: ResultStatus; +} + +/** + * Monitor service details + */ +model MonitorServiceList extends AlertsMetaDataProperties { + /** + * Array of operations + */ + data: MonitorServiceDetails[]; + + /** + * Identification of the information to be retrieved by API call + */ + metadataIdentifier: "MonitorServiceList"; +} + +/** + * Details of a monitor service + */ +model MonitorServiceDetails { + /** + * Monitor service name + */ + name?: string; + + /** + * Monitor service display name + */ + displayName?: string; +} + +/** + * Prometheus enrichment object. + */ +model PrometheusEnrichmentItem is AlertEnrichmentItem { + /** + * Link to Prometheus query API (Url format). + */ + linkToApi: string; + + /** + * An array of the azure monitor workspace resource ids. + */ + datasources: string[]; + + /** + * Partial link to the Grafana explore API. + */ + grafanaExplorePath: string; + + /** + * The Prometheus expression query. + */ + query: string; +} + +alias PrometheusEnrichmentItemProperties = { + /** + * Link to Prometheus query API (Url format). + */ + linkToApi: string; + + /** + * An array of the azure monitor workspace resource ids. + */ + datasources: string[]; + + /** + * Partial link to the Grafana explore API. + */ + grafanaExplorePath: string; + + /** + * The Prometheus expression query. + */ + query: string; +}; + +/** + * Prometheus instant query enrichment object. + */ +#suppress "@azure-tools/typespec-client-generator-core/legacy-hierarchy-building-conflict" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@Azure.ClientGenerator.Core.Legacy.hierarchyBuilding(PrometheusEnrichmentItem) +model PrometheusInstantQuery extends AlertEnrichmentItem { + ...PrometheusEnrichmentItemProperties; + + /** + * The date and the time of the evaluation. + */ + time: string; + + /** + * The enrichment type. + */ + type: "PrometheusInstantQuery"; +} + +/** + * Prometheus instant query enrichment object. + */ +#suppress "@azure-tools/typespec-client-generator-core/legacy-hierarchy-building-conflict" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@Azure.ClientGenerator.Core.Legacy.hierarchyBuilding(PrometheusEnrichmentItem) +model PrometheusRangeQuery extends AlertEnrichmentItem { + ...PrometheusEnrichmentItemProperties; + + /** + * The start evaluation date and time in ISO8601 format. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + start: utcDateTime; + + /** + * The end evaluation date and time in ISO8601 format. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + end: utcDateTime; + + /** + * Query resolution step width in ISO8601 format. + */ + step: string; + + /** + * The enrichment type. + */ + type: "PrometheusRangeQuery"; +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/AlertsManagement.json index d1cfa7274b32..d2311f982803 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/AlertsManagement.json @@ -1,144 +1,559 @@ { "swagger": "2.0", "info": { - "version": "2025-05-25-preview", "title": "Azure Alerts Management Service Resource Provider", - "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." + "version": "2025-05-25-preview", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor.", + "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": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], "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": "Operations" + }, + { + "name": "Alerts" + }, + { + "name": "AlertGetAllTenantOperation" + }, + { + "name": "AlertOperationGroup" + } + ], "paths": { - "/providers/Microsoft.AlertsManagement/alerts": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts": { "get": { - "operationId": "Alerts_GetAllTenant", - "description": "List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. ", + "operationId": "Alerts_GetAll", + "tags": [ + "AlertOperationGroup" + ], + "description": "List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime.", "parameters": [ { - "$ref": "#/parameters/targetResource" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/targetResourceType" + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/targetResourceGroup" + "name": "targetResource", + "in": "query", + "description": "Filter by target resource( which is full ARM ID) Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/monitorService" + "name": "targetResourceType", + "in": "query", + "description": "Filter by target resource type. Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/monitorCondition" + "name": "targetResourceGroup", + "in": "query", + "description": "Filter by target resource group name. Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/severity" + "name": "monitorService", + "in": "query", + "description": "Filter by monitor service which generates the alert instance. Default value is select all.", + "required": false, + "type": "string", + "enum": [ + "Application Insights", + "ActivityLog Administrative", + "ActivityLog Security", + "ActivityLog Recommendation", + "ActivityLog Policy", + "ActivityLog Autoscale", + "Log Analytics", + "Nagios", + "Platform", + "SCOM", + "ServiceHealth", + "SmartDetector", + "VM Insights", + "Zabbix", + "Resource Health" + ], + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": true, + "values": [ + { + "name": "Application Insights", + "value": "Application Insights", + "description": "Application Insights" + }, + { + "name": "ActivityLog Administrative", + "value": "ActivityLog Administrative", + "description": "ActivityLog Administrative" + }, + { + "name": "ActivityLog Security", + "value": "ActivityLog Security", + "description": "ActivityLog Security" + }, + { + "name": "ActivityLog Recommendation", + "value": "ActivityLog Recommendation", + "description": "ActivityLog Recommendation" + }, + { + "name": "ActivityLog Policy", + "value": "ActivityLog Policy", + "description": "ActivityLog Policy" + }, + { + "name": "ActivityLog Autoscale", + "value": "ActivityLog Autoscale", + "description": "ActivityLog Autoscale" + }, + { + "name": "Log Analytics", + "value": "Log Analytics", + "description": "Log Analytics" + }, + { + "name": "Nagios", + "value": "Nagios", + "description": "Nagios" + }, + { + "name": "Platform", + "value": "Platform", + "description": "Platform" + }, + { + "name": "SCOM", + "value": "SCOM", + "description": "SCOM" + }, + { + "name": "ServiceHealth", + "value": "ServiceHealth", + "description": "ServiceHealth" + }, + { + "name": "SmartDetector", + "value": "SmartDetector", + "description": "SmartDetector" + }, + { + "name": "VM Insights", + "value": "VM Insights", + "description": "VM Insights" + }, + { + "name": "Zabbix", + "value": "Zabbix", + "description": "Zabbix" + }, + { + "name": "Resource Health", + "value": "Resource Health", + "description": "Resource Health" + } + ] + } + }, + { + "name": "monitorCondition", + "in": "query", + "description": "Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.", + "required": false, + "type": "string", + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true, + "values": [ + { + "name": "Fired", + "value": "Fired", + "description": "Fired" + }, + { + "name": "Resolved", + "value": "Resolved", + "description": "Resolved" + } + ] + } }, { - "$ref": "#/parameters/alertState" + "name": "severity", + "in": "query", + "description": "Filter by severity. Default value is select all.", + "required": false, + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true, + "values": [ + { + "name": "Sev0", + "value": "Sev0", + "description": "Sev0" + }, + { + "name": "Sev1", + "value": "Sev1", + "description": "Sev1" + }, + { + "name": "Sev2", + "value": "Sev2", + "description": "Sev2" + }, + { + "name": "Sev3", + "value": "Sev3", + "description": "Sev3" + }, + { + "name": "Sev4", + "value": "Sev4", + "description": "Sev4" + } + ] + } }, { - "$ref": "#/parameters/alertRule" + "name": "alertState", + "in": "query", + "description": "Filter by state of the alert instance. Default value is to select all.", + "required": false, + "type": "string", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" + } + ] + } }, { - "$ref": "#/parameters/smartGroupIdFilter" + "name": "alertRule", + "in": "query", + "description": "Filter by specific alert rule. Default value is to select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/includeContext" + "name": "smartGroupId", + "in": "query", + "description": "Filter the alerts list by the Smart Group Id. Default value is none.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/includeEgressConfig" + "name": "includeContext", + "in": "query", + "description": "Include context which has contextual data specific to the monitor service. Default value is false'", + "required": false, + "type": "boolean" }, { - "$ref": "#/parameters/pageCount" + "name": "includeEgressConfig", + "in": "query", + "description": "Include egress config which would be used for displaying the content in portal. Default value is 'false'.", + "required": false, + "type": "boolean" }, { - "$ref": "#/parameters/alertsSortBy" + "name": "pageCount", + "in": "query", + "description": "Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the \"includeContent\" filter is selected, maximum value allowed is 25. Default value is 25.", + "required": false, + "type": "integer", + "format": "int64" }, { - "$ref": "#/parameters/sortOrder" + "name": "sortBy", + "in": "query", + "description": "Sort the query results by input field, Default value is 'lastModifiedDateTime'.", + "required": false, + "type": "string", + "enum": [ + "name", + "severity", + "alertState", + "monitorCondition", + "targetResource", + "targetResourceName", + "targetResourceGroup", + "targetResourceType", + "startDateTime", + "lastModifiedDateTime" + ], + "x-ms-enum": { + "name": "AlertsSortByFields", + "modelAsString": true, + "values": [ + { + "name": "name", + "value": "name", + "description": "name" + }, + { + "name": "severity", + "value": "severity", + "description": "severity" + }, + { + "name": "alertState", + "value": "alertState", + "description": "alertState" + }, + { + "name": "monitorCondition", + "value": "monitorCondition", + "description": "monitorCondition" + }, + { + "name": "targetResource", + "value": "targetResource", + "description": "targetResource" + }, + { + "name": "targetResourceName", + "value": "targetResourceName", + "description": "targetResourceName" + }, + { + "name": "targetResourceGroup", + "value": "targetResourceGroup", + "description": "targetResourceGroup" + }, + { + "name": "targetResourceType", + "value": "targetResourceType", + "description": "targetResourceType" + }, + { + "name": "startDateTime", + "value": "startDateTime", + "description": "startDateTime" + }, + { + "name": "lastModifiedDateTime", + "value": "lastModifiedDateTime", + "description": "lastModifiedDateTime" + } + ] + } }, { - "$ref": "#/parameters/select" + "name": "sortOrder", + "in": "query", + "description": "Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.", + "required": false, + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "SortOrder", + "modelAsString": true, + "values": [ + { + "name": "asc", + "value": "asc", + "description": "asc" + }, + { + "name": "desc", + "value": "desc", + "description": "desc" + } + ] + } }, { - "$ref": "#/parameters/timeRange" + "name": "select", + "in": "query", + "description": "This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/customTimeRange" + "name": "timeRange", + "in": "query", + "description": "Filter by time range by below listed values. Default value is 1 day.", + "required": false, + "type": "string", + "enum": [ + "1h", + "1d", + "7d", + "30d" + ], + "x-ms-enum": { + "name": "TimeRange", + "modelAsString": true, + "values": [ + { + "name": "1h", + "value": "1h", + "description": "1h" + }, + { + "name": "1d", + "value": "1d", + "description": "1d" + }, + { + "name": "7d", + "value": "7d", + "description": "7d" + }, + { + "name": "30d", + "value": "30d", + "description": "30d" + } + ] + } }, { - "$ref": "#/parameters/api-version" + "name": "customTimeRange", + "in": "query", + "description": "Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.", + "required": false, + "type": "string" } ], - "produces": [ - "application/json" - ], "responses": { "200": { - "description": "OK. Successfully listed alert objects.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alertsList" + "$ref": "#/definitions/AlertsList" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, "x-ms-examples": { "ListAlerts": { "$ref": "./examples/Alerts_List.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, - "/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { "get": { - "operationId": "Alerts_GetByIdTenant", - "summary": "Get a specific alert.", - "description": "Get information related to a specific alert.", - "produces": [ - "application/json" + "operationId": "Alerts_GetById", + "tags": [ + "AlertOperationGroup" ], + "summary": "Get a specific alert.", + "description": "Get information related to a specific alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get alert by id then use parent resource of scope. So in this example get alert by id call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'.", "parameters": [ { - "$ref": "#/parameters/alertId" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/api-version" + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" } ], "responses": { "200": { - "description": "OK. Returns the alert with the specified ID.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alert" + "$ref": "#/definitions/Alert" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } @@ -151,27 +566,83 @@ } } }, - "/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { - "get": { - "operationId": "Alerts_GetHistoryTenant", - "description": "Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert.", + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { + "post": { + "operationId": "Alerts_ChangeState", + "tags": [ + "AlertOperationGroup" + ], + "description": "Change the state of an alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to change state of this particular alert then use parent resource of scope. So in this example change state call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'.", "parameters": [ { - "$ref": "#/parameters/alertId" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" + }, + { + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" + }, + { + "name": "newState", + "in": "query", + "description": "New state of the alert.", + "required": true, + "type": "string", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" + } + ] + } }, { - "$ref": "#/parameters/api-version" + "name": "comment", + "in": "body", + "description": "reason of change alert state", + "required": false, + "schema": { + "$ref": "#/definitions/Comments" + } } ], "responses": { "200": { - "description": "OK. Returns the history of the specified alert.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alertModification" + "$ref": "#/definitions/Alert" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } @@ -179,234 +650,975 @@ }, "x-ms-examples": { "Resolve": { - "$ref": "./examples/Alerts_History.json" + "$ref": "./examples/Alerts_ChangeState.json" } } } }, - "/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { - "post": { - "operationId": "Alerts_ChangeStateTenant", - "description": "Change the state of an alert.", + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments": { + "get": { + "operationId": "Alerts_GetEnrichments", + "tags": [ + "AlertOperationGroup" + ], + "description": "Get the enrichments of an alert. It returns a collection of one object named default.", "parameters": [ { - "$ref": "#/parameters/alertId" - }, - { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/newState" + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/comment" + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" } ], "responses": { "200": { - "description": "OK. Alert state updated.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alert" + "$ref": "#/definitions/AlertEnrichmentsList" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/AlertsManagementErrorResponse" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Resolve": { - "$ref": "./examples/Alerts_ChangeState.json" + "$ref": "./examples/Alerts_GetEnrichments.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, - "/providers/Microsoft.AlertsManagement/operations": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { "get": { - "operationId": "Operations_List", - "description": "List all operations available through Azure Alerts Management Resource Provider.", + "operationId": "Alerts_GetHistory", + "tags": [ + "AlertOperationGroup" + ], + "description": "Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get history of this particular alert then use parent resource of scope. So in this example get history call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history'.", "parameters": [ { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" + }, + { + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" } ], - "produces": [ - "application/json" - ], "responses": { "200": { - "description": "OK. Successfully retrieved operations list.", + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/AlertModification" + } + }, + "default": { + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/operationsList" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, "x-ms-examples": { - "ListOperations": { - "$ref": "./examples/Operations_List.json" + "Resolve": { + "$ref": "./examples/Alerts_History.json" } } } }, - "/providers/Microsoft.AlertsManagement/alertsMetaData": { + "/{scope}/providers/Microsoft.AlertsManagement/alertsSummary": { "get": { - "operationId": "Alerts_MetaData", - "description": "List alerts meta data information based on value of identifier parameter.", + "operationId": "Alerts_GetSummary", + "description": "Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity).", "parameters": [ { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "The fully qualified Azure Resource manager identifier of the resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "groupby", + "in": "query", + "description": "This parameter allows the result set to be grouped by input fields. For example, groupby=severity,alertstate.", + "required": true, + "type": "string", + "enum": [ + "severity", + "alertState", + "monitorCondition", + "monitorService", + "signalType", + "alertRule" + ], + "x-ms-enum": { + "name": "AlertsSummaryGroupByFields", + "modelAsString": true, + "values": [ + { + "name": "severity", + "value": "severity", + "description": "severity" + }, + { + "name": "alertState", + "value": "alertState", + "description": "alertState" + }, + { + "name": "monitorCondition", + "value": "monitorCondition", + "description": "monitorCondition" + }, + { + "name": "monitorService", + "value": "monitorService", + "description": "monitorService" + }, + { + "name": "signalType", + "value": "signalType", + "description": "signalType" + }, + { + "name": "alertRule", + "value": "alertRule", + "description": "alertRule" + } + ] + } + }, + { + "name": "includeSmartGroupsCount", + "in": "query", + "description": "Include count of the SmartGroups as part of the summary. Default value is 'false'.", + "required": false, + "type": "boolean" + }, + { + "name": "targetResource", + "in": "query", + "description": "Filter by target resource( which is full ARM ID) Default value is select all.", + "required": false, + "type": "string" + }, + { + "name": "targetResourceType", + "in": "query", + "description": "Filter by target resource type. Default value is select all.", + "required": false, + "type": "string" + }, + { + "name": "targetResourceGroup", + "in": "query", + "description": "Filter by target resource group name. Default value is select all.", + "required": false, + "type": "string" + }, + { + "name": "monitorService", + "in": "query", + "description": "Filter by monitor service which generates the alert instance. Default value is select all.", + "required": false, + "type": "string", + "enum": [ + "Application Insights", + "ActivityLog Administrative", + "ActivityLog Security", + "ActivityLog Recommendation", + "ActivityLog Policy", + "ActivityLog Autoscale", + "Log Analytics", + "Nagios", + "Platform", + "SCOM", + "ServiceHealth", + "SmartDetector", + "VM Insights", + "Zabbix", + "Resource Health" + ], + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": true, + "values": [ + { + "name": "Application Insights", + "value": "Application Insights", + "description": "Application Insights" + }, + { + "name": "ActivityLog Administrative", + "value": "ActivityLog Administrative", + "description": "ActivityLog Administrative" + }, + { + "name": "ActivityLog Security", + "value": "ActivityLog Security", + "description": "ActivityLog Security" + }, + { + "name": "ActivityLog Recommendation", + "value": "ActivityLog Recommendation", + "description": "ActivityLog Recommendation" + }, + { + "name": "ActivityLog Policy", + "value": "ActivityLog Policy", + "description": "ActivityLog Policy" + }, + { + "name": "ActivityLog Autoscale", + "value": "ActivityLog Autoscale", + "description": "ActivityLog Autoscale" + }, + { + "name": "Log Analytics", + "value": "Log Analytics", + "description": "Log Analytics" + }, + { + "name": "Nagios", + "value": "Nagios", + "description": "Nagios" + }, + { + "name": "Platform", + "value": "Platform", + "description": "Platform" + }, + { + "name": "SCOM", + "value": "SCOM", + "description": "SCOM" + }, + { + "name": "ServiceHealth", + "value": "ServiceHealth", + "description": "ServiceHealth" + }, + { + "name": "SmartDetector", + "value": "SmartDetector", + "description": "SmartDetector" + }, + { + "name": "VM Insights", + "value": "VM Insights", + "description": "VM Insights" + }, + { + "name": "Zabbix", + "value": "Zabbix", + "description": "Zabbix" + }, + { + "name": "Resource Health", + "value": "Resource Health", + "description": "Resource Health" + } + ] + } + }, + { + "name": "monitorCondition", + "in": "query", + "description": "Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.", + "required": false, + "type": "string", + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true, + "values": [ + { + "name": "Fired", + "value": "Fired", + "description": "Fired" + }, + { + "name": "Resolved", + "value": "Resolved", + "description": "Resolved" + } + ] + } + }, + { + "name": "severity", + "in": "query", + "description": "Filter by severity. Default value is select all.", + "required": false, + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true, + "values": [ + { + "name": "Sev0", + "value": "Sev0", + "description": "Sev0" + }, + { + "name": "Sev1", + "value": "Sev1", + "description": "Sev1" + }, + { + "name": "Sev2", + "value": "Sev2", + "description": "Sev2" + }, + { + "name": "Sev3", + "value": "Sev3", + "description": "Sev3" + }, + { + "name": "Sev4", + "value": "Sev4", + "description": "Sev4" + } + ] + } + }, + { + "name": "alertState", + "in": "query", + "description": "Filter by state of the alert instance. Default value is to select all.", + "required": false, + "type": "string", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" + } + ] + } + }, + { + "name": "alertRule", + "in": "query", + "description": "Filter by specific alert rule. Default value is to select all.", + "required": false, + "type": "string" + }, + { + "name": "timeRange", + "in": "query", + "description": "Filter by time range by below listed values. Default value is 1 day.", + "required": false, + "type": "string", + "enum": [ + "1h", + "1d", + "7d", + "30d" + ], + "x-ms-enum": { + "name": "TimeRange", + "modelAsString": true, + "values": [ + { + "name": "1h", + "value": "1h", + "description": "1h" + }, + { + "name": "1d", + "value": "1d", + "description": "1d" + }, + { + "name": "7d", + "value": "7d", + "description": "7d" + }, + { + "name": "30d", + "value": "30d", + "description": "30d" + } + ] + } }, { - "$ref": "#/parameters/identifier" + "name": "customTimeRange", + "in": "query", + "description": "Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.", + "required": false, + "type": "string" } ], - "produces": [ - "application/json" - ], "responses": { "200": { - "description": "OK. Successfully listed alert meta data.", + "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/alertsMetaData" + "$ref": "#/definitions/AlertsSummary" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, "x-ms-examples": { - "MonService": { - "$ref": "./examples/AlertsMetaData_MonitorService.json" + "Summary": { + "$ref": "./examples/Alerts_Summary.json" } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts": { + "/providers/Microsoft.AlertsManagement/alerts": { "get": { - "operationId": "Alerts_GetAll", - "description": "List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. ", + "operationId": "Alerts_GetAllTenant", + "tags": [ + "AlertGetAllTenantOperation" + ], + "description": "List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime.", "parameters": [ { - "$ref": "#/parameters/scope" - }, - { - "$ref": "#/parameters/targetResource" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/targetResourceType" + "name": "targetResource", + "in": "query", + "description": "Filter by target resource( which is full ARM ID) Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/targetResourceGroup" + "name": "targetResourceType", + "in": "query", + "description": "Filter by target resource type. Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/monitorService" + "name": "targetResourceGroup", + "in": "query", + "description": "Filter by target resource group name. Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/monitorCondition" + "name": "monitorService", + "in": "query", + "description": "Filter by monitor service which generates the alert instance. Default value is select all.", + "required": false, + "type": "string", + "enum": [ + "Application Insights", + "ActivityLog Administrative", + "ActivityLog Security", + "ActivityLog Recommendation", + "ActivityLog Policy", + "ActivityLog Autoscale", + "Log Analytics", + "Nagios", + "Platform", + "SCOM", + "ServiceHealth", + "SmartDetector", + "VM Insights", + "Zabbix", + "Resource Health" + ], + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": true, + "values": [ + { + "name": "Application Insights", + "value": "Application Insights", + "description": "Application Insights" + }, + { + "name": "ActivityLog Administrative", + "value": "ActivityLog Administrative", + "description": "ActivityLog Administrative" + }, + { + "name": "ActivityLog Security", + "value": "ActivityLog Security", + "description": "ActivityLog Security" + }, + { + "name": "ActivityLog Recommendation", + "value": "ActivityLog Recommendation", + "description": "ActivityLog Recommendation" + }, + { + "name": "ActivityLog Policy", + "value": "ActivityLog Policy", + "description": "ActivityLog Policy" + }, + { + "name": "ActivityLog Autoscale", + "value": "ActivityLog Autoscale", + "description": "ActivityLog Autoscale" + }, + { + "name": "Log Analytics", + "value": "Log Analytics", + "description": "Log Analytics" + }, + { + "name": "Nagios", + "value": "Nagios", + "description": "Nagios" + }, + { + "name": "Platform", + "value": "Platform", + "description": "Platform" + }, + { + "name": "SCOM", + "value": "SCOM", + "description": "SCOM" + }, + { + "name": "ServiceHealth", + "value": "ServiceHealth", + "description": "ServiceHealth" + }, + { + "name": "SmartDetector", + "value": "SmartDetector", + "description": "SmartDetector" + }, + { + "name": "VM Insights", + "value": "VM Insights", + "description": "VM Insights" + }, + { + "name": "Zabbix", + "value": "Zabbix", + "description": "Zabbix" + }, + { + "name": "Resource Health", + "value": "Resource Health", + "description": "Resource Health" + } + ] + } }, { - "$ref": "#/parameters/severity" + "name": "monitorCondition", + "in": "query", + "description": "Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.", + "required": false, + "type": "string", + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true, + "values": [ + { + "name": "Fired", + "value": "Fired", + "description": "Fired" + }, + { + "name": "Resolved", + "value": "Resolved", + "description": "Resolved" + } + ] + } }, { - "$ref": "#/parameters/alertState" + "name": "severity", + "in": "query", + "description": "Filter by severity. Default value is select all.", + "required": false, + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true, + "values": [ + { + "name": "Sev0", + "value": "Sev0", + "description": "Sev0" + }, + { + "name": "Sev1", + "value": "Sev1", + "description": "Sev1" + }, + { + "name": "Sev2", + "value": "Sev2", + "description": "Sev2" + }, + { + "name": "Sev3", + "value": "Sev3", + "description": "Sev3" + }, + { + "name": "Sev4", + "value": "Sev4", + "description": "Sev4" + } + ] + } }, { - "$ref": "#/parameters/alertRule" + "name": "alertState", + "in": "query", + "description": "Filter by state of the alert instance. Default value is to select all.", + "required": false, + "type": "string", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" + } + ] + } }, { - "$ref": "#/parameters/smartGroupIdFilter" + "name": "alertRule", + "in": "query", + "description": "Filter by specific alert rule. Default value is to select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/includeContext" + "name": "smartGroupId", + "in": "query", + "description": "Filter the alerts list by the Smart Group Id. Default value is none.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/includeEgressConfig" + "name": "includeContext", + "in": "query", + "description": "Include context which has contextual data specific to the monitor service. Default value is false'", + "required": false, + "type": "boolean" }, { - "$ref": "#/parameters/pageCount" + "name": "includeEgressConfig", + "in": "query", + "description": "Include egress config which would be used for displaying the content in portal. Default value is 'false'.", + "required": false, + "type": "boolean" }, { - "$ref": "#/parameters/alertsSortBy" + "name": "pageCount", + "in": "query", + "description": "Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the \"includeContent\" filter is selected, maximum value allowed is 25. Default value is 25.", + "required": false, + "type": "integer", + "format": "int64" }, { - "$ref": "#/parameters/sortOrder" + "name": "sortBy", + "in": "query", + "description": "Sort the query results by input field, Default value is 'lastModifiedDateTime'.", + "required": false, + "type": "string", + "enum": [ + "name", + "severity", + "alertState", + "monitorCondition", + "targetResource", + "targetResourceName", + "targetResourceGroup", + "targetResourceType", + "startDateTime", + "lastModifiedDateTime" + ], + "x-ms-enum": { + "name": "AlertsSortByFields", + "modelAsString": true, + "values": [ + { + "name": "name", + "value": "name", + "description": "name" + }, + { + "name": "severity", + "value": "severity", + "description": "severity" + }, + { + "name": "alertState", + "value": "alertState", + "description": "alertState" + }, + { + "name": "monitorCondition", + "value": "monitorCondition", + "description": "monitorCondition" + }, + { + "name": "targetResource", + "value": "targetResource", + "description": "targetResource" + }, + { + "name": "targetResourceName", + "value": "targetResourceName", + "description": "targetResourceName" + }, + { + "name": "targetResourceGroup", + "value": "targetResourceGroup", + "description": "targetResourceGroup" + }, + { + "name": "targetResourceType", + "value": "targetResourceType", + "description": "targetResourceType" + }, + { + "name": "startDateTime", + "value": "startDateTime", + "description": "startDateTime" + }, + { + "name": "lastModifiedDateTime", + "value": "lastModifiedDateTime", + "description": "lastModifiedDateTime" + } + ] + } }, { - "$ref": "#/parameters/select" + "name": "sortOrder", + "in": "query", + "description": "Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.", + "required": false, + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "SortOrder", + "modelAsString": true, + "values": [ + { + "name": "asc", + "value": "asc", + "description": "asc" + }, + { + "name": "desc", + "value": "desc", + "description": "desc" + } + ] + } }, { - "$ref": "#/parameters/timeRange" + "name": "select", + "in": "query", + "description": "This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/customTimeRange" + "name": "timeRange", + "in": "query", + "description": "Filter by time range by below listed values. Default value is 1 day.", + "required": false, + "type": "string", + "enum": [ + "1h", + "1d", + "7d", + "30d" + ], + "x-ms-enum": { + "name": "TimeRange", + "modelAsString": true, + "values": [ + { + "name": "1h", + "value": "1h", + "description": "1h" + }, + { + "name": "1d", + "value": "1d", + "description": "1d" + }, + { + "name": "7d", + "value": "7d", + "description": "7d" + }, + { + "name": "30d", + "value": "30d", + "description": "30d" + } + ] + } }, { - "$ref": "#/parameters/api-version" + "name": "customTimeRange", + "in": "query", + "description": "Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.", + "required": false, + "type": "string" } ], - "produces": [ - "application/json" - ], "responses": { "200": { - "description": "OK. Successfully listed alert objects.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alertsList" + "$ref": "#/definitions/AlertsList" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, "x-ms-examples": { "ListAlerts": { - "$ref": "./examples/Alerts_List.json" + "$ref": "./examples/Alerts_List_GetAllTenant.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "/providers/Microsoft.AlertsManagement/alerts/{alertId}": { "get": { - "operationId": "Alerts_GetById", - "summary": "Get a specific alert.", - "description": "Get information related to a specific alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get alert by id then use parent resource of scope. So in this example get alert by id call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'.", - "produces": [ - "application/json" + "operationId": "Alerts_GetByIdTenant", + "tags": [ + "Alerts" ], + "summary": "Get a specific alert.", + "description": "Get information related to a specific alert.", "parameters": [ { - "$ref": "#/parameters/scope" - }, - { - "$ref": "#/parameters/alertId" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/api-version" + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" } ], "responses": { "200": { - "description": "OK. Returns the alert with the specified ID.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alert" + "$ref": "#/definitions/Alert" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } @@ -414,41 +1626,81 @@ }, "x-ms-examples": { "GetById": { - "$ref": "./examples/Alerts_GetById.json" + "$ref": "./examples/Alerts_GetByIdTenant.json" } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { + "/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { "post": { - "operationId": "Alerts_ChangeState", - "description": "Change the state of an alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to change state of this particular alert then use parent resource of scope. So in this example change state call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'.", + "operationId": "Alerts_ChangeStateTenant", + "tags": [ + "Alerts" + ], + "description": "Change the state of an alert.", "parameters": [ { - "$ref": "#/parameters/scope" - }, - { - "$ref": "#/parameters/alertId" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/api-version" + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/newState" + "name": "newState", + "in": "query", + "description": "New state of the alert.", + "required": true, + "type": "string", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" + } + ] + } }, { - "$ref": "#/parameters/comment" + "name": "comment", + "in": "body", + "description": "reason of change alert state", + "required": false, + "schema": { + "$ref": "#/definitions/Comments" + } } ], "responses": { "200": { - "description": "OK. Alert state updated.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alert" + "$ref": "#/definitions/Alert" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } @@ -456,35 +1708,39 @@ }, "x-ms-examples": { "Resolve": { - "$ref": "./examples/Alerts_ChangeState.json" + "$ref": "./examples/Alerts_ChangeStateTenant.json" } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { + "/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { "get": { - "operationId": "Alerts_GetHistory", - "description": "Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get history of this particular alert then use parent resource of scope. So in this example get history call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history'.", + "operationId": "Alerts_GetHistoryTenant", + "tags": [ + "Alerts" + ], + "description": "Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert.", "parameters": [ { - "$ref": "#/parameters/scope" - }, - { - "$ref": "#/parameters/alertId" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/api-version" + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" } ], "responses": { "200": { - "description": "OK. Returns the history of the specified alert.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alertModification" + "$ref": "#/definitions/AlertModification" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } @@ -492,274 +1748,435 @@ }, "x-ms-examples": { "Resolve": { - "$ref": "./examples/Alerts_History.json" + "$ref": "./examples/Alerts_GetHistoryTenant.json" } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alertsSummary": { + "/providers/Microsoft.AlertsManagement/alertsMetaData": { "get": { - "operationId": "Alerts_GetSummary", - "description": "Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity).", + "operationId": "Alerts_MetaData", + "description": "List alerts meta data information based on value of identifier parameter.", "parameters": [ { - "$ref": "#/parameters/scope" - }, - { - "$ref": "#/parameters/alertsSummaryGroupBy" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/includeSmartGroupsCount" - }, - { - "$ref": "#/parameters/targetResource" - }, - { - "$ref": "#/parameters/targetResourceType" - }, - { - "$ref": "#/parameters/targetResourceGroup" - }, - { - "$ref": "#/parameters/monitorService" - }, - { - "$ref": "#/parameters/monitorCondition" - }, - { - "$ref": "#/parameters/severity" - }, - { - "$ref": "#/parameters/alertState" - }, - { - "$ref": "#/parameters/alertRule" - }, - { - "$ref": "#/parameters/timeRange" - }, - { - "$ref": "#/parameters/customTimeRange" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Alert summary returned.", - "schema": { - "$ref": "#/definitions/alertsSummary" - } + "name": "identifier", + "in": "query", + "description": "Identification of the information to be retrieved by API call.", + "required": true, + "type": "string", + "enum": [ + "MonitorServiceList" + ], + "x-ms-enum": { + "name": "Identifier", + "modelAsString": true, + "values": [ + { + "name": "MonitorServiceList", + "value": "MonitorServiceList", + "description": "MonitorServiceList" + } + ] + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertsMetaData" + } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, "x-ms-examples": { - "Summary": { - "$ref": "./examples/Alerts_Summary.json" + "MonService": { + "$ref": "./examples/AlertsMetaData_MonitorService.json" } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments": { + "/providers/Microsoft.AlertsManagement/operations": { "get": { - "operationId": "Alerts_GetEnrichments", - "description": "Get the enrichments of an alert. It returns a collection of one object named default.", + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List all operations available through Azure Alerts Management Resource Provider.", "parameters": [ { - "$ref": "#/parameters/scope" - }, - { - "$ref": "#/parameters/alertId" - }, - { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { - "description": "OK. Returns the enrichments of the specified alert.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alertEnrichmentsList" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/OperationListResult" } }, "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" } } }, "x-ms-examples": { - "Resolve": { - "$ref": "./examples/Alerts_GetEnrichments.json" + "ListOperations": { + "$ref": "./examples/Operations_List.json" } }, "x-ms-pageable": { - "nextLinkName": null + "nextLinkName": "nextLink" } } } }, - "parameters": { - "scope": { - "name": "scope", - "description": "scope here is resourceId for which alert is created.", - "type": "string", - "in": "path", - "required": true, - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" - }, - "subscriptionId": { - "name": "subscriptionId", - "description": "The Azure subscription Id.", - "type": "string", - "in": "path", - "required": true + "definitions": { + "ActionStatus": { + "type": "object", + "description": "Action status", + "properties": { + "isSuppressed": { + "type": "boolean", + "description": "Value indicating whether alert is suppressed." + } + } }, - "api-version": { - "name": "api-version", - "description": "API version.", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "2019-03-01", - "2025-05-25-preview" + "ActionSuppressedDetails": { + "type": "object", + "properties": { + "suppressionActionRules": { + "type": "array", + "description": "List of suppression action rules", + "items": { + "type": "string" + } + }, + "suppressedActionGroups": { + "type": "array", + "description": "List of suppressed action groups", + "items": { + "$ref": "#/definitions/TriggeredRule" + }, + "x-ms-identifiers": [] + } + }, + "allOf": [ + { + "$ref": "#/definitions/BaseDetails" + } ], - "x-ms-enum": { - "name": "api-version", - "modelAsString": true - } + "x-ms-discriminator-value": "ActionsSuppressed" }, - "alertId": { - "name": "alertId", - "description": "Unique ID of an alert instance.", - "type": "string", - "in": "path", - "required": true, - "x-ms-parameter-location": "method" + "ActionTriggeredDetails": { + "type": "object", + "properties": { + "actionGroup": { + "$ref": "#/definitions/TriggeredRule", + "description": "The action group that was triggered" + }, + "notificationResult": { + "$ref": "#/definitions/NotificationResult", + "description": "The result of the notification delivery" + } + }, + "allOf": [ + { + "$ref": "#/definitions/BaseDetails" + } + ], + "x-ms-discriminator-value": "ActionsTriggered" }, - "targetResourceGroup": { - "description": "Filter by target resource group name. Default value is select all.", - "name": "targetResourceGroup", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" + "Alert": { + "type": "object", + "description": "An alert created in alert management service.", + "properties": { + "properties": { + "$ref": "#/definitions/AlertProperties", + "description": "Alert property bag" + } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] }, - "targetResource": { - "description": "Filter by target resource( which is full ARM ID) Default value is select all.", - "name": "targetResource", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" + "AlertEnrichmentItem": { + "type": "object", + "description": "Alert enrichment item.", + "properties": { + "title": { + "type": "string", + "description": "The enrichment title." + }, + "description": { + "type": "string", + "description": "The enrichment description." + }, + "status": { + "$ref": "#/definitions/Status", + "description": "The status of the evaluation of the enrichment." + }, + "errorMessage": { + "type": "string", + "description": "The error message. Will be present only if the status is 'Failed'." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "The enrichment type." + } + }, + "discriminator": "type", + "required": [ + "title", + "description", + "status", + "type" + ] }, - "targetResourceType": { - "description": "Filter by target resource type. Default value is select all.", - "name": "targetResourceType", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" + "AlertEnrichmentProperties": { + "type": "object", + "description": "Properties of the alert enrichment item.", + "properties": { + "alertId": { + "type": "string", + "description": "Unique Id (GUID) of the alert for which the enrichments are being retrieved.", + "readOnly": true + }, + "enrichments": { + "type": "array", + "description": "Enrichment details", + "items": { + "$ref": "#/definitions/AlertEnrichmentItem" + }, + "x-ms-identifiers": [] + } + } + }, + "AlertEnrichmentResponse": { + "type": "object", + "description": "The alert's enrichments.", + "properties": { + "properties": { + "$ref": "#/definitions/AlertEnrichmentProperties", + "description": "Properties of the alert enrichment item." + } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] + }, + "AlertEnrichmentsList": { + "type": "object", + "description": "List the alert's enrichments.", + "properties": { + "value": { + "type": "array", + "description": "The AlertEnrichmentResponse items on this page", + "items": { + "$ref": "#/definitions/AlertEnrichmentResponse" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] }, - "monitorService": { - "description": "Filter by monitor service which generates the alert instance. Default value is select all.", - "name": "monitorService", + "AlertModification": { + "type": "object", + "description": "Alert Modification details", + "properties": { + "properties": { + "$ref": "#/definitions/AlertModificationProperties", + "description": "Alert modification history properties." + } + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ] + }, + "AlertModificationEvent": { "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", + "description": "Reason for the modification", "enum": [ - "Application Insights", - "ActivityLog Administrative", - "ActivityLog Security", - "ActivityLog Recommendation", - "ActivityLog Policy", - "ActivityLog Autoscale", - "Log Analytics", - "Nagios", - "Platform", - "SCOM", - "ServiceHealth", - "SmartDetector", - "VM Insights", - "Zabbix", - "Resource Health" + "AlertCreated", + "StateChange", + "SeverityChange", + "MonitorConditionChange", + "ActionsTriggered", + "ActionsSuppressed" ], "x-ms-enum": { - "name": "MonitorService", - "modelAsString": true + "name": "AlertModificationEvent", + "modelAsString": false, + "values": [ + { + "name": "AlertCreated", + "value": "AlertCreated", + "description": "AlertCreated" + }, + { + "name": "StateChange", + "value": "StateChange", + "description": "StateChange" + }, + { + "name": "SeverityChange", + "value": "SeverityChange", + "description": "SeverityChange" + }, + { + "name": "MonitorConditionChange", + "value": "MonitorConditionChange", + "description": "MonitorConditionChange" + }, + { + "name": "ActionsTriggered", + "value": "ActionsTriggered", + "description": "ActionsTriggered" + }, + { + "name": "ActionsSuppressed", + "value": "ActionsSuppressed", + "description": "ActionsSuppressed" + } + ] } }, - "severity": { - "description": "Filter by severity. Default value is select all.", - "name": "severity", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "Sev0", - "Sev1", - "Sev2", - "Sev3", - "Sev4" - ], - "x-ms-enum": { - "name": "Severity", - "modelAsString": true + "AlertModificationItem": { + "type": "object", + "description": "Alert modification item.", + "properties": { + "modificationEvent": { + "$ref": "#/definitions/AlertModificationEvent", + "description": "Reason for the modification" + }, + "oldValue": { + "type": "string", + "description": "Old value" + }, + "newValue": { + "type": "string", + "description": "New value" + }, + "modifiedAt": { + "type": "string", + "description": "Modified date and time" + }, + "modifiedBy": { + "type": "string", + "description": "Modified user details (Principal client name)" + }, + "comments": { + "type": "string", + "description": "Modification comments" + }, + "description": { + "type": "string", + "description": "Description of the modification" + }, + "details": { + "$ref": "#/definitions/BaseDetails", + "description": "Base details class." + } } }, - "smartGroupIdFilter": { - "description": "Filter the alerts list by the Smart Group Id. Default value is none.", - "name": "smartGroupId", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" + "AlertModificationProperties": { + "type": "object", + "description": "Alert modification history properties.", + "properties": { + "alertId": { + "type": "string", + "description": "Unique identifier of the alert.", + "readOnly": true + }, + "modifications": { + "type": "array", + "description": "Array of alert modification events.", + "items": { + "$ref": "#/definitions/AlertModificationItem" + }, + "x-ms-identifiers": [] + } + } }, - "newState": { - "description": "New state of the alert.", - "name": "newState", + "AlertModificationType": { "type": "string", - "in": "query", - "required": true, - "x-ms-parameter-location": "method", + "description": "Type of modification details", "enum": [ - "New", - "Acknowledged", - "Closed" + "PropertyChange", + "ActionsSuppressed", + "ActionsTriggered" ], "x-ms-enum": { - "name": "AlertState", - "modelAsString": true + "name": "AlertModificationType", + "modelAsString": true, + "values": [ + { + "name": "PropertyChange", + "value": "PropertyChange", + "description": "PropertyChange" + }, + { + "name": "ActionsSuppressed", + "value": "ActionsSuppressed", + "description": "ActionsSuppressed" + }, + { + "name": "ActionsTriggered", + "value": "ActionsTriggered", + "description": "ActionsTriggered" + } + ] } }, - "comment": { - "description": "reason of change alert state", - "name": "comment", - "in": "body", - "x-ms-parameter-location": "method", - "required": false, - "schema": { - "$ref": "#/definitions/comments" + "AlertProperties": { + "type": "object", + "description": "Alert property bag", + "properties": { + "essentials": { + "$ref": "#/definitions/Essentials", + "description": "This object contains consistent fields across different monitor services." + }, + "context": { + "description": "Information specific to the monitor service that gives more contextual details about the alert.", + "readOnly": true + }, + "egressConfig": { + "description": "Config which would be used for displaying the data in portal.", + "readOnly": true + }, + "customProperties": { + "type": "object", + "description": "Custom properties that can hold any user defined key-value pairs", + "additionalProperties": { + "type": "string" + } + } } }, - "alertState": { - "description": "Filter by state of the alert instance. Default value is to select all.", - "name": "alertState", + "AlertState": { "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", "enum": [ "New", "Acknowledged", @@ -767,99 +2184,83 @@ ], "x-ms-enum": { "name": "AlertState", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" + } + ] } }, - "monitorCondition": { - "description": "Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.", - "name": "monitorCondition", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "Fired", - "Resolved" - ], - "x-ms-enum": { - "name": "MonitorCondition", - "modelAsString": true - } + "AlertsList": { + "type": "object", + "description": "List the alerts.", + "properties": { + "value": { + "type": "array", + "description": "The Alert items on this page", + "items": { + "$ref": "#/definitions/Alert" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] }, - "alertRule": { - "description": "Filter by specific alert rule. Default value is to select all.", - "name": "alertRule", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" + "AlertsManagementErrorResponse": { + "type": "object", + "description": "An error response from the service.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponseBody", + "description": "Details of error response." + } + } }, - "timeRange": { - "description": "Filter by time range by below listed values. Default value is 1 day.", - "name": "timeRange", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "1h", - "1d", - "7d", - "30d" - ], - "x-ms-enum": { - "name": "TimeRange", - "modelAsString": true + "AlertsMetaData": { + "type": "object", + "description": "alert meta data information.", + "properties": { + "properties": { + "$ref": "#/definitions/AlertsMetaDataProperties", + "description": "alert meta data property bag" + } } }, - "customTimeRange": { - "description": "Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.", - "name": "customTimeRange", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "includeContext": { - "description": "Include context which has contextual data specific to the monitor service. Default value is false'", - "name": "includeContext", - "type": "boolean", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "includeEgressConfig": { - "description": "Include egress config which would be used for displaying the content in portal. Default value is 'false'.", - "name": "includeEgressConfig", - "type": "boolean", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "includeSmartGroupsCount": { - "description": "Include count of the SmartGroups as part of the summary. Default value is 'false'.", - "name": "includeSmartGroupsCount", - "type": "boolean", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "pageCount": { - "description": "Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the \"includeContent\" filter is selected, maximum value allowed is 25. Default value is 25.", - "name": "pageCount", - "type": "integer", - "format": "int64", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "alertsSortBy": { - "description": "Sort the query results by input field, Default value is 'lastModifiedDateTime'.", - "name": "sortBy", + "AlertsMetaDataProperties": { + "type": "object", + "description": "alert meta data property bag", + "properties": { + "metadataIdentifier": { + "$ref": "#/definitions/MetadataIdentifier", + "description": "Identification of the information to be retrieved by API call" + } + }, + "discriminator": "metadataIdentifier", + "required": [ + "metadataIdentifier" + ] + }, + "AlertsSortByFields": { "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", "enum": [ "name", "severity", @@ -874,229 +2275,214 @@ ], "x-ms-enum": { "name": "AlertsSortByFields", - "modelAsString": true - } - }, - "alertsSummaryGroupBy": { - "description": "This parameter allows the result set to be grouped by input fields. For example, groupby=severity,alertstate.", - "name": "groupby", - "type": "string", - "in": "query", - "required": true, - "x-ms-parameter-location": "method", - "enum": [ - "severity", - "alertState", - "monitorCondition", - "monitorService", - "signalType", - "alertRule" - ], - "x-ms-enum": { - "name": "AlertsSummaryGroupByFields", - "modelAsString": true - } - }, - "sortOrder": { - "description": "Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.", - "name": "sortOrder", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "asc", - "desc" - ], - "x-ms-enum": { - "name": "SortOrder", - "modelAsString": true - } - }, - "select": { - "description": "This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section.", - "name": "select", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "identifier": { - "name": "identifier", - "description": "Identification of the information to be retrieved by API call.", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "MonitorServiceList" - ], - "x-ms-enum": { - "name": "identifier", - "modelAsString": true - }, - "x-ms-parameter-location": "method" - } - }, - "definitions": { - "operation": { - "description": "Operation provided by provider", - "properties": { - "name": { - "type": "string", - "description": "Name of the operation" - }, - "display": { - "type": "object", - "description": "Properties of the operation", - "properties": { - "provider": { - "type": "string", - "description": "Provider name" - }, - "resource": { - "type": "string", - "description": "Resource name" - }, - "operation": { - "type": "string", - "description": "Operation name" - }, - "description": { - "type": "string", - "description": "Description of the operation" - } + "modelAsString": true, + "values": [ + { + "name": "name", + "value": "name", + "description": "name" + }, + { + "name": "severity", + "value": "severity", + "description": "severity" + }, + { + "name": "alertState", + "value": "alertState", + "description": "alertState" + }, + { + "name": "monitorCondition", + "value": "monitorCondition", + "description": "monitorCondition" + }, + { + "name": "targetResource", + "value": "targetResource", + "description": "targetResource" + }, + { + "name": "targetResourceName", + "value": "targetResourceName", + "description": "targetResourceName" + }, + { + "name": "targetResourceGroup", + "value": "targetResourceGroup", + "description": "targetResourceGroup" + }, + { + "name": "targetResourceType", + "value": "targetResourceType", + "description": "targetResourceType" + }, + { + "name": "startDateTime", + "value": "startDateTime", + "description": "startDateTime" + }, + { + "name": "lastModifiedDateTime", + "value": "lastModifiedDateTime", + "description": "lastModifiedDateTime" } - }, - "origin": { - "type": "string", - "description": "Origin of the operation" - } + ] } }, - "operationsList": { - "description": "Lists the operations available in the AlertsManagement RP.", + "AlertsSummary": { + "type": "object", + "description": "Summary of alerts based on the input filters and 'groupby' parameters.", "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" - }, - "value": { - "description": "Array of operations", - "type": "array", - "items": { - "$ref": "#/definitions/operation" - } + "properties": { + "$ref": "#/definitions/AlertsSummaryGroup", + "description": "Group the result set." } - }, - "required": [ - "value" - ] - }, - "AlertsManagementErrorResponse": { - "description": "An error response from the service.", - "x-ms-external": true, - "properties": { - "error": { - "$ref": "#/definitions/errorResponseBody" + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" } - } + ] }, - "errorResponseBody": { - "description": "Details of error response.", - "x-ms-external": true, + "AlertsSummaryGroup": { + "type": "object", + "description": "Group the result set.", "properties": { - "code": { - "type": "string", - "description": "Error code, intended to be consumed programmatically." + "total": { + "type": "integer", + "format": "int64", + "description": "Total count of the result set." }, - "message": { - "type": "string", - "description": "Description of the error, intended for display in user interface." + "smartGroupsCount": { + "type": "integer", + "format": "int64", + "description": "Total count of the smart groups." }, - "target": { + "groupedby": { "type": "string", - "description": "Target of the particular error, for example name of the property." + "description": "Name of the field aggregated" }, - "details": { + "values": { "type": "array", - "description": "A list of additional details about the error.", + "description": "List of the items", "items": { - "$ref": "#/definitions/errorResponseBody" + "$ref": "#/definitions/AlertsSummaryGroupItem" } } } }, - "ProxyResource": { - "x-ms-azure-resource": true, - "description": "An azure resource object", - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "Azure resource Id" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" - }, - "name": { - "type": "string", - "readOnly": true, - "description": "Azure resource name" - } - } - }, - "alert": { - "type": "object", - "description": "An alert created in alert management service.", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } + "AlertsSummaryGroupByFields": { + "type": "string", + "enum": [ + "severity", + "alertState", + "monitorCondition", + "monitorService", + "signalType", + "alertRule" ], - "properties": { - "properties": { - "$ref": "#/definitions/alertProperties" - } + "x-ms-enum": { + "name": "AlertsSummaryGroupByFields", + "modelAsString": true, + "values": [ + { + "name": "severity", + "value": "severity", + "description": "severity" + }, + { + "name": "alertState", + "value": "alertState", + "description": "alertState" + }, + { + "name": "monitorCondition", + "value": "monitorCondition", + "description": "monitorCondition" + }, + { + "name": "monitorService", + "value": "monitorService", + "description": "monitorService" + }, + { + "name": "signalType", + "value": "signalType", + "description": "signalType" + }, + { + "name": "alertRule", + "value": "alertRule", + "description": "alertRule" + } + ] } }, - "alertsList": { + "AlertsSummaryGroupItem": { "type": "object", - "description": "List the alerts.", + "description": "Alerts summary group item", "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" + "name": { + "type": "string", + "description": "Value of the aggregated field" }, - "value": { - "description": "List of alerts", + "count": { + "type": "integer", + "format": "int64", + "description": "Count of the aggregated field" + }, + "groupedby": { + "type": "string", + "description": "Name of the field aggregated" + }, + "values": { "type": "array", + "description": "List of the items", "items": { - "$ref": "#/definitions/alert" + "$ref": "#/definitions/AlertsSummaryGroupItem" } } } }, - "alertProperties": { + "ApiVersion": { + "type": "string", + "enum": [ + "2019-03-01", + "2025-05-25-preview" + ], + "x-ms-enum": { + "name": "ApiVersion", + "modelAsString": false, + "values": [ + { + "name": "2019-03-01", + "value": "2019-03-01", + "description": "2019-03-01" + }, + { + "name": "2025-05-25-preview", + "value": "2025-05-25-preview", + "description": "2025-05-25-preview" + } + ] + } + }, + "BaseDetails": { "type": "object", - "description": "Alert property bag", + "description": "Base details class.", "properties": { - "essentials": { - "$ref": "#/definitions/essentials" - }, - "context": { - "$ref": "#/definitions/alertContext" - }, - "egressConfig": { - "$ref": "#/definitions/egressConfig" - }, - "customProperties": { - "$ref": "#/definitions/customProperties" + "type": { + "$ref": "#/definitions/AlertModificationType", + "description": "Type of modification details" } - } + }, + "discriminator": "type", + "required": [ + "type" + ] }, - "comments": { + "Comments": { "type": "object", "description": "Change alert state reason", "properties": { @@ -1105,86 +2491,56 @@ } } }, - "egressConfig": { - "type": "object", - "description": "Config which would be used for displaying the data in portal.", - "readOnly": true - }, - "alertContext": { - "type": "object", - "description": "Information specific to the monitor service that gives more contextual details about the alert.", - "readOnly": true - }, - "actionStatus": { + "ErrorResponseBody": { "type": "object", - "description": "Action status", + "description": "Details of error response.", "properties": { - "isSuppressed": { - "type": "boolean", - "description": "Value indicating whether alert is suppressed." + "code": { + "type": "string", + "description": "Error code, intended to be consumed programmatically." + }, + "message": { + "type": "string", + "description": "Description of the error, intended for display in user interface." + }, + "target": { + "type": "string", + "description": "Target of the particular error, for example name of the property." + }, + "details": { + "type": "array", + "description": "A list of additional details about the error.", + "items": { + "$ref": "#/definitions/ErrorResponseBody" + }, + "x-ms-identifiers": [] } - } + }, + "x-ms-external": true }, - "essentials": { + "Essentials": { "type": "object", "description": "This object contains consistent fields across different monitor services.", "properties": { "severity": { - "type": "string", + "$ref": "#/definitions/Severity", "description": "Severity of alert Sev0 being highest and Sev4 being lowest.", - "readOnly": true, - "enum": [ - "Sev0", - "Sev1", - "Sev2", - "Sev3", - "Sev4" - ], - "x-ms-enum": { - "name": "Severity", - "modelAsString": true - } + "readOnly": true }, "signalType": { - "type": "string", + "$ref": "#/definitions/SignalType", "description": "The type of signal the alert is based on, which could be metrics, logs or activity logs.", - "readOnly": true, - "enum": [ - "Metric", - "Log", - "Unknown" - ], - "x-ms-enum": { - "name": "SignalType", - "modelAsString": true - } + "readOnly": true }, "alertState": { - "type": "string", + "$ref": "#/definitions/AlertState", "description": "Alert object state, which can be modified by the user.", - "readOnly": true, - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true - } + "readOnly": true }, "monitorCondition": { - "type": "string", + "$ref": "#/definitions/MonitorCondition", "description": "Can be 'Fired' or 'Resolved', which represents whether the underlying conditions have crossed the defined alert rule thresholds.", - "readOnly": true, - "enum": [ - "Fired", - "Resolved" - ], - "x-ms-enum": { - "name": "MonitorCondition", - "modelAsString": true - } + "readOnly": true }, "targetResource": { "type": "string", @@ -1203,30 +2559,9 @@ "description": "Resource type of target ARM resource, on which alert got created." }, "monitorService": { - "type": "string", + "$ref": "#/definitions/MonitorService", "description": "Monitor service on which the rule(monitor) is set.", - "readOnly": true, - "enum": [ - "Application Insights", - "ActivityLog Administrative", - "ActivityLog Security", - "ActivityLog Recommendation", - "ActivityLog Policy", - "ActivityLog Autoscale", - "Log Analytics", - "Nagios", - "Platform", - "SCOM", - "ServiceHealth", - "SmartDetector", - "VM Insights", - "Zabbix", - "Resource Health" - ], - "x-ms-enum": { - "name": "MonitorService", - "modelAsString": true - } + "readOnly": true }, "alertRule": { "type": "string", @@ -1272,7 +2607,8 @@ "readOnly": true }, "actionStatus": { - "$ref": "#/definitions/actionStatus" + "$ref": "#/definitions/ActionStatus", + "description": "Action status" }, "description": { "type": "string", @@ -1280,428 +2616,355 @@ } } }, - "alertModification": { - "type": "object", - "description": "Alert Modification details", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } + "Identifier": { + "type": "string", + "enum": [ + "MonitorServiceList" ], - "properties": { - "properties": { - "$ref": "#/definitions/alertModificationProperties" - } + "x-ms-enum": { + "name": "Identifier", + "modelAsString": true, + "values": [ + { + "name": "MonitorServiceList", + "value": "MonitorServiceList", + "description": "MonitorServiceList" + } + ] } }, - "alertModificationProperties": { - "type": "object", - "description": "Alert modification history properties.", - "properties": { - "alertId": { - "type": "string", - "description": "Unique identifier of the alert.", - "readOnly": true - }, - "modifications": { - "type": "array", - "description": "Array of alert modification events.", - "items": { - "$ref": "#/definitions/alertModificationItem" + "MetadataIdentifier": { + "type": "string", + "description": "Identification of the information to be retrieved by API call", + "enum": [ + "MonitorServiceList" + ], + "x-ms-enum": { + "name": "MetadataIdentifier", + "modelAsString": true, + "values": [ + { + "name": "MonitorServiceList", + "value": "MonitorServiceList", + "description": "MonitorServiceList" } - } + ] } }, - "alertModificationItem": { - "type": "object", - "description": "Alert modification item.", - "properties": { - "modificationEvent": { - "type": "string", - "description": "Reason for the modification", - "enum": [ - "AlertCreated", - "StateChange", - "SeverityChange", - "MonitorConditionChange", - "ActionsTriggered", - "ActionsSuppressed" - ], - "x-ms-enum": { - "name": "AlertModificationEvent" + "MonitorCondition": { + "type": "string", + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true, + "values": [ + { + "name": "Fired", + "value": "Fired", + "description": "Fired" + }, + { + "name": "Resolved", + "value": "Resolved", + "description": "Resolved" } - }, - "oldValue": { - "type": "string", - "description": "Old value" - }, - "newValue": { - "type": "string", - "description": "New value" - }, - "modifiedAt": { - "type": "string", - "description": "Modified date and time" - }, - "modifiedBy": { - "type": "string", - "description": "Modified user details (Principal client name)" - }, - "comments": { - "type": "string", - "description": "Modification comments" - }, - "description": { - "type": "string", - "description": "Description of the modification" - }, - "details": { - "$ref": "#/definitions/BaseDetails", - "x-nullable": true - } + ] } }, - "BaseDetails": { - "description": "Base details class.", - "type": "object", - "discriminator": "type", - "required": [ - "type" + "MonitorService": { + "type": "string", + "enum": [ + "Application Insights", + "ActivityLog Administrative", + "ActivityLog Security", + "ActivityLog Recommendation", + "ActivityLog Policy", + "ActivityLog Autoscale", + "Log Analytics", + "Nagios", + "Platform", + "SCOM", + "ServiceHealth", + "SmartDetector", + "VM Insights", + "Zabbix", + "Resource Health" ], - "properties": { - "type": { - "type": "string", - "description": "Type of modification details", - "enum": [ - "PropertyChange", - "ActionsSuppressed", - "ActionsTriggered" - ], - "x-ms-enum": { - "name": "AlertModificationType", - "modelAsString": true + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": true, + "values": [ + { + "name": "Application Insights", + "value": "Application Insights", + "description": "Application Insights" + }, + { + "name": "ActivityLog Administrative", + "value": "ActivityLog Administrative", + "description": "ActivityLog Administrative" + }, + { + "name": "ActivityLog Security", + "value": "ActivityLog Security", + "description": "ActivityLog Security" + }, + { + "name": "ActivityLog Recommendation", + "value": "ActivityLog Recommendation", + "description": "ActivityLog Recommendation" + }, + { + "name": "ActivityLog Policy", + "value": "ActivityLog Policy", + "description": "ActivityLog Policy" + }, + { + "name": "ActivityLog Autoscale", + "value": "ActivityLog Autoscale", + "description": "ActivityLog Autoscale" + }, + { + "name": "Log Analytics", + "value": "Log Analytics", + "description": "Log Analytics" + }, + { + "name": "Nagios", + "value": "Nagios", + "description": "Nagios" + }, + { + "name": "Platform", + "value": "Platform", + "description": "Platform" + }, + { + "name": "SCOM", + "value": "SCOM", + "description": "SCOM" + }, + { + "name": "ServiceHealth", + "value": "ServiceHealth", + "description": "ServiceHealth" + }, + { + "name": "SmartDetector", + "value": "SmartDetector", + "description": "SmartDetector" + }, + { + "name": "VM Insights", + "value": "VM Insights", + "description": "VM Insights" + }, + { + "name": "Zabbix", + "value": "Zabbix", + "description": "Zabbix" + }, + { + "name": "Resource Health", + "value": "Resource Health", + "description": "Resource Health" } - } + ] } }, - "PropertyChangeDetails": { - "x-ms-discriminator-value": "PropertyChange", + "MonitorServiceDetails": { "type": "object", - "allOf": [ - { - "$ref": "#/definitions/BaseDetails" - } - ], + "description": "Details of a monitor service", "properties": { - "oldValue": { - "type": "string", - "description": "The value before the change" - }, - "newValue": { + "name": { "type": "string", - "description": "The value after the change" + "description": "Monitor service name" }, - "comment": { + "displayName": { "type": "string", - "description": "The comment" + "description": "Monitor service display name" } } }, - "ActionSuppressedDetails": { - "x-ms-discriminator-value": "ActionsSuppressed", + "MonitorServiceList": { "type": "object", - "allOf": [ - { - "$ref": "#/definitions/BaseDetails" - } - ], + "description": "Monitor service details", "properties": { - "suppressionActionRules": { - "type": "array", - "description": "List of suppression action rules", - "items": { - "type": "string", - "description": "Action rule Id" - } - }, - "suppressedActionGroups": { - "description": "List of suppressed action groups", + "data": { "type": "array", + "description": "Array of operations", "items": { - "$ref": "#/definitions/TriggeredRule" + "$ref": "#/definitions/MonitorServiceDetails" } } - } - }, - "ActionTriggeredDetails": { - "x-ms-discriminator-value": "ActionsTriggered", - "type": "object", + }, + "required": [ + "data" + ], "allOf": [ { - "$ref": "#/definitions/BaseDetails" + "$ref": "#/definitions/AlertsMetaDataProperties" } ], - "properties": { - "actionGroup": { - "$ref": "#/definitions/TriggeredRule", - "description": "The action group that was triggered" - }, - "notificationResult": { - "$ref": "#/definitions/NotificationResult", - "description": "The result of the notification delivery" - } - } - }, - "TriggeredRule": { - "type": "object", - "properties": { - "actionGroupId": { - "type": "string", - "description": "The action group ID" - }, - "ruleId": { - "type": "string", - "description": "The rule ID" - }, - "ruleType": { - "type": "string", - "description": "The rule type", - "enum": [ - "AlertRule", - "ActionRule" - ], - "x-ms-enum": { - "name": "RuleType", - "modelAsString": true - } - } - } + "x-ms-discriminator-value": "MonitorServiceList" }, "NotificationResult": { "type": "object", "properties": { "statusURL": { "type": "string", - "description": "URL endpoint for checking notification delivery status. Only populated when status is 'Inline'.", - "x-nullable": true + "description": "URL endpoint for checking notification delivery status. Only populated when status is 'Inline'." }, "status": { - "type": "string", - "description": "The status of the notification", - "enum": [ - "None", - "Inline", - "Throttled", - "Failed", - "ThrottledByAlertRule", - "ThrottledBySubscription" - ], - "x-ms-enum": { - "name": "ResultStatus", - "modelAsString": true - } + "$ref": "#/definitions/ResultStatus", + "description": "The status of the notification" } } }, - "alertsSummary": { + "Operation": { "type": "object", - "description": "Summary of alerts based on the input filters and 'groupby' parameters.", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], + "description": "Operation provided by provider", "properties": { - "properties": { - "$ref": "#/definitions/alertsSummaryGroup" + "name": { + "type": "string", + "description": "Name of the operation" + }, + "display": { + "$ref": "#/definitions/OperationDisplay", + "description": "Properties of the operation" + }, + "origin": { + "type": "string", + "description": "Origin of the operation" } } }, - "alertsSummaryGroup": { + "OperationDisplay": { "type": "object", - "description": "Group the result set.", + "description": "Properties of the operation", "properties": { - "total": { - "type": "integer", - "format": "int64", - "description": "Total count of the result set." + "provider": { + "type": "string", + "description": "Provider name" }, - "smartGroupsCount": { - "type": "integer", - "format": "int64", - "description": "Total count of the smart groups." + "resource": { + "type": "string", + "description": "Resource name" }, - "groupedby": { + "operation": { "type": "string", - "description": "Name of the field aggregated" + "description": "Operation name" }, - "values": { - "type": "array", - "description": "List of the items", - "items": { - "$ref": "#/definitions/alertsSummaryGroupItem" - } + "description": { + "type": "string", + "description": "Description of the operation" } } }, - "alertsSummaryGroupItem": { + "PrometheusEnrichmentItem": { "type": "object", - "description": "Alerts summary group item", + "description": "Prometheus enrichment object.", "properties": { - "name": { + "title": { "type": "string", - "description": "Value of the aggregated field" + "description": "The enrichment title." }, - "count": { - "type": "integer", - "format": "int64", - "description": "Count of the aggregated field" + "description": { + "type": "string", + "description": "The enrichment description." }, - "groupedby": { + "status": { + "$ref": "#/definitions/Status", + "description": "The status of the evaluation of the enrichment." + }, + "errorMessage": { "type": "string", - "description": "Name of the field aggregated" + "description": "The error message. Will be present only if the status is 'Failed'." }, - "values": { - "type": "array", - "description": "List of the items", - "items": { - "$ref": "#/definitions/alertsSummaryGroupItem" - } - } - } - }, - "alertsMetaData": { - "type": "object", - "description": "alert meta data information.", - "properties": { - "properties": { - "$ref": "#/definitions/alertsMetaDataProperties" - } - } - }, - "alertsMetaDataProperties": { - "type": "object", - "description": "alert meta data property bag", - "discriminator": "metadataIdentifier", - "required": [ - "metadataIdentifier" - ], - "properties": { - "metadataIdentifier": { + "type": { + "$ref": "#/definitions/Type", + "description": "The enrichment type." + }, + "linkToApi": { "type": "string", - "description": "Identification of the information to be retrieved by API call", - "enum": [ - "MonitorServiceList" - ], - "x-ms-enum": { - "name": "metadataIdentifier", - "modelAsString": true - } - } - } - }, - "MonitorServiceList": { - "type": "object", - "title": "Monitor service details", - "description": "Monitor service details", - "required": [ - "data" - ], - "allOf": [ - { - "$ref": "#/definitions/alertsMetaDataProperties" + "description": "Link to Prometheus query API (Url format)." }, - { - "type": "object" - } - ], - "properties": { - "data": { - "description": "Array of operations", + "datasources": { "type": "array", + "description": "An array of the azure monitor workspace resource ids.", "items": { - "$ref": "#/definitions/MonitorServiceDetails" + "type": "string" } - } - } - }, - "MonitorServiceDetails": { - "type": "object", - "description": "Details of a monitor service", - "properties": { - "name": { + }, + "grafanaExplorePath": { "type": "string", - "description": "Monitor service name" + "description": "Partial link to the Grafana explore API." }, - "displayName": { + "query": { "type": "string", - "description": "Monitor service display name" + "description": "The Prometheus expression query." } - } - }, - "alertEnrichmentItem": { - "type": "object", - "description": "Alert enrichment item.", + }, "discriminator": "type", "required": [ "title", "description", "status", - "type" - ], + "type", + "linkToApi", + "datasources", + "grafanaExplorePath", + "query" + ] + }, + "PrometheusInstantQuery": { + "type": "object", + "description": "Prometheus instant query enrichment object.", "properties": { - "title": { + "linkToApi": { "type": "string", - "description": "The enrichment title." + "description": "Link to Prometheus query API (Url format)." }, - "description": { - "type": "string", - "description": "The enrichment description." + "datasources": { + "type": "array", + "description": "An array of the azure monitor workspace resource ids.", + "items": { + "type": "string" + } }, - "status": { + "grafanaExplorePath": { "type": "string", - "description": "The status of the evaluation of the enrichment.", - "enum": [ - "Succeeded", - "Failed" - ], - "x-ms-enum": { - "name": "status", - "modelAsString": true - } + "description": "Partial link to the Grafana explore API." }, - "errorMessage": { + "query": { "type": "string", - "description": "The error message. Will be present only if the status is 'Failed'." + "description": "The Prometheus expression query." }, - "type": { + "time": { "type": "string", - "description": "The enrichment type.", - "enum": [ - "PrometheusInstantQuery", - "PrometheusRangeQuery" - ], - "x-ms-enum": { - "name": "type", - "modelAsString": true - } + "description": "The date and the time of the evaluation." } - } - }, - "PrometheusEnrichmentItem": { - "type": "object", - "description": "Prometheus enrichment object.", + }, "required": [ "linkToApi", "datasources", "grafanaExplorePath", - "query" + "query", + "time" ], "allOf": [ { - "$ref": "#/definitions/alertEnrichmentItem" + "$ref": "#/definitions/AlertEnrichmentItem" } ], + "x-ms-discriminator-value": "PrometheusInstantQuery" + }, + "PrometheusRangeQuery": { + "type": "object", + "description": "Prometheus instant query enrichment object.", "properties": { "linkToApi": { "type": "string", @@ -1711,10 +2974,8 @@ "type": "array", "description": "An array of the azure monitor workspace resource ids.", "items": { - "type": "string", - "description": "The azure monitor workspace resource id." - }, - "x-ms-identifiers": [] + "type": "string" + } }, "grafanaExplorePath": { "type": "string", @@ -1723,115 +2984,348 @@ "query": { "type": "string", "description": "The Prometheus expression query." - } - } - }, - "PrometheusInstantQuery": { - "x-ms-discriminator-value": "PrometheusInstantQuery", - "type": "object", - "description": "Prometheus instant query enrichment object.", - "required": [ - "time" - ], - "allOf": [ - { - "$ref": "#/definitions/PrometheusEnrichmentItem" - } - ], - "properties": { - "time": { + }, + "start": { "type": "string", - "description": "The date and the time of the evaluation." + "format": "date-time", + "description": "The start evaluation date and time in ISO8601 format." + }, + "end": { + "type": "string", + "format": "date-time", + "description": "The end evaluation date and time in ISO8601 format." + }, + "step": { + "type": "string", + "description": "Query resolution step width in ISO8601 format." } - } - }, - "PrometheusRangeQuery": { - "type": "object", - "x-ms-discriminator-value": "PrometheusRangeQuery", - "description": "Prometheus instant query enrichment object.", + }, "required": [ + "linkToApi", + "datasources", + "grafanaExplorePath", + "query", "start", "end", "step" ], "allOf": [ { - "$ref": "#/definitions/PrometheusEnrichmentItem" + "$ref": "#/definitions/AlertEnrichmentItem" } ], + "x-ms-discriminator-value": "PrometheusRangeQuery" + }, + "PropertyChangeDetails": { + "type": "object", "properties": { - "start": { + "oldValue": { "type": "string", - "description": "The start evaluation date and time in ISO8601 format.", - "format": "date-time" + "description": "The value before the change" }, - "end": { + "newValue": { "type": "string", - "description": "The end evaluation date and time in ISO8601 format.", - "format": "date-time" + "description": "The value after the change" }, - "step": { + "comment": { "type": "string", - "description": "Query resolution step width in ISO8601 format." + "description": "The comment" } - } + }, + "allOf": [ + { + "$ref": "#/definitions/BaseDetails" + } + ], + "x-ms-discriminator-value": "PropertyChange" }, - "alertEnrichmentProperties": { + "ProxyResource": { "type": "object", - "description": "Properties of the alert enrichment item.", + "description": "An azure resource object", "properties": { - "alertId": { + "id": { "type": "string", - "description": "Unique Id (GUID) of the alert for which the enrichments are being retrieved.", + "description": "Azure resource Id", "readOnly": true }, - "enrichments": { - "type": "array", - "description": "Enrichment details", - "items": { - "$ref": "#/definitions/alertEnrichmentItem" - }, - "x-ms-identifiers": [] + "type": { + "type": "string", + "description": "Azure resource type", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Azure resource name", + "readOnly": true } } }, - "alertEnrichmentResponse": { - "description": "The alert's enrichments.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" - } + "ResultStatus": { + "type": "string", + "description": "The status of the notification", + "enum": [ + "None", + "Inline", + "Throttled", + "Failed", + "ThrottledByAlertRule", + "ThrottledBySubscription" ], - "properties": { - "properties": { - "$ref": "#/definitions/alertEnrichmentProperties" - } + "x-ms-enum": { + "name": "ResultStatus", + "modelAsString": true, + "values": [ + { + "name": "None", + "value": "None", + "description": "None" + }, + { + "name": "Inline", + "value": "Inline", + "description": "Inline" + }, + { + "name": "Throttled", + "value": "Throttled", + "description": "Throttled" + }, + { + "name": "Failed", + "value": "Failed", + "description": "Failed" + }, + { + "name": "ThrottledByAlertRule", + "value": "ThrottledByAlertRule", + "description": "ThrottledByAlertRule" + }, + { + "name": "ThrottledBySubscription", + "value": "ThrottledBySubscription", + "description": "ThrottledBySubscription" + } + ] } }, - "alertEnrichmentsList": { - "description": "List the alert's enrichments.", + "RuleType": { + "type": "string", + "description": "The rule type", + "enum": [ + "AlertRule", + "ActionRule" + ], + "x-ms-enum": { + "name": "RuleType", + "modelAsString": true, + "values": [ + { + "name": "AlertRule", + "value": "AlertRule", + "description": "AlertRule" + }, + { + "name": "ActionRule", + "value": "ActionRule", + "description": "ActionRule" + } + ] + } + }, + "Severity": { + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true, + "values": [ + { + "name": "Sev0", + "value": "Sev0", + "description": "Sev0" + }, + { + "name": "Sev1", + "value": "Sev1", + "description": "Sev1" + }, + { + "name": "Sev2", + "value": "Sev2", + "description": "Sev2" + }, + { + "name": "Sev3", + "value": "Sev3", + "description": "Sev3" + }, + { + "name": "Sev4", + "value": "Sev4", + "description": "Sev4" + } + ] + } + }, + "SignalType": { + "type": "string", + "description": "The type of signal the alert is based on, which could be metrics, logs or activity logs.", + "enum": [ + "Metric", + "Log", + "Unknown" + ], + "x-ms-enum": { + "name": "SignalType", + "modelAsString": true, + "values": [ + { + "name": "Metric", + "value": "Metric", + "description": "Metric" + }, + { + "name": "Log", + "value": "Log", + "description": "Log" + }, + { + "name": "Unknown", + "value": "Unknown", + "description": "Unknown" + } + ] + } + }, + "SortOrder": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "SortOrder", + "modelAsString": true, + "values": [ + { + "name": "asc", + "value": "asc", + "description": "asc" + }, + { + "name": "desc", + "value": "desc", + "description": "desc" + } + ] + } + }, + "Status": { + "type": "string", + "description": "The status of the evaluation of the enrichment.", + "enum": [ + "Succeeded", + "Failed" + ], + "x-ms-enum": { + "name": "Status", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Succeeded" + }, + { + "name": "Failed", + "value": "Failed", + "description": "Failed" + } + ] + } + }, + "TimeRange": { + "type": "string", + "enum": [ + "1h", + "1d", + "7d", + "30d" + ], + "x-ms-enum": { + "name": "TimeRange", + "modelAsString": true, + "values": [ + { + "name": "1h", + "value": "1h", + "description": "1h" + }, + { + "name": "1d", + "value": "1d", + "description": "1d" + }, + { + "name": "7d", + "value": "7d", + "description": "7d" + }, + { + "name": "30d", + "value": "30d", + "description": "30d" + } + ] + } + }, + "TriggeredRule": { "type": "object", "properties": { - "value": { - "description": "List the alert's enrichments", - "type": "array", - "items": { - "$ref": "#/definitions/alertEnrichmentResponse" - } + "actionGroupId": { + "type": "string", + "description": "The action group ID" }, - "nextLink": { + "ruleId": { "type": "string", - "description": "Request URL that can be used to query next page." + "description": "The rule ID" + }, + "ruleType": { + "$ref": "#/definitions/RuleType", + "description": "The rule type" } } }, - "customProperties": { - "type": "object", - "description": "Custom properties that can hold any user defined key-value pairs", - "additionalProperties": { - "type": "string" + "Type": { + "type": "string", + "description": "The enrichment type.", + "enum": [ + "PrometheusInstantQuery", + "PrometheusRangeQuery" + ], + "x-ms-enum": { + "name": "Type", + "modelAsString": true, + "values": [ + { + "name": "PrometheusInstantQuery", + "value": "PrometheusInstantQuery", + "description": "PrometheusInstantQuery" + }, + { + "name": "PrometheusRangeQuery", + "value": "PrometheusRangeQuery", + "description": "PrometheusRangeQuery" + } + ] } } - } + }, + "parameters": {} } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/AlertsMetaData_MonitorService.json index 0b8ab5f52421..8213a82a486e 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/AlertsMetaData_MonitorService.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/AlertsMetaData_MonitorService.json @@ -7,7 +7,6 @@ "200": { "body": { "properties": { - "metadataIdentifier": "MonitorServiceList", "data": [ { "name": "ActivityLog Administrative", @@ -81,9 +80,12 @@ "name": "Zabbix", "displayName": "ZABBIX" } - ] + ], + "metadataIdentifier": "MonitorServiceList" } } } - } + }, + "operationId": "Alerts_MetaData", + "title": "MonService" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeState.json index 6249ab99cf11..b168748a17b6 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeState.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeState.json @@ -1,47 +1,49 @@ { "parameters": { - "api-version": "2025-05-25-preview", - "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", - "newState": "Acknowledged", + "api-version": "2025-05-25-preview", "body": { "comment": "Acknowledging alert" - } + }, + "newState": "Acknowledged", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" }, "responses": { "200": { "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", "properties": { + "context": {}, + "egressConfig": {}, "essentials": { - "severity": "Sev3", - "signalType": "Log", + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", "monitorService": "Application Insights", - "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", - "targetResourceName": "servicedeskappinsight", - "targetResourceGroup": "servicedeskresourcegroup", - "targetResourceType": "components", - "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "severity": "Sev3", + "signalType": "Log", "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", "smartGroupingReason": "Occurred frequently with other alerts", - "alertRule": "https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", "startDateTime": "2018-09-13T15:51:02Z", - "lastModifiedDateTime": "2018-09-13T15:51:02Z", - "lastModifiedUserName": "System", - "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", - "actionStatus": { - "isSuppressed": false - }, - "description": "description of the alert" - }, - "egressConfig": {}, - "context": {} - }, - "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", - "type": "Microsoft.AlertsManagement/alerts", - "name": "cpu alert" + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } } } - } + }, + "operationId": "Alerts_ChangeState", + "title": "Resolve" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeStateTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeStateTenant.json new file mode 100644 index 000000000000..38178c0029a2 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeStateTenant.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "body": { + "comment": "Acknowledging alert" + }, + "newState": "Acknowledged", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" + }, + "responses": { + "200": { + "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": {}, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + } + } + }, + "operationId": "Alerts_ChangeStateTenant", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetById.json index 1c7efd6cd585..19c767000b5b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetById.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetById.json @@ -1,47 +1,49 @@ { "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", "api-version": "2025-05-25-preview", - "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", - "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" }, "responses": { "200": { "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", "properties": { + "context": {}, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, "essentials": { - "severity": "Sev3", - "signalType": "Log", + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", "monitorService": "Application Insights", - "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", - "targetResourceName": "servicedeskappinsight", - "targetResourceGroup": "servicedeskresourcegroup", - "targetResourceType": "components", - "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "severity": "Sev3", + "signalType": "Log", "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", "smartGroupingReason": "Occurred frequently with other alerts", - "alertRule": "https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", "startDateTime": "2018-09-13T15:51:02Z", - "lastModifiedDateTime": "2018-09-13T15:51:02Z", - "lastModifiedUserName": "System", - "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", - "actionStatus": { - "isSuppressed": false - }, - "description": "description of the alert" - }, - "egressConfig": {}, - "context": {}, - "customProperties": { - "key1": "value1", - "key2": "value2" + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" } - }, - "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", - "type": "Microsoft.AlertsManagement/alerts", - "name": "cpu alert" + } } } - } + }, + "operationId": "Alerts_GetById", + "title": "GetById" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetByIdTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetByIdTenant.json new file mode 100644 index 000000000000..1578aa3d9fda --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetByIdTenant.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight" + }, + "responses": { + "200": { + "body": { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": {}, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + } + } + }, + "operationId": "Alerts_GetByIdTenant", + "title": "GetById" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetEnrichments.json index ee8030fef243..6e3efed7b314 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetEnrichments.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetEnrichments.json @@ -1,63 +1,63 @@ { "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502101", "api-version": "2025-05-25-preview", - "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", - "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" + "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81" }, "responses": { "200": { "body": { "value": [ { - "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502101/enrichments/default", - "type": "Microsoft.AlertsManagement/alerts/enrichments", "name": "default", + "type": "Microsoft.AlertsManagement/alerts/enrichments", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502101/enrichments/default", "properties": { "alertId": "66114d64-d9d9-478b-95c9-b789d6502101", "enrichments": [ { - "title": "Number of OOM killed events by container", - "description": "Enrichment description", - "status": "Succeeded", "type": "PrometheusInstantQuery", - "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", - "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", + "description": "Enrichment description", "datasources": [ "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" ], + "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", "query": "sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace1'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0", - "time": "2015-07-01T20:10:51.781Z" + "status": "Succeeded", + "time": "2015-07-01T20:10:51.781Z", + "title": "Number of OOM killed events by container" }, { - "title": "Number of OOM killed events by container", - "description": "Enrichment description", - "status": "Succeeded", "type": "PrometheusRangeQuery", - "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", - "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "description": "Enrichment description", "datasources": [ "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" ], + "end": "2015-07-01T20:20:51.781Z", + "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", "query": "sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0", "start": "2015-07-01T20:10:51.781Z", - "end": "2015-07-01T20:20:51.781Z", - "step": "PT15S" + "status": "Succeeded", + "step": "PT15S", + "title": "Number of OOM killed events by container" }, { - "title": "Number of OOM killed events by container", - "description": "Enrichment description", - "status": "Failed", "type": "PrometheusRangeQuery", - "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", - "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", - "errorMessage": "Calling Prometheus query API failed", + "description": "Enrichment description", "datasources": [ "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" ], + "end": "2015-07-01T20:20:51.781Z", + "errorMessage": "Calling Prometheus query API failed", + "grafanaExplorePath": "/explore?left=%7B%22datasource%22...", + "linkToApi": "https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?...", "query": "sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0", "start": "2015-07-01T20:10:51.781Z", - "end": "2015-07-01T20:20:51.781Z", - "step": "PT15S" + "status": "Failed", + "step": "PT15S", + "title": "Number of OOM killed events by container" } ] } @@ -65,5 +65,7 @@ ] } } - } + }, + "operationId": "Alerts_GetEnrichments", + "title": "Resolve" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetHistoryTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetHistoryTenant.json new file mode 100644 index 000000000000..7501dac0ba93 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetHistoryTenant.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a" + }, + "responses": { + "200": { + "body": { + "name": "CPU Alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "modifications": [ + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "AlertCreated", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": null + }, + { + "description": "State changed from 'New' to 'Acknowledged'", + "comments": "The alert has been resolved", + "modificationEvent": "StateChange", + "modifiedAt": "2018-06-13T06:14:15.7378737Z", + "modifiedBy": "vikramm@microsoft.com", + "newValue": "Resolved", + "oldValue": "Fired", + "details": { + "type": "PropertyChange", + "comment": "The alert has been resolved", + "newValue": "Resolved", + "oldValue": "Fired" + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsTriggered", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsTriggered", + "actionGroup": { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + }, + "notificationResult": { + "status": "Accepted", + "statusURL": "https://management.azure.com/subscriptions/2a784a95-81bd-41c8-ba8a-362d1098a2b9/resourceGroups/AzNSTest/providers/microsoft.insights/actionGroups/ag2/notificationStatus/00000000000?api-version=2021-09-01" + } + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsSuppressed", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsSuppressed", + "suppressedActionGroups": [ + { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + } + ], + "suppressionActionRules": [ + "ActionRule 1", + "ActionRule 2" + ] + } + } + ] + } + } + } + }, + "operationId": "Alerts_GetHistoryTenant", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_History.json index 07fc1f5debdd..dfde045a4133 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_History.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_History.json @@ -1,51 +1,51 @@ { "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", "api-version": "2025-05-25-preview", - "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a", - "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a" }, "responses": { "200": { "body": { - "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", - "type": "Microsoft.AlertsManagement/alerts", "name": "CPU Alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", "properties": { "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", "modifications": [ { + "description": "New Alert Object is created", + "comments": "", "modificationEvent": "AlertCreated", "modifiedAt": "2018-06-13T06:09:01Z", "modifiedBy": "System", - "description": "New Alert Object is created", - "oldValue": "", "newValue": "", - "comments": "", + "oldValue": "", "details": null }, { + "description": "State changed from 'New' to 'Acknowledged'", + "comments": "The alert has been resolved", "modificationEvent": "StateChange", "modifiedAt": "2018-06-13T06:14:15.7378737Z", "modifiedBy": "vikramm@microsoft.com", - "description": "State changed from 'New' to 'Acknowledged'", - "oldValue": "Fired", "newValue": "Resolved", - "comments": "The alert has been resolved", + "oldValue": "Fired", "details": { "type": "PropertyChange", - "oldValue": "Fired", + "comment": "The alert has been resolved", "newValue": "Resolved", - "comment": "The alert has been resolved" + "oldValue": "Fired" } }, { + "description": "New Alert Object is created", + "comments": "", "modificationEvent": "ActionsTriggered", "modifiedAt": "2018-06-13T06:09:01Z", "modifiedBy": "System", - "description": "New Alert Object is created", - "oldValue": "", "newValue": "", - "comments": "", + "oldValue": "", "details": { "type": "ActionsTriggered", "actionGroup": { @@ -60,25 +60,25 @@ } }, { + "description": "New Alert Object is created", + "comments": "", "modificationEvent": "ActionsSuppressed", "modifiedAt": "2018-06-13T06:09:01Z", "modifiedBy": "System", - "description": "New Alert Object is created", - "oldValue": "", "newValue": "", - "comments": "", + "oldValue": "", "details": { "type": "ActionsSuppressed", - "suppressionActionRules": [ - "ActionRule 1", - "ActionRule 2" - ], "suppressedActionGroups": [ { "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", "ruleId": "RuleId1", "ruleType": "AlertRule" } + ], + "suppressionActionRules": [ + "ActionRule 1", + "ActionRule 2" ] } } @@ -86,5 +86,7 @@ } } } - } + }, + "operationId": "Alerts_GetHistory", + "title": "Resolve" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_HistoryTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_HistoryTenant.json new file mode 100644 index 000000000000..7501dac0ba93 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_HistoryTenant.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "api-version": "2025-05-25-preview", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a" + }, + "responses": { + "200": { + "body": { + "name": "CPU Alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "modifications": [ + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "AlertCreated", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": null + }, + { + "description": "State changed from 'New' to 'Acknowledged'", + "comments": "The alert has been resolved", + "modificationEvent": "StateChange", + "modifiedAt": "2018-06-13T06:14:15.7378737Z", + "modifiedBy": "vikramm@microsoft.com", + "newValue": "Resolved", + "oldValue": "Fired", + "details": { + "type": "PropertyChange", + "comment": "The alert has been resolved", + "newValue": "Resolved", + "oldValue": "Fired" + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsTriggered", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsTriggered", + "actionGroup": { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + }, + "notificationResult": { + "status": "Accepted", + "statusURL": "https://management.azure.com/subscriptions/2a784a95-81bd-41c8-ba8a-362d1098a2b9/resourceGroups/AzNSTest/providers/microsoft.insights/actionGroups/ag2/notificationStatus/00000000000?api-version=2021-09-01" + } + } + }, + { + "description": "New Alert Object is created", + "comments": "", + "modificationEvent": "ActionsSuppressed", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "newValue": "", + "oldValue": "", + "details": { + "type": "ActionsSuppressed", + "suppressedActionGroups": [ + { + "actionGroupId": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1", + "ruleId": "RuleId1", + "ruleType": "AlertRule" + } + ], + "suppressionActionRules": [ + "ActionRule 1", + "ActionRule 2" + ] + } + } + ] + } + } + } + }, + "operationId": "Alerts_GetHistoryTenant", + "title": "Resolve" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List.json index d5c64fb6bb16..1d13296a2e0b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List.json @@ -1,8 +1,8 @@ { "parameters": { "api-version": "2025-05-25-preview", - "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166", - "includeContext": true + "includeContext": true, + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166" }, "responses": { "200": { @@ -10,128 +10,130 @@ "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", "value": [ { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, "essentials": { - "severity": "Sev3", - "signalType": "Log", + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", "monitorService": "Application Insights", - "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", - "targetResourceName": "servicedeskappinsight", - "targetResourceGroup": "servicedeskresourcegroup", - "targetResourceType": "components", - "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "severity": "Sev3", + "signalType": "Log", "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", "smartGroupingReason": "Occurred frequently with other alerts", - "alertRule": "https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", "startDateTime": "2018-09-13T15:51:02Z", - "lastModifiedDateTime": "2018-09-13T15:51:02Z", - "lastModifiedUserName": "System", - "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", - "actionStatus": { - "isSuppressed": false - }, - "description": "description of the alert" - }, - "egressConfig": {}, - "customProperties": { - "key1": "value1", - "key2": "value2" - }, + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + }, + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { "context": { + "AffectedConfigurationItems": [ + "" + ], "AlertRuleName": "Test number of results", - "SearchQuery": "traces", "AlertThresholdOperator": "Greater Than Or Equal To", "AlertThresholdValue": 0, - "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", - "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", - "ResultCount": 3, - "SearchIntervalInSeconds": 1800, - "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", - "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", - "Description": "", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", "SeverityDescription": "Informational", "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", - "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf", - "SearchIntervalDurationMin": "30", - "AffectedConfigurationItems": [ - "" - ], - "AlertType": "Number of results", - "IncludeSearchResults": true, - "Frequency": 5 - } - }, - "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", - "type": "Microsoft.AlertsManagement/alerts", - "name": "cpu alert" - }, - { - "properties": { + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "category": "performance", + "environment": "production", + "priority": "high" + }, + "egressConfig": {}, "essentials": { - "severity": "Sev3", - "signalType": "Log", + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", "alertState": "New", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", "monitorService": "Application Insights", - "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus", - "targetResourceName": "servicedeskwcus", - "targetResourceGroup": "servicedeskresourcegroup", - "targetResourceType": "components", - "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "severity": "Sev3", + "signalType": "Log", "smartGroupId": "d1c49c89-ea95-4697-a299-c0f5ebac62f1", "smartGroupingReason": "Alerts that frequently occur together have been grouped.", - "alertRule": "https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", "startDateTime": "2018-09-13T15:51:02Z", - "lastModifiedDateTime": "2018-09-13T15:51:02Z", - "lastModifiedUserName": "System", - "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", - "actionStatus": { - "isSuppressed": false - }, - "description": "description of the alert" - }, - "egressConfig": {}, - "customProperties": { - "environment": "production", - "category": "performance", - "priority": "high" - }, - "context": { - "AlertRuleName": "Test number of results", - "SearchQuery": "traces", - "AlertThresholdOperator": "Greater Than Or Equal To", - "AlertThresholdValue": 0, - "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", - "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", - "ResultCount": 3, - "SearchIntervalInSeconds": 1800, - "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", - "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", - "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", - "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", - "Description": "", - "SeverityDescription": "Informational", - "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", - "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf", - "SearchIntervalDurationMin": "30", - "AffectedConfigurationItems": [ - "" - ], - "AlertType": "Number of results", - "IncludeSearchResults": true, - "Frequency": 5 + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskwcus", + "targetResourceType": "components" } - }, - "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", - "type": "Microsoft.AlertsManagement/alerts", - "name": "cpu alert" + } } ] } } - } + }, + "operationId": "Alerts_GetAll", + "title": "ListAlerts" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List_GetAllTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List_GetAllTenant.json new file mode 100644 index 000000000000..2509782122b3 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List_GetAllTenant.json @@ -0,0 +1,139 @@ +{ + "parameters": { + "api-version": "2025-05-25-preview", + "includeContext": true, + "scope": "subscriptions/3b540246-808d-4331-99aa-917b808a9166" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", + "value": [ + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "key1": "value1", + "key2": "value2" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "Acknowledged", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "23d6b2ce-8c54-468f-aff0-sd32aebb7e56", + "smartGroupingReason": "Occurred frequently with other alerts", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskappinsight", + "targetResourceType": "components" + } + } + }, + { + "name": "cpu alert", + "type": "Microsoft.AlertsManagement/alerts", + "id": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "properties": { + "context": { + "AffectedConfigurationItems": [ + "" + ], + "AlertRuleName": "Test number of results", + "AlertThresholdOperator": "Greater Than Or Equal To", + "AlertThresholdValue": 0, + "AlertType": "Number of results", + "Description": "", + "Frequency": 5, + "IncludeSearchResults": true, + "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z", + "ResultCount": 3, + "SearchIntervalDurationMin": "30", + "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z", + "SearchIntervalInSeconds": 1800, + "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z", + "SearchQuery": "traces", + "SeverityDescription": "Informational", + "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901", + "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf" + }, + "customProperties": { + "category": "performance", + "environment": "production", + "priority": "high" + }, + "egressConfig": {}, + "essentials": { + "description": "description of the alert", + "actionStatus": { + "isSuppressed": false + }, + "alertRule": "https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=", + "alertState": "New", + "lastModifiedDateTime": "2018-09-13T15:51:02Z", + "lastModifiedUserName": "System", + "monitorCondition": "Fired", + "monitorConditionResolvedDateTime": "2018-09-13T15:51:02Z", + "monitorService": "Application Insights", + "severity": "Sev3", + "signalType": "Log", + "smartGroupId": "d1c49c89-ea95-4697-a299-c0f5ebac62f1", + "smartGroupingReason": "Alerts that frequently occur together have been grouped.", + "sourceCreatedId": "6cd6b2ce-8c54-468f-aff0-9d12aebb7e49", + "startDateTime": "2018-09-13T15:51:02Z", + "targetResource": "/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus", + "targetResourceGroup": "servicedeskresourcegroup", + "targetResourceName": "servicedeskwcus", + "targetResourceType": "components" + } + } + } + ] + } + } + }, + "operationId": "Alerts_GetAllTenant", + "title": "ListAlerts" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_Summary.json index daeaca6c9f32..103116fb97cb 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_Summary.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_Summary.json @@ -1,12 +1,15 @@ { "parameters": { "api-version": "2025-05-25-preview", - "scope": "subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d", - "groupby": "severity,alertState" + "groupby": "severity,alertState", + "scope": "subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d" }, "responses": { "200": { "body": { + "name": "current", + "type": "Microsoft.AlertsManagement/alertsSummary", + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current", "properties": { "groupedby": "severity", "smartGroupsCount": 100, @@ -108,11 +111,10 @@ ] } ] - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current", - "type": "Microsoft.AlertsManagement/alertsSummary", - "name": "current" + } } } - } + }, + "operationId": "Alerts_GetSummary", + "title": "Summary" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Operations_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Operations_List.json index a3e468e2e276..af0f8cc49a98 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Operations_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Operations_List.json @@ -9,230 +9,232 @@ { "name": "Microsoft.AlertsManagement/register/action", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "Subscription", + "description": "Subscription Registration Action", "operation": "Subscription Registration Action", - "description": "Subscription Registration Action" + "provider": "Microsoft.AlertsManagement", + "resource": "Subscription" } }, { "name": "Microsoft.AlertsManagement/register/action", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "register", + "description": "Registers the subscription for the Microsoft Alerts Management", "operation": "Register subscription", - "description": "Registers the subscription for the Microsoft Alerts Management" + "provider": "Microsoft.AlertsManagement", + "resource": "register" } }, { "name": "Microsoft.AlertsManagement/alerts/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "alerts", + "description": "Get all the alerts for the input filters.", "operation": "Read alerts", - "description": "Get all the alerts for the input filters." + "provider": "Microsoft.AlertsManagement", + "resource": "alerts" } }, { "name": "Microsoft.AlertsManagement/alerts/changestate/action", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "alerts", + "description": "Change the state of the alert.", "operation": "Resolve alerts", - "description": "Change the state of the alert." + "provider": "Microsoft.AlertsManagement", + "resource": "alerts" } }, { "name": "Microsoft.AlertsManagement/alerts/history/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "alerts", + "description": "Get history of the alert", "operation": "Read alert history", - "description": "Get history of the alert" + "provider": "Microsoft.AlertsManagement", + "resource": "alerts" } }, { "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/write", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "smartDetectorAlertRules", + "description": "Create or update Smart Detector alert rule in a given subscription", "operation": "Create Smart Detector alert rule", - "description": "Create or update Smart Detector alert rule in a given subscription" + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules" } }, { "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "smartDetectorAlertRules", + "description": "Get all the Smart Detector alert rules for the input filters", "operation": "Read Smart Detector alert rules", - "description": "Get all the Smart Detector alert rules for the input filters" + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules" } }, { "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/delete", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "smartDetectorAlertRules", + "description": "Delete Smart Detector alert rule in a given subscription", "operation": "Delete Smart Detector alert rule", - "description": "Delete Smart Detector alert rule in a given subscription" + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules" } }, { "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/write", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "resourceHealthAlertRules", + "description": "Create or update Resource Health alert rule in a given subscription", "operation": "Create Resource Health alert rule", - "description": "Create or update Resource Health alert rule in a given subscription" + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules" } }, { "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "resourceHealthAlertRules", + "description": "Get all the Resource Health alert rules for the input filters", "operation": "Read Resource Health alert rules", - "description": "Get all the Resource Health alert rules for the input filters" + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules" } }, { "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/delete", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "resourceHealthAlertRules", + "description": "Delete Resource Health alert rule in a given subscription", "operation": "Delete Resource Health alert rule", - "description": "Delete Resource Health alert rule in a given subscription" + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules" } }, { "name": "Microsoft.AlertsManagement/migrateFromSmartDetection/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "migrateFromSmartDetection", + "description": "Get the status of an asynchronous Smart Detection to smart alerts migration process", "operation": "Get Smart Detection Migration status", - "description": "Get the status of an asynchronous Smart Detection to smart alerts migration process" + "provider": "Microsoft.AlertsManagement", + "resource": "migrateFromSmartDetection" } }, { "name": "Microsoft.AlertsManagement/migrateFromSmartDetection/action", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "migrateFromSmartDetection", + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource", "operation": "Migrate From Smart Detection", - "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource" + "provider": "Microsoft.AlertsManagement", + "resource": "migrateFromSmartDetection" } }, { "name": "Microsoft.AlertsManagement/alertsSummary/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "alertsSummary", + "description": "Get the summary of alerts", "operation": "Read alerts summary", - "description": "Get the summary of alerts" + "provider": "Microsoft.AlertsManagement", + "resource": "alertsSummary" } }, { "name": "Microsoft.AlertsManagement/smartGroups/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "smartGroups", + "description": "Get all the smart groups for the input filters", "operation": "Read smart groups", - "description": "Get all the smart groups for the input filters" + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups" } }, { "name": "Microsoft.AlertsManagement/smartGroups/changestate/action", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "smartGroups", + "description": "Change the state of the smart group", "operation": "Read smart groups", - "description": "Change the state of the smart group" + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups" } }, { "name": "Microsoft.AlertsManagement/smartGroups/history/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "smartGroups", + "description": "Get history of the smart group", "operation": "Read smart group history", - "description": "Get history of the smart group" + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups" } }, { "name": "Microsoft.AlertsManagement/actionRules/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "actionRules", + "description": "Get all the alert processing rules for the input filters.", "operation": "Read action rules", - "description": "Get all the alert processing rules for the input filters." + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules" } }, { "name": "Microsoft.AlertsManagement/actionRules/write", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "actionRules", + "description": "Create or update alert processing rule in a given subscription", "operation": "Write action rule", - "description": "Create or update alert processing rule in a given subscription" + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules" } }, { "name": "Microsoft.AlertsManagement/actionRules/delete", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "actionRules", + "description": "Delete alert processing rule in a given subscription.", "operation": "Delete action rule", - "description": "Delete alert processing rule in a given subscription." + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules" } }, { "name": "Microsoft.AlertsManagement/alertsMetaData/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "Microsoft.AlertsManagement/alertsMetaData", + "description": "Get alerts meta data for the input parameter.", "operation": "Read alerts meta data", - "description": "Get alerts meta data for the input parameter." + "provider": "Microsoft.AlertsManagement", + "resource": "Microsoft.AlertsManagement/alertsMetaData" } }, { "name": "Microsoft.AlertsManagement/Operations/read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "operations", + "description": "Reads the operations provided", "operation": "Read operations", - "description": "Reads the operations provided" + "provider": "Microsoft.AlertsManagement", + "resource": "operations" } }, { "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Write", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "prometheusRuleGroups", + "description": "Set prometheusRuleGroups", "operation": "Creates or updates the prometheusRuleGroups", - "description": "Set prometheusRuleGroups" + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups" } }, { "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Delete", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "prometheusRuleGroups", + "description": "Delete prometheusRuleGroups", "operation": "Deletes the prometheusRuleGroups", - "description": "Delete prometheusRuleGroups" + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups" } }, { "name": "Microsoft.AlertsManagement/prometheusRuleGroups/Read", "display": { - "provider": "Microsoft.AlertsManagement", - "resource": "prometheusRuleGroups", + "description": "Read prometheusRuleGroups", "operation": "Reads the prometheusRuleGroups", - "description": "Read prometheusRuleGroups" + "provider": "Microsoft.AlertsManagement", + "resource": "prometheusRuleGroups" } } ] } } - } + }, + "operationId": "Operations_List", + "title": "ListOperations" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/routes.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/routes.tsp new file mode 100644 index 000000000000..867fa30cf24d --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/routes.tsp @@ -0,0 +1,119 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace Microsoft.AlertsManagement; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface AlertsOperationGroup { + /** + * List alerts meta data information based on value of identifier parameter. + */ + @autoRoute + @get + @action("alertsMetaData") + metaData is ArmProviderActionSync< + Response = AlertsMetaData, + Parameters = { + /** + * Identification of the information to be retrieved by API call. + */ + @query("identifier") + identifier: Identifier; + }, + Error = AlertsManagementErrorResponse + >; + /** + * Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). + */ + @autoRoute + @get + @action("alertsSummary") + getSummary is ArmProviderActionSync< + Response = AlertsSummary, + Scope = ExtensionActionScope, + Parameters = { + /** + * This parameter allows the result set to be grouped by input fields. For example, groupby=severity,alertstate. + */ + @query("groupby") + groupby: AlertsSummaryGroupByFields; + + /** + * Include count of the SmartGroups as part of the summary. Default value is 'false'. + */ + @query("includeSmartGroupsCount") + includeSmartGroupsCount?: boolean; + + /** + * Filter by target resource( which is full ARM ID) Default value is select all. + */ + @query("targetResource") + targetResource?: string; + + /** + * Filter by target resource type. Default value is select all. + */ + @query("targetResourceType") + targetResourceType?: string; + + /** + * Filter by target resource group name. Default value is select all. + */ + @query("targetResourceGroup") + targetResourceGroup?: string; + + /** + * Filter by monitor service which generates the alert instance. Default value is select all. + */ + @query("monitorService") + monitorService?: MonitorService; + + /** + * Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + */ + @query("monitorCondition") + monitorCondition?: MonitorCondition; + + /** + * Filter by severity. Default value is select all. + */ + @query("severity") + severity?: Severity; + + /** + * Filter by state of the alert instance. Default value is to select all. + */ + @query("alertState") + alertState?: AlertState; + + /** + * Filter by specific alert rule. Default value is to select all. + */ + @query("alertRule") + alertRule?: string; + + /** + * Filter by time range by below listed values. Default value is 1 day. + */ + @query("timeRange") + timeRange?: TimeRange; + + /** + * Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + */ + @query("customTimeRange") + customTimeRange?: string; + }, + Error = AlertsManagementErrorResponse + >; +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/suppressions.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/suppressions.yaml index 56868075fecf..7bb300289f5b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/suppressions.yaml +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/suppressions.yaml @@ -10,9 +10,6 @@ - tool: TypeSpecRequirement path: ./preview/2021-01-01-preview/*.json reason: Brownfield service not ready to migrate -- tool: TypeSpecRequirement - path: ./preview/2025-05-25-preview/*.json - reason: Brownfield service not ready to migrate - tool: TypeSpecRequirement path: ./stable/2018-05-05/*.json reason: Brownfield service not ready to migrate diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml new file mode 100644 index 000000000000..e5d8319896a1 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml @@ -0,0 +1,46 @@ +parameters: + "service-dir": + default: "sdk/alertsmanagement" +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}/AlertsManagement.json" + arm-types-dir: "{project-root}/../../../../common-types/resource-management" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" + "@azure-tools/typespec-python": + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-alertsmanagement" + namespace: "azure.mgmt.alertsmanagement" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-alertsmanagement" + namespace: "com.azure.resourcemanager.alertsmanagement" + service-name: "AlertsManagement" # human-readable service name, whitespace allowed + flavor: azure + "@azure-tools/typespec-ts": + service-dir: sdk/alertsmanagement + emitter-output-dir: "{output-dir}/{service-dir}/arm-alertsmanagement" + is-modular-library: true + flavor: "azure" + experimental-extensible-enums: true + package-details: + name: "@azure/arm-alertsmanagement" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/alertsmanagement" + emitter-output-dir: "{output-dir}/{service-dir}/armalertsmanagement" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armalertsmanagement" + 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"