From 37c8dffa45649115fcef9b139a607b8019177c23 Mon Sep 17 00:00:00 2001 From: noneumar <113899918+noneumar@users.noreply.github.com> Date: Wed, 23 Aug 2023 10:28:11 +0300 Subject: [PATCH 01/22] Adds base for updating Microsoft.AlertsManagement from version preview/2019-05-05-preview to version 2023-07-12-preview --- .../2023-07-12-preview/ActionRules.json | 948 +++++++++++++ .../2023-07-12-preview/AlertsManagement.json | 1255 +++++++++++++++++ .../2023-07-12-preview/SmartGroups.json | 739 ++++++++++ .../ActionRules_Create_SuppressionRule.json | 123 ++ .../examples/ActionRules_Delete.json | 13 + .../examples/ActionRules_GetById.json | 71 + .../ActionRules_List_ResourceGroup.json | 114 ++ .../ActionRules_List_Subscription.json | 105 ++ .../examples/ActionRules_Patch.json | 81 ++ .../AlertsMetaData_MonitorService.json | 89 ++ .../examples/Alerts_ChangeState.json | 47 + .../examples/Alerts_GetById.json | 43 + .../examples/Alerts_History.json | 39 + .../examples/Alerts_List.json | 79 ++ .../examples/Alerts_Summary.json | 118 ++ .../examples/Operations_List.json | 211 +++ .../examples/SmartGroups_ChangeState.json | 74 + .../examples/SmartGroups_GetById.json | 70 + .../examples/SmartGroups_History.json | 30 + .../examples/SmartGroups_List.json | 145 ++ 20 files changed, 4394 insertions(+) create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json new file mode 100644 index 000000000000..1903b3ee8c72 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json @@ -0,0 +1,948 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-05-05-preview", + "title": "Azure Alerts Management Service Resource Provider", + "description": "APIs for Azure Action Rules CRUD operations." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/actionRules": { + "get": { + "summary": "Get all action rule in a given subscription", + "description": "List all action rules of the subscription and given input filters", + "operationId": "ActionRules_ListBySubscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/targetResourceGroup" + }, + { + "$ref": "#/parameters/targetResourceType" + }, + { + "$ref": "#/parameters/targetResource" + }, + { + "$ref": "#/parameters/severity" + }, + { + "$ref": "#/parameters/monitorService" + }, + { + "$ref": "#/parameters/impactedScope" + }, + { + "$ref": "#/parameters/description" + }, + { + "$ref": "#/parameters/alertRuleId" + }, + { + "$ref": "#/parameters/actionGroup" + }, + { + "$ref": "#/parameters/actionRuleName" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Return the list of action rules", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/ActionRulesList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "GetActionRulesSubscriptionWide": { + "$ref": "./examples/ActionRules_List_Subscription.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules": { + "get": { + "summary": "Get all action rules created in a resource group", + "operationId": "ActionRules_ListByResourceGroup", + "description": "List all action rules of the subscription, created in given resource group and given input filters", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/targetResourceGroup" + }, + { + "$ref": "#/parameters/targetResourceType" + }, + { + "$ref": "#/parameters/targetResource" + }, + { + "$ref": "#/parameters/severity" + }, + { + "$ref": "#/parameters/monitorService" + }, + { + "$ref": "#/parameters/impactedScope" + }, + { + "$ref": "#/parameters/description" + }, + { + "$ref": "#/parameters/alertRuleId" + }, + { + "$ref": "#/parameters/actionGroup" + }, + { + "$ref": "#/parameters/actionRuleName" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Return the list of action rules", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/ActionRulesList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "GetActionRulesResourceGroupWide": { + "$ref": "./examples/ActionRules_List_ResourceGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}": { + "get": { + "summary": "Get action rule by name", + "operationId": "ActionRules_GetByName", + "description": "Get a specific action rule", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "name": "actionRuleName", + "in": "path", + "description": "The name of action rule that needs to be fetched", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the specific action rule", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/ActionRule" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "GetActionRuleById": { + "$ref": "./examples/ActionRules_GetById.json" + } + } + }, + "put": { + "summary": "Create/update an action rule", + "operationId": "ActionRules_CreateUpdate", + "description": "Creates/Updates a specific action rule", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "name": "actionRuleName", + "in": "path", + "description": "The name of action rule that needs to be created/updated", + "required": true, + "type": "string" + }, + { + "name": "actionRule", + "in": "body", + "description": "action rule to be created/updated", + "required": true, + "schema": { + "$ref": "#/definitions/ActionRule" + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the created/updated action rule", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/ActionRule" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "PutActionRule": { + "$ref": "./examples/ActionRules_Create_SuppressionRule.json" + } + } + }, + "delete": { + "summary": "Delete action rule", + "description": "Deletes a given action rule", + "operationId": "ActionRules_Delete", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "name": "actionRuleName", + "in": "path", + "description": "The name that needs to be deleted", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns true if deleted successfully", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "type": "boolean" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "DeleteActionRule": { + "$ref": "./examples/ActionRules_Delete.json" + } + } + }, + "patch": { + "summary": "Patch action rule", + "description": "Update enabled flag and/or tags for the given action rule", + "operationId": "ActionRules_Update", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "name": "actionRuleName", + "in": "path", + "description": "The name that needs to be updated", + "required": true, + "type": "string" + }, + { + "name": "actionRulePatch", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchObject" + }, + "description": "Parameters supplied to the operation." + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the created/updated action rule", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/ActionRule" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "PatchActionRule": { + "$ref": "./examples/ActionRules_Patch.json" + } + } + } + } + }, + "parameters": { + "subscriptionId": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 + }, + "resourceGroupName": { + "name": "resourceGroupName", + "description": "Resource group name where the resource is created.", + "type": "string", + "in": "path", + "required": true, + "x-ms-parameter-location": "method" + }, + "api-version": { + "name": "api-version", + "description": "client API version", + "type": "string", + "in": "query", + "required": true, + "enum": [ + "2019-05-05-preview" + ], + "x-ms-enum": { + "name": "api-version", + "modelAsString": true + } + }, + "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" + ], + "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 + } + }, + "description": { + "description": "filter by alert rule description", + "name": "description", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "alertRuleId": { + "description": "filter by alert rule id", + "name": "alertRuleId", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "actionGroup": { + "description": "filter by action group configured as part of action rule", + "name": "actionGroup", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "actionRuleName": { + "description": "filter by action rule name", + "name": "name", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "impactedScope": { + "description": "filter by impacted/target scope (provide comma separated list for multiple scopes). The value should be an well constructed ARM id of the scope.", + "name": "impactedScope", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + } + }, + "definitions": { + "errorResponse": { + "description": "An error response from the service.", + "properties": { + "error": { + "$ref": "#/definitions/errorResponseBody" + } + } + }, + "errorResponseBody": { + "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" + } + } + } + }, + "Resource": { + "x-ms-azure-resource": true, + "description": "An azure resource object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + } + } + }, + "ManagedResource": { + "description": "An azure managed resource object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ] + }, + "Scope": { + "type": "object", + "description": "Target scope for a given action rule. By default scope will be the subscription. User can also provide list of resource groups or list of resources from the scope subscription as well.", + "properties": { + "scopeType": { + "type": "string", + "description": "type of target scope", + "enum": [ + "ResourceGroup", + "Resource", + "Subscription" + ], + "x-ms-enum": { + "name": "ScopeType", + "modelAsString": true + } + }, + "values": { + "type": "array", + "description": "list of ARM IDs of the given scope type which will be the target of the given action rule.", + "items": { + "type": "string" + } + } + } + }, + "Condition": { + "type": "object", + "description": "condition to trigger an action rule", + "properties": { + "operator": { + "type": "string", + "description": "operator for a given condition", + "enum": [ + "Equals", + "NotEquals", + "Contains", + "DoesNotContain" + ], + "x-ms-enum": { + "name": "Operator", + "modelAsString": true + } + }, + "values": { + "type": "array", + "description": "list of values to match for a given condition.", + "items": { + "type": "string" + } + } + } + }, + "Conditions": { + "type": "object", + "description": "Conditions in alert instance to be matched for a given action rule. Default value is all. Multiple values could be provided with comma separation.", + "properties": { + "severity": { + "description": "filter alerts by severity", + "$ref": "#/definitions/Condition" + }, + "monitorService": { + "description": "filter alerts by monitor service", + "$ref": "#/definitions/Condition" + }, + "monitorCondition": { + "description": "filter alerts by monitor condition", + "$ref": "#/definitions/Condition" + }, + "targetResourceType": { + "description": "filter alerts by target resource type", + "$ref": "#/definitions/Condition" + }, + "alertRuleId": { + "description": "filter alerts by alert rule id", + "$ref": "#/definitions/Condition" + }, + "alertRuleName": { + "description": "filter alerts by alert rule name", + "$ref": "#/definitions/Condition" + }, + "description": { + "description": "filter alerts by alert rule description", + "$ref": "#/definitions/Condition" + }, + "alertContext": { + "description": "filter alerts by alert context (payload)", + "$ref": "#/definitions/Condition" + } + } + }, + "SuppressionConfig": { + "type": "object", + "description": "Suppression logic for a given action rule", + "required": [ + "recurrenceType" + ], + "properties": { + "recurrenceType": { + "type": "string", + "description": "Specifies when the suppression should be applied", + "enum": [ + "Always", + "Once", + "Daily", + "Weekly", + "Monthly" + ], + "x-ms-enum": { + "name": "SuppressionType", + "modelAsString": true + } + }, + "schedule": { + "description": "suppression schedule configuration", + "$ref": "#/definitions/SuppressionSchedule" + } + } + }, + "SuppressionSchedule": { + "type": "object", + "description": "Schedule for a given suppression configuration.", + "properties": { + "startDate": { + "type": "string", + "description": "Start date for suppression" + }, + "endDate": { + "type": "string", + "description": "End date for suppression" + }, + "startTime": { + "type": "string", + "description": "Start time for suppression" + }, + "endTime": { + "type": "string", + "description": "End date for suppression" + }, + "recurrenceValues": { + "type": "array", + "description": "Specifies the values for recurrence pattern", + "items": { + "type": "integer" + } + } + } + }, + "ActionRule": { + "description": "Action rule object containing target scope, conditions and suppression logic", + "allOf": [ + { + "$ref": "#/definitions/ManagedResource" + } + ], + "properties": { + "properties": { + "description": "action rule properties", + "$ref": "#/definitions/ActionRuleProperties" + } + } + }, + "ActionRuleProperties": { + "description": "Action rule properties defining scope, conditions, suppression logic for action rule", + "discriminator": "type", + "required": [ + "type" + ], + "properties": { + "scope": { + "description": "scope on which action rule will apply", + "$ref": "#/definitions/Scope" + }, + "conditions": { + "description": "conditions on which alerts will be filtered", + "$ref": "#/definitions/Conditions" + }, + "description": { + "type": "string", + "description": "Description of action rule" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Creation time of action rule. Date-Time in ISO-8601 format.", + "readOnly": true + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "Last updated time of action rule. Date-Time in ISO-8601 format.", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "Created by user name.", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "Last modified by user name.", + "readOnly": true + }, + "status": { + "type": "string", + "description": "Indicates if the given action rule is enabled or disabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "ActionRuleStatus", + "modelAsString": true + } + }, + "type": { + "type": "string", + "description": "Indicates type of action rule", + "enum": [ + "Suppression", + "ActionGroup", + "Diagnostics" + ], + "x-ms-enum": { + "name": "ActionRuleType", + "modelAsString": true + } + } + } + }, + "Suppression": { + "title": "Suppression based Action Rule", + "description": "Action rule with suppression configuration", + "required": [ + "suppressionConfig" + ], + "allOf": [ + { + "$ref": "#/definitions/ActionRuleProperties" + }, + { + "type": "object", + "properties": { + "suppressionConfig": { + "description": "suppression configuration for the action rule", + "$ref": "#/definitions/SuppressionConfig" + } + } + } + ] + }, + "ActionGroup": { + "title": "Action Group based Action Rule", + "description": "Action rule with action group configuration", + "required": [ + "actionGroupId" + ], + "allOf": [ + { + "$ref": "#/definitions/ActionRuleProperties" + }, + { + "type": "object", + "properties": { + "actionGroupId": { + "type": "string", + "description": "Action group to trigger if action rule matches" + } + } + } + ] + }, + "Diagnostics": { + "title": "Diagnostics based Action Rule", + "description": "Action rule with diagnostics configuration", + "allOf": [ + { + "$ref": "#/definitions/ActionRuleProperties" + }, + { + "type": "object" + } + ] + }, + "ActionRulesList": { + "description": "List of action rules", + "properties": { + "nextLink": { + "type": "string", + "description": "URL to fetch the next set of action rules" + }, + "value": { + "type": "array", + "description": "List of action rules", + "items": { + "$ref": "#/definitions/ActionRule" + } + } + } + }, + "PatchProperties": { + "description": "Action rule properties supported by patch", + "properties": { + "status": { + "type": "string", + "description": "Indicates if the given action rule is enabled or disabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "ActionRuleStatus", + "modelAsString": true + } + } + } + }, + "PatchObject": { + "description": "Data contract for patch", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "properties supported by patch operation", + "$ref": "#/definitions/PatchProperties" + }, + "tags": { + "type": "object", + "description": "tags to be updated" + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json new file mode 100644 index 000000000000..5fd5b5520375 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -0,0 +1,1255 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-05-05-preview", + "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" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/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" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListOperations": { + "$ref": "./examples/Operations_List.json" + } + } + } + }, + "/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/errorResponse" + } + } + }, + "x-ms-examples": { + "MonService": { + "$ref": "./examples/AlertsMetaData_MonitorService.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/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. ", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$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/smartGroupIdFilter" + }, + { + "$ref": "#/parameters/includeContext" + }, + { + "$ref": "#/parameters/includeEgressConfig" + }, + { + "$ref": "#/parameters/pageCount" + }, + { + "$ref": "#/parameters/alertsSortBy" + }, + { + "$ref": "#/parameters/sortOrder" + }, + { + "$ref": "#/parameters/select" + }, + { + "$ref": "#/parameters/timeRange" + }, + { + "$ref": "#/parameters/customTimeRange" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Successfully listed alert objects.", + "schema": { + "$ref": "#/definitions/alertsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListAlerts": { + "$ref": "./examples/Alerts_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "get": { + "operationId": "Alerts_GetById", + "summary": "Get a specific alert.", + "description": "Get information related to a specific alert", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the alert with the specified ID.", + "schema": { + "$ref": "#/definitions/alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "GetById": { + "$ref": "./examples/Alerts_GetById.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { + "post": { + "operationId": "Alerts_ChangeState", + "description": "Change the state of an alert.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/newState" + }, + { + "$ref": "#/parameters/comment" + } + ], + "responses": { + "200": { + "description": "OK. Alert state updated.", + "schema": { + "$ref": "#/definitions/alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_ChangeState.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/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) and alert state changes (New/Acknowledged/Closed).", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the history of the specified alert.", + "schema": { + "$ref": "#/definitions/alertModification" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_History.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertsSummary": { + "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).", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$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": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Alert summary returned.", + "schema": { + "$ref": "#/definitions/alertsSummary" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Summary": { + "$ref": "./examples/Alerts_Summary.json" + } + } + } + } + }, + "parameters": { + "subscriptionId": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 + }, + "api-version": { + "name": "api-version", + "description": "client API version", + "type": "string", + "in": "query", + "required": true, + "enum": [ + "2019-05-05-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" + ], + "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", + "required": false, + "x-ms-parameter-location": "method", + "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 (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate.", + "name": "groupby", + "type": "string", + "in": "query", + "required": true, + "x-ms-parameter-location": "method", + "enum": [ + "severity", + "alertState", + "monitorCondition", + "monitorService", + "signalType", + "alertRule" + ], + "x-ms-enum": { + "name": "AlertsSummaryGroupByFields", + "modelAsString": true + } + }, + "sortOrder": { + "description": "Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.", + "name": "sortOrder", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "SortOrder", + "modelAsString": true + } + }, + "select": { + "description": "This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section.", + "name": "select", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "identifier": { + "name": "identifier", + "description": "Identification of the information to be retrieved by API call.", + "type": "string", + "in": "query", + "required": true, + "enum": [ + "MonitorServiceList" + ], + "x-ms-enum": { + "name": "identifier", + "modelAsString": true + }, + "x-ms-parameter-location": "method" + } + }, + "definitions": { + "operation": { + "description": "Operation provided by provider", + "properties": { + "name": { + "type": "string", + "description": "Name of the operation" + }, + "display": { + "type": "object", + "description": "Properties of the operation", + "properties": { + "provider": { + "type": "string", + "description": "Provider name" + }, + "resource": { + "type": "string", + "description": "Resource name" + }, + "operation": { + "type": "string", + "description": "Operation name" + }, + "description": { + "type": "string", + "description": "Description of the operation" + } + } + }, + "origin": { + "type": "string", + "description": "Origin of the operation" + } + } + }, + "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", + "items": { + "$ref": "#/definitions/operation" + } + } + }, + "required": [ + "value" + ] + }, + "errorResponse": { + "description": "An error response from the service.", + "properties": { + "error": { + "$ref": "#/definitions/errorResponseBody" + } + } + }, + "errorResponseBody": { + "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" + } + } + } + }, + "Resource": { + "x-ms-azure-resource": true, + "description": "An azure resource object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + } + } + }, + "alert": { + "type": "object", + "description": "An alert created in alert management service.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertProperties" + } + } + }, + "alertsList": { + "type": "object", + "description": "List the alerts.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" + }, + "value": { + "description": "List of alerts", + "type": "array", + "items": { + "$ref": "#/definitions/alert" + } + } + } + }, + "alertProperties": { + "type": "object", + "description": "Alert property bag", + "properties": { + "essentials": { + "$ref": "#/definitions/essentials" + }, + "context": { + "$ref": "#/definitions/alertContext" + }, + "egressConfig": { + "$ref": "#/definitions/egressConfig" + } + } + }, + "comments": { + "type": "object", + "description": "Change alert state reason", + "properties": { + "comments": { + "type": "string" + } + } + }, + "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": { + "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": "Condition of the rule at the monitor service. It 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" + ], + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": 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": { + "type": "string", + "description": "Alert description." + } + } + }, + "alertModification": { + "type": "object", + "description": "Alert Modification details", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "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" + } + } + } + }, + "alertModificationItem": { + "type": "object", + "description": "Alert modification item.", + "properties": { + "modificationEvent": { + "type": "string", + "description": "Reason for the modification", + "enum": [ + "AlertCreated", + "StateChange", + "MonitorConditionChange", + "SeverityChange", + "ActionRuleTriggered", + "ActionRuleSuppressed", + "ActionsTriggered", + "ActionsSuppressed", + "ActionsFailed" + ], + "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" + } + } + }, + "alertsSummary": { + "type": "object", + "description": "Summary of alerts based on the input filters and 'groupby' parameters.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertsSummaryGroup" + } + } + }, + "alertsSummaryGroup": { + "type": "object", + "description": "Group the result set.", + "properties": { + "total": { + "type": "integer", + "format": "int64", + "description": "Total count of the result set." + }, + "smartGroupsCount": { + "type": "integer", + "format": "int64", + "description": "Total count of the smart groups." + }, + "groupedby": { + "type": "string", + "description": "Name of the field aggregated" + }, + "values": { + "type": "array", + "description": "List of the items", + "items": { + "$ref": "#/definitions/alertsSummaryGroupItem" + } + } + } + }, + "alertsSummaryGroupItem": { + "type": "object", + "description": "Alerts summary group item", + "properties": { + "name": { + "type": "string", + "description": "Value of the aggregated field" + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Count of the aggregated field" + }, + "groupedby": { + "type": "string", + "description": "Name of the field aggregated" + }, + "values": { + "type": "array", + "description": "List of the items", + "items": { + "$ref": "#/definitions/alertsSummaryGroupItem" + } + } + } + }, + "alertsMetaData": { + "type": "object", + "description": "alert meta data information.", + "properties": { + "properties": { + "$ref": "#/definitions/alertsMetaDataProperties" + } + } + }, + "alertsMetaDataProperties": { + "type": "object", + "description": "alert meta data property bag", + "discriminator": "metadataIdentifier", + "required": [ + "metadataIdentifier" + ], + "properties": { + "metadataIdentifier": { + "type": "string", + "description": "Identification of the information to be retrieved by API call", + "enum": [ + "MonitorServiceList" + ], + "x-ms-enum": { + "name": "metadataIdentifier", + "modelAsString": true + } + } + } + }, + "MonitorServiceList": { + "type": "object", + "title": "Monitor service details", + "description": "Monitor service details", + "required": [ + "data" + ], + "allOf": [ + { + "$ref": "#/definitions/alertsMetaDataProperties" + }, + { + "type": "object" + } + ], + "properties": { + "data": { + "description": "Array of operations", + "type": "array", + "items": { + "$ref": "#/definitions/MonitorServiceDetails" + } + } + } + }, + "MonitorServiceDetails": { + "type": "object", + "description": "Details of a monitor service", + "properties": { + "name": { + "type": "string", + "description": "Monitor service name" + }, + "displayName": { + "type": "string", + "description": "Monitor service display name" + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json new file mode 100644 index 000000000000..e587aebabacf --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json @@ -0,0 +1,739 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-05-05-preview", + "title": "Azure Alerts Management Service Resource Provider", + "description": "APIs for Azure Smart Groups CRUD operations." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups": { + "get": { + "operationId": "SmartGroups_GetAll", + "summary": "Get all Smart Groups within a specified subscription", + "description": "List all the Smart Groups within a specified subscription. ", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/targetResource" + }, + { + "$ref": "#/parameters/targetResourceGroup" + }, + { + "$ref": "#/parameters/targetResourceType" + }, + { + "$ref": "#/parameters/monitorService" + }, + { + "$ref": "#/parameters/monitorCondition" + }, + { + "$ref": "#/parameters/severity" + }, + { + "$ref": "#/parameters/smartGroupState" + }, + { + "$ref": "#/parameters/timeRange" + }, + { + "$ref": "#/parameters/pageCount" + }, + { + "$ref": "#/parameters/smartGroupsSortBy" + }, + { + "$ref": "#/parameters/sortOrder" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Returns list of all smartGroups.", + "schema": { + "$ref": "#/definitions/smartGroupsList", + "description": "List of smart groups in value property." + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List": { + "$ref": "./examples/SmartGroups_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}": { + "get": { + "operationId": "SmartGroups_GetById", + "summary": "Get information related to a specific Smart Group.", + "description": "Get information related to a specific Smart Group.", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/smartGroupId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the group with the specified smart group Id.", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/smartGroup" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Get": { + "$ref": "./examples/SmartGroups_GetById.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/changeState": { + "post": { + "operationId": "SmartGroups_ChangeState", + "description": "Change the state of a Smart Group.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/smartGroupId" + }, + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/newState" + } + ], + "responses": { + "200": { + "description": "OK. Smart Group state updated.", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/smartGroup" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "changestate": { + "$ref": "./examples/SmartGroups_ChangeState.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/history": { + "get": { + "operationId": "SmartGroups_GetHistory", + "description": "Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) .", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/smartGroupId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the list of changes of smart group.", + "schema": { + "$ref": "#/definitions/smartGroupModification" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/SmartGroups_History.json" + } + } + } + } + }, + "parameters": { + "subscriptionId": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 + }, + "api-version": { + "name": "api-version", + "description": "client API version", + "type": "string", + "in": "query", + "required": true, + "enum": [ + "2019-05-05-preview" + ], + "x-ms-enum": { + "name": "api-version", + "modelAsString": true + } + }, + "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" + ], + "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 + } + }, + "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 + } + }, + "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-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 + } + }, + "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 + } + }, + "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" + }, + "smartGroupsSortBy": { + "description": "Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.", + "name": "sortBy", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "alertsCount", + "state", + "severity", + "startDateTime", + "lastModifiedDateTime" + ], + "x-ms-enum": { + "name": "SmartGroupsSortByFields", + "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 + } + } + }, + "definitions": { + "errorResponse": { + "description": "An error response from the service.", + "properties": { + "error": { + "$ref": "#/definitions/errorResponseBody" + } + } + }, + "errorResponseBody": { + "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" + } + } + } + }, + "Resource": { + "x-ms-azure-resource": true, + "description": "An azure resource object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + } + } + }, + "smartGroupModification": { + "type": "object", + "description": "Alert Modification details", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/smartGroupModificationProperties" + } + } + }, + "smartGroupModificationProperties": { + "type": "object", + "description": "Properties of the smartGroup modification item.", + "properties": { + "smartGroupId": { + "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" + } + }, + "nextLink": { + "description": "URL to fetch the next set of results.", + "type": "string" + } + } + }, + "smartGroupModificationItem": { + "type": "object", + "description": "smartGroup modification item.", + "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" + } + } + }, + "smartGroupsList": { + "type": "object", + "description": "List the alerts.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" + }, + "value": { + "description": "List of alerts", + "type": "array", + "items": { + "$ref": "#/definitions/smartGroup" + } + } + } + }, + "smartGroup": { + "type": "object", + "description": "Set of related alerts grouped together smartly by AMS.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/smartGroupProperties" + } + } + }, + "smartGroupProperties": { + "type": "object", + "description": "Properties of smart group.", + "properties": { + "alertsCount": { + "type": "integer", + "format": "int64", + "description": "Total number of alerts in smart group" + }, + "smartGroupState": { + "type": "string", + "description": "Smart group state", + "readOnly": true, + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "State", + "modelAsString": true + } + }, + "severity": { + "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 + } + }, + "startDateTime": { + "type": "string", + "format": "date-time", + "description": "Creation time of smart group. Date-Time in ISO-8601 format.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "Last updated time of smart group. Date-Time in ISO-8601 format.", + "readOnly": true + }, + "lastModifiedUserName": { + "type": "string", + "description": "Last modified by user name.", + "readOnly": true + }, + "resources": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of target resources in the smart group" + }, + "resourceTypes": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of target resource types in the smart group" + }, + "resourceGroups": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of target resource groups in the smart group" + }, + "monitorServices": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of monitorServices in the smart group" + }, + "monitorConditions": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of monitorConditions in the smart group" + }, + "alertStates": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of alertStates in the smart group" + }, + "alertSeverities": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "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." + } + } + }, + "smartGroupAggregatedProperty": { + "type": "object", + "description": "Aggregated property of each type", + "properties": { + "name": { + "type": "string", + "description": "Name of the type." + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total number of items of type." + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json new file mode 100644 index 000000000000..ed86d083aab6 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json @@ -0,0 +1,123 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "resourceGroupName": "alertscorrelationrg", + "actionRuleName": "DailySuppression", + "actionRule": { + "location": "Global", + "tags": {}, + "properties": { + "scope": { + "scopeType": "ResourceGroup", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" + ] + }, + "conditions": { + "severity": { + "operator": "Equals", + "values": [ + "Sev0", + "Sev2" + ] + }, + "monitorService": { + "operator": "Equals", + "values": [ + "Platform", + "Application Insights" + ] + }, + "monitorCondition": { + "operator": "Equals", + "values": [ + "Fired" + ] + }, + "targetResourceType": { + "operator": "NotEquals", + "values": [ + "Microsoft.Compute/VirtualMachines" + ] + } + }, + "type": "Suppression", + "suppressionConfig": { + "recurrenceType": "Daily", + "schedule": { + "startDate": "12/09/2018", + "endDate": "12/18/2018", + "startTime": "06:00:00", + "endTime": "14:00:00" + } + }, + "description": "Action rule on resource group for daily suppression", + "status": "Enabled" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "scope": { + "scopeType": "ResourceGroup", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" + ] + }, + "conditions": { + "severity": { + "operator": "Equals", + "values": [ + "Sev0", + "Sev2" + ] + }, + "monitorService": { + "operator": "Equals", + "values": [ + "Platform", + "Application Insights" + ] + }, + "monitorCondition": { + "operator": "Equals", + "values": [ + "Fired" + ] + }, + "targetResourceType": { + "operator": "NotEquals", + "values": [ + "Microsoft.Compute/VirtualMachines" + ] + } + }, + "type": "Suppression", + "suppressionConfig": { + "recurrenceType": "Daily", + "schedule": { + "startDate": "12/09/2018", + "endDate": "12/18/2018", + "startTime": "06:00:00", + "endTime": "14:00:00" + } + }, + "description": "Action rule on resource group for daily suppression", + "status": "Enabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "DailySuppression", + "location": "Global", + "tags": {} + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json new file mode 100644 index 000000000000..ab9ef51318f0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "resourceGroupName": "alertscorrelationrg", + "actionRuleName": "DailySuppression" + }, + "responses": { + "200": { + "body": true + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json new file mode 100644 index 000000000000..77b20d14013f --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json @@ -0,0 +1,71 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "resourceGroupName": "alertscorrelationrg", + "actionRuleName": "DailySuppression" + }, + "responses": { + "200": { + "body": { + "properties": { + "scope": { + "scopeType": "ResourceGroup", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" + ] + }, + "conditions": { + "severity": { + "operator": "Equals", + "values": [ + "Sev0", + "Sev2" + ] + }, + "monitorService": { + "operator": "Equals", + "values": [ + "Platform", + "Application Insights" + ] + }, + "monitorCondition": { + "operator": "Equals", + "values": [ + "Fired" + ] + }, + "targetResourceType": { + "operator": "NotEquals", + "values": [ + "Microsoft.Compute/VirtualMachines" + ] + } + }, + "type": "Suppression", + "suppressionConfig": { + "recurrenceType": "Daily", + "schedule": { + "startDate": "12/09/2018", + "endDate": "12/18/2018", + "startTime": "06:00:00", + "endTime": "14:00:00" + } + }, + "description": "Action rule on resource group for daily suppression", + "status": "Enabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "DailySuppression", + "location": "Global", + "tags": {} + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json new file mode 100644 index 000000000000..2f9c60e46f45 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json @@ -0,0 +1,114 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "resourceGroupName": "alertscorrelationrg" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules?api-version=2018-11-02-privatepreview&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", + "value": [ + { + "properties": { + "scope": { + "scopeType": "ResourceGroup", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" + ] + }, + "conditions": { + "severity": { + "operator": "Equals", + "values": [ + "Sev0", + "Sev2" + ] + }, + "monitorService": { + "operator": "Equals", + "values": [ + "Platform", + "Application Insights" + ] + }, + "targetResourceType": { + "operator": "NotEquals", + "values": [ + "Microsoft.Compute/VirtualMachines" + ] + } + }, + "type": "Suppression", + "suppressionConfig": { + "recurrenceType": "Daily", + "schedule": { + "startDate": "12/09/2018", + "endDate": "12/18/2018", + "startTime": "06:00:00", + "endTime": "14:00:00" + } + }, + "description": "Action rule on resource group for daily suppression", + "status": "Enabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "DailySuppression", + "location": "Global", + "tags": {} + }, + { + "properties": { + "scope": { + "scopeType": "Resource", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.Compute/VirtualMachines/testResource" + ] + }, + "conditions": { + "monitorCondition": { + "operator": "Equals", + "values": [ + "Fired" + ] + }, + "description": { + "operator": "Contains", + "values": [ + "Percentage CPU greater than 80%", + "Metric alert on resource foo" + ] + }, + "alertContext": { + "operator": "DoesNotContain", + "values": [ + "testresource", + "foo" + ] + } + }, + "type": "ActionGroup", + "actionGroupId": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.insights/actiongroups/testAG", + "description": "Action rule on resource group for sending email", + "status": "Enabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "WeeklySuppression", + "location": "Global", + "tags": {} + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json new file mode 100644 index 000000000000..00972ab28db0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json @@ -0,0 +1,105 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/actionRules?api-version=2018-11-02-privatepreview&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", + "value": [ + { + "properties": { + "scope": { + "scopeType": "ResourceGroup", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" + ] + }, + "conditions": { + "severity": { + "operator": "Equals", + "values": [ + "Sev0", + "Sev2" + ] + }, + "monitorService": { + "operator": "Equals", + "values": [ + "Platform", + "Application Insights" + ] + }, + "targetResourceType": { + "operator": "NotEquals", + "values": [ + "Microsoft.Compute/VirtualMachines" + ] + } + }, + "type": "Suppression", + "suppressionConfig": { + "recurrenceType": "Daily", + "schedule": { + "startDate": "12/09/2018", + "endDate": "12/18/2018", + "startTime": "06:00:00", + "endTime": "14:00:00" + } + }, + "description": "Action rule on resource group for daily suppression", + "status": "Enabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "DailySuppression", + "location": "Global", + "tags": {} + }, + { + "properties": { + "scope": { + "scopeType": "Resource", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.Compute/VirtualMachines/testResource" + ] + }, + "conditions": { + "monitorCondition": { + "operator": "Equals", + "values": [ + "Fired" + ] + }, + "description": { + "operator": "Contains", + "values": [ + "Percentage CPU greater than 80%", + "Metric alert on resource foo" + ] + } + }, + "type": "Diagnostics", + "description": "Action rule on resource group for sending diagnostics", + "status": "Enabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "WeeklySuppression", + "location": "Global", + "tags": {} + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json new file mode 100644 index 000000000000..abb2b0d7d4f4 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "resourceGroupName": "alertscorrelationrg", + "actionRuleName": "WeeklySuppression", + "actionRulePatch": { + "tags": { + "key1": "value1", + "key2": "value2" + }, + "properties": { + "status": "Disabled" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "scope": { + "scopeType": "ResourceGroup", + "values": [ + "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" + ] + }, + "conditions": { + "severity": { + "operator": "Equals", + "values": [ + "Sev0", + "Sev2" + ] + }, + "monitorService": { + "operator": "Equals", + "values": [ + "Platform", + "Application Insights" + ] + }, + "targetResourceType": { + "operator": "NotEquals", + "values": [ + "Microsoft.Compute/VirtualMachines" + ] + } + }, + "suppressionConfig": { + "recurrenceType": "Weekly", + "schedule": { + "startDate": "12/09/2018", + "endDate": "12/18/2018", + "startTime": "06:00:00", + "endTime": "14:00:00", + "recurrenceValues": [ + 1, + 2 + ] + } + }, + "type": "Suppression", + "description": "Action rule on resource group for weekly suppression", + "status": "Disabled", + "createdAt": "2018-06-12T22:05:09Z", + "lastModifiedAt": "2018-06-12T22:05:09Z", + "createdBy": "abc@microsoft.com", + "lastModifiedBy": "xyz@microsoft.com" + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression", + "type": "Microsoft.AlertsManagement/actionRules", + "name": "WeeklySuppression", + "location": "Global", + "tags": { + "key1": "value1", + "key2": "value2" + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json new file mode 100644 index 000000000000..30a95d200ffa --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json @@ -0,0 +1,89 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "identifier": "MonitorServiceList" + }, + "responses": { + "200": { + "body": { + "properties": { + "metadataIdentifier": "MonitorServiceList", + "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" + } + ] + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json new file mode 100644 index 000000000000..8674648f9019 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "newState": "Acknowledged", + "body": { + "comment": "Acknowledging alert" + } + }, + "responses": { + "200": { + "body": { + "properties": { + "essentials": { + "severity": "Sev3", + "signalType": "Log", + "alertState": "Acknowledged", + "monitorCondition": "Fired", + "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", + "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=", + "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/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type": "Microsoft.AlertsManagement/alerts", + "name": "cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json new file mode 100644 index 000000000000..c586a2e9de24 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" + }, + "responses": { + "200": { + "body": { + "properties": { + "essentials": { + "severity": "Sev3", + "signalType": "Log", + "alertState": "Acknowledged", + "monitorCondition": "Fired", + "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", + "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=", + "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/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type": "Microsoft.AlertsManagement/alerts", + "name": "cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json new file mode 100644 index 000000000000..490ccb5edd4b --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json @@ -0,0 +1,39 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" + }, + "responses": { + "200": { + "body": { + "properties": { + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "modifications": [ + { + "modificationEvent": "StateChange", + "oldValue": "New", + "newValue": "Acknowledged", + "modifiedAt": "2018-06-13T06:14:15.7378737Z", + "modifiedBy": "vikramm@microsoft.com", + "comments": "Acknowledging alert", + "description": "State changed from 'New' to 'Acknowledged'" + }, + { + "modificationEvent": "AlertCreated", + "oldValue": "", + "newValue": "", + "modifiedAt": "2018-06-13T06:09:01Z", + "modifiedBy": "System", + "comments": "", + "description": "New Alert Object is created" + } + ] + }, + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100/history/default", + "type": "Microsoft.AlertsManagement/alerts", + "name": "CPU Alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json new file mode 100644 index 000000000000..929a98c7fa4f --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json @@ -0,0 +1,79 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" + }, + "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": [ + { + "properties": { + "essentials": { + "severity": "Sev3", + "signalType": "Log", + "alertState": "Acknowledged", + "monitorCondition": "Fired", + "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", + "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=", + "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/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type": "Microsoft.AlertsManagement/alerts", + "name": "cpu alert" + }, + { + "properties": { + "essentials": { + "severity": "Sev3", + "signalType": "Log", + "alertState": "New", + "monitorCondition": "Fired", + "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", + "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=", + "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/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type": "Microsoft.AlertsManagement/alerts", + "name": "cpu alert" + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json new file mode 100644 index 000000000000..772b0d649e48 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json @@ -0,0 +1,118 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "groupby": "severity,alertState" + }, + "responses": { + "200": { + "body": { + "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 + } + ] + } + ] + }, + "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current", + "type": "Microsoft.AlertsManagement/alertsSummary", + "name": "current" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json new file mode 100644 index 000000000000..bd2a412411c0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json @@ -0,0 +1,211 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.AlertsManagement/register/action", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "Subscription", + "operation": "Subscription Registration Action", + "description": "Subscription Registration Action" + } + }, + { + "name": "Microsoft.AlertsManagement/register/action", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "register", + "operation": "Register subscription", + "description": "Registers the subscription for the Microsoft Alerts Management" + } + }, + { + "name": "Microsoft.AlertsManagement/alerts/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "alerts", + "operation": "Read alerts", + "description": "Get all the alerts for the input filters." + } + }, + { + "name": "Microsoft.AlertsManagement/alerts/changestate/action", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "alerts", + "operation": "Resolve alerts", + "description": "Change the state of the alert." + } + }, + { + "name": "Microsoft.AlertsManagement/alerts/history/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "alerts", + "operation": "Read alert history", + "description": "Get history of the alert" + } + }, + { + "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/write", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules", + "operation": "Create Smart Detector alert rule", + "description": "Create or update Smart Detector alert rule in a given subscription" + } + }, + { + "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules", + "operation": "Read Smart Detector alert rules", + "description": "Get all the Smart Detector alert rules for the input filters" + } + }, + { + "name": "Microsoft.AlertsManagement/smartDetectorAlertRules/delete", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "smartDetectorAlertRules", + "operation": "Delete Smart Detector alert rule", + "description": "Delete Smart Detector alert rule in a given subscription" + } + }, + { + "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/write", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules", + "operation": "Create Resource Health alert rule", + "description": "Create or update Resource Health alert rule in a given subscription" + } + }, + { + "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules", + "operation": "Read Resource Health alert rules", + "description": "Get all the Resource Health alert rules for the input filters" + } + }, + { + "name": "Microsoft.AlertsManagement/resourceHealthAlertRules/delete", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "resourceHealthAlertRules", + "operation": "Delete Resource Health alert rule", + "description": "Delete Resource Health alert rule in a given subscription" + } + }, + { + "name": "Microsoft.AlertsManagement/migrateFromSmartDetection/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "migrateFromSmartDetection", + "operation": "Get Smart Detection Migration status", + "description": "Get the status of an asynchronous Smart Detection to smart alerts migration process" + } + }, + { + "name": "Microsoft.AlertsManagement/migrateFromSmartDetection/action", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "migrateFromSmartDetection", + "operation": "Migrate From Smart Detection", + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource" + } + }, + { + "name": "Microsoft.AlertsManagement/alertsSummary/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "alertsSummary", + "operation": "Read alerts summary", + "description": "Get the summary of alerts" + } + }, + { + "name": "Microsoft.AlertsManagement/smartGroups/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups", + "operation": "Read smart groups", + "description": "Get all the smart groups for the input filters" + } + }, + { + "name": "Microsoft.AlertsManagement/smartGroups/changestate/action", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups", + "operation": "Read smart groups", + "description": "Change the state of the smart group" + } + }, + { + "name": "Microsoft.AlertsManagement/smartGroups/history/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "smartGroups", + "operation": "Read smart group history", + "description": "Get history of the smart group" + } + }, + { + "name": "Microsoft.AlertsManagement/actionRules/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules", + "operation": "Read action rules", + "description": "Get all the alert processing rules for the input filters." + } + }, + { + "name": "Microsoft.AlertsManagement/actionRules/write", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules", + "operation": "Write action rule", + "description": "Create or update alert processing rule in a given subscription" + } + }, + { + "name": "Microsoft.AlertsManagement/actionRules/delete", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "actionRules", + "operation": "Delete action rule", + "description": "Delete alert processing rule in a given subscription." + } + }, + { + "name": "Microsoft.AlertsManagement/alertsMetaData/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "Microsoft.AlertsManagement/alertsMetaData", + "operation": "Read alerts meta data", + "description": "Get alerts meta data for the input parameter." + } + }, + { + "name": "Microsoft.AlertsManagement/Operations/read", + "display": { + "provider": "Microsoft.AlertsManagement", + "resource": "operations", + "operation": "Read operations", + "description": "Reads the operations provided" + } + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json new file mode 100644 index 000000000000..6bdb65e58aed --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json @@ -0,0 +1,74 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72", + "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059", + "newState": "Acknowledged", + "body": { + "comments": "Acknowledging smart group" + } + }, + "responses": { + "200": { + "body": { + "properties": { + "alertsCount": 1942, + "smartGroupState": "Acknowledged", + "severity": "Sev3", + "startDateTime": "2018-06-06T12:35:09Z", + "lastModifiedDateTime": "2018-06-13T06:30:09Z", + "lastModifiedUserName": "System", + "resources": [ + { + "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "count": 1942 + } + ], + "resourceTypes": [ + { + "name": "components", + "count": 1942 + } + ], + "resourceGroups": [ + { + "name": "alertscorrelationrg", + "count": 1942 + } + ], + "monitorServices": [ + { + "name": "Application Insights", + "count": 1942 + } + ], + "monitorConditions": [ + { + "name": "Fired", + "count": 1942 + } + ], + "alertStates": [ + { + "name": "New", + "count": 1941 + }, + { + "name": "Acknowledged", + "count": 1 + } + ], + "alertSeverities": [ + { + "name": "Sev3", + "count": 1942 + } + ] + }, + "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", + "type": "Microsoft.AlertsManagement/smartGroups", + "name": "cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json new file mode 100644 index 000000000000..bf70f86a4355 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "smartGroupId": "603675da-9851-4b26-854a-49fc53d32715" + }, + "responses": { + "200": { + "body": { + "properties": { + "alertsCount": 1942, + "smartGroupState": "New", + "severity": "Sev3", + "startDateTime": "2018-06-06T12:35:09Z", + "lastModifiedDateTime": "2018-06-13T06:30:09Z", + "lastModifiedUserName": "System", + "resources": [ + { + "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "count": 1942 + } + ], + "resourceTypes": [ + { + "name": "components", + "count": 1942 + } + ], + "resourceGroups": [ + { + "name": "alertscorrelationrg", + "count": 1942 + } + ], + "monitorServices": [ + { + "name": "Application Insights", + "count": 1942 + } + ], + "monitorConditions": [ + { + "name": "Fired", + "count": 1942 + } + ], + "alertStates": [ + { + "name": "New", + "count": 1941 + }, + { + "name": "Acknowledged", + "count": 1 + } + ], + "alertSeverities": [ + { + "name": "Sev3", + "count": 1942 + } + ] + }, + "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", + "type": "Microsoft.AlertsManagement/smartGroups", + "name": "cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json new file mode 100644 index 000000000000..320d3ef850f1 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059" + }, + "responses": { + "200": { + "body": { + "properties": { + "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059", + "modifications": [ + { + "modificationEvent": "SmartGroupCreated", + "oldValue": "", + "newValue": "", + "modifiedAt": "2018-06-06T12:35:09Z", + "modifiedBy": "System", + "comments": "", + "description": "New Smart Group is created" + } + ] + }, + "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059/history/default", + "type": "Microsoft.AlertsManagement/alerts", + "name": "cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json new file mode 100644 index 000000000000..44c2aa47c866 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json @@ -0,0 +1,145 @@ +{ + "parameters": { + "api-version": "2019-05-05-preview", + "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72" + }, + "responses": { + "200": { + "body": { + "nextLink": null, + "value": [ + { + "properties": { + "alertsCount": 1942, + "smartGroupState": "New", + "severity": "Sev3", + "startDateTime": "2018-06-06T12:35:09Z", + "lastModifiedDateTime": "2018-06-13T06:30:09Z", + "lastModifiedUserName": "System", + "resources": [ + { + "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "count": 1942 + } + ], + "resourceTypes": [ + { + "name": "components", + "count": 1942 + } + ], + "resourceGroups": [ + { + "name": "alertscorrelationrg", + "count": 1942 + } + ], + "monitorServices": [ + { + "name": "Application Insights", + "count": 1942 + } + ], + "monitorConditions": [ + { + "name": "Fired", + "count": 1942 + } + ], + "alertStates": [ + { + "name": "New", + "count": 1941 + }, + { + "name": "Acknowledged", + "count": 1 + } + ], + "alertSeverities": [ + { + "name": "Sev3", + "count": 1942 + } + ] + }, + "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", + "type": "Microsoft.AlertsManagement/smartGroups", + "name": "cpu alert" + }, + { + "properties": { + "alertsCount": 15374, + "smartGroupState": "Acknowledged", + "severity": "Sev0", + "startDateTime": "2018-05-17T10:18:44.2020997Z", + "lastModifiedDateTime": "2018-06-13T06:29:01Z", + "lastModifiedUserName": "System", + "resources": [ + { + "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/alertsint", + "count": 15374 + } + ], + "resourceTypes": [ + { + "name": "microsoft.operationalinsights/workspaces", + "count": 6912 + }, + { + "name": "workspaces", + "count": 8462 + } + ], + "resourceGroups": [ + { + "name": "mms-eus", + "count": 15374 + } + ], + "monitorServices": [ + { + "name": "Log Analytics", + "count": 13911 + } + ], + "monitorConditions": [ + { + "name": "Fired", + "count": 15374 + } + ], + "alertStates": [ + { + "name": "New", + "count": 15358 + }, + { + "name": "Acknowledged", + "count": 12 + }, + { + "name": "Closed", + "count": 4 + } + ], + "alertSeverities": [ + { + "name": "Sev0", + "count": 6984 + }, + { + "name": "Sev1", + "count": 6927 + } + ] + }, + "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/01114c7c-769f-4fd4-b6fa-ab77693b83cd", + "type": "Microsoft.AlertsManagement/smartGroups", + "name": "CPU Alert" + } + ] + } + } + } +} From af1de42f6529527c7676cb4841035ce2b6368147 Mon Sep 17 00:00:00 2001 From: noneumar <113899918+noneumar@users.noreply.github.com> Date: Wed, 23 Aug 2023 10:28:14 +0300 Subject: [PATCH 02/22] Updates readme --- .../alertsmanagement/resource-manager/readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index bf84e86b9c78..ceebf0fd5eee 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -46,6 +46,17 @@ tag: package-2023-03 + +### Tag: package-preview-2023-07 + +These settings apply only when `--tag=package-preview-2023-07` is specified on the command line. + +```yaml $(tag) == 'package-preview-2023-07' +input-file: + - Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json + - Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json + - Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json +``` ### Tag: package-preview-2023-05 These settings apply only when `--tag=package-preview-2023-05` is specified on the command line. From 4255ce423e74fdca81fe740a5f393fc03be7b9ae Mon Sep 17 00:00:00 2001 From: noneumar <113899918+noneumar@users.noreply.github.com> Date: Wed, 23 Aug 2023 10:28:17 +0300 Subject: [PATCH 03/22] Updates API version in new specs and examples --- .../preview/2023-07-12-preview/ActionRules.json | 4 ++-- .../preview/2023-07-12-preview/AlertsManagement.json | 4 ++-- .../preview/2023-07-12-preview/SmartGroups.json | 4 ++-- .../examples/ActionRules_Create_SuppressionRule.json | 2 +- .../2023-07-12-preview/examples/ActionRules_Delete.json | 2 +- .../2023-07-12-preview/examples/ActionRules_GetById.json | 2 +- .../examples/ActionRules_List_ResourceGroup.json | 2 +- .../examples/ActionRules_List_Subscription.json | 2 +- .../2023-07-12-preview/examples/ActionRules_Patch.json | 2 +- .../examples/AlertsMetaData_MonitorService.json | 2 +- .../2023-07-12-preview/examples/Alerts_ChangeState.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_GetById.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_History.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_List.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_Summary.json | 2 +- .../preview/2023-07-12-preview/examples/Operations_List.json | 2 +- .../2023-07-12-preview/examples/SmartGroups_ChangeState.json | 2 +- .../2023-07-12-preview/examples/SmartGroups_GetById.json | 2 +- .../2023-07-12-preview/examples/SmartGroups_History.json | 2 +- .../preview/2023-07-12-preview/examples/SmartGroups_List.json | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json index 1903b3ee8c72..2a7301a8e32b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2019-05-05-preview", + "version": "2023-07-12-preview", "title": "Azure Alerts Management Service Resource Provider", "description": "APIs for Azure Action Rules CRUD operations." }, @@ -413,7 +413,7 @@ "in": "query", "required": true, "enum": [ - "2019-05-05-preview" + "2023-07-12-preview" ], "x-ms-enum": { "name": "api-version", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 5fd5b5520375..c57981373b4e 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2019-05-05-preview", + "version": "2023-07-12-preview", "title": "Azure Alerts Management Service Resource Provider", "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." }, @@ -393,7 +393,7 @@ "in": "query", "required": true, "enum": [ - "2019-05-05-preview" + "2023-07-12-preview" ], "x-ms-enum": { "name": "api-version", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json index e587aebabacf..59f7c5d16065 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2019-05-05-preview", + "version": "2023-07-12-preview", "title": "Azure Alerts Management Service Resource Provider", "description": "APIs for Azure Smart Groups CRUD operations." }, @@ -245,7 +245,7 @@ "in": "query", "required": true, "enum": [ - "2019-05-05-preview" + "2023-07-12-preview" ], "x-ms-enum": { "name": "api-version", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json index ed86d083aab6..b7b5cc2d4d6b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", "resourceGroupName": "alertscorrelationrg", "actionRuleName": "DailySuppression", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json index ab9ef51318f0..99679388988f 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", "resourceGroupName": "alertscorrelationrg", "actionRuleName": "DailySuppression" diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json index 77b20d14013f..2b785196fd27 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", "resourceGroupName": "alertscorrelationrg", "actionRuleName": "DailySuppression" diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json index 2f9c60e46f45..d3edef252104 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", "resourceGroupName": "alertscorrelationrg" }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json index 00972ab28db0..7dd1c5d3845f 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json index abb2b0d7d4f4..3370b24d03ca 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", "resourceGroupName": "alertscorrelationrg", "actionRuleName": "WeeklySuppression", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json index 30a95d200ffa..fbfd2d193591 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/AlertsMetaData_MonitorService.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "identifier": "MonitorServiceList" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json index 8674648f9019..3c3bdc0354e0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", "newState": "Acknowledged", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json index c586a2e9de24..0fa9d95f6987 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json index 490ccb5edd4b..c3bbedc48982 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json index 929a98c7fa4f..a9ec7b436996 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json index 772b0d649e48..406863fbc247 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", "groupby": "severity,alertState" }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json index bd2a412411c0..1b4916ad19c6 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Operations_List.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview" + "api-version": "2023-07-12-preview" }, "responses": { "200": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json index 6bdb65e58aed..bc613b9afbd0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72", "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059", "newState": "Acknowledged", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json index bf70f86a4355..e9f8ea2b14b2 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "smartGroupId": "603675da-9851-4b26-854a-49fc53d32715" }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json index 320d3ef850f1..b2cb153b116f 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059" }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json index 44c2aa47c866..94b1218f3464 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-05-05-preview", + "api-version": "2023-07-12-preview", "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72" }, "responses": { From 39b078efe5d7ecaf7ffd9c88887b7527375a7bc9 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:01:21 +0300 Subject: [PATCH 04/22] added enrichments api --- .../2023-07-12-preview/AlertsManagement.json | 288 ++++++++++++++++-- .../examples/Alerts_GetEnrichments.json | 65 ++++ .../examples/Alerts_ListEnrichments.json | 69 +++++ 3 files changed, 400 insertions(+), 22 deletions(-) create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index c57981373b4e..39918258baf5 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -33,7 +33,7 @@ "description": "List all operations available through Azure Alerts Management Resource Provider.", "parameters": [ { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "produces": [ @@ -69,7 +69,7 @@ "description": "List alerts meta data information based on value of identifier parameter.", "parameters": [ { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/identifier" @@ -159,7 +159,7 @@ "$ref": "#/parameters/customTimeRange" }, { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "produces": [ @@ -205,7 +205,7 @@ "$ref": "#/parameters/alertId" }, { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -241,7 +241,7 @@ "$ref": "#/parameters/alertId" }, { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/newState" @@ -283,7 +283,7 @@ "$ref": "#/parameters/alertId" }, { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -352,7 +352,7 @@ "$ref": "#/parameters/customTimeRange" }, { - "$ref": "#/parameters/api-version" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -375,6 +375,81 @@ } } } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments": { + "get": { + "operationId": "Alerts_ListEnrichments", + "description": "List the enrichments of an alert. It returns a collection of one object named default.", + "parameters": [ + { + "$ref": "#/parameters/scope" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Returns the enrichments of the specified alert.", + "schema": { + "$ref": "#/definitions/alertEnrichmentsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_ListEnrichments.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments/default": { + "get": { + "operationId": "Alerts_GetEnrichments", + "description": "Get the enrichments of an alert.", + "parameters": [ + { + "$ref": "#/parameters/scope" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Returns the enrichments of the specified alert.", + "schema": { + "$ref": "#/definitions/alertEnrichmentResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_GetEnrichments.json" + } + } + } } }, "parameters": { @@ -385,21 +460,7 @@ "type": "string", "description": "The ID of the target subscription.", "minLength": 1 - }, - "api-version": { - "name": "api-version", - "description": "client API version", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "2023-07-12-preview" - ], - "x-ms-enum": { - "name": "api-version", - "modelAsString": true - } - }, + }, "alertId": { "name": "alertId", "description": "Unique ID of an alert instance.", @@ -1250,6 +1311,189 @@ "description": "Monitor service display name" } } + }, + "alertEnrichmentResponse": { + "description": "The alert's enrichments.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertEnrichmentProperties" + } + } + }, + "alertEnrichmentsList": { + "description": "List the alert's enrichments.", + "type": "object", + "properties": { + "value": { + "description": "List the alert's enrichments", + "type": "array", + "items": { + "$ref": "#/definitions/alertEnrichmentResponse" + } + }, + "nextLink": { + "type": "string", + "description": "Request URL that can be used to query next page." + } + } + }, + "alertEnrichmentProperties": { + "type": "object", + "description": "Properties of the alert enrichment item.", + "properties": { + "alertId": { + "type": "string", + "description": "Unique Id of the alert for which the enrichments are being retrieved.", + "readOnly": true + }, + "enrichments": { + "type": "array", + "description": "Enrichment details", + "items": { + "$ref": "#/definitions/alertEnrichmentItem" + } + } + } + }, + "alertEnrichmentItem": { + "description": "Alert enrichment item.", + "discriminator": "type", + "required": [ + "title", + "description", + "status", + "type" + ], + "properties": { + "title": { + "type": "string", + "description": "The enrichment title." + }, + "description": { + "type": "string", + "description": "The enrichment description." + }, + "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 + } + } + } + }, + "PrometheusEnrichmentItem": { + "description": "Prometheus enrichment object.", + "required": [ + "linkToApi", + "datasources", + "grafanaExplorePath", + "query" + ], + "allOf": [ + { + "$ref": "#/definitions/alertEnrichmentItem" + } + ], + "properties": { + "linkToApi": { + "type": "string", + "description": "Link to Prometheus query API." + }, + "datasources": { + "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": [] + }, + "grafanaExplorePath": { + "type": "string", + "description": "Partial link to the Grafana explore API." + }, + "query": { + "type": "string", + "description": "The Prometheus expression query." + } + } + }, + "PrometheusInstantQuery": { + "x-ms-discriminator-value": "PrometheusInstantQuery", + "type": "object", + "description": "Prometheus instant query enrichment object.", + "required": [ + "time" + ], + "allOf": [ + { + "$ref": "#/definitions/PrometheusEnrichmentItem" + } + ], + "properties": { + "time": { + "type": "string", + "description": "The date and the time of the evaluation." + } + } + }, + "PrometheusRangeQuery": { + "x-ms-discriminator-value": "PrometheusRangeQuery", + "description": "Prometheus instant query enrichment object.", + "required": [ + "start", + "end", + "step" + ], + "allOf": [ + { + "$ref": "#/definitions/PrometheusEnrichmentItem" + } + ], + "properties": { + "start": { + "type": "string", + "description": "The start evaluation date and time in ISO8601 format.", + "format": "date-time" + }, + "end": { + "type": "string", + "description": "The end evaluation date and time in ISO8601 format.", + "format": "date-time" + }, + "step": { + "type": "string", + "description": "Query resolution step width in ISO8601 format." + } + } } } } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json new file mode 100644 index 000000000000..ffbf7368b0b0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "api-version": "2023-07-12-preview", + "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" + }, + "responses": { + "200": { + "body": { + "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?...", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "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" + }, + { + "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...", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "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" + }, + { + "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", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "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" + } + ] + }, + "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" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json new file mode 100644 index 000000000000..3e577adb105e --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "api-version": "2023-07-12-preview", + "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" + }, + "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", + "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?...", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "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" + }, + { + "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...", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "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" + }, + { + "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", + "datasources": [ + "/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw" + ], + "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" + } + ] + } + } + ] + } + } + } +} From 5da99330517fb8be53c296142612efbf58a0da15 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:09:56 +0300 Subject: [PATCH 05/22] fixing errors --- .../preview/2023-07-12-preview/AlertsManagement.json | 4 ++-- specification/alertsmanagement/resource-manager/readme.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 39918258baf5..1379791b7667 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -460,7 +460,7 @@ "type": "string", "description": "The ID of the target subscription.", "minLength": 1 - }, + }, "alertId": { "name": "alertId", "description": "Unique ID of an alert instance.", @@ -1312,7 +1312,7 @@ } } }, - "alertEnrichmentResponse": { + "alertEnrichmentResponse": { "description": "The alert's enrichments.", "type": "object", "allOf": [ diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index ceebf0fd5eee..e60043484cba 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -90,7 +90,7 @@ These settings apply only when `--tag=package-2023-03` is specified on the comma ```yaml $(tag) == 'package-2023-03' input-file: - Microsoft.AlertsManagement/stable/2023-03-01/PrometheusRuleGroups.json - - Microsoft.AlertsManagement/preview/2019-05-05-preview/AlertsManagement.json + - Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json - Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json - Microsoft.AlertsManagement/preview/2023-01-01-preview/AlertRuleRecommendations.json - Microsoft.AlertsManagement/preview/2023-05-01-preview/AlertProcessingRules.json From efa97dfb65a8c43eb2f3fb52a3634966952e6629 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:11:43 +0300 Subject: [PATCH 06/22] fixed more erros --- .../preview/2023-07-12-preview/AlertsManagement.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 1379791b7667..c4b94bfcca78 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -382,7 +382,7 @@ "description": "List the enrichments of an alert. It returns a collection of one object named default.", "parameters": [ { - "$ref": "#/parameters/scope" + "$ref": "#/parameters/subscriptionId" }, { "$ref": "#/parameters/alertId" @@ -421,7 +421,7 @@ "description": "Get the enrichments of an alert.", "parameters": [ { - "$ref": "#/parameters/scope" + "$ref": "#/parameters/subscriptionId" }, { "$ref": "#/parameters/alertId" From f193b404354b4b143bc0c3e77ab7c8eca89cb8f2 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:20:40 +0300 Subject: [PATCH 07/22] cont --- .../2023-07-12-preview/ActionRules.json | 948 ------------------ .../2023-07-12-preview/SmartGroups.json | 739 -------------- 2 files changed, 1687 deletions(-) delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json deleted file mode 100644 index 2a7301a8e32b..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json +++ /dev/null @@ -1,948 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2023-07-12-preview", - "title": "Azure Alerts Management Service Resource Provider", - "description": "APIs for Azure Action Rules CRUD operations." - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/actionRules": { - "get": { - "summary": "Get all action rule in a given subscription", - "description": "List all action rules of the subscription and given input filters", - "operationId": "ActionRules_ListBySubscription", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/targetResourceGroup" - }, - { - "$ref": "#/parameters/targetResourceType" - }, - { - "$ref": "#/parameters/targetResource" - }, - { - "$ref": "#/parameters/severity" - }, - { - "$ref": "#/parameters/monitorService" - }, - { - "$ref": "#/parameters/impactedScope" - }, - { - "$ref": "#/parameters/description" - }, - { - "$ref": "#/parameters/alertRuleId" - }, - { - "$ref": "#/parameters/actionGroup" - }, - { - "$ref": "#/parameters/actionRuleName" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Return the list of action rules", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/ActionRulesList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "GetActionRulesSubscriptionWide": { - "$ref": "./examples/ActionRules_List_Subscription.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules": { - "get": { - "summary": "Get all action rules created in a resource group", - "operationId": "ActionRules_ListByResourceGroup", - "description": "List all action rules of the subscription, created in given resource group and given input filters", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/resourceGroupName" - }, - { - "$ref": "#/parameters/targetResourceGroup" - }, - { - "$ref": "#/parameters/targetResourceType" - }, - { - "$ref": "#/parameters/targetResource" - }, - { - "$ref": "#/parameters/severity" - }, - { - "$ref": "#/parameters/monitorService" - }, - { - "$ref": "#/parameters/impactedScope" - }, - { - "$ref": "#/parameters/description" - }, - { - "$ref": "#/parameters/alertRuleId" - }, - { - "$ref": "#/parameters/actionGroup" - }, - { - "$ref": "#/parameters/actionRuleName" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Return the list of action rules", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/ActionRulesList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "GetActionRulesResourceGroupWide": { - "$ref": "./examples/ActionRules_List_ResourceGroup.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}": { - "get": { - "summary": "Get action rule by name", - "operationId": "ActionRules_GetByName", - "description": "Get a specific action rule", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/resourceGroupName" - }, - { - "name": "actionRuleName", - "in": "path", - "description": "The name of action rule that needs to be fetched", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Returns the specific action rule", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/ActionRule" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "GetActionRuleById": { - "$ref": "./examples/ActionRules_GetById.json" - } - } - }, - "put": { - "summary": "Create/update an action rule", - "operationId": "ActionRules_CreateUpdate", - "description": "Creates/Updates a specific action rule", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/resourceGroupName" - }, - { - "name": "actionRuleName", - "in": "path", - "description": "The name of action rule that needs to be created/updated", - "required": true, - "type": "string" - }, - { - "name": "actionRule", - "in": "body", - "description": "action rule to be created/updated", - "required": true, - "schema": { - "$ref": "#/definitions/ActionRule" - } - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Returns the created/updated action rule", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/ActionRule" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "PutActionRule": { - "$ref": "./examples/ActionRules_Create_SuppressionRule.json" - } - } - }, - "delete": { - "summary": "Delete action rule", - "description": "Deletes a given action rule", - "operationId": "ActionRules_Delete", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/resourceGroupName" - }, - { - "name": "actionRuleName", - "in": "path", - "description": "The name that needs to be deleted", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Returns true if deleted successfully", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "type": "boolean" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "DeleteActionRule": { - "$ref": "./examples/ActionRules_Delete.json" - } - } - }, - "patch": { - "summary": "Patch action rule", - "description": "Update enabled flag and/or tags for the given action rule", - "operationId": "ActionRules_Update", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/resourceGroupName" - }, - { - "name": "actionRuleName", - "in": "path", - "description": "The name that needs to be updated", - "required": true, - "type": "string" - }, - { - "name": "actionRulePatch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchObject" - }, - "description": "Parameters supplied to the operation." - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Returns the created/updated action rule", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/ActionRule" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "PatchActionRule": { - "$ref": "./examples/ActionRules_Patch.json" - } - } - } - } - }, - "parameters": { - "subscriptionId": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of the target subscription.", - "minLength": 1 - }, - "resourceGroupName": { - "name": "resourceGroupName", - "description": "Resource group name where the resource is created.", - "type": "string", - "in": "path", - "required": true, - "x-ms-parameter-location": "method" - }, - "api-version": { - "name": "api-version", - "description": "client API version", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "2023-07-12-preview" - ], - "x-ms-enum": { - "name": "api-version", - "modelAsString": true - } - }, - "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" - ], - "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 - } - }, - "description": { - "description": "filter by alert rule description", - "name": "description", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "alertRuleId": { - "description": "filter by alert rule id", - "name": "alertRuleId", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "actionGroup": { - "description": "filter by action group configured as part of action rule", - "name": "actionGroup", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "actionRuleName": { - "description": "filter by action rule name", - "name": "name", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - }, - "impactedScope": { - "description": "filter by impacted/target scope (provide comma separated list for multiple scopes). The value should be an well constructed ARM id of the scope.", - "name": "impactedScope", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method" - } - }, - "definitions": { - "errorResponse": { - "description": "An error response from the service.", - "properties": { - "error": { - "$ref": "#/definitions/errorResponseBody" - } - } - }, - "errorResponseBody": { - "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" - } - } - } - }, - "Resource": { - "x-ms-azure-resource": true, - "description": "An azure resource object", - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "Azure resource Id" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" - }, - "name": { - "type": "string", - "readOnly": true, - "description": "Azure resource name" - } - } - }, - "ManagedResource": { - "description": "An azure managed resource object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "location": { - "type": "string", - "description": "Resource location", - "x-ms-mutability": [ - "create", - "read" - ] - }, - "tags": { - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ] - }, - "Scope": { - "type": "object", - "description": "Target scope for a given action rule. By default scope will be the subscription. User can also provide list of resource groups or list of resources from the scope subscription as well.", - "properties": { - "scopeType": { - "type": "string", - "description": "type of target scope", - "enum": [ - "ResourceGroup", - "Resource", - "Subscription" - ], - "x-ms-enum": { - "name": "ScopeType", - "modelAsString": true - } - }, - "values": { - "type": "array", - "description": "list of ARM IDs of the given scope type which will be the target of the given action rule.", - "items": { - "type": "string" - } - } - } - }, - "Condition": { - "type": "object", - "description": "condition to trigger an action rule", - "properties": { - "operator": { - "type": "string", - "description": "operator for a given condition", - "enum": [ - "Equals", - "NotEquals", - "Contains", - "DoesNotContain" - ], - "x-ms-enum": { - "name": "Operator", - "modelAsString": true - } - }, - "values": { - "type": "array", - "description": "list of values to match for a given condition.", - "items": { - "type": "string" - } - } - } - }, - "Conditions": { - "type": "object", - "description": "Conditions in alert instance to be matched for a given action rule. Default value is all. Multiple values could be provided with comma separation.", - "properties": { - "severity": { - "description": "filter alerts by severity", - "$ref": "#/definitions/Condition" - }, - "monitorService": { - "description": "filter alerts by monitor service", - "$ref": "#/definitions/Condition" - }, - "monitorCondition": { - "description": "filter alerts by monitor condition", - "$ref": "#/definitions/Condition" - }, - "targetResourceType": { - "description": "filter alerts by target resource type", - "$ref": "#/definitions/Condition" - }, - "alertRuleId": { - "description": "filter alerts by alert rule id", - "$ref": "#/definitions/Condition" - }, - "alertRuleName": { - "description": "filter alerts by alert rule name", - "$ref": "#/definitions/Condition" - }, - "description": { - "description": "filter alerts by alert rule description", - "$ref": "#/definitions/Condition" - }, - "alertContext": { - "description": "filter alerts by alert context (payload)", - "$ref": "#/definitions/Condition" - } - } - }, - "SuppressionConfig": { - "type": "object", - "description": "Suppression logic for a given action rule", - "required": [ - "recurrenceType" - ], - "properties": { - "recurrenceType": { - "type": "string", - "description": "Specifies when the suppression should be applied", - "enum": [ - "Always", - "Once", - "Daily", - "Weekly", - "Monthly" - ], - "x-ms-enum": { - "name": "SuppressionType", - "modelAsString": true - } - }, - "schedule": { - "description": "suppression schedule configuration", - "$ref": "#/definitions/SuppressionSchedule" - } - } - }, - "SuppressionSchedule": { - "type": "object", - "description": "Schedule for a given suppression configuration.", - "properties": { - "startDate": { - "type": "string", - "description": "Start date for suppression" - }, - "endDate": { - "type": "string", - "description": "End date for suppression" - }, - "startTime": { - "type": "string", - "description": "Start time for suppression" - }, - "endTime": { - "type": "string", - "description": "End date for suppression" - }, - "recurrenceValues": { - "type": "array", - "description": "Specifies the values for recurrence pattern", - "items": { - "type": "integer" - } - } - } - }, - "ActionRule": { - "description": "Action rule object containing target scope, conditions and suppression logic", - "allOf": [ - { - "$ref": "#/definitions/ManagedResource" - } - ], - "properties": { - "properties": { - "description": "action rule properties", - "$ref": "#/definitions/ActionRuleProperties" - } - } - }, - "ActionRuleProperties": { - "description": "Action rule properties defining scope, conditions, suppression logic for action rule", - "discriminator": "type", - "required": [ - "type" - ], - "properties": { - "scope": { - "description": "scope on which action rule will apply", - "$ref": "#/definitions/Scope" - }, - "conditions": { - "description": "conditions on which alerts will be filtered", - "$ref": "#/definitions/Conditions" - }, - "description": { - "type": "string", - "description": "Description of action rule" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "description": "Creation time of action rule. Date-Time in ISO-8601 format.", - "readOnly": true - }, - "lastModifiedAt": { - "type": "string", - "format": "date-time", - "description": "Last updated time of action rule. Date-Time in ISO-8601 format.", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "Created by user name.", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "Last modified by user name.", - "readOnly": true - }, - "status": { - "type": "string", - "description": "Indicates if the given action rule is enabled or disabled", - "enum": [ - "Enabled", - "Disabled" - ], - "x-ms-enum": { - "name": "ActionRuleStatus", - "modelAsString": true - } - }, - "type": { - "type": "string", - "description": "Indicates type of action rule", - "enum": [ - "Suppression", - "ActionGroup", - "Diagnostics" - ], - "x-ms-enum": { - "name": "ActionRuleType", - "modelAsString": true - } - } - } - }, - "Suppression": { - "title": "Suppression based Action Rule", - "description": "Action rule with suppression configuration", - "required": [ - "suppressionConfig" - ], - "allOf": [ - { - "$ref": "#/definitions/ActionRuleProperties" - }, - { - "type": "object", - "properties": { - "suppressionConfig": { - "description": "suppression configuration for the action rule", - "$ref": "#/definitions/SuppressionConfig" - } - } - } - ] - }, - "ActionGroup": { - "title": "Action Group based Action Rule", - "description": "Action rule with action group configuration", - "required": [ - "actionGroupId" - ], - "allOf": [ - { - "$ref": "#/definitions/ActionRuleProperties" - }, - { - "type": "object", - "properties": { - "actionGroupId": { - "type": "string", - "description": "Action group to trigger if action rule matches" - } - } - } - ] - }, - "Diagnostics": { - "title": "Diagnostics based Action Rule", - "description": "Action rule with diagnostics configuration", - "allOf": [ - { - "$ref": "#/definitions/ActionRuleProperties" - }, - { - "type": "object" - } - ] - }, - "ActionRulesList": { - "description": "List of action rules", - "properties": { - "nextLink": { - "type": "string", - "description": "URL to fetch the next set of action rules" - }, - "value": { - "type": "array", - "description": "List of action rules", - "items": { - "$ref": "#/definitions/ActionRule" - } - } - } - }, - "PatchProperties": { - "description": "Action rule properties supported by patch", - "properties": { - "status": { - "type": "string", - "description": "Indicates if the given action rule is enabled or disabled", - "enum": [ - "Enabled", - "Disabled" - ], - "x-ms-enum": { - "name": "ActionRuleStatus", - "modelAsString": true - } - } - } - }, - "PatchObject": { - "description": "Data contract for patch", - "properties": { - "properties": { - "x-ms-client-flatten": true, - "description": "properties supported by patch operation", - "$ref": "#/definitions/PatchProperties" - }, - "tags": { - "type": "object", - "description": "tags to be updated" - } - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json deleted file mode 100644 index 59f7c5d16065..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json +++ /dev/null @@ -1,739 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2023-07-12-preview", - "title": "Azure Alerts Management Service Resource Provider", - "description": "APIs for Azure Smart Groups CRUD operations." - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups": { - "get": { - "operationId": "SmartGroups_GetAll", - "summary": "Get all Smart Groups within a specified subscription", - "description": "List all the Smart Groups within a specified subscription. ", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/targetResource" - }, - { - "$ref": "#/parameters/targetResourceGroup" - }, - { - "$ref": "#/parameters/targetResourceType" - }, - { - "$ref": "#/parameters/monitorService" - }, - { - "$ref": "#/parameters/monitorCondition" - }, - { - "$ref": "#/parameters/severity" - }, - { - "$ref": "#/parameters/smartGroupState" - }, - { - "$ref": "#/parameters/timeRange" - }, - { - "$ref": "#/parameters/pageCount" - }, - { - "$ref": "#/parameters/smartGroupsSortBy" - }, - { - "$ref": "#/parameters/sortOrder" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK. Returns list of all smartGroups.", - "schema": { - "$ref": "#/definitions/smartGroupsList", - "description": "List of smart groups in value property." - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "List": { - "$ref": "./examples/SmartGroups_List.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}": { - "get": { - "operationId": "SmartGroups_GetById", - "summary": "Get information related to a specific Smart Group.", - "description": "Get information related to a specific Smart Group.", - "produces": [ - "application/json" - ], - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/smartGroupId" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Returns the group with the specified smart group Id.", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/smartGroup" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "Get": { - "$ref": "./examples/SmartGroups_GetById.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/changeState": { - "post": { - "operationId": "SmartGroups_ChangeState", - "description": "Change the state of a Smart Group.", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/smartGroupId" - }, - { - "$ref": "#/parameters/api-version" - }, - { - "$ref": "#/parameters/newState" - } - ], - "responses": { - "200": { - "description": "OK. Smart Group state updated.", - "headers": { - "x-ms-request-id": { - "type": "string", - "description": "Service generated Request ID." - } - }, - "schema": { - "$ref": "#/definitions/smartGroup" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "changestate": { - "$ref": "./examples/SmartGroups_ChangeState.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/history": { - "get": { - "operationId": "SmartGroups_GetHistory", - "description": "Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) .", - "parameters": [ - { - "$ref": "#/parameters/subscriptionId" - }, - { - "$ref": "#/parameters/smartGroupId" - }, - { - "$ref": "#/parameters/api-version" - } - ], - "responses": { - "200": { - "description": "OK. Returns the list of changes of smart group.", - "schema": { - "$ref": "#/definitions/smartGroupModification" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/errorResponse" - } - } - }, - "x-ms-examples": { - "Resolve": { - "$ref": "./examples/SmartGroups_History.json" - } - } - } - } - }, - "parameters": { - "subscriptionId": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of the target subscription.", - "minLength": 1 - }, - "api-version": { - "name": "api-version", - "description": "client API version", - "type": "string", - "in": "query", - "required": true, - "enum": [ - "2023-07-12-preview" - ], - "x-ms-enum": { - "name": "api-version", - "modelAsString": true - } - }, - "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" - ], - "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 - } - }, - "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 - } - }, - "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-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 - } - }, - "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 - } - }, - "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" - }, - "smartGroupsSortBy": { - "description": "Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.", - "name": "sortBy", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "enum": [ - "alertsCount", - "state", - "severity", - "startDateTime", - "lastModifiedDateTime" - ], - "x-ms-enum": { - "name": "SmartGroupsSortByFields", - "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 - } - } - }, - "definitions": { - "errorResponse": { - "description": "An error response from the service.", - "properties": { - "error": { - "$ref": "#/definitions/errorResponseBody" - } - } - }, - "errorResponseBody": { - "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" - } - } - } - }, - "Resource": { - "x-ms-azure-resource": true, - "description": "An azure resource object", - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "Azure resource Id" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" - }, - "name": { - "type": "string", - "readOnly": true, - "description": "Azure resource name" - } - } - }, - "smartGroupModification": { - "type": "object", - "description": "Alert Modification details", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "$ref": "#/definitions/smartGroupModificationProperties" - } - } - }, - "smartGroupModificationProperties": { - "type": "object", - "description": "Properties of the smartGroup modification item.", - "properties": { - "smartGroupId": { - "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" - } - }, - "nextLink": { - "description": "URL to fetch the next set of results.", - "type": "string" - } - } - }, - "smartGroupModificationItem": { - "type": "object", - "description": "smartGroup modification item.", - "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" - } - } - }, - "smartGroupsList": { - "type": "object", - "description": "List the alerts.", - "properties": { - "nextLink": { - "description": "URL to fetch the next set of alerts.", - "type": "string" - }, - "value": { - "description": "List of alerts", - "type": "array", - "items": { - "$ref": "#/definitions/smartGroup" - } - } - } - }, - "smartGroup": { - "type": "object", - "description": "Set of related alerts grouped together smartly by AMS.", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/smartGroupProperties" - } - } - }, - "smartGroupProperties": { - "type": "object", - "description": "Properties of smart group.", - "properties": { - "alertsCount": { - "type": "integer", - "format": "int64", - "description": "Total number of alerts in smart group" - }, - "smartGroupState": { - "type": "string", - "description": "Smart group state", - "readOnly": true, - "enum": [ - "New", - "Acknowledged", - "Closed" - ], - "x-ms-enum": { - "name": "State", - "modelAsString": true - } - }, - "severity": { - "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 - } - }, - "startDateTime": { - "type": "string", - "format": "date-time", - "description": "Creation time of smart group. Date-Time in ISO-8601 format.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "Last updated time of smart group. Date-Time in ISO-8601 format.", - "readOnly": true - }, - "lastModifiedUserName": { - "type": "string", - "description": "Last modified by user name.", - "readOnly": true - }, - "resources": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of target resources in the smart group" - }, - "resourceTypes": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of target resource types in the smart group" - }, - "resourceGroups": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of target resource groups in the smart group" - }, - "monitorServices": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of monitorServices in the smart group" - }, - "monitorConditions": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of monitorConditions in the smart group" - }, - "alertStates": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "type": "array", - "description": "Summary of alertStates in the smart group" - }, - "alertSeverities": { - "items": { - "$ref": "#/definitions/smartGroupAggregatedProperty" - }, - "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." - } - } - }, - "smartGroupAggregatedProperty": { - "type": "object", - "description": "Aggregated property of each type", - "properties": { - "name": { - "type": "string", - "description": "Name of the type." - }, - "count": { - "type": "integer", - "format": "int64", - "description": "Total number of items of type." - } - } - } - } -} From 3ad89592090be98e2748c91296f1672201a89cde Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:32:21 +0300 Subject: [PATCH 08/22] cont --- .../preview/2023-07-12-preview/AlertsManagement.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index c4b94bfcca78..bdda4e6609d4 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -1317,7 +1317,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/ProxyResource" + "$ref": "#/definitions/Resource" } ], "properties": { From da412a4d3b75a84ca0e059d45f2c73d5635afe87 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:40:46 +0300 Subject: [PATCH 09/22] cont --- .../2023-07-12-preview/examples/Alerts_GetEnrichments.json | 2 +- .../2023-07-12-preview/examples/Alerts_ListEnrichments.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json index ffbf7368b0b0..2e4fb6bc1a75 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", + "subscriptionId": "72fa99ef-9c84-4a7c-b343-ec62da107d81", "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json index 3e577adb105e..9104523727b9 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", + "subscriptionId": "72fa99ef-9c84-4a7c-b343-ec62da107d81", "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" }, "responses": { From a0cc839f6f462cc84b1bd1b63bb72f6f95a0f005 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 11:49:59 +0300 Subject: [PATCH 10/22] cont --- .../ActionRules_Create_SuppressionRule.json | 123 --------------- .../examples/ActionRules_Delete.json | 13 -- .../examples/ActionRules_GetById.json | 71 --------- .../ActionRules_List_ResourceGroup.json | 114 -------------- .../ActionRules_List_Subscription.json | 105 ------------- .../examples/ActionRules_Patch.json | 81 ---------- .../examples/SmartGroups_ChangeState.json | 74 --------- .../examples/SmartGroups_GetById.json | 70 --------- .../examples/SmartGroups_History.json | 30 ---- .../examples/SmartGroups_List.json | 145 ------------------ .../resource-manager/readme.md | 4 +- 11 files changed, 1 insertion(+), 829 deletions(-) delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json deleted file mode 100644 index b7b5cc2d4d6b..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Create_SuppressionRule.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", - "resourceGroupName": "alertscorrelationrg", - "actionRuleName": "DailySuppression", - "actionRule": { - "location": "Global", - "tags": {}, - "properties": { - "scope": { - "scopeType": "ResourceGroup", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" - ] - }, - "conditions": { - "severity": { - "operator": "Equals", - "values": [ - "Sev0", - "Sev2" - ] - }, - "monitorService": { - "operator": "Equals", - "values": [ - "Platform", - "Application Insights" - ] - }, - "monitorCondition": { - "operator": "Equals", - "values": [ - "Fired" - ] - }, - "targetResourceType": { - "operator": "NotEquals", - "values": [ - "Microsoft.Compute/VirtualMachines" - ] - } - }, - "type": "Suppression", - "suppressionConfig": { - "recurrenceType": "Daily", - "schedule": { - "startDate": "12/09/2018", - "endDate": "12/18/2018", - "startTime": "06:00:00", - "endTime": "14:00:00" - } - }, - "description": "Action rule on resource group for daily suppression", - "status": "Enabled" - } - } - }, - "responses": { - "200": { - "body": { - "properties": { - "scope": { - "scopeType": "ResourceGroup", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" - ] - }, - "conditions": { - "severity": { - "operator": "Equals", - "values": [ - "Sev0", - "Sev2" - ] - }, - "monitorService": { - "operator": "Equals", - "values": [ - "Platform", - "Application Insights" - ] - }, - "monitorCondition": { - "operator": "Equals", - "values": [ - "Fired" - ] - }, - "targetResourceType": { - "operator": "NotEquals", - "values": [ - "Microsoft.Compute/VirtualMachines" - ] - } - }, - "type": "Suppression", - "suppressionConfig": { - "recurrenceType": "Daily", - "schedule": { - "startDate": "12/09/2018", - "endDate": "12/18/2018", - "startTime": "06:00:00", - "endTime": "14:00:00" - } - }, - "description": "Action rule on resource group for daily suppression", - "status": "Enabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "DailySuppression", - "location": "Global", - "tags": {} - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json deleted file mode 100644 index 99679388988f..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Delete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", - "resourceGroupName": "alertscorrelationrg", - "actionRuleName": "DailySuppression" - }, - "responses": { - "200": { - "body": true - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json deleted file mode 100644 index 2b785196fd27..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_GetById.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", - "resourceGroupName": "alertscorrelationrg", - "actionRuleName": "DailySuppression" - }, - "responses": { - "200": { - "body": { - "properties": { - "scope": { - "scopeType": "ResourceGroup", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" - ] - }, - "conditions": { - "severity": { - "operator": "Equals", - "values": [ - "Sev0", - "Sev2" - ] - }, - "monitorService": { - "operator": "Equals", - "values": [ - "Platform", - "Application Insights" - ] - }, - "monitorCondition": { - "operator": "Equals", - "values": [ - "Fired" - ] - }, - "targetResourceType": { - "operator": "NotEquals", - "values": [ - "Microsoft.Compute/VirtualMachines" - ] - } - }, - "type": "Suppression", - "suppressionConfig": { - "recurrenceType": "Daily", - "schedule": { - "startDate": "12/09/2018", - "endDate": "12/18/2018", - "startTime": "06:00:00", - "endTime": "14:00:00" - } - }, - "description": "Action rule on resource group for daily suppression", - "status": "Enabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "DailySuppression", - "location": "Global", - "tags": {} - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json deleted file mode 100644 index d3edef252104..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_ResourceGroup.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", - "resourceGroupName": "alertscorrelationrg" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules?api-version=2018-11-02-privatepreview&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", - "value": [ - { - "properties": { - "scope": { - "scopeType": "ResourceGroup", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" - ] - }, - "conditions": { - "severity": { - "operator": "Equals", - "values": [ - "Sev0", - "Sev2" - ] - }, - "monitorService": { - "operator": "Equals", - "values": [ - "Platform", - "Application Insights" - ] - }, - "targetResourceType": { - "operator": "NotEquals", - "values": [ - "Microsoft.Compute/VirtualMachines" - ] - } - }, - "type": "Suppression", - "suppressionConfig": { - "recurrenceType": "Daily", - "schedule": { - "startDate": "12/09/2018", - "endDate": "12/18/2018", - "startTime": "06:00:00", - "endTime": "14:00:00" - } - }, - "description": "Action rule on resource group for daily suppression", - "status": "Enabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "DailySuppression", - "location": "Global", - "tags": {} - }, - { - "properties": { - "scope": { - "scopeType": "Resource", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.Compute/VirtualMachines/testResource" - ] - }, - "conditions": { - "monitorCondition": { - "operator": "Equals", - "values": [ - "Fired" - ] - }, - "description": { - "operator": "Contains", - "values": [ - "Percentage CPU greater than 80%", - "Metric alert on resource foo" - ] - }, - "alertContext": { - "operator": "DoesNotContain", - "values": [ - "testresource", - "foo" - ] - } - }, - "type": "ActionGroup", - "actionGroupId": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.insights/actiongroups/testAG", - "description": "Action rule on resource group for sending email", - "status": "Enabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "WeeklySuppression", - "location": "Global", - "tags": {} - } - ] - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json deleted file mode 100644 index 7dd1c5d3845f..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_List_Subscription.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/actionRules?api-version=2018-11-02-privatepreview&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", - "value": [ - { - "properties": { - "scope": { - "scopeType": "ResourceGroup", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" - ] - }, - "conditions": { - "severity": { - "operator": "Equals", - "values": [ - "Sev0", - "Sev2" - ] - }, - "monitorService": { - "operator": "Equals", - "values": [ - "Platform", - "Application Insights" - ] - }, - "targetResourceType": { - "operator": "NotEquals", - "values": [ - "Microsoft.Compute/VirtualMachines" - ] - } - }, - "type": "Suppression", - "suppressionConfig": { - "recurrenceType": "Daily", - "schedule": { - "startDate": "12/09/2018", - "endDate": "12/18/2018", - "startTime": "06:00:00", - "endTime": "14:00:00" - } - }, - "description": "Action rule on resource group for daily suppression", - "status": "Enabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "DailySuppression", - "location": "Global", - "tags": {} - }, - { - "properties": { - "scope": { - "scopeType": "Resource", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.Compute/VirtualMachines/testResource" - ] - }, - "conditions": { - "monitorCondition": { - "operator": "Equals", - "values": [ - "Fired" - ] - }, - "description": { - "operator": "Contains", - "values": [ - "Percentage CPU greater than 80%", - "Metric alert on resource foo" - ] - } - }, - "type": "Diagnostics", - "description": "Action rule on resource group for sending diagnostics", - "status": "Enabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "WeeklySuppression", - "location": "Global", - "tags": {} - } - ] - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json deleted file mode 100644 index 3370b24d03ca..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/ActionRules_Patch.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", - "resourceGroupName": "alertscorrelationrg", - "actionRuleName": "WeeklySuppression", - "actionRulePatch": { - "tags": { - "key1": "value1", - "key2": "value2" - }, - "properties": { - "status": "Disabled" - } - } - }, - "responses": { - "200": { - "body": { - "properties": { - "scope": { - "scopeType": "ResourceGroup", - "values": [ - "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg" - ] - }, - "conditions": { - "severity": { - "operator": "Equals", - "values": [ - "Sev0", - "Sev2" - ] - }, - "monitorService": { - "operator": "Equals", - "values": [ - "Platform", - "Application Insights" - ] - }, - "targetResourceType": { - "operator": "NotEquals", - "values": [ - "Microsoft.Compute/VirtualMachines" - ] - } - }, - "suppressionConfig": { - "recurrenceType": "Weekly", - "schedule": { - "startDate": "12/09/2018", - "endDate": "12/18/2018", - "startTime": "06:00:00", - "endTime": "14:00:00", - "recurrenceValues": [ - 1, - 2 - ] - } - }, - "type": "Suppression", - "description": "Action rule on resource group for weekly suppression", - "status": "Disabled", - "createdAt": "2018-06-12T22:05:09Z", - "lastModifiedAt": "2018-06-12T22:05:09Z", - "createdBy": "abc@microsoft.com", - "lastModifiedBy": "xyz@microsoft.com" - }, - "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression", - "type": "Microsoft.AlertsManagement/actionRules", - "name": "WeeklySuppression", - "location": "Global", - "tags": { - "key1": "value1", - "key2": "value2" - } - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json deleted file mode 100644 index bc613b9afbd0..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_ChangeState.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72", - "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059", - "newState": "Acknowledged", - "body": { - "comments": "Acknowledging smart group" - } - }, - "responses": { - "200": { - "body": { - "properties": { - "alertsCount": 1942, - "smartGroupState": "Acknowledged", - "severity": "Sev3", - "startDateTime": "2018-06-06T12:35:09Z", - "lastModifiedDateTime": "2018-06-13T06:30:09Z", - "lastModifiedUserName": "System", - "resources": [ - { - "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", - "count": 1942 - } - ], - "resourceTypes": [ - { - "name": "components", - "count": 1942 - } - ], - "resourceGroups": [ - { - "name": "alertscorrelationrg", - "count": 1942 - } - ], - "monitorServices": [ - { - "name": "Application Insights", - "count": 1942 - } - ], - "monitorConditions": [ - { - "name": "Fired", - "count": 1942 - } - ], - "alertStates": [ - { - "name": "New", - "count": 1941 - }, - { - "name": "Acknowledged", - "count": 1 - } - ], - "alertSeverities": [ - { - "name": "Sev3", - "count": 1942 - } - ] - }, - "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", - "type": "Microsoft.AlertsManagement/smartGroups", - "name": "cpu alert" - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json deleted file mode 100644 index e9f8ea2b14b2..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_GetById.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", - "smartGroupId": "603675da-9851-4b26-854a-49fc53d32715" - }, - "responses": { - "200": { - "body": { - "properties": { - "alertsCount": 1942, - "smartGroupState": "New", - "severity": "Sev3", - "startDateTime": "2018-06-06T12:35:09Z", - "lastModifiedDateTime": "2018-06-13T06:30:09Z", - "lastModifiedUserName": "System", - "resources": [ - { - "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", - "count": 1942 - } - ], - "resourceTypes": [ - { - "name": "components", - "count": 1942 - } - ], - "resourceGroups": [ - { - "name": "alertscorrelationrg", - "count": 1942 - } - ], - "monitorServices": [ - { - "name": "Application Insights", - "count": 1942 - } - ], - "monitorConditions": [ - { - "name": "Fired", - "count": 1942 - } - ], - "alertStates": [ - { - "name": "New", - "count": 1941 - }, - { - "name": "Acknowledged", - "count": 1 - } - ], - "alertSeverities": [ - { - "name": "Sev3", - "count": 1942 - } - ] - }, - "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", - "type": "Microsoft.AlertsManagement/smartGroups", - "name": "cpu alert" - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json deleted file mode 100644 index b2cb153b116f..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_History.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", - "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059" - }, - "responses": { - "200": { - "body": { - "properties": { - "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059", - "modifications": [ - { - "modificationEvent": "SmartGroupCreated", - "oldValue": "", - "newValue": "", - "modifiedAt": "2018-06-06T12:35:09Z", - "modifiedBy": "System", - "comments": "", - "description": "New Smart Group is created" - } - ] - }, - "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059/history/default", - "type": "Microsoft.AlertsManagement/alerts", - "name": "cpu alert" - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json deleted file mode 100644 index 94b1218f3464..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/SmartGroups_List.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-12-preview", - "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72" - }, - "responses": { - "200": { - "body": { - "nextLink": null, - "value": [ - { - "properties": { - "alertsCount": 1942, - "smartGroupState": "New", - "severity": "Sev3", - "startDateTime": "2018-06-06T12:35:09Z", - "lastModifiedDateTime": "2018-06-13T06:30:09Z", - "lastModifiedUserName": "System", - "resources": [ - { - "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", - "count": 1942 - } - ], - "resourceTypes": [ - { - "name": "components", - "count": 1942 - } - ], - "resourceGroups": [ - { - "name": "alertscorrelationrg", - "count": 1942 - } - ], - "monitorServices": [ - { - "name": "Application Insights", - "count": 1942 - } - ], - "monitorConditions": [ - { - "name": "Fired", - "count": 1942 - } - ], - "alertStates": [ - { - "name": "New", - "count": 1941 - }, - { - "name": "Acknowledged", - "count": 1 - } - ], - "alertSeverities": [ - { - "name": "Sev3", - "count": 1942 - } - ] - }, - "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", - "type": "Microsoft.AlertsManagement/smartGroups", - "name": "cpu alert" - }, - { - "properties": { - "alertsCount": 15374, - "smartGroupState": "Acknowledged", - "severity": "Sev0", - "startDateTime": "2018-05-17T10:18:44.2020997Z", - "lastModifiedDateTime": "2018-06-13T06:29:01Z", - "lastModifiedUserName": "System", - "resources": [ - { - "name": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/alertsint", - "count": 15374 - } - ], - "resourceTypes": [ - { - "name": "microsoft.operationalinsights/workspaces", - "count": 6912 - }, - { - "name": "workspaces", - "count": 8462 - } - ], - "resourceGroups": [ - { - "name": "mms-eus", - "count": 15374 - } - ], - "monitorServices": [ - { - "name": "Log Analytics", - "count": 13911 - } - ], - "monitorConditions": [ - { - "name": "Fired", - "count": 15374 - } - ], - "alertStates": [ - { - "name": "New", - "count": 15358 - }, - { - "name": "Acknowledged", - "count": 12 - }, - { - "name": "Closed", - "count": 4 - } - ], - "alertSeverities": [ - { - "name": "Sev0", - "count": 6984 - }, - { - "name": "Sev1", - "count": 6927 - } - ] - }, - "id": "/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/01114c7c-769f-4fd4-b6fa-ab77693b83cd", - "type": "Microsoft.AlertsManagement/smartGroups", - "name": "CPU Alert" - } - ] - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index e60043484cba..066780a40ef3 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -53,9 +53,7 @@ These settings apply only when `--tag=package-preview-2023-07` is specified on t ```yaml $(tag) == 'package-preview-2023-07' input-file: - - Microsoft.AlertsManagement/preview/2023-07-12-preview/ActionRules.json - - Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json - - Microsoft.AlertsManagement/preview/2023-07-12-preview/SmartGroups.json + - Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json ``` ### Tag: package-preview-2023-05 From 5bb72a6bf0cdb1507b39aa51dea8f861d60c62cf Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 12:23:19 +0300 Subject: [PATCH 11/22] cont --- .../2023-07-12-preview/AlertsManagement.json | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index bdda4e6609d4..879b525d9a54 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -761,6 +761,7 @@ }, "definitions": { "operation": { + "type": "object", "description": "Operation provided by provider", "properties": { "name": { @@ -796,6 +797,7 @@ } }, "operationsList": { + "type": "object", "description": "Lists the operations available in the AlertsManagement RP.", "properties": { "nextLink": { @@ -807,7 +809,8 @@ "type": "array", "items": { "$ref": "#/definitions/operation" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -815,6 +818,7 @@ ] }, "errorResponse": { + "type": "object", "description": "An error response from the service.", "properties": { "error": { @@ -823,6 +827,7 @@ } }, "errorResponseBody": { + "type": "object", "description": "Details of error response.", "properties": { "code": { @@ -847,6 +852,7 @@ } }, "Resource": { + "type": "object", "x-ms-azure-resource": true, "description": "An azure resource object", "properties": { @@ -1124,7 +1130,8 @@ "description": "Modification details", "items": { "$ref": "#/definitions/alertModificationItem" - } + }, + "x-ms-identifiers": [] } } }, @@ -1213,7 +1220,8 @@ "description": "List of the items", "items": { "$ref": "#/definitions/alertsSummaryGroupItem" - } + }, + "x-ms-identifiers": [] } } }, @@ -1239,7 +1247,8 @@ "description": "List of the items", "items": { "$ref": "#/definitions/alertsSummaryGroupItem" - } + }, + "x-ms-identifiers": [] } } }, @@ -1294,7 +1303,8 @@ "type": "array", "items": { "$ref": "#/definitions/MonitorServiceDetails" - } + }, + "x-ms-identifiers": [] } } }, @@ -1357,11 +1367,13 @@ "description": "Enrichment details", "items": { "$ref": "#/definitions/alertEnrichmentItem" - } + }, + "x-ms-identifiers": [] } } }, "alertEnrichmentItem": { + "type": "object", "description": "Alert enrichment item.", "discriminator": "type", "required": [ @@ -1410,6 +1422,7 @@ } }, "PrometheusEnrichmentItem": { + "type": "object", "description": "Prometheus enrichment object.", "required": [ "linkToApi", @@ -1466,6 +1479,7 @@ } }, "PrometheusRangeQuery": { + "type": "object", "x-ms-discriminator-value": "PrometheusRangeQuery", "description": "Prometheus instant query enrichment object.", "required": [ From 1a6847c36fcd1d20eae34f6cffaaffdf94cd7843 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 14:24:28 +0300 Subject: [PATCH 12/22] trying to fix errors --- .../2023-07-12-preview/AlertsManagement.json | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 879b525d9a54..3841dd4c992b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -514,7 +514,8 @@ "ServiceHealth", "SmartDetector", "VM Insights", - "Zabbix" + "Zabbix", + "Resource Health" ], "x-ms-enum": { "name": "MonitorService", @@ -670,7 +671,6 @@ "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" @@ -729,11 +729,7 @@ "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.", @@ -1043,7 +1039,8 @@ "ServiceHealth", "SmartDetector", "VM Insights", - "Zabbix" + "Zabbix", + "Resource Health" ], "x-ms-enum": { "name": "MonitorService", @@ -1203,12 +1200,10 @@ "properties": { "total": { "type": "integer", - "format": "int64", "description": "Total count of the result set." }, "smartGroupsCount": { "type": "integer", - "format": "int64", "description": "Total count of the smart groups." }, "groupedby": { @@ -1235,7 +1230,6 @@ }, "count": { "type": "integer", - "format": "int64", "description": "Count of the aggregated field" }, "groupedby": { From 9e4f180215bf70b584f6eae87e46c6421a48b277 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 14:34:13 +0300 Subject: [PATCH 13/22] cont --- .../preview/2023-07-12-preview/AlertsManagement.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 3841dd4c992b..e329302fcc79 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -671,6 +671,7 @@ "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" @@ -729,7 +730,11 @@ "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.", @@ -1200,10 +1205,12 @@ "properties": { "total": { "type": "integer", + "format": "int64", "description": "Total count of the result set." }, "smartGroupsCount": { "type": "integer", + "format": "int64", "description": "Total count of the smart groups." }, "groupedby": { @@ -1230,6 +1237,7 @@ }, "count": { "type": "integer", + "format": "int64", "description": "Count of the aggregated field" }, "groupedby": { From 22588d89b69df68957c3ce4641476c76c4a290f9 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 15:23:49 +0300 Subject: [PATCH 14/22] cont --- .../2023-07-12-preview/AlertsManagement.json | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index e329302fcc79..569803ff1444 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -549,6 +549,14 @@ "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", @@ -593,6 +601,23 @@ "modelAsString": true } }, + "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-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", @@ -720,6 +745,25 @@ "modelAsString": true } }, + "smartGroupsSortBy": { + "description": "Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.", + "name": "sortBy", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "alertsCount", + "state", + "severity", + "startDateTime", + "lastModifiedDateTime" + ], + "x-ms-enum": { + "name": "SmartGroupsSortByFields", + "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", From 0e28e24a960470349203482371882ca784895d99 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 17:45:35 +0300 Subject: [PATCH 15/22] cont --- .../2023-07-12-preview/AlertsManagement.json | 37 ++++++++++++------- .../examples/Alerts_GetEnrichments.json | 2 +- .../examples/Alerts_ListEnrichments.json | 2 +- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 569803ff1444..d317a7fcd9da 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -99,13 +99,13 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts": { + "/{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. ", "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/targetResource" @@ -189,7 +189,7 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { "get": { "operationId": "Alerts_GetById", "summary": "Get a specific alert.", @@ -199,7 +199,7 @@ ], "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/alertId" @@ -229,13 +229,13 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { "post": { "operationId": "Alerts_ChangeState", "description": "Change the state of an alert.", "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/alertId" @@ -271,13 +271,13 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { + "/{scope}/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) and alert state changes (New/Acknowledged/Closed).", "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/alertId" @@ -307,13 +307,13 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertsSummary": { + "/{scope}/providers/Microsoft.AlertsManagement/alertsSummary": { "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).", "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/alertsSummaryGroupBy" @@ -376,13 +376,13 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments": { "get": { "operationId": "Alerts_ListEnrichments", "description": "List the enrichments of an alert. It returns a collection of one object named default.", "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/alertId" @@ -415,13 +415,13 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments/default": { + "/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/enrichments/default": { "get": { "operationId": "Alerts_GetEnrichments", "description": "Get the enrichments of an alert.", "parameters": [ { - "$ref": "#/parameters/subscriptionId" + "$ref": "#/parameters/scope" }, { "$ref": "#/parameters/alertId" @@ -453,6 +453,15 @@ } }, "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", "in": "path", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json index 2e4fb6bc1a75..ffbf7368b0b0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetEnrichments.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "72fa99ef-9c84-4a7c-b343-ec62da107d81", + "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json index 9104523727b9..3e577adb105e 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ListEnrichments.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "72fa99ef-9c84-4a7c-b343-ec62da107d81", + "scope": "subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", "alertId": "66114d64-d9d9-478b-95c9-b789d6502101" }, "responses": { From 80ecb4de93f209199d37d8f5e29c452afb3a3620 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Wed, 23 Aug 2023 17:56:43 +0300 Subject: [PATCH 16/22] cont --- .../preview/2023-07-12-preview/examples/Alerts_ChangeState.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_GetById.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_History.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_List.json | 2 +- .../preview/2023-07-12-preview/examples/Alerts_Summary.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json index 3c3bdc0354e0..4818f92ab0dd 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_ChangeState.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", "newState": "Acknowledged", "body": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json index 0fa9d95f6987..64f454ec3da7 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_GetById.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json index c3bbedc48982..92af9a6840ab 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_History.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "scope": "subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a", "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" }, "responses": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json index a9ec7b436996..84c6718764af 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_List.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" + "scope": "subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d" }, "responses": { "200": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json index 406863fbc247..ccedd6f3caff 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/examples/Alerts_Summary.json @@ -1,7 +1,7 @@ { "parameters": { "api-version": "2023-07-12-preview", - "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d", + "scope": "subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d", "groupby": "severity,alertState" }, "responses": { From ee78739ec5d0f480d3beb616ea5be4203ef67d46 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Thu, 7 Sep 2023 08:27:04 +0300 Subject: [PATCH 17/22] used v5/types.json --- .../preview/2023-07-12-preview/AlertsManagement.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index d317a7fcd9da..4b724dc42420 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -388,7 +388,7 @@ "$ref": "#/parameters/alertId" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -401,7 +401,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -427,7 +427,7 @@ "$ref": "#/parameters/alertId" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -440,7 +440,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, From 71317ab43dce37fce77915b5a371a33bae961084 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Thu, 7 Sep 2023 08:52:19 +0300 Subject: [PATCH 18/22] Used Resource definition from common-types --- .../preview/2023-07-12-preview/AlertsManagement.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 4b724dc42420..18711e4b4c05 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -1382,7 +1382,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/Resource" } ], "properties": { From 29573428984f80189ca883ef275b3ec4bd425c7e Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Thu, 7 Sep 2023 09:32:32 +0300 Subject: [PATCH 19/22] Updated descriptions. --- .../preview/2023-07-12-preview/AlertsManagement.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 18711e4b4c05..8133ea254337 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -1414,7 +1414,7 @@ "properties": { "alertId": { "type": "string", - "description": "Unique Id of the alert for which the enrichments are being retrieved.", + "description": "Unique Id (GUID) of the alert for which the enrichments are being retrieved.", "readOnly": true }, "enrichments": { @@ -1493,7 +1493,7 @@ "properties": { "linkToApi": { "type": "string", - "description": "Link to Prometheus query API." + "description": "Link to Prometheus query API (Url format)." }, "datasources": { "type": "array", From a62f59c488d74baedcf46deff0a724c892181e77 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Fri, 8 Sep 2023 12:54:55 +0300 Subject: [PATCH 20/22] set "x-ms-parameter-location": "method" for "scope" parameter --- .../preview/2023-07-12-preview/AlertsManagement.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json index 8133ea254337..6f7db7f3373d 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2023-07-12-preview/AlertsManagement.json @@ -460,7 +460,7 @@ "in": "path", "required": true, "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" + "x-ms-parameter-location": "method" }, "subscriptionId": { "name": "subscriptionId", From 26ce8b387e5763933a08e645f8b192659af48286 Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Thu, 14 Sep 2023 09:12:24 +0300 Subject: [PATCH 21/22] Suppress lint err --- specification/alertsmanagement/resource-manager/readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 066780a40ef3..4eddae33341e 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -35,6 +35,10 @@ directive: reason: The rule applied incorrectly to base class. where: - $.definitions.ManagedResource + - suppress: TopLevelResourcesListBySubscription + reason: The list by scope includes also list by subscription. + where: + - $.definitions.ManagedResource ``` ``` yaml From 3f292ff8cd466a7453b85786d3c494b06a67f17f Mon Sep 17 00:00:00 2001 From: Noa Neumark Tel-Nir Date: Thu, 14 Sep 2023 09:24:00 +0300 Subject: [PATCH 22/22] another try to suppress lint err --- specification/alertsmanagement/resource-manager/readme.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 4eddae33341e..b08f5805de74 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -36,9 +36,8 @@ directive: where: - $.definitions.ManagedResource - suppress: TopLevelResourcesListBySubscription - reason: The list by scope includes also list by subscription. - where: - - $.definitions.ManagedResource + reason: The list by scope includes also list by subscription, this is an extension resource. + from: AlertsManagement.json ``` ``` yaml