From 9ee22186ddbc0366462845852e748c6fb763e0f5 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 09:01:56 +0800 Subject: [PATCH 01/20] converted --- .../AlertsManagement.Management/Alert.tsp | 289 ++++ .../back-compatible.tsp | 15 + .../AlertsMetaData_MonitorService.json | 91 ++ .../Alerts_ChangeState.json | 49 + .../2025-05-25-preview/Alerts_GetById.json | 49 + .../Alerts_GetEnrichments.json | 71 + .../2025-05-25-preview/Alerts_History.json | 92 ++ .../2025-05-25-preview/Alerts_List.json | 139 ++ .../2025-05-25-preview/Alerts_Summary.json | 120 ++ .../2025-05-25-preview/Operations_List.json | 240 ++++ .../AlertsManagement.Management/main.tsp | 54 + .../AlertsManagement.Management/models.tsp | 1180 +++++++++++++++++ .../AlertsManagement.Management/routes.tsp | 121 ++ .../tspconfig.yaml | 13 + .../2025-05-25-preview/AlertsManagement.json | 2 +- 15 files changed, 2524 insertions(+), 1 deletion(-) create mode 100644 specification/alertsmanagement/AlertsManagement.Management/Alert.tsp create mode 100644 specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/main.tsp create mode 100644 specification/alertsmanagement/AlertsManagement.Management/models.tsp create mode 100644 specification/alertsmanagement/AlertsManagement.Management/routes.tsp create mode 100644 specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml diff --git a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp new file mode 100644 index 000000000000..ff4cfccd7f4e --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp @@ -0,0 +1,289 @@ +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. + */ + getByIdTenant is AlertOps.Read; + + /** + * 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 + >; + + /** + * 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 + >; +} +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; + } +>; + +@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}'. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_GetById") + getById is AlertOperationGroupOps.Read; + + /** + * 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. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_GetAllTenant") + getAllTenant is AlertOperationGroupOps.List< + Extension.ScopeParameter, + 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 + >; + + /** + * 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}'. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_ChangeState") + @action("changestate") + changeState is AlertOperationGroupOps.ActionSync< + Extension.ScopeParameter, + Alert, + Comments, + ArmResponse, + Parameters = { + /** + * New state of the alert. + */ + @query("newState") + newState: AlertState; + }, + OptionalRequestBody = true + >; + + /** + * 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'. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_GetHistory") + @get + @action("history") + getHistory is AlertOperationGroupOps.ActionSync< + Extension.ScopeParameter, + Alert, + void, + ArmResponse + >; + + /** + * Get the enrichments of an alert. It returns a collection of one object named default. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_GetEnrichments") + @list + @get + @action("enrichments") + getEnrichments is AlertOperationGroupOps.ActionSync< + Extension.ScopeParameter, + 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/AlertsManagement.Management/back-compatible.tsp b/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp new file mode 100644 index 000000000000..c295fdfdc0bc --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp @@ -0,0 +1,15 @@ +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.getAllTenant, 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); diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json new file mode 100644 index 000000000000..14a1caf1cdb4 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json new file mode 100644 index 000000000000..c2fe43938376 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json new file mode 100644 index 000000000000..33fb0eeb3849 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json new file mode 100644 index 000000000000..41ecaf025ef4 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json new file mode 100644 index 000000000000..4a4cbedec2d5 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json new file mode 100644 index 000000000000..46054dd780c1 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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_GetAllTenant", + "title": "ListAlerts" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json new file mode 100644 index 000000000000..22c64101d2f9 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json new file mode 100644 index 000000000000..e1673e29e08a --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/main.tsp b/specification/alertsmanagement/AlertsManagement.Management/main.tsp new file mode 100644 index 000000000000..379ad8f14041 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/main.tsp @@ -0,0 +1,54 @@ +/** + * 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; +/** + * AlertsManagement Client + */ +@armProviderNamespace +@service(#{ title: "AlertsManagementClient" }) +@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", + + /** + * The 2019-03-01 API version. + */ + v2019_03_01: "2019-03-01", + + /** + * The 2025-05-25-preview API version. + */ + v2025_05_25_preview: "2025-05-25-preview", +} + +interface Operations extends Azure.ResourceManager.Operations {} diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/AlertsManagement.Management/models.tsp new file mode 100644 index 000000000000..7c77c1197eaa --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/models.tsp @@ -0,0 +1,1180 @@ +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" "For backward compatibility" +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" "For backward compatibility" +union MonitorCondition { + string, + + /** + * Fired + */ + Fired: "Fired", + + /** + * Resolved + */ + Resolved: "Resolved", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +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" "For backward compatibility" +union AlertState { + string, + + /** + * New + */ + New: "New", + + /** + * Acknowledged + */ + Acknowledged: "Acknowledged", + + /** + * Closed + */ + Closed: "Closed", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +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" "For backward compatibility" +union SortOrder { + string, + + /** + * asc + */ + asc: "asc", + + /** + * desc + */ + desc: "desc", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +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" "For backward compatibility" +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" "For backward compatibility" +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" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +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" "For backward compatibility" +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" "For backward compatibility" +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. + */ + @visibility(Lifecycle.Read) + context?: unknown; + + /** + * Config which would be used for displaying the data in portal. + */ + @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" "For backward compatibility" + 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. + */ +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. + */ + details?: ErrorResponseBody[]; +} + +/** + * Alert Modification details + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" +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. + */ + 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-azure-core/documentation-required" "For backward compatibility" + 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" "For backward compatibility" +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" "For backward compatibility" +model AlertEnrichmentResponse extends 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" "For backward compatibility" +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" "For backward compatibility" +model ActionSuppressedDetails extends BaseDetails { + /** + * List of suppression action rules + */ + suppressionActionRules?: string[]; + + /** + * List of suppressed action groups + */ + suppressedActionGroups?: TriggeredRule[]; + + /** + * Type of modification details + */ + type: "ActionsSuppressed"; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +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" "For backward compatibility" +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" "For backward compatibility" +model NotificationResult { + /** + * URL endpoint for checking notification delivery status. Only populated when status is 'Inline'. + */ + 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. + */ +@discriminator("type") +model PrometheusEnrichmentItem extends AlertEnrichmentItem { + /** + * Link to Prometheus query API (Url format). + */ + linkToApi: string; + + /** + * An array of the azure monitor workspace resource ids. + */ + @identifiers(#[]) + datasources: string[]; + + /** + * Partial link to the Grafana explore API. + */ + grafanaExplorePath: string; + + /** + * The Prometheus expression query. + */ + query: string; +} + +/** + * Prometheus instant query enrichment object. + */ +model PrometheusInstantQuery extends PrometheusEnrichmentItem { + /** + * The date and the time of the evaluation. + */ + time: string; + + /** + * The enrichment type. + */ + type: "PrometheusInstantQuery"; +} + +/** + * Prometheus instant query enrichment object. + */ +model PrometheusRangeQuery extends PrometheusEnrichmentItem { + /** + * 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/AlertsManagement.Management/routes.tsp b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp new file mode 100644 index 000000000000..4a381a257e04 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp @@ -0,0 +1,121 @@ +// 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" "For backward compatibility" +interface AlertsOperationGroup { + /** + * List alerts meta data information based on value of identifier parameter. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_MetaData") + @autoRoute + @get + @action("alertsMetaData") + metaData is ArmProviderActionSync< + Response = AlertsMetaData, + Parameters = { + /** + * Identification of the information to be retrieved by API call. + */ + @query("identifier") + identifier: Identifier; + } + >; + /** + * Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_GetSummary") + @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; + } + >; +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml new file mode 100644 index 000000000000..f7e086b95030 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml @@ -0,0 +1,13 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: true + emitter-output-dir: "{project-root}/.." + azure-resource-provider-folder: "resource-manager" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/AlertsManagement.json" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager" 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..35e21212827c 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 @@ -1800,7 +1800,7 @@ "type": "object", "allOf": [ { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "$ref": "#/definitions/ProxyResource" } ], "properties": { From 0a438a27a41ebdaa88c8ab04932229d56c8fd282 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 09:13:55 +0800 Subject: [PATCH 02/20] could compile --- .../AlertsManagement.Management/Alert.tsp | 6 +- .../AlertsManagement.Management/main.tsp | 5 - .../AlertsManagement.Management/models.tsp | 4 +- .../tspconfig.yaml | 2 +- .../2025-05-25-preview/AlertsManagement.json | 3097 ++++++++++------- .../AlertsMetaData_MonitorService.json | 10 +- .../examples/Alerts_ChangeState.json | 58 +- .../examples/Alerts_GetById.json | 60 +- .../examples/Alerts_GetEnrichments.json | 56 +- .../examples/Alerts_History.json | 50 +- .../examples/Alerts_List.json | 200 +- .../examples/Alerts_Summary.json | 18 +- .../examples/Operations_List.json | 156 +- .../stable/2019-03-01/AlertsManagement.json | 3038 ++++++++++------ 14 files changed, 4205 insertions(+), 2555 deletions(-) diff --git a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp index ff4cfccd7f4e..8561fe2439de 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp @@ -120,7 +120,6 @@ interface AlertOperationGroup { #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("Alerts_GetAllTenant") getAllTenant is AlertOperationGroupOps.List< - Extension.ScopeParameter, Alert, Parameters = { /** @@ -235,9 +234,8 @@ interface AlertOperationGroup { @operationId("Alerts_ChangeState") @action("changestate") changeState is AlertOperationGroupOps.ActionSync< - Extension.ScopeParameter, Alert, - Comments, + void, ArmResponse, Parameters = { /** @@ -257,7 +255,6 @@ interface AlertOperationGroup { @get @action("history") getHistory is AlertOperationGroupOps.ActionSync< - Extension.ScopeParameter, Alert, void, ArmResponse @@ -272,7 +269,6 @@ interface AlertOperationGroup { @get @action("enrichments") getEnrichments is AlertOperationGroupOps.ActionSync< - Extension.ScopeParameter, Alert, void, ArmResponse diff --git a/specification/alertsmanagement/AlertsManagement.Management/main.tsp b/specification/alertsmanagement/AlertsManagement.Management/main.tsp index 379ad8f14041..af5ee3365353 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/main.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/main.tsp @@ -35,11 +35,6 @@ namespace Microsoft.AlertsManagement; * The available API versions. */ enum Versions { - /** - * The 2025-05-25-preview API version. - */ - v2025_05_25_preview: "2025-05-25-preview", - /** * The 2019-03-01 API version. */ diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/AlertsManagement.Management/models.tsp index 7c77c1197eaa..259e690c5915 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/models.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/models.tsp @@ -935,7 +935,8 @@ model AlertEnrichmentsList is Azure.Core.Page; * The alert's enrichments. */ #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -model AlertEnrichmentResponse extends ProxyResource { +model AlertEnrichmentResponse + extends Azure.ResourceManager.Foundations.ProxyResource { /** * Properties of the alert enrichment item. */ @@ -1123,7 +1124,6 @@ model PrometheusEnrichmentItem extends AlertEnrichmentItem { /** * An array of the azure monitor workspace resource ids. */ - @identifiers(#[]) datasources: string[]; /** diff --git a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml index f7e086b95030..5fe78d4fef18 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml +++ b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml @@ -5,7 +5,7 @@ options: omit-unreachable-types: true emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" - output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/AlertsManagement.json" + output-file: "{azure-resource-provider-folder}/{service-name}/AlertsManagement/{version-status}/{version}/AlertsManagement.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" linter: 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 35e21212827c..c806c2e433b9 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,146 +1,582 @@ { "swagger": "2.0", "info": { + "title": "AlertsManagementClient", "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." + "description": "AlertsManagement Client", + "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": "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. ", + "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" + }, + { + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, - "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}/alerts/{name}": { "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" ], + "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" + }, + { + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/api-version" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + } } ], "responses": { "200": { - "description": "OK. Returns the alert with the specified ID.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alert" + "type": "object", + "description": "The default scope parameter for an extension resource.", + "properties": { + "scope": { + "type": "string", + "description": "The fully qualified Azure Resource manager identifier of the resource." + } + }, + "required": [ + "scope" + ] } }, "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" } } }, @@ -151,1185 +587,1026 @@ } } }, - "/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" }, { - "$ref": "#/parameters/api-version" + "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" + } + ] + } } ], "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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "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" - } - } - } - }, - "/providers/Microsoft.AlertsManagement/operations": { - "get": { - "operationId": "Operations_List", - "description": "List all operations available through Azure Alerts Management Resource Provider.", - "parameters": [ - { - "$ref": "#/parameters/api-version" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK. Successfully retrieved operations list.", - "schema": { - "$ref": "#/definitions/operationsList" - } + "$ref": "./examples/Alerts_GetEnrichments.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "ListOperations": { - "$ref": "./examples/Operations_List.json" - } } } }, - "/providers/Microsoft.AlertsManagement/alertsMetaData": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { "get": { - "operationId": "Alerts_MetaData", - "description": "List alerts meta data information based on value of identifier parameter.", + "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" }, { - "$ref": "#/parameters/identifier" + "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 listed alert meta data.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alertsMetaData" + "$ref": "#/definitions/AlertModification" } }, "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": { - "MonService": { - "$ref": "./examples/AlertsMetaData_MonitorService.json" + "Resolve": { + "$ref": "./examples/Alerts_History.json" } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts": { + "/{scope}/providers/Microsoft.AlertsManagement/alertsSummary": { "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_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/scope" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/targetResource" - }, - { - "$ref": "#/parameters/targetResourceType" - }, - { - "$ref": "#/parameters/targetResourceGroup" - }, - { - "$ref": "#/parameters/monitorService" - }, - { - "$ref": "#/parameters/monitorCondition" - }, - { - "$ref": "#/parameters/severity" + "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 }, { - "$ref": "#/parameters/alertState" + "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" + } + ] + } }, { - "$ref": "#/parameters/alertRule" + "name": "includeSmartGroupsCount", + "in": "query", + "description": "Include count of the SmartGroups as part of the summary. Default value is 'false'.", + "required": false, + "type": "boolean" }, { - "$ref": "#/parameters/smartGroupIdFilter" + "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/includeContext" + "name": "targetResourceType", + "in": "query", + "description": "Filter by target resource type. Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/includeEgressConfig" + "name": "targetResourceGroup", + "in": "query", + "description": "Filter by target resource group name. Default value is select all.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/pageCount" + "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/alertsSortBy" + "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/sortOrder" + "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/select" + "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/timeRange" + "name": "alertRule", + "in": "query", + "description": "Filter by specific alert rule. Default value is to select all.", + "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": "The request has succeeded.", "schema": { - "$ref": "#/definitions/alertsList" + "$ref": "#/definitions/AlertsSummary" } }, "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-pageable": { - "nextLinkName": "nextLink" - }, "x-ms-examples": { - "ListAlerts": { - "$ref": "./examples/Alerts_List.json" + "Summary": { + "$ref": "./examples/Alerts_Summary.json" } } } }, - "/{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" ], + "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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "GetById": { - "$ref": "./examples/Alerts_GetById.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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/alertId" + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/api-version" - }, - { - "$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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Resolve": { - "$ref": "./examples/Alerts_ChangeState.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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Resolve": { - "$ref": "./examples/Alerts_History.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": "#/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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/api-version" + "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": "OK. Alert summary returned.", + "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/alertsSummary" + "$ref": "#/definitions/AlertsMetaData" } }, "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": { - "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 the operations for the 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 - }, - "api-version": { - "name": "api-version", - "description": "API version.", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "2019-03-01", - "2025-05-25-preview" - ], - "x-ms-enum": { - "name": "api-version", - "modelAsString": true - } - }, - "alertId": { - "name": "alertId", - "description": "Unique ID of an alert instance.", - "type": "string", - "in": "path", - "required": true, - "x-ms-parameter-location": "method" - }, - "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" - }, - "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" - }, - "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" - }, - "monitorService": { - "description": "Filter by monitor service which generates the alert instance. Default value is select all.", - "name": "monitorService", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "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 - } - }, - "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 - } - }, - "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" - }, - "newState": { - "description": "New state of the alert.", - "name": "newState", - "type": "string", - "in": "query", - "required": true, - "x-ms-parameter-location": "method", - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true - } - }, - "comment": { - "description": "reason of change alert state", - "name": "comment", - "in": "body", - "x-ms-parameter-location": "method", - "required": false, - "schema": { - "$ref": "#/definitions/comments" - } - }, - "alertState": { - "description": "Filter by state of the alert instance. Default value is to select all.", - "name": "alertState", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true - } - }, - "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 - } - }, - "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" - }, - "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 - } - }, - "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", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "name", - "severity", - "alertState", - "monitorCondition", - "targetResource", - "targetResourceName", - "targetResourceGroup", - "targetResourceType", - "startDateTime", - "lastModifiedDateTime" - ], - "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", + "ActionStatus": { + "type": "object", + "description": "Action status", "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" - } - } - }, - "origin": { - "type": "string", - "description": "Origin of the operation" + "isSuppressed": { + "type": "boolean", + "description": "Value indicating whether alert is suppressed." } } }, - "operationsList": { - "description": "Lists the operations available in the AlertsManagement RP.", + "ActionSuppressedDetails": { + "type": "object", "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" - }, - "value": { - "description": "Array of operations", + "suppressionActionRules": { "type": "array", + "description": "List of suppression action rules", "items": { - "$ref": "#/definitions/operation" + "type": "string" } - } - }, - "required": [ - "value" - ] - }, - "AlertsManagementErrorResponse": { - "description": "An error response from the service.", - "x-ms-external": true, - "properties": { - "error": { - "$ref": "#/definitions/errorResponseBody" - } - } - }, - "errorResponseBody": { - "description": "Details of error response.", - "x-ms-external": true, - "properties": { - "code": { - "type": "string", - "description": "Error code, intended to be consumed programmatically." - }, - "message": { - "type": "string", - "description": "Description of the error, intended for display in user interface." - }, - "target": { - "type": "string", - "description": "Target of the particular error, for example name of the property." }, - "details": { + "suppressedActionGroups": { "type": "array", - "description": "A list of additional details about the error.", + "description": "List of suppressed action groups", "items": { - "$ref": "#/definitions/errorResponseBody" + "$ref": "#/definitions/TriggeredRule" } } - } + }, + "allOf": [ + { + "$ref": "#/definitions/BaseDetails" + } + ], + "x-ms-discriminator-value": "ActionsSuppressed" }, - "ProxyResource": { - "x-ms-azure-resource": true, - "description": "An azure resource object", + "ActionTriggeredDetails": { + "type": "object", "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "Azure resource Id" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" + "actionGroup": { + "$ref": "#/definitions/TriggeredRule", + "description": "The action group that was triggered" }, - "name": { - "type": "string", - "readOnly": true, - "description": "Azure resource name" + "notificationResult": { + "$ref": "#/definitions/NotificationResult", + "description": "The result of the notification delivery" } - } - }, - "alert": { - "type": "object", - "description": "An alert created in alert management service.", + }, "allOf": [ { - "$ref": "#/definitions/ProxyResource" + "$ref": "#/definitions/BaseDetails" } ], - "properties": { - "properties": { - "$ref": "#/definitions/alertProperties" - } - } + "x-ms-discriminator-value": "ActionsTriggered" }, - "alertsList": { + "Alert": { "type": "object", - "description": "List the alerts.", + "description": "An alert created in alert management service.", "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" - }, - "value": { - "description": "List of alerts", - "type": "array", - "items": { - "$ref": "#/definitions/alert" - } + "properties": { + "$ref": "#/definitions/AlertProperties", + "description": "Alert property bag" } - } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] }, - "alertProperties": { + "AlertEnrichmentItem": { "type": "object", - "description": "Alert property bag", + "description": "Alert enrichment item.", "properties": { - "essentials": { - "$ref": "#/definitions/essentials" + "title": { + "type": "string", + "description": "The enrichment title." }, - "context": { - "$ref": "#/definitions/alertContext" + "description": { + "type": "string", + "description": "The enrichment description." }, - "egressConfig": { - "$ref": "#/definitions/egressConfig" + "status": { + "$ref": "#/definitions/Status", + "description": "The status of the evaluation of the enrichment." }, - "customProperties": { - "$ref": "#/definitions/customProperties" + "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" + ] }, - "comments": { + "AlertEnrichmentProperties": { "type": "object", - "description": "Change alert state reason", + "description": "Properties of the alert enrichment item.", "properties": { - "comments": { - "type": "string" + "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": [] } } }, - "egressConfig": { - "type": "object", - "description": "Config which would be used for displaying the data in portal.", - "readOnly": true - }, - "alertContext": { + "AlertEnrichmentResponse": { "type": "object", - "description": "Information specific to the monitor service that gives more contextual details about the alert.", - "readOnly": true - }, - "actionStatus": { - "type": "object", - "description": "Action status", + "description": "The alert's enrichments.", "properties": { - "isSuppressed": { - "type": "boolean", - "description": "Value indicating whether alert is suppressed." + "properties": { + "$ref": "#/definitions/AlertEnrichmentProperties", + "description": "Properties of the alert enrichment item." } - } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] }, - "essentials": { + "AlertEnrichmentsList": { "type": "object", - "description": "This object contains consistent fields across different monitor services.", + "description": "List the alert's enrichments.", "properties": { - "severity": { - "type": "string", - "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 - } - }, - "signalType": { - "type": "string", - "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 - } - }, - "alertState": { - "type": "string", - "description": "Alert object state, which can be modified by the user.", - "readOnly": true, - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true - } - }, - "monitorCondition": { - "type": "string", - "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 - } - }, - "targetResource": { - "type": "string", - "description": "Target ARM resource, on which alert got created." - }, - "targetResourceName": { - "type": "string", - "description": "Name of the target ARM resource name, on which alert got created." - }, - "targetResourceGroup": { - "type": "string", - "description": "Resource group of target ARM resource, on which alert got created." - }, - "targetResourceType": { - "type": "string", - "description": "Resource type of target ARM resource, on which alert got created." - }, - "monitorService": { - "type": "string", - "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 + "value": { + "type": "array", + "description": "The AlertEnrichmentResponse items on this page", + "items": { + "$ref": "#/definitions/AlertEnrichmentResponse" } }, - "alertRule": { - "type": "string", - "description": "Rule(monitor) which fired alert instance. Depending on the monitor service, this would be ARM id or name of the rule.", - "readOnly": true - }, - "sourceCreatedId": { - "type": "string", - "description": "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.", - "readOnly": true - }, - "smartGroupId": { - "type": "string", - "description": "Unique Id of the smart group", - "readOnly": true - }, - "smartGroupingReason": { - "type": "string", - "description": "Verbose reason describing the reason why this alert instance is added to a smart group", - "readOnly": true - }, - "startDateTime": { - "type": "string", - "format": "date-time", - "description": "Creation time(ISO-8601 format) of alert instance.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "Last modification time(ISO-8601 format) of alert instance.", - "readOnly": true - }, - "monitorConditionResolvedDateTime": { - "type": "string", - "format": "date-time", - "description": "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.", - "readOnly": true - }, - "lastModifiedUserName": { - "type": "string", - "description": "User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user.", - "readOnly": true - }, - "actionStatus": { - "$ref": "#/definitions/actionStatus" - }, - "description": { + "nextLink": { "type": "string", - "description": "Alert description." + "format": "uri", + "description": "The link to the next page of items" } - } + }, + "required": [ + "value" + ] }, - "alertModification": { + "AlertModification": { "type": "object", "description": "Alert Modification details", + "properties": { + "properties": { + "$ref": "#/definitions/AlertModificationProperties", + "description": "Alert modification history properties." + } + }, "allOf": [ { "$ref": "#/definitions/ProxyResource" } - ], - "properties": { - "properties": { - "$ref": "#/definitions/alertModificationProperties" - } - } + ] }, - "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" + "AlertModificationEvent": { + "type": "string", + "description": "Reason for the modification", + "enum": [ + "AlertCreated", + "StateChange", + "SeverityChange", + "MonitorConditionChange", + "ActionsTriggered", + "ActionsSuppressed" + ], + "x-ms-enum": { + "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" } - } + ] } }, - "alertModificationItem": { + "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" - } + "$ref": "#/definitions/AlertModificationEvent", + "description": "Reason for the modification" }, "oldValue": { "type": "string", @@ -1357,167 +1634,173 @@ }, "details": { "$ref": "#/definitions/BaseDetails", - "x-nullable": true + "description": "Base details class." } } }, - "BaseDetails": { - "description": "Base details class.", + "AlertModificationProperties": { "type": "object", - "discriminator": "type", - "required": [ - "type" - ], + "description": "Alert modification history properties.", "properties": { - "type": { + "alertId": { "type": "string", - "description": "Type of modification details", - "enum": [ - "PropertyChange", - "ActionsSuppressed", - "ActionsTriggered" - ], - "x-ms-enum": { - "name": "AlertModificationType", - "modelAsString": true + "description": "Unique identifier of the alert.", + "readOnly": true + }, + "modifications": { + "type": "array", + "description": "Array of alert modification events.", + "items": { + "$ref": "#/definitions/AlertModificationItem" } } } }, - "PropertyChangeDetails": { - "x-ms-discriminator-value": "PropertyChange", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/BaseDetails" - } + "AlertModificationType": { + "type": "string", + "description": "Type of modification details", + "enum": [ + "PropertyChange", + "ActionsSuppressed", + "ActionsTriggered" ], + "x-ms-enum": { + "name": "AlertModificationType", + "modelAsString": true, + "values": [ + { + "name": "PropertyChange", + "value": "PropertyChange", + "description": "PropertyChange" + }, + { + "name": "ActionsSuppressed", + "value": "ActionsSuppressed", + "description": "ActionsSuppressed" + }, + { + "name": "ActionsTriggered", + "value": "ActionsTriggered", + "description": "ActionsTriggered" + } + ] + } + }, + "AlertProperties": { + "type": "object", + "description": "Alert property bag", "properties": { - "oldValue": { - "type": "string", - "description": "The value before the change" + "essentials": { + "$ref": "#/definitions/Essentials", + "description": "This object contains consistent fields across different monitor services." }, - "newValue": { - "type": "string", - "description": "The value after the change" + "context": { + "description": "Information specific to the monitor service that gives more contextual details about the alert.", + "readOnly": true }, - "comment": { - "type": "string", - "description": "The comment" + "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" + } } } }, - "ActionSuppressedDetails": { - "x-ms-discriminator-value": "ActionsSuppressed", + "AlertState": { + "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" + } + ] + } + }, + "AlertsList": { "type": "object", - "allOf": [ - { - "$ref": "#/definitions/BaseDetails" - } - ], + "description": "List the alerts.", "properties": { - "suppressionActionRules": { + "value": { "type": "array", - "description": "List of suppression action rules", + "description": "The Alert items on this page", "items": { - "type": "string", - "description": "Action rule Id" + "$ref": "#/definitions/Alert" } }, - "suppressedActionGroups": { - "description": "List of suppressed action groups", - "type": "array", - "items": { - "$ref": "#/definitions/TriggeredRule" - } + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" } - } + }, + "required": [ + "value" + ] }, - "ActionTriggeredDetails": { - "x-ms-discriminator-value": "ActionsTriggered", + "AlertsMetaData": { "type": "object", - "allOf": [ - { - "$ref": "#/definitions/BaseDetails" - } - ], + "description": "alert meta data information.", "properties": { - "actionGroup": { - "$ref": "#/definitions/TriggeredRule", - "description": "The action group that was triggered" - }, - "notificationResult": { - "$ref": "#/definitions/NotificationResult", - "description": "The result of the notification delivery" + "properties": { + "$ref": "#/definitions/AlertsMetaDataProperties", + "description": "alert meta data property bag" } } }, - "TriggeredRule": { + "AlertsMetaDataProperties": { "type": "object", + "description": "alert meta data property bag", "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 - } + "metadataIdentifier": { + "$ref": "#/definitions/MetadataIdentifier", + "description": "Identification of the information to be retrieved by API call" } - } + }, + "discriminator": "metadataIdentifier", + "required": [ + "metadataIdentifier" + ] }, - "NotificationResult": { + "AlertsSummary": { "type": "object", + "description": "Summary of alerts based on the input filters and 'groupby' parameters.", "properties": { - "statusURL": { - "type": "string", - "description": "URL endpoint for checking notification delivery status. Only populated when status is 'Inline'.", - "x-nullable": true - }, - "status": { - "type": "string", - "description": "The status of the notification", - "enum": [ - "None", - "Inline", - "Throttled", - "Failed", - "ThrottledByAlertRule", - "ThrottledBySubscription" - ], - "x-ms-enum": { - "name": "ResultStatus", - "modelAsString": true - } + "properties": { + "$ref": "#/definitions/AlertsSummaryGroup", + "description": "Group the result set." } - } - }, - "alertsSummary": { - "type": "object", - "description": "Summary of alerts based on the input filters and 'groupby' parameters.", + }, "allOf": [ { "$ref": "#/definitions/ProxyResource" } - ], - "properties": { - "properties": { - "$ref": "#/definitions/alertsSummaryGroup" - } - } + ] }, - "alertsSummaryGroup": { + "AlertsSummaryGroup": { "type": "object", "description": "Group the result set.", "properties": { @@ -1539,12 +1822,12 @@ "type": "array", "description": "List of the items", "items": { - "$ref": "#/definitions/alertsSummaryGroupItem" + "$ref": "#/definitions/AlertsSummaryGroupItem" } } } }, - "alertsSummaryGroupItem": { + "AlertsSummaryGroupItem": { "type": "object", "description": "Alerts summary group item", "properties": { @@ -1565,64 +1848,272 @@ "type": "array", "description": "List of the items", "items": { - "$ref": "#/definitions/alertsSummaryGroupItem" + "$ref": "#/definitions/AlertsSummaryGroupItem" } } } }, - "alertsMetaData": { + "BaseDetails": { "type": "object", - "description": "alert meta data information.", + "description": "Base details class.", "properties": { - "properties": { - "$ref": "#/definitions/alertsMetaDataProperties" + "type": { + "$ref": "#/definitions/AlertModificationType", + "description": "Type of modification details" } - } + }, + "discriminator": "type", + "required": [ + "type" + ] }, - "alertsMetaDataProperties": { + "Comments": { "type": "object", - "description": "alert meta data property bag", - "discriminator": "metadataIdentifier", - "required": [ - "metadataIdentifier" - ], + "description": "Change alert state reason", "properties": { - "metadataIdentifier": { - "type": "string", - "description": "Identification of the information to be retrieved by API call", - "enum": [ - "MonitorServiceList" - ], - "x-ms-enum": { - "name": "metadataIdentifier", - "modelAsString": true - } + "comments": { + "type": "string" } } }, - "MonitorServiceList": { + "Essentials": { "type": "object", - "title": "Monitor service details", - "description": "Monitor service details", - "required": [ - "data" - ], - "allOf": [ - { - "$ref": "#/definitions/alertsMetaDataProperties" + "description": "This object contains consistent fields across different monitor services.", + "properties": { + "severity": { + "$ref": "#/definitions/Severity", + "description": "Severity of alert Sev0 being highest and Sev4 being lowest.", + "readOnly": true }, - { - "type": "object" + "signalType": { + "$ref": "#/definitions/SignalType", + "description": "The type of signal the alert is based on, which could be metrics, logs or activity logs.", + "readOnly": true + }, + "alertState": { + "$ref": "#/definitions/AlertState", + "description": "Alert object state, which can be modified by the user.", + "readOnly": true + }, + "monitorCondition": { + "$ref": "#/definitions/MonitorCondition", + "description": "Can be 'Fired' or 'Resolved', which represents whether the underlying conditions have crossed the defined alert rule thresholds.", + "readOnly": true + }, + "targetResource": { + "type": "string", + "description": "Target ARM resource, on which alert got created." + }, + "targetResourceName": { + "type": "string", + "description": "Name of the target ARM resource name, on which alert got created." + }, + "targetResourceGroup": { + "type": "string", + "description": "Resource group of target ARM resource, on which alert got created." + }, + "targetResourceType": { + "type": "string", + "description": "Resource type of target ARM resource, on which alert got created." + }, + "monitorService": { + "$ref": "#/definitions/MonitorService", + "description": "Monitor service on which the rule(monitor) is set.", + "readOnly": true + }, + "alertRule": { + "type": "string", + "description": "Rule(monitor) which fired alert instance. Depending on the monitor service, this would be ARM id or name of the rule.", + "readOnly": true + }, + "sourceCreatedId": { + "type": "string", + "description": "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.", + "readOnly": true + }, + "smartGroupId": { + "type": "string", + "description": "Unique Id of the smart group", + "readOnly": true + }, + "smartGroupingReason": { + "type": "string", + "description": "Verbose reason describing the reason why this alert instance is added to a smart group", + "readOnly": true + }, + "startDateTime": { + "type": "string", + "format": "date-time", + "description": "Creation time(ISO-8601 format) of alert instance.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "Last modification time(ISO-8601 format) of alert instance.", + "readOnly": true + }, + "monitorConditionResolvedDateTime": { + "type": "string", + "format": "date-time", + "description": "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.", + "readOnly": true + }, + "lastModifiedUserName": { + "type": "string", + "description": "User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user.", + "readOnly": true + }, + "actionStatus": { + "$ref": "#/definitions/ActionStatus", + "description": "Action status" + }, + "description": { + "type": "string", + "description": "Alert description." } + } + }, + "MetadataIdentifier": { + "type": "string", + "description": "Identification of the information to be retrieved by API call", + "enum": [ + "MonitorServiceList" ], - "properties": { - "data": { - "description": "Array of operations", - "type": "array", - "items": { - "$ref": "#/definitions/MonitorServiceDetails" + "x-ms-enum": { + "name": "MetadataIdentifier", + "modelAsString": true, + "values": [ + { + "name": "MonitorServiceList", + "value": "MonitorServiceList", + "description": "MonitorServiceList" + } + ] + } + }, + "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" + } + ] + } + }, + "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" + ], + "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" } - } + ] } }, "MonitorServiceDetails": { @@ -1639,70 +2130,49 @@ } } }, - "alertEnrichmentItem": { + "MonitorServiceList": { "type": "object", - "description": "Alert enrichment item.", - "discriminator": "type", + "description": "Monitor service details", + "properties": { + "data": { + "type": "array", + "description": "Array of operations", + "items": { + "$ref": "#/definitions/MonitorServiceDetails" + } + } + }, "required": [ - "title", - "description", - "status", - "type" + "data" + ], + "allOf": [ + { + "$ref": "#/definitions/AlertsMetaDataProperties" + } ], + "x-ms-discriminator-value": "MonitorServiceList" + }, + "NotificationResult": { + "type": "object", "properties": { - "title": { - "type": "string", - "description": "The enrichment title." - }, - "description": { + "statusURL": { "type": "string", - "description": "The enrichment description." + "description": "URL endpoint for checking notification delivery status. Only populated when status is 'Inline'." }, "status": { - "type": "string", - "description": "The status of the evaluation of the enrichment.", - "enum": [ - "Succeeded", - "Failed" - ], - "x-ms-enum": { - "name": "status", - "modelAsString": true - } - }, - "errorMessage": { - "type": "string", - "description": "The error message. Will be present only if the status is 'Failed'." - }, - "type": { - "type": "string", - "description": "The enrichment type.", - "enum": [ - "PrometheusInstantQuery", - "PrometheusRangeQuery" - ], - "x-ms-enum": { - "name": "type", - "modelAsString": true - } + "$ref": "#/definitions/ResultStatus", + "description": "The status of the notification" } } }, "PrometheusEnrichmentItem": { "type": "object", "description": "Prometheus enrichment object.", - "required": [ - "linkToApi", - "datasources", - "grafanaExplorePath", - "query" - ], - "allOf": [ - { - "$ref": "#/definitions/alertEnrichmentItem" - } - ], "properties": { + "type": { + "type": "string", + "description": "Discriminator property for PrometheusEnrichmentItem." + }, "linkToApi": { "type": "string", "description": "Link to Prometheus query API (Url format)." @@ -1711,10 +2181,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", @@ -1724,12 +2192,30 @@ "type": "string", "description": "The Prometheus expression query." } - } + }, + "discriminator": "type", + "required": [ + "type", + "linkToApi", + "datasources", + "grafanaExplorePath", + "query" + ], + "allOf": [ + { + "$ref": "#/definitions/AlertEnrichmentItem" + } + ] }, "PrometheusInstantQuery": { - "x-ms-discriminator-value": "PrometheusInstantQuery", "type": "object", "description": "Prometheus instant query enrichment object.", + "properties": { + "time": { + "type": "string", + "description": "The date and the time of the evaluation." + } + }, "required": [ "time" ], @@ -1738,17 +2224,27 @@ "$ref": "#/definitions/PrometheusEnrichmentItem" } ], - "properties": { - "time": { - "type": "string", - "description": "The date and the time of the evaluation." - } - } + "x-ms-discriminator-value": "PrometheusInstantQuery" }, "PrometheusRangeQuery": { "type": "object", - "x-ms-discriminator-value": "PrometheusRangeQuery", "description": "Prometheus instant query enrichment object.", + "properties": { + "start": { + "type": "string", + "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." + } + }, "required": [ "start", "end", @@ -1759,79 +2255,260 @@ "$ref": "#/definitions/PrometheusEnrichmentItem" } ], + "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": "#/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" + } + ] + } + }, + "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" + } + ] + } + }, + "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..14a1caf1cdb4 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" +} \ No newline at end of file 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..c2fe43938376 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" +} \ No newline at end of file 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..33fb0eeb3849 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" +} \ No newline at end of file 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..41ecaf025ef4 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" +} \ No newline at end of file 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..4a4cbedec2d5 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" +} \ No newline at end of file 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..46054dd780c1 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_GetAllTenant", + "title": "ListAlerts" +} \ No newline at end of file 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..22c64101d2f9 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" +} \ No newline at end of file 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..e1673e29e08a 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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json index 053398617185..fa213f7e8678 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json @@ -1,303 +1,741 @@ { "swagger": "2.0", "info": { + "title": "AlertsManagementClient", "version": "2019-03-01", - "title": "Azure Alerts Management Service Resource Provider", - "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." + "description": "AlertsManagement Client", + "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" } } }, - "paths": { - "/providers/Microsoft.AlertsManagement/operations": { - "get": { - "operationId": "Operations_List", - "description": "List all operations available through Azure Alerts Management Resource Provider.", - "parameters": [ - { - "$ref": "#/parameters/api-version" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK. Successfully retrieved operations list.", - "schema": { - "$ref": "#/definitions/operationsList" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "ListOperations": { - "$ref": "./examples/Operations_List.json" - } - } - } + "tags": [ + { + "name": "Operations" }, - "/providers/Microsoft.AlertsManagement/alertsMetaData": { - "get": { - "operationId": "Alerts_MetaData", - "description": "List alerts meta data information based on value of identifier parameter.", - "parameters": [ - { - "$ref": "#/parameters/api-version" - }, - { - "$ref": "#/parameters/identifier" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK. Successfully listed alert meta data.", - "schema": { - "$ref": "#/definitions/alertsMetaData" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/AlertsManagementErrorResponse" - } - } - }, - "x-ms-examples": { - "MonService": { - "$ref": "./examples/AlertsMetaData_MonitorService.json" - } - } - } + { + "name": "Alerts" }, + { + "name": "AlertOperationGroup" + } + ], + "paths": { "/{scope}/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": [ + "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/scope" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/targetResource" + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "ListAlerts": { - "$ref": "./examples/Alerts_List.json" - } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/alerts/{name}": { "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" + "tags": [ + "AlertOperationGroup" ], + "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/scope" + "$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" }, { - "$ref": "#/parameters/alertId" + "name": "name", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/api-version" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + } } ], "responses": { "200": { - "description": "OK. Returns the alert with the specified ID.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/alert" + "type": "object", + "description": "The default scope parameter for an extension resource.", + "properties": { + "scope": { + "type": "string", + "description": "The fully qualified Azure Resource manager identifier of the resource." + } + }, + "required": [ + "scope" + ] } }, "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": { - "GetById": { - "$ref": "./examples/Alerts_GetById.json" - } } } }, "/{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/scope" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/alertId" + "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" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/Alert" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/{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/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" - } + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { "get": { "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/scope" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/alertId" + "name": "scope", + "in": "path", + "description": "undefined", + "required": true, + "type": "string" }, { - "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + "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" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Resolve": { - "$ref": "./examples/Alerts_History.json" - } } } }, @@ -307,590 +745,1089 @@ "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/scope" + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/alertsSummaryGroupBy" + "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 }, { - "$ref": "#/parameters/includeSmartGroupsCount" + "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" + } + ] + } }, { - "$ref": "#/parameters/targetResource" + "name": "includeSmartGroupsCount", + "in": "query", + "description": "Include count of the SmartGroups as part of the summary. Default value is 'false'.", + "required": false, + "type": "boolean" }, { - "$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/timeRange" + "name": "alertRule", + "in": "query", + "description": "Filter by specific alert rule. Default value is to select all.", + "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" } ], "responses": { "200": { - "description": "OK. Alert summary returned.", + "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/alertsSummary" + "$ref": "#/definitions/AlertsSummary" } }, "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": { - "Summary": { - "$ref": "./examples/Alerts_Summary.json" - } } } - } - }, - "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 - }, - "api-version": { - "name": "api-version", - "description": "API version.", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "2019-03-01" - ], - "x-ms-enum": { - "name": "api-version", - "modelAsString": true + "/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "get": { + "operationId": "Alerts_GetByIdTenant", + "tags": [ + "Alerts" + ], + "description": "Get information related to a specific alert.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + } } }, - "alertId": { - "name": "alertId", - "description": "Unique ID of an alert instance.", - "type": "string", - "in": "path", - "required": true, - "x-ms-parameter-location": "method" - }, - "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" - }, - "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" - }, - "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" - }, - "monitorService": { - "description": "Filter by monitor service which generates the alert instance. Default value is select all.", - "name": "monitorService", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "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 + "/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { + "post": { + "operationId": "Alerts_ChangeStateTenant", + "tags": [ + "Alerts" + ], + "description": "Change the state of an alert.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "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" + } + ] + } + }, + { + "name": "comment", + "in": "body", + "description": "reason of change alert state", + "required": false, + "schema": { + "$ref": "#/definitions/Comments" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + } } }, - "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 + "/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { + "get": { + "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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "alertId", + "in": "path", + "description": "Unique ID of an alert instance.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/AlertModification" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + } } }, - "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" - }, - "smartGroupId": { - "description": "Smart group unique id. ", - "name": "smartGroupId", - "type": "string", - "in": "path", - "required": true, - "x-ms-parameter-location": "method" + "/providers/Microsoft.AlertsManagement/alertsMetaData": { + "get": { + "operationId": "Alerts_MetaData", + "description": "List alerts meta data information based on value of identifier parameter.", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "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": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + } + } }, - "newState": { - "description": "New state of the alert.", - "name": "newState", - "type": "string", - "in": "query", - "required": true, - "x-ms-parameter-location": "method", - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true + "/providers/Microsoft.AlertsManagement/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } } - }, - "comment": { - "description": "reason of change alert state", - "name": "comment", - "in": "body", - "x-ms-parameter-location": "method", - "required": false, - "schema": { - "$ref": "#/definitions/comments" + } + }, + "definitions": { + "ActionStatus": { + "type": "object", + "description": "Action status", + "properties": { + "isSuppressed": { + "type": "boolean", + "description": "Value indicating whether alert is suppressed." + } } }, - "alertState": { - "description": "Filter by state of the alert instance. Default value is to select all.", - "name": "alertState", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "New", - "Acknowledged", - "Closed" + "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" + } + } + }, + "allOf": [ + { + "$ref": "#/definitions/BaseDetails" + } ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true - } + "x-ms-discriminator-value": "ActionsSuppressed" }, - "smartGroupState": { - "description": "Filter by state of the smart group. Default value is to select all.", - "name": "smartGroupState", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "New", - "Acknowledged", - "Closed" + "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-enum": { - "name": "AlertState", - "modelAsString": true - } + "x-ms-discriminator-value": "ActionsTriggered" }, - "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 - } + "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" + } + ] }, - "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" + "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" + ] }, - "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 + "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": [] + } } }, - "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" + "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" + } + ] }, - "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" + "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" + ] }, - "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", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" + "AlertModification": { + "type": "object", + "description": "Alert Modification details", + "properties": { + "properties": { + "$ref": "#/definitions/AlertModificationProperties", + "description": "Alert modification history properties." + } + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ] }, - "alertsSortBy": { - "description": "Sort the query results by input field, Default value is 'lastModifiedDateTime'.", - "name": "sortBy", + "AlertModificationEvent": { "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", + "description": "Reason for the modification", "enum": [ - "name", - "severity", - "alertState", - "monitorCondition", - "targetResource", - "targetResourceName", - "targetResourceGroup", - "targetResourceType", - "startDateTime", - "lastModifiedDateTime" + "AlertCreated", + "StateChange", + "SeverityChange", + "MonitorConditionChange", + "ActionsTriggered", + "ActionsSuppressed" ], "x-ms-enum": { - "name": "AlertsSortByFields", - "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" + } + ] } }, - "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 + "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." + } } }, - "smartGroupsSortBy": { - "description": "Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.", - "name": "sortBy", + "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" + } + } + } + }, + "AlertModificationType": { "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", + "description": "Type of modification details", "enum": [ - "alertsCount", - "state", - "severity", - "startDateTime", - "lastModifiedDateTime" + "PropertyChange", + "ActionsSuppressed", + "ActionsTriggered" ], "x-ms-enum": { - "name": "SmartGroupsSortByFields", - "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" + } + ] } }, - "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" - ] - }, - "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" + "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" + } + } + } }, - "identifier": { - "name": "identifier", - "description": "Identification of the information to be retrieved by API call.", + "AlertState": { "type": "string", - "in": "query", - "required": true, "enum": [ - "MonitorServiceList" + "New", + "Acknowledged", + "Closed" ], "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" - } + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "New", + "value": "New", + "description": "New" + }, + { + "name": "Acknowledged", + "value": "Acknowledged", + "description": "Acknowledged" + }, + { + "name": "Closed", + "value": "Closed", + "description": "Closed" } - } + ] } }, - "operationsList": { - "description": "Lists the operations available in the AlertsManagement RP.", + "AlertsList": { + "type": "object", + "description": "List the alerts.", "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" - }, "value": { - "description": "Array of operations", "type": "array", + "description": "The Alert items on this page", "items": { - "$ref": "#/definitions/operation" + "$ref": "#/definitions/Alert" } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" } }, "required": [ "value" ] }, - "AlertsManagementErrorResponse": { - "description": "An error response from the service.", - "x-ms-external": true, + "AlertsMetaData": { + "type": "object", + "description": "alert meta data information.", "properties": { - "error": { - "$ref": "#/definitions/errorResponseBody" + "properties": { + "$ref": "#/definitions/AlertsMetaDataProperties", + "description": "alert meta data property bag" } } }, - "errorResponseBody": { - "description": "Details of error response.", - "x-ms-external": true, + "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" + ] + }, + "AlertsSummary": { + "type": "object", + "description": "Summary of alerts based on the input filters and 'groupby' parameters.", + "properties": { + "properties": { + "$ref": "#/definitions/AlertsSummaryGroup", + "description": "Group the result set." + } + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ] + }, + "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", + "AlertsSummaryGroupItem": { + "type": "object", + "description": "Alerts summary group item", "properties": { - "id": { + "name": { "type": "string", - "readOnly": true, - "description": "Azure resource Id" + "description": "Value of the aggregated field" }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" + "count": { + "type": "integer", + "format": "int64", + "description": "Count of the aggregated field" }, - "name": { + "groupedby": { "type": "string", - "readOnly": true, - "description": "Azure resource name" - } - } - }, - "alert": { - "description": "An alert created in alert management service.", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "properties": { - "properties": { - "$ref": "#/definitions/alertProperties" - } - } - }, - "alertsList": { - "description": "List the alerts.", - "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" + "description": "Name of the field aggregated" }, - "value": { - "description": "List of alerts", + "values": { "type": "array", + "description": "List of the items", "items": { - "$ref": "#/definitions/alert" + "$ref": "#/definitions/AlertsSummaryGroupItem" } } } }, - "alertProperties": { + "BaseDetails": { "type": "object", - "description": "Alert property bag", + "description": "Base details class.", "properties": { - "essentials": { - "$ref": "#/definitions/essentials" - }, - "context": { - "$ref": "#/definitions/alertContext" - }, - "egressConfig": { - "$ref": "#/definitions/egressConfig" + "type": { + "$ref": "#/definitions/AlertModificationType", + "description": "Type of modification details" } - } + }, + "discriminator": "type", + "required": [ + "type" + ] }, - "comments": { + "Comments": { "type": "object", "description": "Change alert state reason", "properties": { @@ -899,86 +1836,29 @@ } } }, - "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": { - "type": "object", - "description": "Action status", - "properties": { - "isSuppressed": { - "type": "boolean", - "description": "Value indicating whether alert is suppressed." - } - } - }, - "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", @@ -997,30 +1877,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", @@ -1066,7 +1925,8 @@ "readOnly": true }, "actionStatus": { - "$ref": "#/definitions/actionStatus" + "$ref": "#/definitions/ActionStatus", + "description": "Action status" }, "description": { "type": "string", @@ -1074,435 +1934,541 @@ } } }, - "alertModification": { - "description": "Alert Modification details", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } + "MetadataIdentifier": { + "type": "string", + "description": "Identification of the information to be retrieved by API call", + "enum": [ + "MonitorServiceList" ], - "properties": { - "properties": { - "$ref": "#/definitions/alertModificationProperties" - } - } - }, - "alertModificationProperties": { - "type": "object", - "description": "Properties of the alert modification item.", - "properties": { - "alertId": { - "type": "string", - "description": "Unique Id of the alert for which the history is being retrieved", - "readOnly": true - }, - "modifications": { - "type": "array", - "description": "Modification details", - "items": { - "$ref": "#/definitions/alertModificationItem" + "x-ms-enum": { + "name": "MetadataIdentifier", + "modelAsString": true, + "values": [ + { + "name": "MonitorServiceList", + "value": "MonitorServiceList", + "description": "MonitorServiceList" } - } + ] } }, - "alertModificationItem": { - "description": "Alert modification item.", - "properties": { - "modificationEvent": { - "type": "string", - "description": "Reason for the modification", - "enum": [ - "AlertCreated", - "StateChange", - "MonitorConditionChange" - ], - "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" - } + ] } }, - "smartGroupModification": { - "description": "Alert Modification details", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } + "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": { - "properties": { - "$ref": "#/definitions/smartGroupModificationProperties" - } + "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" + } + ] } }, - "smartGroupModificationProperties": { - "description": "Properties of the smartGroup modification item.", + "MonitorServiceDetails": { + "type": "object", + "description": "Details of a monitor service", "properties": { - "smartGroupId": { + "name": { "type": "string", - "description": "Unique Id of the smartGroup for which the history is being retrieved", - "readOnly": true - }, - "modifications": { - "type": "array", - "description": "Modification details", - "items": { - "$ref": "#/definitions/smartGroupModificationItem" - } + "description": "Monitor service name" }, - "nextLink": { - "description": "URL to fetch the next set of results.", - "type": "string" + "displayName": { + "type": "string", + "description": "Monitor service display name" } } }, - "smartGroupModificationItem": { - "description": "smartGroup modification item.", + "MonitorServiceList": { + "type": "object", + "description": "Monitor service details", "properties": { - "modificationEvent": { - "type": "string", - "description": "Reason for the modification", - "enum": [ - "SmartGroupCreated", - "StateChange", - "AlertAdded", - "AlertRemoved" - ], - "x-ms-enum": { - "name": "SmartGroupModificationEvent" - } - }, - "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" + "data": { + "type": "array", + "description": "Array of operations", + "items": { + "$ref": "#/definitions/MonitorServiceDetails" + } } - } - }, - "alertsSummary": { - "description": "Summary of alerts based on the input filters and 'groupby' parameters.", + }, + "required": [ + "data" + ], "allOf": [ { - "$ref": "#/definitions/ProxyResource" + "$ref": "#/definitions/AlertsMetaDataProperties" } ], - "properties": { - "properties": { - "$ref": "#/definitions/alertsSummaryGroup" - } - } + "x-ms-discriminator-value": "MonitorServiceList" }, - "alertsSummaryGroup": { + "NotificationResult": { "type": "object", - "description": "Group the result set.", "properties": { - "total": { - "type": "integer", - "description": "Total count of the result set." - }, - "smartGroupsCount": { - "type": "integer", - "description": "Total count of the smart groups." - }, - "groupedby": { + "statusURL": { "type": "string", - "description": "Name of the field aggregated" + "description": "URL endpoint for checking notification delivery status. Only populated when status is 'Inline'." }, - "values": { - "type": "array", - "description": "List of the items", - "items": { - "$ref": "#/definitions/alertsSummaryGroupItem" - } + "status": { + "$ref": "#/definitions/ResultStatus", + "description": "The status of the notification" } } }, - "alertsSummaryGroupItem": { + "PrometheusEnrichmentItem": { "type": "object", - "description": "Alerts summary group item", + "description": "Prometheus enrichment object.", "properties": { - "name": { + "type": { "type": "string", - "description": "Value of the aggregated field" - }, - "count": { - "type": "integer", - "description": "Count of the aggregated field" + "description": "Discriminator property for PrometheusEnrichmentItem." }, - "groupedby": { + "linkToApi": { "type": "string", - "description": "Name of the field aggregated" + "description": "Link to Prometheus query API (Url format)." }, - "values": { + "datasources": { "type": "array", - "description": "List of the items", + "description": "An array of the azure monitor workspace resource ids.", "items": { - "$ref": "#/definitions/alertsSummaryGroupItem" + "type": "string" } + }, + "grafanaExplorePath": { + "type": "string", + "description": "Partial link to the Grafana explore API." + }, + "query": { + "type": "string", + "description": "The Prometheus expression query." } - } + }, + "discriminator": "type", + "required": [ + "type", + "linkToApi", + "datasources", + "grafanaExplorePath", + "query" + ], + "allOf": [ + { + "$ref": "#/definitions/AlertEnrichmentItem" + } + ] }, - "alertsMetaData": { - "description": "alert meta data information.", + "PrometheusInstantQuery": { + "type": "object", + "description": "Prometheus instant query enrichment object.", "properties": { - "properties": { - "$ref": "#/definitions/alertsMetaDataProperties" + "time": { + "type": "string", + "description": "The date and the time of the evaluation." } - } - }, - "alertsMetaDataProperties": { - "description": "alert meta data property bag", - "discriminator": "metadataIdentifier", + }, "required": [ - "metadataIdentifier" + "time" ], - "properties": { - "metadataIdentifier": { - "type": "string", - "description": "Identification of the information to be retrieved by API call", - "enum": [ - "MonitorServiceList" - ], - "x-ms-enum": { - "name": "metadataIdentifier", - "modelAsString": true - } + "allOf": [ + { + "$ref": "#/definitions/PrometheusEnrichmentItem" } - } + ], + "x-ms-discriminator-value": "PrometheusInstantQuery" }, - "smartGroupsList": { - "description": "List the alerts.", + "PrometheusRangeQuery": { + "type": "object", + "description": "Prometheus instant query enrichment object.", "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" + "start": { + "type": "string", + "format": "date-time", + "description": "The start evaluation date and time in ISO8601 format." }, - "value": { - "description": "List of alerts", - "type": "array", - "items": { - "$ref": "#/definitions/smartGroup" - } + "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." } - } - }, - "smartGroup": { - "description": "Set of related alerts grouped together smartly by AMS.", + }, + "required": [ + "start", + "end", + "step" + ], "allOf": [ { - "$ref": "#/definitions/ProxyResource" + "$ref": "#/definitions/PrometheusEnrichmentItem" } ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/smartGroupProperties" - } - } + "x-ms-discriminator-value": "PrometheusRangeQuery" }, - "smartGroupProperties": { + "PropertyChangeDetails": { "type": "object", - "description": "Properties of smart group.", "properties": { - "alertsCount": { - "type": "integer", - "description": "Total number of alerts in smart group" - }, - "smartGroupState": { + "oldValue": { "type": "string", - "description": "Smart group state", - "readOnly": true, - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "State", - "modelAsString": true - } + "description": "The value before the change" }, - "severity": { + "newValue": { "type": "string", - "description": "Severity of smart group is the highest(Sev0 >... > Sev4) severity of all the alerts in the group.", - "readOnly": true, - "enum": [ - "Sev0", - "Sev1", - "Sev2", - "Sev3", - "Sev4" - ], - "x-ms-enum": { - "name": "Severity", - "modelAsString": true - } + "description": "The value after the change" }, - "startDateTime": { + "comment": { "type": "string", - "format": "date-time", - "description": "Creation time of smart group. Date-Time in ISO-8601 format.", + "description": "The comment" + } + }, + "allOf": [ + { + "$ref": "#/definitions/BaseDetails" + } + ], + "x-ms-discriminator-value": "PropertyChange" + }, + "ProxyResource": { + "type": "object", + "description": "An azure resource object", + "properties": { + "id": { + "type": "string", + "description": "Azure resource Id", "readOnly": true }, - "lastModifiedDateTime": { + "type": { "type": "string", - "format": "date-time", - "description": "Last updated time of smart group. Date-Time in ISO-8601 format.", + "description": "Azure resource type", "readOnly": true }, - "lastModifiedUserName": { + "name": { "type": "string", - "description": "Last modified by user name.", + "description": "Azure resource name", "readOnly": true - }, - "resources": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of target resources in the smart group" - }, - "resourceTypes": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" + } + } + }, + "ResultStatus": { + "type": "string", + "description": "The status of the notification", + "enum": [ + "None", + "Inline", + "Throttled", + "Failed", + "ThrottledByAlertRule", + "ThrottledBySubscription" + ], + "x-ms-enum": { + "name": "ResultStatus", + "modelAsString": true, + "values": [ + { + "name": "None", + "value": "None", + "description": "None" }, - "type": "array", - "description": "Summary of target resource types in the smart group" - }, - "resourceGroups": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" + { + "name": "Inline", + "value": "Inline", + "description": "Inline" }, - "type": "array", - "description": "Summary of target resource groups in the smart group" - }, - "monitorServices": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" + { + "name": "Throttled", + "value": "Throttled", + "description": "Throttled" }, - "type": "array", - "description": "Summary of monitorServices in the smart group" - }, - "monitorConditions": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" + { + "name": "Failed", + "value": "Failed", + "description": "Failed" }, - "type": "array", - "description": "Summary of monitorConditions in the smart group" - }, - "alertStates": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" + { + "name": "ThrottledByAlertRule", + "value": "ThrottledByAlertRule", + "description": "ThrottledByAlertRule" }, - "type": "array", - "description": "Summary of alertStates in the smart group" - }, - "alertSeverities": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" + { + "name": "ThrottledBySubscription", + "value": "ThrottledBySubscription", + "description": "ThrottledBySubscription" + } + ] + } + }, + "RuleType": { + "type": "string", + "description": "The rule type", + "enum": [ + "AlertRule", + "ActionRule" + ], + "x-ms-enum": { + "name": "RuleType", + "modelAsString": true, + "values": [ + { + "name": "AlertRule", + "value": "AlertRule", + "description": "AlertRule" }, - "type": "array", - "description": "Summary of alertSeverities in the smart group" - }, - "nextLink": { - "type": "string", - "description": "The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the next page alerts." - } + { + "name": "ActionRule", + "value": "ActionRule", + "description": "ActionRule" + } + ] } }, - "smartGroupAggregatedProperty": { - "type": "object", - "description": "Aggregated property of each type", - "properties": { - "name": { - "type": "string", - "description": "Name of the type." - }, - "count": { - "type": "integer", - "description": "Total number of items of type." - } + "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" + } + ] } }, - "MonitorServiceList": { - "title": "Monitor service details", - "description": "Monitor service details", - "required": [ - "data" + "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" ], - "allOf": [ - { - "$ref": "#/definitions/alertsMetaDataProperties" - }, - { - "type": "object" - } + "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" + } + ] + } + }, + "Status": { + "type": "string", + "description": "The status of the evaluation of the enrichment.", + "enum": [ + "Succeeded", + "Failed" ], - "properties": { - "data": { - "description": "Array of operations", - "type": "array", - "items": { - "$ref": "#/definitions/MonitorServiceDetails" + "x-ms-enum": { + "name": "Status", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Succeeded" + }, + { + "name": "Failed", + "value": "Failed", + "description": "Failed" } - } + ] } }, - "MonitorServiceDetails": { - "description": "Details of a monitor service", + "TriggeredRule": { + "type": "object", "properties": { - "name": { + "actionGroupId": { "type": "string", - "description": "Monitor service name" + "description": "The action group ID" }, - "displayName": { + "ruleId": { "type": "string", - "description": "Monitor service display name" + "description": "The rule ID" + }, + "ruleType": { + "$ref": "#/definitions/RuleType", + "description": "The rule type" } } + }, + "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": {} } From 3d80de30d048303ec8aeab8e23d648bc0f4428b9 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 09:53:07 +0800 Subject: [PATCH 03/20] update --- .../AlertsManagement.Management/main.tsp | 4 ++-- .../AlertsManagement.Management/models.tsp | 3 +++ .../preview/2025-05-25-preview/AlertsManagement.json | 10 ++++++---- .../stable/2019-03-01/AlertsManagement.json | 10 ++++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/specification/alertsmanagement/AlertsManagement.Management/main.tsp b/specification/alertsmanagement/AlertsManagement.Management/main.tsp index af5ee3365353..951dc0a58cbd 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/main.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/main.tsp @@ -23,10 +23,10 @@ using Azure.Core; using Azure.ResourceManager; using TypeSpec.Versioning; /** - * AlertsManagement Client + * Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor. */ @armProviderNamespace -@service(#{ title: "AlertsManagementClient" }) +@service(#{ title: "Azure Alerts Management Service Resource Provider" }) @versioned(Versions) @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) namespace Microsoft.AlertsManagement; diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/AlertsManagement.Management/models.tsp index 259e690c5915..f56f929b018a 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/models.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/models.tsp @@ -705,6 +705,7 @@ model ErrorResponseBody { /** * A list of additional details about the error. */ + @identifiers(#[]) details?: ErrorResponseBody[]; } @@ -732,6 +733,7 @@ model AlertModificationProperties { /** * Array of alert modification events. */ + @identifiers(#[]) modifications?: AlertModificationItem[]; } @@ -1024,6 +1026,7 @@ model ActionSuppressedDetails extends BaseDetails { /** * List of suppressed action groups */ + @identifiers(#[]) suppressedActionGroups?: TriggeredRule[]; /** 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 c806c2e433b9..29c27fb8dfd5 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,9 +1,9 @@ { "swagger": "2.0", "info": { - "title": "AlertsManagementClient", + "title": "Azure Alerts Management Service Resource Provider", "version": "2025-05-25-preview", - "description": "AlertsManagement Client", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" @@ -1405,7 +1405,8 @@ "description": "List of suppressed action groups", "items": { "$ref": "#/definitions/TriggeredRule" - } + }, + "x-ms-identifiers": [] } }, "allOf": [ @@ -1652,7 +1653,8 @@ "description": "Array of alert modification events.", "items": { "$ref": "#/definitions/AlertModificationItem" - } + }, + "x-ms-identifiers": [] } } }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json index fa213f7e8678..4f17981ce377 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json @@ -1,9 +1,9 @@ { "swagger": "2.0", "info": { - "title": "AlertsManagementClient", + "title": "Azure Alerts Management Service Resource Provider", "version": "2019-03-01", - "description": "AlertsManagement Client", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" @@ -1365,7 +1365,8 @@ "description": "List of suppressed action groups", "items": { "$ref": "#/definitions/TriggeredRule" - } + }, + "x-ms-identifiers": [] } }, "allOf": [ @@ -1612,7 +1613,8 @@ "description": "Array of alert modification events.", "items": { "$ref": "#/definitions/AlertModificationItem" - } + }, + "x-ms-identifiers": [] } } }, From 84ae2f48a12e31f41216150a7aec2ec44edb32fd Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 15:05:47 +0800 Subject: [PATCH 04/20] update --- .../AlertsManagement.Management/Alert.tsp | 169 +++- .../back-compatible.tsp | 2 +- .../AlertsManagement.Management/client.tsp | 16 + .../Alerts_ChangeStateTenant.json | 49 + .../Alerts_GetByIdTenant.json | 49 + .../Alerts_GetHistoryTenant.json | 92 ++ .../2025-05-25-preview/Alerts_List.json | 4 +- .../Alerts_List_GetAllTenant.json | 139 +++ .../AlertsManagement.Management/main.tsp | 8 +- .../AlertsManagement.Management/models.tsp | 1 + .../AlertsManagement.Management/routes.tsp | 6 +- .../tspconfig.yaml | 2 +- .../2025-05-25-preview/AlertsManagement.json | 907 ++++++++++++++++-- .../examples/Alerts_ChangeStateTenant.json | 49 + .../examples/Alerts_GetByIdTenant.json | 49 + .../examples/Alerts_GetHistoryTenant.json | 92 ++ .../examples/Alerts_HistoryTenant.json | 92 ++ .../examples/Alerts_List.json | 4 +- .../examples/Alerts_List_GetAllTenant.json | 139 +++ 19 files changed, 1770 insertions(+), 99 deletions(-) create mode 100644 specification/alertsmanagement/AlertsManagement.Management/client.tsp create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetByIdTenant.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json create mode 100644 specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_ChangeStateTenant.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetByIdTenant.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_GetHistoryTenant.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_HistoryTenant.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/preview/2025-05-25-preview/examples/Alerts_List_GetAllTenant.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp index 8561fe2439de..f3e7eb0ae215 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp @@ -48,7 +48,11 @@ interface Alerts { /** * Get information related to a specific alert. */ - getByIdTenant is AlertOps.Read; + @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. @@ -58,7 +62,8 @@ interface Alerts { getHistoryTenant is AlertOps.ActionSync< Alert, void, - ArmResponse + ArmResponse, + ErrorType = AlertsManagementErrorResponse >; /** @@ -76,7 +81,8 @@ interface Alerts { @query("newState") newState: AlertState; }, - OptionalRequestBody = true + OptionalRequestBody = true, + ErrorType = AlertsManagementErrorResponse >; } alias AlertOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< @@ -105,21 +111,161 @@ alias AlertOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< } >; +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. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("Alerts_GetAllTenant") + 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}'. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Get a specific alert.") @operationId("Alerts_GetById") - getById is AlertOperationGroupOps.Read; + 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. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_GetAllTenant") - getAllTenant is AlertOperationGroupOps.List< + @operationId("Alerts_GetAll") + getAll is AlertOperationGroupOps.List< Alert, Parameters = { /** @@ -224,7 +370,8 @@ interface AlertOperationGroup { @query("customTimeRange") customTimeRange?: string; }, - Response = ArmResponse + Response = ArmResponse, + ErrorType = AlertsManagementErrorResponse >; /** @@ -235,7 +382,7 @@ interface AlertOperationGroup { @action("changestate") changeState is AlertOperationGroupOps.ActionSync< Alert, - void, + Comments, ArmResponse, Parameters = { /** @@ -244,7 +391,8 @@ interface AlertOperationGroup { @query("newState") newState: AlertState; }, - OptionalRequestBody = true + OptionalRequestBody = true, + ErrorType = AlertsManagementErrorResponse >; /** @@ -257,7 +405,8 @@ interface AlertOperationGroup { getHistory is AlertOperationGroupOps.ActionSync< Alert, void, - ArmResponse + ArmResponse, + ErrorType = AlertsManagementErrorResponse >; /** diff --git a/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp b/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp index c295fdfdc0bc..fd98ba37a468 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp @@ -5,7 +5,7 @@ using Microsoft.AlertsManagement; @@clientName(Alerts.changeStateTenant::parameters.body, "comment"); @@clientLocation(AlertOperationGroup.getById, Alerts); -@@clientLocation(AlertOperationGroup.getAllTenant, Alerts); +@@clientLocation(AlertOperationGroup.getAll, Alerts); @@clientLocation(AlertOperationGroup.changeState, Alerts); @@clientName(AlertOperationGroup.changeState::parameters.body, "comment"); @@clientLocation(AlertOperationGroup.getHistory, Alerts); diff --git a/specification/alertsmanagement/AlertsManagement.Management/client.tsp b/specification/alertsmanagement/AlertsManagement.Management/client.tsp new file mode 100644 index 000000000000..b56bd7b4b064 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json new file mode 100644 index 000000000000..38178c0029a2 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetByIdTenant.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetByIdTenant.json new file mode 100644 index 000000000000..1578aa3d9fda --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json new file mode 100644 index 000000000000..7501dac0ba93 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json index 46054dd780c1..1d13296a2e0b 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json @@ -134,6 +134,6 @@ } } }, - "operationId": "Alerts_GetAllTenant", + "operationId": "Alerts_GetAll", "title": "ListAlerts" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json new file mode 100644 index 000000000000..46054dd780c1 --- /dev/null +++ b/specification/alertsmanagement/AlertsManagement.Management/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" +} \ No newline at end of file diff --git a/specification/alertsmanagement/AlertsManagement.Management/main.tsp b/specification/alertsmanagement/AlertsManagement.Management/main.tsp index 951dc0a58cbd..d483ed3e3e60 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/main.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/main.tsp @@ -35,11 +35,6 @@ namespace Microsoft.AlertsManagement; * The available API versions. */ enum Versions { - /** - * The 2019-03-01 API version. - */ - v2019_03_01: "2019-03-01", - /** * The 2025-05-25-preview API version. */ @@ -47,3 +42,6 @@ enum Versions { } interface Operations extends Azure.ResourceManager.Operations {} +@@doc(Operations.list, + "List all operations available through Azure Alerts Management Resource Provider." +); diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/AlertsManagement.Management/models.tsp index f56f929b018a..03bc1d4037f0 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/models.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/models.tsp @@ -686,6 +686,7 @@ model AlertsManagementErrorResponse { /** * Details of error response. */ +@Azure.ResourceManager.Legacy.armExternalType model ErrorResponseBody { /** * Error code, intended to be consumed programmatically. diff --git a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp index 4a381a257e04..70473c4c7958 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp @@ -31,7 +31,8 @@ interface AlertsOperationGroup { */ @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). @@ -116,6 +117,7 @@ interface AlertsOperationGroup { */ @query("customTimeRange") customTimeRange?: string; - } + }, + Error = AlertsManagementErrorResponse >; } diff --git a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml index 5fe78d4fef18..983a9783a252 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml +++ b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml @@ -2,7 +2,7 @@ emit: - "@azure-tools/typespec-autorest" options: "@azure-tools/typespec-autorest": - omit-unreachable-types: true + omit-unreachable-types: false emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/AlertsManagement/{version-status}/{version}/AlertsManagement.json" 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 29c27fb8dfd5..5527102b4fb4 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 @@ -45,6 +45,9 @@ { "name": "Alerts" }, + { + "name": "AlertGetAllTenantOperation" + }, { "name": "AlertOperationGroup" } @@ -52,7 +55,7 @@ "paths": { "/{scope}/providers/Microsoft.AlertsManagement/alerts": { "get": { - "operationId": "Alerts_GetAllTenant", + "operationId": "Alerts_GetAll", "tags": [ "AlertOperationGroup" ], @@ -501,7 +504,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, @@ -515,12 +518,13 @@ } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/alerts/{name}": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { "get": { "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": [ { @@ -539,44 +543,19 @@ "description": "Unique ID of an alert instance.", "required": true, "type": "string" - }, - { - "name": "name", - "in": "path", - "description": "Unique ID of an alert instance.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Alert" - } } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { - "type": "object", - "description": "The default scope parameter for an extension resource.", - "properties": { - "scope": { - "type": "string", - "description": "The fully qualified Azure Resource manager identifier of the resource." - } - }, - "required": [ - "scope" - ] + "$ref": "#/definitions/Alert" } }, "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, @@ -644,6 +623,15 @@ } ] } + }, + { + "name": "comment", + "in": "body", + "description": "reason of change alert state", + "required": false, + "schema": { + "$ref": "#/definitions/Comments" + } } ], "responses": { @@ -656,7 +644,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, @@ -753,7 +741,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, @@ -1009,70 +997,525 @@ "modelAsString": true, "values": [ { - "name": "Sev0", - "value": "Sev0", - "description": "Sev0" + "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" + } + ] + } + }, + { + "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" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertsSummary" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/AlertsManagementErrorResponse" + } + } + }, + "x-ms-examples": { + "Summary": { + "$ref": "./examples/Alerts_Summary.json" + } + } + } + }, + "/providers/Microsoft.AlertsManagement/alerts": { + "get": { + "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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "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": "smartGroupId", + "in": "query", + "description": "Filter the alerts list by the Smart Group Id. Default value is none.", + "required": false, + "type": "string" + }, + { + "name": "includeContext", + "in": "query", + "description": "Include context which has contextual data specific to the monitor service. Default value is false'", + "required": false, + "type": "boolean" + }, + { + "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" + }, + { + "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" + }, + { + "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": "Sev1", - "value": "Sev1", - "description": "Sev1" + "name": "targetResourceGroup", + "value": "targetResourceGroup", + "description": "targetResourceGroup" }, { - "name": "Sev2", - "value": "Sev2", - "description": "Sev2" + "name": "targetResourceType", + "value": "targetResourceType", + "description": "targetResourceType" }, { - "name": "Sev3", - "value": "Sev3", - "description": "Sev3" + "name": "startDateTime", + "value": "startDateTime", + "description": "startDateTime" }, { - "name": "Sev4", - "value": "Sev4", - "description": "Sev4" + "name": "lastModifiedDateTime", + "value": "lastModifiedDateTime", + "description": "lastModifiedDateTime" } ] } }, { - "name": "alertState", + "name": "sortOrder", "in": "query", - "description": "Filter by state of the alert instance. Default value is to select all.", + "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": [ - "New", - "Acknowledged", - "Closed" + "asc", + "desc" ], "x-ms-enum": { - "name": "AlertState", + "name": "SortOrder", "modelAsString": true, "values": [ { - "name": "New", - "value": "New", - "description": "New" - }, - { - "name": "Acknowledged", - "value": "Acknowledged", - "description": "Acknowledged" + "name": "asc", + "value": "asc", + "description": "asc" }, { - "name": "Closed", - "value": "Closed", - "description": "Closed" + "name": "desc", + "value": "desc", + "description": "desc" } ] } }, { - "name": "alertRule", + "name": "select", "in": "query", - "description": "Filter by specific alert rule. Default value is to select all.", + "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" }, @@ -1125,22 +1568,25 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { - "$ref": "#/definitions/AlertsSummary" + "$ref": "#/definitions/AlertsList" } }, "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, "x-ms-examples": { - "Summary": { - "$ref": "./examples/Alerts_Summary.json" + "ListAlerts": { + "$ref": "./examples/Alerts_List_GetAllTenant.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, @@ -1150,6 +1596,7 @@ "tags": [ "Alerts" ], + "summary": "Get a specific alert.", "description": "Get information related to a specific alert.", "parameters": [ { @@ -1173,9 +1620,14 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } + }, + "x-ms-examples": { + "GetById": { + "$ref": "./examples/Alerts_GetByIdTenant.json" + } } } }, @@ -1250,9 +1702,14 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_ChangeStateTenant.json" + } } } }, @@ -1285,9 +1742,14 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_GetHistoryTenant.json" + } } } }, @@ -1331,7 +1793,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, @@ -1348,7 +1810,7 @@ "tags": [ "Operations" ], - "description": "List the operations for the provider", + "description": "List all operations available through Azure Alerts Management Resource Provider.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -1763,6 +2225,16 @@ "value" ] }, + "AlertsManagementErrorResponse": { + "type": "object", + "description": "An error response from the service.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponseBody", + "description": "Details of error response." + } + } + }, "AlertsMetaData": { "type": "object", "description": "alert meta data information.", @@ -1787,6 +2259,77 @@ "metadataIdentifier" ] }, + "AlertsSortByFields": { + "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" + } + ] + } + }, "AlertsSummary": { "type": "object", "description": "Summary of alerts based on the input filters and 'groupby' parameters.", @@ -1829,6 +2372,53 @@ } } }, + "AlertsSummaryGroupByFields": { + "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" + } + ] + } + }, "AlertsSummaryGroupItem": { "type": "object", "description": "Alerts summary group item", @@ -1855,6 +2445,29 @@ } } }, + "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": "Base details class.", @@ -1878,6 +2491,33 @@ } } }, + "ErrorResponseBody": { + "type": "object", + "description": "Details of error response.", + "properties": { + "code": { + "type": "string", + "description": "Error code, intended to be consumed programmatically." + }, + "message": { + "type": "string", + "description": "Description of the error, intended for display in user interface." + }, + "target": { + "type": "string", + "description": "Target of the particular error, for example name of the property." + }, + "details": { + "type": "array", + "description": "A list of additional details about the error.", + "items": { + "$ref": "#/definitions/ErrorResponseBody" + }, + "x-ms-identifiers": [] + } + }, + "x-ms-external": true + }, "Essentials": { "type": "object", "description": "This object contains consistent fields across different monitor services.", @@ -1976,6 +2616,23 @@ } } }, + "Identifier": { + "type": "string", + "enum": [ + "MonitorServiceList" + ], + "x-ms-enum": { + "name": "Identifier", + "modelAsString": true, + "values": [ + { + "name": "MonitorServiceList", + "value": "MonitorServiceList", + "description": "MonitorServiceList" + } + ] + } + }, "MetadataIdentifier": { "type": "string", "description": "Identification of the information to be retrieved by API call", @@ -2167,6 +2824,46 @@ } } }, + "Operation": { + "type": "object", + "description": "Operation provided by provider", + "properties": { + "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" + } + } + }, + "OperationDisplay": { + "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" + } + } + }, "PrometheusEnrichmentItem": { "type": "object", "description": "Prometheus enrichment object.", @@ -2446,6 +3143,29 @@ ] } }, + "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.", @@ -2470,6 +3190,41 @@ ] } }, + "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": { 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_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_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_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 46054dd780c1..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 @@ -134,6 +134,6 @@ } } }, - "operationId": "Alerts_GetAllTenant", + "operationId": "Alerts_GetAll", "title": "ListAlerts" -} \ No newline at end of file +} 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..46054dd780c1 --- /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" +} \ No newline at end of file From b2c8dc2a6925e732745e6eb31ae48b97d8b36a2a Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 15:21:45 +0800 Subject: [PATCH 05/20] remove @operationid --- .../AlertsManagement.Management/Alert.tsp | 12 ------------ .../AlertsManagement.Management/back-compatible.tsp | 1 + .../AlertsManagement.Management/routes.tsp | 4 ---- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp index f3e7eb0ae215..a17d359a8b7f 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp @@ -135,8 +135,6 @@ 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. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_GetAllTenant") getAllTenant is GetAllTenantOps.List< Alert, Parameters = { @@ -252,9 +250,7 @@ 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}'. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Get a specific alert.") - @operationId("Alerts_GetById") getById is AlertOperationGroupOps.Read< Alert, ErrorType = AlertsManagementErrorResponse @@ -263,8 +259,6 @@ interface AlertOperationGroup { /** * 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. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_GetAll") getAll is AlertOperationGroupOps.List< Alert, Parameters = { @@ -377,8 +371,6 @@ interface AlertOperationGroup { /** * 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}'. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_ChangeState") @action("changestate") changeState is AlertOperationGroupOps.ActionSync< Alert, @@ -398,8 +390,6 @@ interface AlertOperationGroup { /** * 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'. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_GetHistory") @get @action("history") getHistory is AlertOperationGroupOps.ActionSync< @@ -412,8 +402,6 @@ interface AlertOperationGroup { /** * Get the enrichments of an alert. It returns a collection of one object named default. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_GetEnrichments") @list @get @action("enrichments") diff --git a/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp b/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp index fd98ba37a468..43705d34a556 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp @@ -13,3 +13,4 @@ using Microsoft.AlertsManagement; @@clientLocation(AlertsOperationGroup.metaData, Alerts); @@clientLocation(AlertsOperationGroup.getSummary, Alerts); +@@clientLocation(AlertGetAllTenantOperation.getAllTenant, Alerts); diff --git a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp index 70473c4c7958..67c9e5b6bdfb 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp @@ -18,8 +18,6 @@ interface AlertsOperationGroup { /** * List alerts meta data information based on value of identifier parameter. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_MetaData") @autoRoute @get @action("alertsMetaData") @@ -37,8 +35,6 @@ interface AlertsOperationGroup { /** * Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("Alerts_GetSummary") @autoRoute @get @action("alertsSummary") From 422a3e19851a032c17ab549a40e7c8588c363a5c Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 15:59:58 +0800 Subject: [PATCH 06/20] update --- .../AlertsManagement.Management/models.tsp | 90 +++++++++++++------ .../AlertsManagement.Management/routes.tsp | 2 +- .../2025-05-25-preview/AlertsManagement.json | 78 ++++++++++++++-- 3 files changed, 133 insertions(+), 37 deletions(-) diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/AlertsManagement.Management/models.tsp index 03bc1d4037f0..56d59999917a 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/models.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/models.tsp @@ -10,7 +10,7 @@ using Azure.ResourceManager.Foundations; namespace Microsoft.AlertsManagement; -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union MonitorService { string, @@ -90,7 +90,7 @@ union MonitorService { `Resource Health`: "Resource Health", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union MonitorCondition { string, @@ -105,7 +105,7 @@ union MonitorCondition { Resolved: "Resolved", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union Severity { string, @@ -135,7 +135,7 @@ union Severity { Sev4: "Sev4", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union AlertState { string, @@ -155,7 +155,7 @@ union AlertState { Closed: "Closed", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union AlertsSortByFields { string, @@ -210,7 +210,7 @@ union AlertsSortByFields { lastModifiedDateTime: "lastModifiedDateTime", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union SortOrder { string, @@ -225,7 +225,7 @@ union SortOrder { desc: "desc", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union TimeRange { string, @@ -294,7 +294,7 @@ union AlertModificationType { ActionsTriggered: "ActionsTriggered", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union Identifier { string, @@ -316,7 +316,7 @@ union MetadataIdentifier { MonitorServiceList: "MonitorServiceList", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" union AlertsSummaryGroupByFields { string, @@ -439,8 +439,8 @@ union ResultStatus { ThrottledBySubscription: "ThrottledBySubscription", } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +#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 @@ -456,7 +456,7 @@ enum ApiVersion { /** * Reason for the modification */ -#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" enum AlertModificationEvent { /** * AlertCreated @@ -497,7 +497,7 @@ model AlertsList is Azure.Core.Page; /** * Alert property bag */ -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "For backward compatibility" +#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. @@ -507,19 +507,21 @@ model AlertProperties { /** * 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" "For backward compatibility" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" customProperties?: Record; } @@ -686,6 +688,7 @@ model AlertsManagementErrorResponse { /** * 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 { /** @@ -713,7 +716,7 @@ model ErrorResponseBody { /** * Alert Modification details */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" +#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. @@ -798,7 +801,8 @@ model BaseDetails { * Change alert state reason */ model Comments { - #suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" + #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; } @@ -871,7 +875,7 @@ model AlertsMetaDataProperties { /** * Summary of alerts based on the input filters and 'groupby' parameters. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" +#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. @@ -937,7 +941,7 @@ model AlertEnrichmentsList is Azure.Core.Page; /** * The alert's enrichments. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" +#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 { /** @@ -994,7 +998,7 @@ model AlertEnrichmentItem { type: Type; } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#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 @@ -1017,7 +1021,7 @@ model PropertyChangeDetails extends BaseDetails { type: "PropertyChange"; } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#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 @@ -1036,7 +1040,7 @@ model ActionSuppressedDetails extends BaseDetails { type: "ActionsSuppressed"; } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#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 @@ -1054,7 +1058,7 @@ model TriggeredRule { ruleType?: RuleType; } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#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 @@ -1072,11 +1076,12 @@ model ActionTriggeredDetails extends BaseDetails { type: "ActionsTriggered"; } -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#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; /** @@ -1118,8 +1123,7 @@ model MonitorServiceDetails { /** * Prometheus enrichment object. */ -@discriminator("type") -model PrometheusEnrichmentItem extends AlertEnrichmentItem { +model PrometheusEnrichmentItem is AlertEnrichmentItem { /** * Link to Prometheus query API (Url format). */ @@ -1141,10 +1145,37 @@ model PrometheusEnrichmentItem extends AlertEnrichmentItem { query: string; } +alias PrometheusEnrichmentItemPrperties = { + /** + * 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. */ -model PrometheusInstantQuery extends PrometheusEnrichmentItem { +#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 { + ...PrometheusEnrichmentItemPrperties; + /** * The date and the time of the evaluation. */ @@ -1159,7 +1190,12 @@ model PrometheusInstantQuery extends PrometheusEnrichmentItem { /** * Prometheus instant query enrichment object. */ -model PrometheusRangeQuery extends PrometheusEnrichmentItem { +#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 { + ...PrometheusEnrichmentItemPrperties; + /** * The start evaluation date and time in ISO8601 format. */ diff --git a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp index 67c9e5b6bdfb..867fa30cf24d 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/routes.tsp @@ -13,7 +13,7 @@ using TypeSpec.OpenAPI; namespace Microsoft.AlertsManagement; -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +#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. 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 5527102b4fb4..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 @@ -2868,9 +2868,25 @@ "type": "object", "description": "Prometheus enrichment object.", "properties": { - "type": { + "title": { + "type": "string", + "description": "The enrichment title." + }, + "description": { "type": "string", - "description": "Discriminator property for PrometheusEnrichmentItem." + "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." }, "linkToApi": { "type": "string", @@ -2894,33 +2910,54 @@ }, "discriminator": "type", "required": [ + "title", + "description", + "status", "type", "linkToApi", "datasources", "grafanaExplorePath", "query" - ], - "allOf": [ - { - "$ref": "#/definitions/AlertEnrichmentItem" - } ] }, "PrometheusInstantQuery": { "type": "object", "description": "Prometheus instant query enrichment object.", "properties": { + "linkToApi": { + "type": "string", + "description": "Link to Prometheus query API (Url format)." + }, + "datasources": { + "type": "array", + "description": "An array of the azure monitor workspace resource ids.", + "items": { + "type": "string" + } + }, + "grafanaExplorePath": { + "type": "string", + "description": "Partial link to the Grafana explore API." + }, + "query": { + "type": "string", + "description": "The Prometheus expression query." + }, "time": { "type": "string", "description": "The date and the time of the evaluation." } }, "required": [ + "linkToApi", + "datasources", + "grafanaExplorePath", + "query", "time" ], "allOf": [ { - "$ref": "#/definitions/PrometheusEnrichmentItem" + "$ref": "#/definitions/AlertEnrichmentItem" } ], "x-ms-discriminator-value": "PrometheusInstantQuery" @@ -2929,6 +2966,25 @@ "type": "object", "description": "Prometheus instant query enrichment object.", "properties": { + "linkToApi": { + "type": "string", + "description": "Link to Prometheus query API (Url format)." + }, + "datasources": { + "type": "array", + "description": "An array of the azure monitor workspace resource ids.", + "items": { + "type": "string" + } + }, + "grafanaExplorePath": { + "type": "string", + "description": "Partial link to the Grafana explore API." + }, + "query": { + "type": "string", + "description": "The Prometheus expression query." + }, "start": { "type": "string", "format": "date-time", @@ -2945,13 +3001,17 @@ } }, "required": [ + "linkToApi", + "datasources", + "grafanaExplorePath", + "query", "start", "end", "step" ], "allOf": [ { - "$ref": "#/definitions/PrometheusEnrichmentItem" + "$ref": "#/definitions/AlertEnrichmentItem" } ], "x-ms-discriminator-value": "PrometheusRangeQuery" From 427e911f6ed3c4c52fbbeb6fb45c4e7382b3ba06 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 16:01:45 +0800 Subject: [PATCH 07/20] prettier --- .../2025-05-25-preview/AlertsMetaData_MonitorService.json | 2 +- .../examples/2025-05-25-preview/Alerts_ChangeState.json | 2 +- .../examples/2025-05-25-preview/Alerts_GetById.json | 2 +- .../examples/2025-05-25-preview/Alerts_GetEnrichments.json | 2 +- .../examples/2025-05-25-preview/Alerts_History.json | 2 +- .../examples/2025-05-25-preview/Alerts_List_GetAllTenant.json | 2 +- .../examples/2025-05-25-preview/Alerts_Summary.json | 2 +- .../examples/2025-05-25-preview/Operations_List.json | 2 +- .../examples/AlertsMetaData_MonitorService.json | 2 +- .../preview/2025-05-25-preview/examples/Alerts_ChangeState.json | 2 +- .../preview/2025-05-25-preview/examples/Alerts_GetById.json | 2 +- .../2025-05-25-preview/examples/Alerts_GetEnrichments.json | 2 +- .../preview/2025-05-25-preview/examples/Alerts_History.json | 2 +- .../2025-05-25-preview/examples/Alerts_List_GetAllTenant.json | 2 +- .../preview/2025-05-25-preview/examples/Alerts_Summary.json | 2 +- .../preview/2025-05-25-preview/examples/Operations_List.json | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json index 14a1caf1cdb4..8213a82a486e 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json @@ -88,4 +88,4 @@ }, "operationId": "Alerts_MetaData", "title": "MonService" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json index c2fe43938376..b168748a17b6 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json @@ -46,4 +46,4 @@ }, "operationId": "Alerts_ChangeState", "title": "Resolve" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json index 33fb0eeb3849..19c767000b5b 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json @@ -46,4 +46,4 @@ }, "operationId": "Alerts_GetById", "title": "GetById" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json index 41ecaf025ef4..6e3efed7b314 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json @@ -68,4 +68,4 @@ }, "operationId": "Alerts_GetEnrichments", "title": "Resolve" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json index 4a4cbedec2d5..dfde045a4133 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json @@ -89,4 +89,4 @@ }, "operationId": "Alerts_GetHistory", "title": "Resolve" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json index 46054dd780c1..2509782122b3 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json @@ -136,4 +136,4 @@ }, "operationId": "Alerts_GetAllTenant", "title": "ListAlerts" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json index 22c64101d2f9..103116fb97cb 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json @@ -117,4 +117,4 @@ }, "operationId": "Alerts_GetSummary", "title": "Summary" -} \ No newline at end of file +} diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json index e1673e29e08a..af0f8cc49a98 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json +++ b/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json @@ -237,4 +237,4 @@ }, "operationId": "Operations_List", "title": "ListOperations" -} \ No newline at end of file +} 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 14a1caf1cdb4..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 @@ -88,4 +88,4 @@ }, "operationId": "Alerts_MetaData", "title": "MonService" -} \ No newline at end of file +} 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 c2fe43938376..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 @@ -46,4 +46,4 @@ }, "operationId": "Alerts_ChangeState", "title": "Resolve" -} \ No newline at end of file +} 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 33fb0eeb3849..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 @@ -46,4 +46,4 @@ }, "operationId": "Alerts_GetById", "title": "GetById" -} \ No newline at end of file +} 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 41ecaf025ef4..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 @@ -68,4 +68,4 @@ }, "operationId": "Alerts_GetEnrichments", "title": "Resolve" -} \ No newline at end of file +} 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 4a4cbedec2d5..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 @@ -89,4 +89,4 @@ }, "operationId": "Alerts_GetHistory", "title": "Resolve" -} \ No newline at end of file +} 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 index 46054dd780c1..2509782122b3 100644 --- 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 @@ -136,4 +136,4 @@ }, "operationId": "Alerts_GetAllTenant", "title": "ListAlerts" -} \ No newline at end of file +} 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 22c64101d2f9..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 @@ -117,4 +117,4 @@ }, "operationId": "Alerts_GetSummary", "title": "Summary" -} \ No newline at end of file +} 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 e1673e29e08a..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 @@ -237,4 +237,4 @@ }, "operationId": "Operations_List", "title": "ListOperations" -} \ No newline at end of file +} From af1aa99ee280c2c7e24468f77a502727023e5aa0 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 16:05:19 +0800 Subject: [PATCH 08/20] Update tspconfig.yaml --- .../tspconfig.yaml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml index 983a9783a252..e37e89703a92 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml +++ b/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml @@ -1,3 +1,6 @@ +parameters: + "service-dir": + default: "sdk/alertsmanagement" emit: - "@azure-tools/typespec-autorest" options: @@ -8,6 +11,35 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/AlertsManagement/{version-status}/{version}/AlertsManagement.json" 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" From 0c9194814ea2ae95ffe83e4db26233d499a7f3a2 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 5 Dec 2025 16:37:14 +0800 Subject: [PATCH 09/20] update --- .../AlertsManagement.Management/models.tsp | 6 +- .../stable/2019-03-01/AlertsManagement.json | 3038 ++++++----------- 2 files changed, 1038 insertions(+), 2006 deletions(-) diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/AlertsManagement.Management/models.tsp index 56d59999917a..58b849d51c6e 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/models.tsp +++ b/specification/alertsmanagement/AlertsManagement.Management/models.tsp @@ -1145,7 +1145,7 @@ model PrometheusEnrichmentItem is AlertEnrichmentItem { query: string; } -alias PrometheusEnrichmentItemPrperties = { +alias PrometheusEnrichmentItemProperties = { /** * Link to Prometheus query API (Url format). */ @@ -1174,7 +1174,7 @@ alias PrometheusEnrichmentItemPrperties = { #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 { - ...PrometheusEnrichmentItemPrperties; + ...PrometheusEnrichmentItemProperties; /** * The date and the time of the evaluation. @@ -1194,7 +1194,7 @@ model PrometheusInstantQuery extends AlertEnrichmentItem { #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 { - ...PrometheusEnrichmentItemPrperties; + ...PrometheusEnrichmentItemProperties; /** * The start evaluation date and time in ISO8601 format. diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json index 4f17981ce377..053398617185 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/stable/2019-03-01/AlertsManagement.json @@ -1,741 +1,303 @@ { "swagger": "2.0", "info": { - "title": "Azure Alerts Management Service Resource Provider", "version": "2019-03-01", - "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor.", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] + "title": "Azure Alerts Management Service Resource Provider", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." }, + "host": "management.azure.com", "schemes": [ "https" ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], "consumes": [ "application/json" ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } + "produces": [ + "application/json" ], "securityDefinitions": { "azure_auth": { "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", "scopes": { "user_impersonation": "impersonate your user account" } } }, - "tags": [ - { - "name": "Operations" + "paths": { + "/providers/Microsoft.AlertsManagement/operations": { + "get": { + "operationId": "Operations_List", + "description": "List all operations available through Azure Alerts Management Resource Provider.", + "parameters": [ + { + "$ref": "#/parameters/api-version" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Successfully retrieved operations list.", + "schema": { + "$ref": "#/definitions/operationsList" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListOperations": { + "$ref": "./examples/Operations_List.json" + } + } + } }, - { - "name": "Alerts" + "/providers/Microsoft.AlertsManagement/alertsMetaData": { + "get": { + "operationId": "Alerts_MetaData", + "description": "List alerts meta data information based on value of identifier parameter.", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/identifier" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Successfully listed alert meta data.", + "schema": { + "$ref": "#/definitions/alertsMetaData" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/AlertsManagementErrorResponse" + } + } + }, + "x-ms-examples": { + "MonService": { + "$ref": "./examples/AlertsMetaData_MonitorService.json" + } + } + } }, - { - "name": "AlertOperationGroup" - } - ], - "paths": { "/{scope}/providers/Microsoft.AlertsManagement/alerts": { "get": { - "operationId": "Alerts_GetAllTenant", - "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.", + "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. ", "parameters": [ { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "#/parameters/scope" }, { - "name": "scope", - "in": "path", - "description": "undefined", - "required": true, - "type": "string" + "$ref": "#/parameters/targetResource" }, { - "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/targetResourceType" }, { - "name": "targetResourceType", - "in": "query", - "description": "Filter by target resource type. Default value is select all.", - "required": false, - "type": "string" + "$ref": "#/parameters/targetResourceGroup" }, { - "name": "targetResourceGroup", - "in": "query", - "description": "Filter by target resource group name. Default value is select all.", - "required": false, - "type": "string" + "$ref": "#/parameters/monitorService" }, { - "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/monitorCondition" }, { - "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/severity" }, { - "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/alertState" }, { - "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/alertRule" }, { - "name": "alertRule", - "in": "query", - "description": "Filter by specific alert rule. Default value is to select all.", - "required": false, - "type": "string" + "$ref": "#/parameters/smartGroupIdFilter" }, { - "name": "smartGroupId", - "in": "query", - "description": "Filter the alerts list by the Smart Group Id. Default value is none.", - "required": false, - "type": "string" + "$ref": "#/parameters/includeContext" }, { - "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/includeEgressConfig" }, { - "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/pageCount" }, { - "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/alertsSortBy" }, { - "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/sortOrder" }, { - "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/select" }, { - "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/timeRange" }, { - "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/customTimeRange" }, { - "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" + "$ref": "#/parameters/api-version" } ], + "produces": [ + "application/json" + ], "responses": { "200": { - "description": "Azure operation completed successfully.", + "description": "OK. Successfully listed alert objects.", "schema": { - "$ref": "#/definitions/AlertsList" + "$ref": "#/definitions/alertsList" } }, "default": { - "description": "An unexpected error response.", + "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListAlerts": { + "$ref": "./examples/Alerts_List.json" + } } } }, - "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/alerts/{name}": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { "get": { "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}'.", + "produces": [ + "application/json" + ], "parameters": [ { - "$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" + "$ref": "#/parameters/scope" }, { - "name": "name", - "in": "path", - "description": "Unique ID of an alert instance.", - "required": true, - "type": "string" + "$ref": "#/parameters/alertId" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Alert" - } + "$ref": "#/parameters/api-version" } ], "responses": { "200": { - "description": "Azure operation completed successfully.", + "description": "OK. Returns the alert with the specified ID.", "schema": { - "type": "object", - "description": "The default scope parameter for an extension resource.", - "properties": { - "scope": { - "type": "string", - "description": "The fully qualified Azure Resource manager identifier of the resource." - } - }, - "required": [ - "scope" - ] + "$ref": "#/definitions/alert" } }, "default": { - "description": "An unexpected error response.", + "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } + }, + "x-ms-examples": { + "GetById": { + "$ref": "./examples/Alerts_GetById.json" + } } } }, "/{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": "../../../../../../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" + "$ref": "#/parameters/scope" }, { - "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" - } - ] - } - } - ], - "responses": { - "200": { - "description": "Azure operation completed successfully.", - "schema": { - "$ref": "#/definitions/Alert" - } + "$ref": "#/parameters/alertId" }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "#/parameters/api-version" }, { - "name": "scope", - "in": "path", - "description": "undefined", - "required": true, - "type": "string" + "$ref": "#/parameters/newState" }, { - "name": "alertId", - "in": "path", - "description": "Unique ID of an alert instance.", - "required": true, - "type": "string" + "$ref": "#/parameters/comment" } ], "responses": { "200": { - "description": "Azure operation completed successfully.", + "description": "OK. Alert state updated.", "schema": { - "$ref": "#/definitions/AlertEnrichmentsList" + "$ref": "#/definitions/alert" } }, "default": { - "description": "An unexpected error response.", + "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": "nextLink" + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_ChangeState.json" + } } } }, "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { "get": { "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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "#/parameters/scope" }, { - "name": "scope", - "in": "path", - "description": "undefined", - "required": true, - "type": "string" + "$ref": "#/parameters/alertId" }, { - "name": "alertId", - "in": "path", - "description": "Unique ID of an alert instance.", - "required": true, - "type": "string" + "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { - "description": "Azure operation completed successfully.", + "description": "OK. Returns the history of the specified alert.", "schema": { - "$ref": "#/definitions/AlertModification" + "$ref": "#/definitions/alertModification" } }, "default": { - "description": "An unexpected error response.", + "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_History.json" + } } } }, @@ -745,1091 +307,590 @@ "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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "#/parameters/scope" }, { - "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 + "$ref": "#/parameters/alertsSummaryGroupBy" }, { - "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" - } - ] - } + "$ref": "#/parameters/includeSmartGroupsCount" }, { - "name": "includeSmartGroupsCount", - "in": "query", - "description": "Include count of the SmartGroups as part of the summary. Default value is 'false'.", - "required": false, - "type": "boolean" + "$ref": "#/parameters/targetResource" }, { - "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/targetResourceType" }, { - "name": "targetResourceType", - "in": "query", - "description": "Filter by target resource type. Default value is select all.", - "required": false, - "type": "string" + "$ref": "#/parameters/targetResourceGroup" }, { - "name": "targetResourceGroup", - "in": "query", - "description": "Filter by target resource group name. Default value is select all.", - "required": false, - "type": "string" + "$ref": "#/parameters/monitorService" }, { - "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/monitorCondition" }, { - "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/severity" }, { - "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/alertState" }, { - "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/alertRule" }, { - "name": "alertRule", - "in": "query", - "description": "Filter by specific alert rule. Default value is to select all.", - "required": false, - "type": "string" + "$ref": "#/parameters/timeRange" }, { - "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/customTimeRange" }, { - "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" + "$ref": "#/parameters/api-version" } ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "OK. Alert summary returned.", "schema": { - "$ref": "#/definitions/AlertsSummary" + "$ref": "#/definitions/alertsSummary" } }, "default": { - "description": "An unexpected error response.", + "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/AlertsManagementErrorResponse" } } - } - } - }, - "/providers/Microsoft.AlertsManagement/alerts/{alertId}": { - "get": { - "operationId": "Alerts_GetByIdTenant", - "tags": [ - "Alerts" - ], - "description": "Get information related to a specific alert.", - "parameters": [ - { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "alertId", - "in": "path", - "description": "Unique ID of an alert instance.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Azure operation completed successfully.", - "schema": { - "$ref": "#/definitions/Alert" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } + }, + "x-ms-examples": { + "Summary": { + "$ref": "./examples/Alerts_Summary.json" } } } + } + }, + "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" }, - "/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { - "post": { - "operationId": "Alerts_ChangeStateTenant", - "tags": [ - "Alerts" - ], - "description": "Change the state of an alert.", - "parameters": [ - { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "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" - } - ] - } - }, - { - "name": "comment", - "in": "body", - "description": "reason of change alert state", - "required": false, - "schema": { - "$ref": "#/definitions/Comments" - } - } - ], - "responses": { - "200": { - "description": "Azure operation completed successfully.", - "schema": { - "$ref": "#/definitions/Alert" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - } + "subscriptionId": { + "name": "subscriptionId", + "description": "The Azure subscription Id.", + "type": "string", + "in": "path", + "required": true + }, + "api-version": { + "name": "api-version", + "description": "API version.", + "type": "string", + "in": "query", + "required": true, + "enum": [ + "2019-03-01" + ], + "x-ms-enum": { + "name": "api-version", + "modelAsString": true } }, - "/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { - "get": { - "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": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "alertId", - "in": "path", - "description": "Unique ID of an alert instance.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Azure operation completed successfully.", - "schema": { - "$ref": "#/definitions/AlertModification" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - } + "alertId": { + "name": "alertId", + "description": "Unique ID of an alert instance.", + "type": "string", + "in": "path", + "required": true, + "x-ms-parameter-location": "method" + }, + "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" + }, + "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" + }, + "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" + }, + "monitorService": { + "description": "Filter by monitor service which generates the alert instance. Default value is select all.", + "name": "monitorService", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "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 } }, - "/providers/Microsoft.AlertsManagement/alertsMetaData": { - "get": { - "operationId": "Alerts_MetaData", - "description": "List alerts meta data information based on value of identifier parameter.", - "parameters": [ - { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "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": "An unexpected error response.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - } + "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 } }, - "/providers/Microsoft.AlertsManagement/operations": { - "get": { - "operationId": "Operations_List", - "tags": [ - "Operations" - ], - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Azure operation completed successfully.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } + "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" + }, + "smartGroupId": { + "description": "Smart group unique id. ", + "name": "smartGroupId", + "type": "string", + "in": "path", + "required": true, + "x-ms-parameter-location": "method" + }, + "newState": { + "description": "New state of the alert.", + "name": "newState", + "type": "string", + "in": "query", + "required": true, + "x-ms-parameter-location": "method", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true } - } - }, - "definitions": { - "ActionStatus": { - "type": "object", - "description": "Action status", - "properties": { - "isSuppressed": { - "type": "boolean", - "description": "Value indicating whether alert is suppressed." - } + }, + "comment": { + "description": "reason of change alert state", + "name": "comment", + "in": "body", + "x-ms-parameter-location": "method", + "required": false, + "schema": { + "$ref": "#/definitions/comments" } }, - "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" - } + "alertState": { + "description": "Filter by state of the alert instance. Default value is to select all.", + "name": "alertState", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "New", + "Acknowledged", + "Closed" ], - "x-ms-discriminator-value": "ActionsSuppressed" + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } }, - "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" - } + "smartGroupState": { + "description": "Filter by state of the smart group. Default value is to select all.", + "name": "smartGroupState", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "New", + "Acknowledged", + "Closed" ], - "x-ms-discriminator-value": "ActionsTriggered" + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } }, - "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" - } - ] + "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 + } }, - "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" - ] + "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" }, - "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": [] - } + "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 } }, - "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" - } - ] + "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" }, - "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" - ] + "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" }, - "AlertModification": { - "type": "object", - "description": "Alert Modification details", - "properties": { - "properties": { - "$ref": "#/definitions/AlertModificationProperties", - "description": "Alert modification history properties." - } - }, - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ] + "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", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" }, - "AlertModificationEvent": { + "alertsSortBy": { + "description": "Sort the query results by input field, Default value is 'lastModifiedDateTime'.", + "name": "sortBy", "type": "string", - "description": "Reason for the modification", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", "enum": [ - "AlertCreated", - "StateChange", - "SeverityChange", - "MonitorConditionChange", - "ActionsTriggered", - "ActionsSuppressed" + "name", + "severity", + "alertState", + "monitorCondition", + "targetResource", + "targetResourceName", + "targetResourceGroup", + "targetResourceType", + "startDateTime", + "lastModifiedDateTime" ], "x-ms-enum": { - "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" - } - ] + "name": "AlertsSortByFields", + "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." - } - } - }, - "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": [] - } + "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 } }, - "AlertModificationType": { + "smartGroupsSortBy": { + "description": "Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.", + "name": "sortBy", "type": "string", - "description": "Type of modification details", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", "enum": [ - "PropertyChange", - "ActionsSuppressed", - "ActionsTriggered" + "alertsCount", + "state", + "severity", + "startDateTime", + "lastModifiedDateTime" ], "x-ms-enum": { - "name": "AlertModificationType", - "modelAsString": true, - "values": [ - { - "name": "PropertyChange", - "value": "PropertyChange", - "description": "PropertyChange" - }, - { - "name": "ActionsSuppressed", - "value": "ActionsSuppressed", - "description": "ActionsSuppressed" - }, - { - "name": "ActionsTriggered", - "value": "ActionsTriggered", - "description": "ActionsTriggered" - } - ] + "name": "SmartGroupsSortByFields", + "modelAsString": true } }, - "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" - } - } - } + "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" + ] + }, + "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" }, - "AlertState": { + "identifier": { + "name": "identifier", + "description": "Identification of the information to be retrieved by API call.", "type": "string", + "in": "query", + "required": true, "enum": [ - "New", - "Acknowledged", - "Closed" + "MonitorServiceList" ], "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": "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" + } } - ] + } } }, - "AlertsList": { - "type": "object", - "description": "List the alerts.", + "operationsList": { + "description": "Lists the operations available in the AlertsManagement RP.", "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" + }, "value": { + "description": "Array of operations", "type": "array", - "description": "The Alert items on this page", "items": { - "$ref": "#/definitions/Alert" + "$ref": "#/definitions/operation" } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" } }, "required": [ "value" ] }, - "AlertsMetaData": { - "type": "object", - "description": "alert meta data information.", + "AlertsManagementErrorResponse": { + "description": "An error response from the service.", + "x-ms-external": true, "properties": { - "properties": { - "$ref": "#/definitions/AlertsMetaDataProperties", - "description": "alert meta data property bag" + "error": { + "$ref": "#/definitions/errorResponseBody" } } }, - "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" - ] - }, - "AlertsSummary": { - "type": "object", - "description": "Summary of alerts based on the input filters and 'groupby' parameters.", - "properties": { - "properties": { - "$ref": "#/definitions/AlertsSummaryGroup", - "description": "Group the result set." - } - }, - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ] - }, - "AlertsSummaryGroup": { - "type": "object", - "description": "Group the result set.", + "errorResponseBody": { + "description": "Details of error response.", + "x-ms-external": true, "properties": { - "total": { - "type": "integer", - "format": "int64", - "description": "Total count of the result set." + "code": { + "type": "string", + "description": "Error code, intended to be consumed programmatically." }, - "smartGroupsCount": { - "type": "integer", - "format": "int64", - "description": "Total count of the smart groups." + "message": { + "type": "string", + "description": "Description of the error, intended for display in user interface." }, - "groupedby": { + "target": { "type": "string", - "description": "Name of the field aggregated" + "description": "Target of the particular error, for example name of the property." }, - "values": { + "details": { "type": "array", - "description": "List of the items", + "description": "A list of additional details about the error.", "items": { - "$ref": "#/definitions/AlertsSummaryGroupItem" + "$ref": "#/definitions/errorResponseBody" } } } }, - "AlertsSummaryGroupItem": { - "type": "object", - "description": "Alerts summary group item", + "ProxyResource": { + "x-ms-azure-resource": true, + "description": "An azure resource object", "properties": { - "name": { + "id": { "type": "string", - "description": "Value of the aggregated field" + "readOnly": true, + "description": "Azure resource Id" }, - "count": { - "type": "integer", - "format": "int64", - "description": "Count of the aggregated field" + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" }, - "groupedby": { + "name": { "type": "string", - "description": "Name of the field aggregated" + "readOnly": true, + "description": "Azure resource name" + } + } + }, + "alert": { + "description": "An alert created in alert management service.", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertProperties" + } + } + }, + "alertsList": { + "description": "List the alerts.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" }, - "values": { + "value": { + "description": "List of alerts", "type": "array", - "description": "List of the items", "items": { - "$ref": "#/definitions/AlertsSummaryGroupItem" + "$ref": "#/definitions/alert" } } } }, - "BaseDetails": { + "alertProperties": { "type": "object", - "description": "Base details class.", + "description": "Alert property bag", "properties": { - "type": { - "$ref": "#/definitions/AlertModificationType", - "description": "Type of modification details" + "essentials": { + "$ref": "#/definitions/essentials" + }, + "context": { + "$ref": "#/definitions/alertContext" + }, + "egressConfig": { + "$ref": "#/definitions/egressConfig" } - }, - "discriminator": "type", - "required": [ - "type" - ] + } }, - "Comments": { + "comments": { "type": "object", "description": "Change alert state reason", "properties": { @@ -1838,29 +899,86 @@ } } }, - "Essentials": { + "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": { + "type": "object", + "description": "Action status", + "properties": { + "isSuppressed": { + "type": "boolean", + "description": "Value indicating whether alert is suppressed." + } + } + }, + "essentials": { "type": "object", "description": "This object contains consistent fields across different monitor services.", "properties": { "severity": { - "$ref": "#/definitions/Severity", + "type": "string", "description": "Severity of alert Sev0 being highest and Sev4 being lowest.", - "readOnly": true + "readOnly": true, + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + } }, "signalType": { - "$ref": "#/definitions/SignalType", + "type": "string", "description": "The type of signal the alert is based on, which could be metrics, logs or activity logs.", - "readOnly": true + "readOnly": true, + "enum": [ + "Metric", + "Log", + "Unknown" + ], + "x-ms-enum": { + "name": "SignalType", + "modelAsString": true + } }, "alertState": { - "$ref": "#/definitions/AlertState", + "type": "string", "description": "Alert object state, which can be modified by the user.", - "readOnly": true + "readOnly": true, + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } }, "monitorCondition": { - "$ref": "#/definitions/MonitorCondition", + "type": "string", "description": "Can be 'Fired' or 'Resolved', which represents whether the underlying conditions have crossed the defined alert rule thresholds.", - "readOnly": true + "readOnly": true, + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true + } }, "targetResource": { "type": "string", @@ -1879,9 +997,30 @@ "description": "Resource type of target ARM resource, on which alert got created." }, "monitorService": { - "$ref": "#/definitions/MonitorService", + "type": "string", "description": "Monitor service on which the rule(monitor) is set.", - "readOnly": true + "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 + } }, "alertRule": { "type": "string", @@ -1927,8 +1066,7 @@ "readOnly": true }, "actionStatus": { - "$ref": "#/definitions/ActionStatus", - "description": "Action status" + "$ref": "#/definitions/actionStatus" }, "description": { "type": "string", @@ -1936,541 +1074,435 @@ } } }, - "MetadataIdentifier": { - "type": "string", - "description": "Identification of the information to be retrieved by API call", - "enum": [ - "MonitorServiceList" + "alertModification": { + "description": "Alert Modification details", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } ], - "x-ms-enum": { - "name": "MetadataIdentifier", - "modelAsString": true, - "values": [ - { - "name": "MonitorServiceList", - "value": "MonitorServiceList", - "description": "MonitorServiceList" + "properties": { + "properties": { + "$ref": "#/definitions/alertModificationProperties" + } + } + }, + "alertModificationProperties": { + "type": "object", + "description": "Properties of the alert modification item.", + "properties": { + "alertId": { + "type": "string", + "description": "Unique Id of the alert for which the history is being retrieved", + "readOnly": true + }, + "modifications": { + "type": "array", + "description": "Modification details", + "items": { + "$ref": "#/definitions/alertModificationItem" } - ] + } } }, - "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" + "alertModificationItem": { + "description": "Alert modification item.", + "properties": { + "modificationEvent": { + "type": "string", + "description": "Reason for the modification", + "enum": [ + "AlertCreated", + "StateChange", + "MonitorConditionChange" + ], + "x-ms-enum": { + "name": "AlertModificationEvent" } - ] + }, + "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" + } } }, - "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" + "smartGroupModification": { + "description": "Alert Modification details", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } ], - "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" - } - ] + "properties": { + "properties": { + "$ref": "#/definitions/smartGroupModificationProperties" + } } }, - "MonitorServiceDetails": { - "type": "object", - "description": "Details of a monitor service", + "smartGroupModificationProperties": { + "description": "Properties of the smartGroup modification item.", "properties": { - "name": { + "smartGroupId": { "type": "string", - "description": "Monitor service name" + "description": "Unique Id of the smartGroup for which the history is being retrieved", + "readOnly": true }, - "displayName": { - "type": "string", - "description": "Monitor service display name" + "modifications": { + "type": "array", + "description": "Modification details", + "items": { + "$ref": "#/definitions/smartGroupModificationItem" + } + }, + "nextLink": { + "description": "URL to fetch the next set of results.", + "type": "string" } } }, - "MonitorServiceList": { - "type": "object", - "description": "Monitor service details", + "smartGroupModificationItem": { + "description": "smartGroup modification item.", "properties": { - "data": { - "type": "array", - "description": "Array of operations", - "items": { - "$ref": "#/definitions/MonitorServiceDetails" + "modificationEvent": { + "type": "string", + "description": "Reason for the modification", + "enum": [ + "SmartGroupCreated", + "StateChange", + "AlertAdded", + "AlertRemoved" + ], + "x-ms-enum": { + "name": "SmartGroupModificationEvent" } + }, + "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" } - }, - "required": [ - "data" - ], + } + }, + "alertsSummary": { + "description": "Summary of alerts based on the input filters and 'groupby' parameters.", "allOf": [ { - "$ref": "#/definitions/AlertsMetaDataProperties" + "$ref": "#/definitions/ProxyResource" } ], - "x-ms-discriminator-value": "MonitorServiceList" + "properties": { + "properties": { + "$ref": "#/definitions/alertsSummaryGroup" + } + } }, - "NotificationResult": { + "alertsSummaryGroup": { "type": "object", + "description": "Group the result set.", "properties": { - "statusURL": { + "total": { + "type": "integer", + "description": "Total count of the result set." + }, + "smartGroupsCount": { + "type": "integer", + "description": "Total count of the smart groups." + }, + "groupedby": { "type": "string", - "description": "URL endpoint for checking notification delivery status. Only populated when status is 'Inline'." + "description": "Name of the field aggregated" }, - "status": { - "$ref": "#/definitions/ResultStatus", - "description": "The status of the notification" + "values": { + "type": "array", + "description": "List of the items", + "items": { + "$ref": "#/definitions/alertsSummaryGroupItem" + } } } }, - "PrometheusEnrichmentItem": { + "alertsSummaryGroupItem": { "type": "object", - "description": "Prometheus enrichment object.", + "description": "Alerts summary group item", "properties": { - "type": { + "name": { "type": "string", - "description": "Discriminator property for PrometheusEnrichmentItem." + "description": "Value of the aggregated field" + }, + "count": { + "type": "integer", + "description": "Count of the aggregated field" }, - "linkToApi": { + "groupedby": { "type": "string", - "description": "Link to Prometheus query API (Url format)." + "description": "Name of the field aggregated" }, - "datasources": { + "values": { "type": "array", - "description": "An array of the azure monitor workspace resource ids.", + "description": "List of the items", "items": { - "type": "string" + "$ref": "#/definitions/alertsSummaryGroupItem" } - }, - "grafanaExplorePath": { - "type": "string", - "description": "Partial link to the Grafana explore API." - }, - "query": { - "type": "string", - "description": "The Prometheus expression query." - } - }, - "discriminator": "type", - "required": [ - "type", - "linkToApi", - "datasources", - "grafanaExplorePath", - "query" - ], - "allOf": [ - { - "$ref": "#/definitions/AlertEnrichmentItem" } - ] + } }, - "PrometheusInstantQuery": { - "type": "object", - "description": "Prometheus instant query enrichment object.", + "alertsMetaData": { + "description": "alert meta data information.", "properties": { - "time": { - "type": "string", - "description": "The date and the time of the evaluation." + "properties": { + "$ref": "#/definitions/alertsMetaDataProperties" } - }, + } + }, + "alertsMetaDataProperties": { + "description": "alert meta data property bag", + "discriminator": "metadataIdentifier", "required": [ - "time" + "metadataIdentifier" ], - "allOf": [ - { - "$ref": "#/definitions/PrometheusEnrichmentItem" + "properties": { + "metadataIdentifier": { + "type": "string", + "description": "Identification of the information to be retrieved by API call", + "enum": [ + "MonitorServiceList" + ], + "x-ms-enum": { + "name": "metadataIdentifier", + "modelAsString": true + } } - ], - "x-ms-discriminator-value": "PrometheusInstantQuery" + } }, - "PrometheusRangeQuery": { - "type": "object", - "description": "Prometheus instant query enrichment object.", + "smartGroupsList": { + "description": "List the alerts.", "properties": { - "start": { - "type": "string", - "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." + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" }, - "step": { - "type": "string", - "description": "Query resolution step width in ISO8601 format." + "value": { + "description": "List of alerts", + "type": "array", + "items": { + "$ref": "#/definitions/smartGroup" + } } - }, - "required": [ - "start", - "end", - "step" - ], + } + }, + "smartGroup": { + "description": "Set of related alerts grouped together smartly by AMS.", "allOf": [ { - "$ref": "#/definitions/PrometheusEnrichmentItem" + "$ref": "#/definitions/ProxyResource" } ], - "x-ms-discriminator-value": "PrometheusRangeQuery" + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/smartGroupProperties" + } + } }, - "PropertyChangeDetails": { + "smartGroupProperties": { "type": "object", + "description": "Properties of smart group.", "properties": { - "oldValue": { - "type": "string", - "description": "The value before the change" + "alertsCount": { + "type": "integer", + "description": "Total number of alerts in smart group" }, - "newValue": { + "smartGroupState": { "type": "string", - "description": "The value after the change" + "description": "Smart group state", + "readOnly": true, + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "State", + "modelAsString": true + } }, - "comment": { + "severity": { "type": "string", - "description": "The comment" - } - }, - "allOf": [ - { - "$ref": "#/definitions/BaseDetails" - } - ], - "x-ms-discriminator-value": "PropertyChange" - }, - "ProxyResource": { - "type": "object", - "description": "An azure resource object", - "properties": { - "id": { + "description": "Severity of smart group is the highest(Sev0 >... > Sev4) severity of all the alerts in the group.", + "readOnly": true, + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + } + }, + "startDateTime": { "type": "string", - "description": "Azure resource Id", + "format": "date-time", + "description": "Creation time of smart group. Date-Time in ISO-8601 format.", "readOnly": true }, - "type": { + "lastModifiedDateTime": { "type": "string", - "description": "Azure resource type", + "format": "date-time", + "description": "Last updated time of smart group. Date-Time in ISO-8601 format.", "readOnly": true }, - "name": { + "lastModifiedUserName": { "type": "string", - "description": "Azure resource name", + "description": "Last modified by user name.", "readOnly": true - } - } - }, - "ResultStatus": { - "type": "string", - "description": "The status of the notification", - "enum": [ - "None", - "Inline", - "Throttled", - "Failed", - "ThrottledByAlertRule", - "ThrottledBySubscription" - ], - "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" + }, + "resources": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "name": "ThrottledByAlertRule", - "value": "ThrottledByAlertRule", - "description": "ThrottledByAlertRule" + "type": "array", + "description": "Summary of target resources in the smart group" + }, + "resourceTypes": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "name": "ThrottledBySubscription", - "value": "ThrottledBySubscription", - "description": "ThrottledBySubscription" - } - ] - } - }, - "RuleType": { - "type": "string", - "description": "The rule type", - "enum": [ - "AlertRule", - "ActionRule" - ], - "x-ms-enum": { - "name": "RuleType", - "modelAsString": true, - "values": [ - { - "name": "AlertRule", - "value": "AlertRule", - "description": "AlertRule" + "type": "array", + "description": "Summary of target resource types in the smart group" + }, + "resourceGroups": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "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" + "type": "array", + "description": "Summary of target resource groups in the smart group" + }, + "monitorServices": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "name": "Sev1", - "value": "Sev1", - "description": "Sev1" + "type": "array", + "description": "Summary of monitorServices in the smart group" + }, + "monitorConditions": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "name": "Sev2", - "value": "Sev2", - "description": "Sev2" + "type": "array", + "description": "Summary of monitorConditions in the smart group" + }, + "alertStates": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "name": "Sev3", - "value": "Sev3", - "description": "Sev3" + "type": "array", + "description": "Summary of alertStates in the smart group" + }, + "alertSeverities": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" }, - { - "name": "Sev4", - "value": "Sev4", - "description": "Sev4" - } - ] + "type": "array", + "description": "Summary of alertSeverities in the smart group" + }, + "nextLink": { + "type": "string", + "description": "The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the next page alerts." + } } }, - "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" - } - ] + "smartGroupAggregatedProperty": { + "type": "object", + "description": "Aggregated property of each type", + "properties": { + "name": { + "type": "string", + "description": "Name of the type." + }, + "count": { + "type": "integer", + "description": "Total number of items of type." + } } }, - "Status": { - "type": "string", - "description": "The status of the evaluation of the enrichment.", - "enum": [ - "Succeeded", - "Failed" + "MonitorServiceList": { + "title": "Monitor service details", + "description": "Monitor service details", + "required": [ + "data" ], - "x-ms-enum": { - "name": "Status", - "modelAsString": true, - "values": [ - { - "name": "Succeeded", - "value": "Succeeded", - "description": "Succeeded" - }, - { - "name": "Failed", - "value": "Failed", - "description": "Failed" + "allOf": [ + { + "$ref": "#/definitions/alertsMetaDataProperties" + }, + { + "type": "object" + } + ], + "properties": { + "data": { + "description": "Array of operations", + "type": "array", + "items": { + "$ref": "#/definitions/MonitorServiceDetails" } - ] + } } }, - "TriggeredRule": { - "type": "object", + "MonitorServiceDetails": { + "description": "Details of a monitor service", "properties": { - "actionGroupId": { + "name": { "type": "string", - "description": "The action group ID" + "description": "Monitor service name" }, - "ruleId": { + "displayName": { "type": "string", - "description": "The rule ID" - }, - "ruleType": { - "$ref": "#/definitions/RuleType", - "description": "The rule type" + "description": "Monitor service display name" } } - }, - "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": {} + } } From e39ecdf416bdf8d885ef50fadc6c072f4dd083f3 Mon Sep 17 00:00:00 2001 From: "Tong Xu (MSFT)" Date: Thu, 11 Dec 2025 14:47:40 +0800 Subject: [PATCH 10/20] Refactor folder --- .../Microsoft.AlertsManagement/AlertsManagement}/Alert.tsp | 0 .../AlertsManagement}/back-compatible.tsp | 0 .../Microsoft.AlertsManagement/AlertsManagement}/client.tsp | 0 .../2025-05-25-preview/AlertsMetaData_MonitorService.json | 0 .../examples/2025-05-25-preview/Alerts_ChangeState.json | 0 .../2025-05-25-preview/Alerts_ChangeStateTenant.json | 0 .../examples/2025-05-25-preview/Alerts_GetById.json | 0 .../examples/2025-05-25-preview/Alerts_GetByIdTenant.json | 0 .../examples/2025-05-25-preview/Alerts_GetEnrichments.json | 0 .../examples/2025-05-25-preview/Alerts_GetHistoryTenant.json | 0 .../examples/2025-05-25-preview/Alerts_History.json | 0 .../examples/2025-05-25-preview/Alerts_List.json | 0 .../2025-05-25-preview/Alerts_List_GetAllTenant.json | 0 .../examples/2025-05-25-preview/Alerts_Summary.json | 0 .../examples/2025-05-25-preview/Operations_List.json | 0 .../Microsoft.AlertsManagement/AlertsManagement}/main.tsp | 0 .../Microsoft.AlertsManagement/AlertsManagement}/models.tsp | 0 .../Microsoft.AlertsManagement/AlertsManagement}/routes.tsp | 0 .../AlertsManagement/suppressions.yaml | 3 --- .../AlertsManagement}/tspconfig.yaml | 5 +++-- 20 files changed, 3 insertions(+), 5 deletions(-) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/Alert.tsp (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/back-compatible.tsp (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/client.tsp (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_ChangeState.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_GetById.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_GetByIdTenant.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_GetEnrichments.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_History.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_List.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Alerts_Summary.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/examples/2025-05-25-preview/Operations_List.json (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/main.tsp (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/models.tsp (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/routes.tsp (100%) rename specification/alertsmanagement/{AlertsManagement.Management => resource-manager/Microsoft.AlertsManagement/AlertsManagement}/tspconfig.yaml (89%) diff --git a/specification/alertsmanagement/AlertsManagement.Management/Alert.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/Alert.tsp similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/Alert.tsp rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/Alert.tsp diff --git a/specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/back-compatible.tsp similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/back-compatible.tsp rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/back-compatible.tsp diff --git a/specification/alertsmanagement/AlertsManagement.Management/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/client.tsp rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/AlertsMetaData_MonitorService.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeState.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeState.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeState.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_ChangeStateTenant.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetById.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetById.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetById.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetByIdTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetByIdTenant.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetByIdTenant.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetByIdTenant.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetEnrichments.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetEnrichments.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetEnrichments.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_GetHistoryTenant.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_History.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_History.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_History.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/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 similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_List_GetAllTenant.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_Summary.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Alerts_Summary.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Alerts_Summary.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Operations_List.json similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/examples/2025-05-25-preview/Operations_List.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/examples/2025-05-25-preview/Operations_List.json diff --git a/specification/alertsmanagement/AlertsManagement.Management/main.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/main.tsp similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/main.tsp rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/main.tsp diff --git a/specification/alertsmanagement/AlertsManagement.Management/models.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/models.tsp rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp diff --git a/specification/alertsmanagement/AlertsManagement.Management/routes.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/routes.tsp similarity index 100% rename from specification/alertsmanagement/AlertsManagement.Management/routes.tsp rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/routes.tsp 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/AlertsManagement.Management/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml similarity index 89% rename from specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml index e37e89703a92..e5d8319896a1 100644 --- a/specification/alertsmanagement/AlertsManagement.Management/tspconfig.yaml +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml @@ -6,9 +6,10 @@ emit: options: "@azure-tools/typespec-autorest": omit-unreachable-types: false - emitter-output-dir: "{project-root}/.." + emitter-output-dir: "{project-root}" azure-resource-provider-folder: "resource-manager" - output-file: "{azure-resource-provider-folder}/{service-name}/AlertsManagement/{version-status}/{version}/AlertsManagement.json" + 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": From 897a6055bee254591e12448de85b84545ee79bfc Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:57:36 +0800 Subject: [PATCH 11/20] Remove is-modular-library flag from tspconfig.yaml --- .../Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml index e5d8319896a1..345f0071f07e 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml @@ -26,7 +26,6 @@ options: "@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: From 80bed6e0c0c127fa8404e0b72067fa7bfd2f4e8c Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:03:37 +0800 Subject: [PATCH 12/20] Update client.tsp --- .../Microsoft.AlertsManagement/AlertsManagement/client.tsp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index b56bd7b4b064..4b7f72218239 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -14,3 +14,9 @@ model AlertsClientOptions { parameters: AlertsClientOptions, } ); + +@@clientName(Microsoft.AlertsManagement, "AlertsManagementClient", "python"); +@@clientName(Azure.ResourceManager.CommonTypes.ProxyResource, + "ArmProxyResource", + "python" +); From 75ef6bcb1c1efd0204a97fc5f1c3478f1db502c3 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:01:10 +0800 Subject: [PATCH 13/20] Update client names and time range constants --- .../AlertsManagement/client.tsp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index 4b7f72218239..0101ce3f59a2 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -12,11 +12,13 @@ model AlertsClientOptions { @@Azure.ClientGenerator.Core.clientInitialization(Microsoft.AlertsManagement, { parameters: AlertsClientOptions, - } + }, + "!python" ); @@clientName(Microsoft.AlertsManagement, "AlertsManagementClient", "python"); -@@clientName(Azure.ResourceManager.CommonTypes.ProxyResource, - "ArmProxyResource", - "python" -); +@@clientName(ProxyResource, "ProxyResourceAutoGenerated", "python"); +@@clientName(TimeRange.`1h`, "ONE_H", "python"); +@@clientName(TimeRange.`1d`, "ONE_D", "python"); +@@clientName(TimeRange.`7d`, "SEVEN_D", "python"); +@@clientName(TimeRange.`30d`, "THIRTY_D", "python"); From 904fd7e4685b4d3c506b52afd323b63f83f20db9 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:04:10 +0800 Subject: [PATCH 14/20] Update client.tsp --- .../Microsoft.AlertsManagement/AlertsManagement/client.tsp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index 0101ce3f59a2..2b8a2e563ae2 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -2,6 +2,8 @@ import "@azure-tools/typespec-client-generator-core"; import "./main.tsp"; using Azure.ClientGenerator.Core; +using Microsoft.AlertsManagement; +using Http; #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" model AlertsClientOptions { From 0c44f1fea0fa2f37d9f1b6c6d8fdc7ed2432ea19 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 29 Jan 2026 13:17:11 +0800 Subject: [PATCH 15/20] Update client.tsp --- .../Microsoft.AlertsManagement/AlertsManagement/client.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index 2b8a2e563ae2..6ddbda823909 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -15,7 +15,7 @@ model AlertsClientOptions { { parameters: AlertsClientOptions, }, - "!python" + "!(python,java)" ); @@clientName(Microsoft.AlertsManagement, "AlertsManagementClient", "python"); From 19c083321cbbc86305dda951073a6ebb9b8d5ca6 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Thu, 29 Jan 2026 13:38:44 +0800 Subject: [PATCH 16/20] Update client.tsp --- .../Microsoft.AlertsManagement/AlertsManagement/client.tsp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index 6ddbda823909..a78a9e26cdd3 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -24,3 +24,5 @@ model AlertsClientOptions { @@clientName(TimeRange.`1d`, "ONE_D", "python"); @@clientName(TimeRange.`7d`, "SEVEN_D", "python"); @@clientName(TimeRange.`30d`, "THIRTY_D", "python"); + +@@clientName(AlertsManagementErrorResponse, "ErrorResponseForAlertsManagement", "go"); From e399dabac9306d57b602e37a5720f1d7b44c0f45 Mon Sep 17 00:00:00 2001 From: v-huizhu2 Date: Thu, 29 Jan 2026 14:32:23 +0800 Subject: [PATCH 17/20] Add statusUrl client name for Java --- .../Microsoft.AlertsManagement/AlertsManagement/client.tsp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index a78a9e26cdd3..fbbb1a357bd0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -26,3 +26,5 @@ model AlertsClientOptions { @@clientName(TimeRange.`30d`, "THIRTY_D", "python"); @@clientName(AlertsManagementErrorResponse, "ErrorResponseForAlertsManagement", "go"); + +@@clientName(Microsoft.AlertsManagement.NotificationResult.statusURL, "statusUrl", "java"); From 16367c0af4ee137214e2975a138b40bfe459c15a Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Thu, 29 Jan 2026 16:30:37 +0800 Subject: [PATCH 18/20] feat(alertsmanagement): add Java client name mappings and update tspconfig Add Java client name mappings for NotificationResult, AlertsMetaData, AlertsMetaDataProperties, and Essentials models in the client.tsp file. Also add use-object-for-unknown option to tspconfig.yaml to handle unknown properties properly. --- .../AlertsManagement/client.tsp | 20 ++++++++++++++++++- .../AlertsManagement/tspconfig.yaml | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index fbbb1a357bd0..b927dc6eb494 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -27,4 +27,22 @@ model AlertsClientOptions { @@clientName(AlertsManagementErrorResponse, "ErrorResponseForAlertsManagement", "go"); -@@clientName(Microsoft.AlertsManagement.NotificationResult.statusURL, "statusUrl", "java"); +@@clientName(Microsoft.AlertsManagement.NotificationResult.statusURL, + "statusUrl", + "java" +); + +@@clientName(Microsoft.AlertsManagement.AlertsMetaData, + "AlertsMetadata", + "java" +); +@@clientName(Microsoft.AlertsManagement.AlertsMetaDataProperties, + "AlertsMetadataProperties", + "java" +); +@@clientName(Microsoft.AlertsManagement.Essentials.lastModifiedUserName, + "lastModifiedUsername", + "java" +); + +@@clientName(Microsoft.AlertsManagement, "AlertsManagementClient", "java"); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml index 345f0071f07e..b908df5a2790 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/tspconfig.yaml @@ -23,6 +23,7 @@ options: namespace: "com.azure.resourcemanager.alertsmanagement" service-name: "AlertsManagement" # human-readable service name, whitespace allowed flavor: azure + use-object-for-unknown: true "@azure-tools/typespec-ts": service-dir: sdk/alertsmanagement emitter-output-dir: "{output-dir}/{service-dir}/arm-alertsmanagement" From d30941e8522adc3612c844a683fef07b89969996 Mon Sep 17 00:00:00 2001 From: "judy.liu" Date: Fri, 30 Jan 2026 11:40:40 +0800 Subject: [PATCH 19/20] add go config --- .../AlertsManagement/client.tsp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp index fbbb1a357bd0..5b0170a9eae0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/client.tsp @@ -25,6 +25,17 @@ model AlertsClientOptions { @@clientName(TimeRange.`7d`, "SEVEN_D", "python"); @@clientName(TimeRange.`30d`, "THIRTY_D", "python"); -@@clientName(AlertsManagementErrorResponse, "ErrorResponseForAlertsManagement", "go"); +@@clientName(AlertsManagementErrorResponse, + "ErrorResponseForAlertsManagement", + "go" +); + +@@clientName(Microsoft.AlertsManagement.NotificationResult.statusURL, + "statusUrl", + "java" +); -@@clientName(Microsoft.AlertsManagement.NotificationResult.statusURL, "statusUrl", "java"); +@@clientName(TimeRange.`1h`, "OneH", "go"); +@@clientName(TimeRange.`1d`, "OneD", "go"); +@@clientName(TimeRange.`7d`, "SevenD", "go"); +@@clientName(TimeRange.`30d`, "ThirtyD", "go"); From 4c74671ddd3a719e12a07a270536d81c3489a62a Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 30 Jan 2026 16:42:28 +0800 Subject: [PATCH 20/20] fix: AlertModificationItem.details nullable --- .../Microsoft.AlertsManagement/AlertsManagement/models.tsp | 3 ++- .../preview/2025-05-25-preview/AlertsManagement.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp index 58b849d51c6e..128d3f3d30cd 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement/models.tsp @@ -783,7 +783,8 @@ model AlertModificationItem { /** * Base details class. */ - details?: BaseDetails; + #suppress "@azure-tools/typespec-azure-core/no-nullable" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + details?: BaseDetails | null; } /** 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 d2311f982803..3b66f0384e63 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 @@ -2097,7 +2097,8 @@ }, "details": { "$ref": "#/definitions/BaseDetails", - "description": "Base details class." + "description": "Base details class.", + "x-nullable": true } } },