From ab158136440f1942a26a91ce23c26d8d6d94a7ed Mon Sep 17 00:00:00 2001 From: Noam Dishon <30979046+dishonono@users.noreply.github.com> Date: Thu, 28 Jan 2021 15:39:52 +0200 Subject: [PATCH 01/15] Adds base for updating Microsoft.AlertsManagement from version preview/2020-08-04-preview to version 2021-01-01-preview --- .../2021-01-01-preview/AlertsManagement.json | 117 ++++ .../ResourceHealthAlertRules.json | 593 ++++++++++++++++++ ...createOrUpdateResourceHealthAlertRule.json | 81 +++ .../deleteResourceHealthAlertRule.json | 12 + .../examples/getResourceHealthAlertRule.json | 54 ++ .../listResourceHealthAlertRules.json | 57 ++ .../patchResourceHealthAlertRule.json | 92 +++ 7 files changed, 1006 insertions(+) create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json new file mode 100644 index 000000000000..9b17f3d56e34 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json @@ -0,0 +1,117 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-08-04-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/ApiVersionParameter" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Successfully retrieved operations list.", + "schema": { + "$ref": "#/definitions/operationsList" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "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" + } + } + } + } + }, + "operationsList": { + "description": "Lists the operations available in the AlertsManagement RP.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of operations.", + "type": "string" + }, + "value": { + "description": "Array of operations", + "type": "array", + "items": { + "$ref": "#/definitions/operation" + } + } + }, + "required": [ + "value" + ] + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json new file mode 100644 index 000000000000..82b212290f05 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json @@ -0,0 +1,593 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-08-04-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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules": { + "get": { + "tags": [ + "HealthAlerts" + ], + "description": "Retrieve health alert rule definitions in a subscription.", + "operationId": "HealthAlerts_ListBySubscription", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of health alerts", + "schema": { + "$ref": "#/definitions/HealthAlertResourceCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "ListResourceHealthAlertRules": { + "$ref": "./examples/listResourceHealthAlertRules.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules": { + "get": { + "tags": [ + "HealthAlerts" + ], + "description": "Retrieve alert rule definitions in a resource group.", + "operationId": "HealthAlerts_ListByResourceGroup", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of health alerts", + "schema": { + "$ref": "#/definitions/HealthAlertResourceCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "ListResourceHealthAlertRules": { + "$ref": "./examples/listResourceHealthAlertRules.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules/{ruleName}": { + "get": { + "tags": [ + "HealthAlerts" + ], + "description": "Retrieve an alert rule definition.", + "operationId": "HealthAlerts_Get", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of health alerts", + "schema": { + "$ref": "#/definitions/HealthAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "GetResourceHealthAlertRuleRule": { + "$ref": "./examples/getResourceHealthAlertRule.json" + } + } + }, + "put": { + "tags": [ + "HealthAlerts" + ], + "description": "Create or update an health alert definition.", + "operationId": "HealthAlerts_CreateOrUpdate", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/HealthAlertResource" + }, + "description": "The parameters of the rule to create or update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "CreateResourceHealthAlertRule": { + "$ref": "./examples/createOrUpdateResourceHealthAlertRule.json" + } + } + }, + "patch": { + "tags": [ + "HealthAlerts" + ], + "description": "Update an health alert definition.", + "operationId": "HealthAlerts_Update", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/HealthAlertResourcePatch" + }, + "description": "The parameters of the rule to update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "PatchResourceHealthAlertRule": { + "$ref": "./examples/patchResourceHealthAlertRule.json" + } + } + }, + "delete": { + "tags": [ + "HealthAlerts" + ], + "description": "Delete an alert rule definition.", + "operationId": "HealthAlerts_Delete", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request to delete an health alert rule" + }, + "204": { + "description": "No content: the request was successful, but the response is empty" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "DeleteResourceHealthAlertRule": { + "$ref": "./examples/deleteResourceHealthAlertRule.json" + } + } + } + } + }, + "definitions": { + "Resource": { + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ], + "x-ms-azure-resource": true, + "description": "An azure resource object" + }, + "HealthAlertAction": { + "description": "An alert action.", + "properties": { + "actionGroupId": { + "type": "string", + "description": "the id of the action group to use." + }, + "webHookProperties": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload." + }, + "description": "The properties of a webhook object." + } + } + }, + "HealthAlertProperties": { + "required": [ + "enabled", + "description", + "criteria" + ], + "properties": { + "description": { + "type": "string", + "description": "the description of the health alert that will be included in the alert email." + }, + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the health alert is enabled." + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the list of resource id's that this health alert is scoped to." + }, + "criteria": { + "$ref": "#/definitions/HealthAlertCriteria", + "description": "defines the specific alert criteria information." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthAlertAction" + }, + "description": "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved." + }, + "lastUpdatedTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "Last time the rule was updated in ISO8601 format." + } + }, + "description": "An alert rule." + }, + "HealthAlertResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/HealthAlertProperties", + "description": "The alert rule properties of the resource." + } + }, + "description": "The health alert resource." + }, + "HealthAlertResourcePatch": { + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/HealthAlertProperties", + "description": "The alert rule properties of the resource." + } + }, + "description": "The health alert resource for patch operations." + }, + "HealthAlertResourceCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthAlertResource" + }, + "description": "the values for the alert rule resources." + } + }, + "description": "Represents a collection of alert rule resources." + }, + "HealthAlertCriteria": { + "type": "object", + "properties": { + "allOf": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthAlertCriterion" + }, + "description": "The list of metric criteria for this 'all of' operation. " + } + }, + "description": "Specifies the resource health alert criteria for a single resource that has multiple metric criteria." + }, + "HealthAlertCriterion": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "discriminator": "namespace", + "properties": { + "namespace": { + "type": "string", + "enum": [ + "GuestVmHealth" + ], + "x-ms-enum": { + "name": "HealthAlertsNamespace", + "modelAsString": true + }, + "description": "specifies the type of the alert criterion." + } + }, + "required": [ + "namespace" + ], + "description": "The rule criterion that defines the conditions of the alert rule." + }, + "VmGuestHealthAlertCriterion": { + "x-ms-discriminator-value": "GuestVmHealth", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/HealthAlertCriterion" + } + ], + "properties": { + "monitorNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Names of health monitor on which to define alert" + }, + "monitorTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Names of health monitor type on which to define alert" + }, + "healthStates": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthState" + }, + "description": "Health states to alert on" + } + }, + "required": [ + "healthStates" + ], + "description": "Specifies the health alert criteria to alert on." + }, + "HealthState": { + "type": "object", + "properties": { + "healthStateName": { + "type": "string", + "description": "Health state name", + "enum": [ + "Warning", + "Critical" + ], + "x-ms-enum": { + "name": "HealthStateName", + "modelAsString": true + } + }, + "severity": { + "type": "integer", + "format": "int64", + "description": "Severity of alert fired" + } + }, + "required": [ + "healthStateName", + "severity" + ], + "description": "Specifies the health state to alert on and the corresponding severity" + }, + "HealthAlertsErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/HealthAlertsErrorResponseBody" + } + } + }, + "HealthAlertsErrorResponseBody": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "RuleNameParameter": { + "name": "ruleName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the rule.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json new file mode 100644 index 000000000000..199a988ca62d --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "highcpu", + "api-version": "2020-08-04-preview", + "parameters": { + "location": "global", + "properties": { + "description": "This is the description of the rule1", + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "criteria": { + "allOf": [ + { + "monitorNames": [ + "root" + ], + "healthStates": [ + { + "name": "Critical", + "severity": 2 + }, + { + "name": "Warning", + "severity": 3 + } + ], + "namespace": "GuestVmHealth" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", + "type": "Microsoft.AlertsManagement/resourceHealthAlerts", + "location": "global", + "properties": { + "description": "This is the description of the first rule", + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "criteria": { + "allOf": [ + { + "monitorNames": "root", + "namespace": "GuestVmHealth" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json new file mode 100644 index 000000000000..0d5dfed02952 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "highcpu", + "api-version": "2018-03-01" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json new file mode 100644 index 000000000000..96ce9b3e6cec --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "highcpu", + "api-version": "2020-08-04-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", + "type": "Microsoft.AlertsManagement/resourceHealthAlerts", + "location": "global", + "properties": { + "description": "This is the description of the rule1", + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "criteria": { + "allOf": [ + { + "monitorNames": [ + "root" + ], + "healthStates": [ + { + "name": "Critical", + "severity": 2 + }, + { + "name": "Warning", + "severity": 3 + } + ], + "namespace": "GuestVmHealth" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json new file mode 100644 index 000000000000..10d0ac94ba11 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "api-version": "2020-08-04-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", + "type": "Microsoft.AlertsManagement/resourceHealthAlerts", + "location": "global", + "properties": { + "description": "This is the description of the first rule", + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "criteria": { + "allOf": [ + { + "monitorNames": [ + "root" + ], + "healthStates": [ + { + "name": "Critical", + "severity": 2 + }, + { + "name": "Warning", + "severity": 3 + } + ], + "namespace": "GuestVmHealth" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json new file mode 100644 index 000000000000..4c80833897c5 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "ruleName": "highcpu", + "api-version": "2020-08-04-preview", + "parameters": { + "properties": { + "description": "This is the description of the rule1", + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "criteria": { + "allOf": [ + { + "monitorNames": [ + "root" + ], + "healthStates": [ + { + "name": "Critical", + "severity": 2 + }, + { + "name": "Warning", + "severity": 3 + } + ], + "namespace": "GuestVmHealth" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", + "type": "Microsoft.AlertsManagement/resourceHealthAlerts", + "location": "global", + "properties": { + "description": "This is the description of the rule1", + "enabled": true, + "scopes": [ + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" + ], + "criteria": { + "allOf": [ + { + "monitorNames": [ + "root" + ], + "healthStates": [ + { + "name": "Critical", + "severity": 2 + }, + { + "name": "Warning", + "severity": 3 + } + ], + "namespace": "GuestVmHealth" + } + ] + }, + "actions": [ + { + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", + "webHookProperties": { + "key11": "value11", + "key12": "value12" + } + } + ] + } + } + } + } +} From 2b67d46f21ee92f8a96a6e874da43c0a78e7f605 Mon Sep 17 00:00:00 2001 From: Noam Dishon <30979046+dishonono@users.noreply.github.com> Date: Thu, 28 Jan 2021 15:40:13 +0200 Subject: [PATCH 02/15] Updates readme --- .../alertsmanagement/resource-manager/readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 8ff3b9b877a2..98b405ba1d0b 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -44,6 +44,16 @@ openapi-type: arm tag: package-2019-06-preview ``` + +### Tag: package-preview-2021-01 + +These settings apply only when `--tag=package-preview-2021-01` is specified on the command line. + +```yaml $(tag) == 'package-preview-2021-01' +input-file: + - Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json + - Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json +``` ### Tag: package-2019-06-preview These settings apply only when `--tag=package-2019-06-preview` is specified on the command line. From 90d47af133c264657ffac5c669b611eb2e1c1eec Mon Sep 17 00:00:00 2001 From: Noam Dishon <30979046+dishonono@users.noreply.github.com> Date: Thu, 28 Jan 2021 15:40:14 +0200 Subject: [PATCH 03/15] Updates API version in new specs and examples --- .../preview/2021-01-01-preview/AlertsManagement.json | 2 +- .../preview/2021-01-01-preview/ResourceHealthAlertRules.json | 2 +- .../examples/createOrUpdateResourceHealthAlertRule.json | 2 +- .../2021-01-01-preview/examples/getResourceHealthAlertRule.json | 2 +- .../examples/listResourceHealthAlertRules.json | 2 +- .../examples/patchResourceHealthAlertRule.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json index 9b17f3d56e34..3177163fb8b8 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2020-08-04-preview", + "version": "2021-01-01-preview", "title": "Azure Alerts Management Service Resource Provider", "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json index 82b212290f05..5e5da9fda884 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2020-08-04-preview", + "version": "2021-01-01-preview", "title": "Azure Alerts Management Service Resource Provider", "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json index 199a988ca62d..d840f9304236 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json @@ -3,7 +3,7 @@ "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", "resourceGroupName": "gigtest", "ruleName": "highcpu", - "api-version": "2020-08-04-preview", + "api-version": "2021-01-01-preview", "parameters": { "location": "global", "properties": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json index 96ce9b3e6cec..d3c9b2d6a6b5 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json @@ -3,7 +3,7 @@ "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", "resourceGroupName": "gigtest", "ruleName": "highcpu", - "api-version": "2020-08-04-preview" + "api-version": "2021-01-01-preview" }, "responses": { "200": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json index 10d0ac94ba11..837ec5914588 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", "resourceGroupName": "gigtest", - "api-version": "2020-08-04-preview" + "api-version": "2021-01-01-preview" }, "responses": { "200": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json index 4c80833897c5..186e2799dd5d 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json @@ -3,7 +3,7 @@ "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", "resourceGroupName": "gigtest", "ruleName": "highcpu", - "api-version": "2020-08-04-preview", + "api-version": "2021-01-01-preview", "parameters": { "properties": { "description": "This is the description of the rule1", From b669a8698a28e387914a931dd9d09ca40cbf591c Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 28 Jan 2021 15:44:29 +0200 Subject: [PATCH 04/15] first commit --- .../MigrateFromSmartDetections.json | 274 ++++++++ .../ResourceHealthAlertRules.json | 593 ------------------ ...createOrUpdateResourceHealthAlertRule.json | 81 --- .../deleteResourceHealthAlertRule.json | 12 - .../examples/getResourceHealthAlertRule.json | 54 -- .../listResourceHealthAlertRules.json | 57 -- .../migrateFromSmartDetectionsGet.json | 20 + .../migrateFromSmartDetectionsTrigger.json | 24 + .../patchResourceHealthAlertRule.json | 92 --- .../resource-manager/readme.md | 2 +- 10 files changed, 319 insertions(+), 890 deletions(-) create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsGet.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsTrigger.json delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json new file mode 100644 index 000000000000..f64db3fa5730 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -0,0 +1,274 @@ +{ + "swagger": "2.0", + "info": { + "version": "2021-01-01-preview", + "title": "Azure Alerts Management Service Resource Provider", + "description": "APIs for managing a migration from Smart Detection to smart alerts." + }, + "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/migrateFromSmartDetections": { + "post": { + "tags": [ + "SmartDetectionsMigration" + ], + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource.", + "operationId": "SmartDetectionsMigration_StartMigration", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SmartDetectionMigrationRequest" + }, + "description": "The parameters controlling the migration process." + } + ], + "responses": { + "202": { + "description": "Migration request was accepted. Processing will start promptly.", + "schema": { + "$ref": "#/definitions/MigrationStatusResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/MigrationErrorResponse" + } + } + }, + "x-ms-examples": { + "Migration Triggering": { + "$ref": "./examples/migrateFromSmartDetectionsTrigger.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetections/{migrationId}": { + "get": { + "tags": [ + "SmartDetectionsMigration" + ], + "description": "Retrieve the status of a migration process.", + "operationId": "SmartDetectionsMigration_Get", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/MigrationIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MigrationStatusResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/MigrationErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Migration Status": { + "$ref": "./examples/migrateFromSmartDetectionsGet.json" + } + } + } + } + }, + "definitions": { + "SmartDetectionMigrationRequest": { + "required": [ + "scope" + ], + "properties": { + "scope": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of resource IDs that the requested migration should be performed on." + }, + "actionGroupCreationPolicy": { + "type": "string", + "enum": [ + "Custom", + "Auto" + ], + "x-ms-enum": { + "name": "ActionGroupCreationPolicy", + "values": [ + { + "value": "Custom", + "description": "Create all alert rules with a custom action group that is specified in 'customActionGroupName'." + }, + { + "value": "Auto", + "description": "Automatically create an action group for each unique setting in the Smart Detection settings." + } + ], + "modelAsString": true + }, + "description": "The policy for migrating the email settings in the Smart Detection Rules into action groups. If not specified, 'Auto' policy is used." + }, + "customActionGroupName": { + "type": "string", + "description": "A custom name of an existing action group to attach to the created alert rules. Required only when actionGroupCreationPolicy is set to 'Custom'." + } + }, + "description": "The Smart Detection migration request." + }, + "MigrationStatusResponse": { + "required": [ + "id", + "status", + "scope" + ], + "properties": { + "id": { + "type": "string", + "description": "The migration process unique id." + }, + "status": { + "type": "string", + "enum": [ + "Starting", + "InProcess", + "Deploying", + "Completed", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "MigrationStatus", + "values": [ + { + "value": "Starting", + "description": "The migration was accepted and will start shortly." + }, + { + "value": "InProcess", + "description": "The migration is in progress." + }, + { + "value": "Deploying", + "description": "The migration template is deploying." + }, + { + "value": "Completed", + "description": "The migration completed successfully." + }, + { + "value": "Failed", + "description": "The migration failed." + }, + { + "value": "Canceled", + "description": "The migration was canceled by the user." + } + ], + "modelAsString": true + }, + "description": "The current status of the migration process" + }, + "scope": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of resource IDs that the requested migration should be performed on." + }, + "armDeploymentName": { + "type": "string", + "description": "The name of the ARM deployment associated with the migration process." + } + }, + "description": "A migration status response." + }, + "MigrationErrorResponse": { + "description": "API error.", + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/MigrationErrorResponseBody", + "description": "The API error body." + } + } + }, + "MigrationErrorResponseBody": { + "description": "API error body.", + "type": "object", + "properties": { + "code": { + "description": "Error code.", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client API Version." + }, + "MigrationIdParameter": { + "name": "migrationId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the migration process.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json deleted file mode 100644 index 5e5da9fda884..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json +++ /dev/null @@ -1,593 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2021-01-01-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": { - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules": { - "get": { - "tags": [ - "HealthAlerts" - ], - "description": "Retrieve health alert rule definitions in a subscription.", - "operationId": "HealthAlerts_ListBySubscription", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request for a list of health alerts", - "schema": { - "$ref": "#/definitions/HealthAlertResourceCollection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - }, - "x-ms-examples": { - "ListResourceHealthAlertRules": { - "$ref": "./examples/listResourceHealthAlertRules.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules": { - "get": { - "tags": [ - "HealthAlerts" - ], - "description": "Retrieve alert rule definitions in a resource group.", - "operationId": "HealthAlerts_ListByResourceGroup", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request for a list of health alerts", - "schema": { - "$ref": "#/definitions/HealthAlertResourceCollection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - }, - "x-ms-examples": { - "ListResourceHealthAlertRules": { - "$ref": "./examples/listResourceHealthAlertRules.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules/{ruleName}": { - "get": { - "tags": [ - "HealthAlerts" - ], - "description": "Retrieve an alert rule definition.", - "operationId": "HealthAlerts_Get", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request for a list of health alerts", - "schema": { - "$ref": "#/definitions/HealthAlertResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "GetResourceHealthAlertRuleRule": { - "$ref": "./examples/getResourceHealthAlertRule.json" - } - } - }, - "put": { - "tags": [ - "HealthAlerts" - ], - "description": "Create or update an health alert definition.", - "operationId": "HealthAlerts_CreateOrUpdate", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/HealthAlertResource" - }, - "description": "The parameters of the rule to create or update." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/HealthAlertResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "CreateResourceHealthAlertRule": { - "$ref": "./examples/createOrUpdateResourceHealthAlertRule.json" - } - } - }, - "patch": { - "tags": [ - "HealthAlerts" - ], - "description": "Update an health alert definition.", - "operationId": "HealthAlerts_Update", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/HealthAlertResourcePatch" - }, - "description": "The parameters of the rule to update." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/HealthAlertResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "PatchResourceHealthAlertRule": { - "$ref": "./examples/patchResourceHealthAlertRule.json" - } - } - }, - "delete": { - "tags": [ - "HealthAlerts" - ], - "description": "Delete an alert rule definition.", - "operationId": "HealthAlerts_Delete", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request to delete an health alert rule" - }, - "204": { - "description": "No content: the request was successful, but the response is empty" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "DeleteResourceHealthAlertRule": { - "$ref": "./examples/deleteResourceHealthAlertRule.json" - } - } - } - } - }, - "definitions": { - "Resource": { - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "Azure resource Id" - }, - "name": { - "type": "string", - "readOnly": true, - "description": "Azure resource name" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" - }, - "location": { - "type": "string", - "description": "Resource location", - "x-ms-mutability": [ - "create", - "read" - ] - }, - "tags": { - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-azure-resource": true, - "description": "An azure resource object" - }, - "HealthAlertAction": { - "description": "An alert action.", - "properties": { - "actionGroupId": { - "type": "string", - "description": "the id of the action group to use." - }, - "webHookProperties": { - "type": "object", - "additionalProperties": { - "type": "string", - "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload." - }, - "description": "The properties of a webhook object." - } - } - }, - "HealthAlertProperties": { - "required": [ - "enabled", - "description", - "criteria" - ], - "properties": { - "description": { - "type": "string", - "description": "the description of the health alert that will be included in the alert email." - }, - "enabled": { - "type": "boolean", - "description": "the flag that indicates whether the health alert is enabled." - }, - "scopes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "the list of resource id's that this health alert is scoped to." - }, - "criteria": { - "$ref": "#/definitions/HealthAlertCriteria", - "description": "defines the specific alert criteria information." - }, - "actions": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthAlertAction" - }, - "description": "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved." - }, - "lastUpdatedTime": { - "readOnly": true, - "type": "string", - "format": "date-time", - "description": "Last time the rule was updated in ISO8601 format." - } - }, - "description": "An alert rule." - }, - "HealthAlertResource": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "required": [ - "properties" - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/HealthAlertProperties", - "description": "The alert rule properties of the resource." - } - }, - "description": "The health alert resource." - }, - "HealthAlertResourcePatch": { - "properties": { - "tags": { - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/HealthAlertProperties", - "description": "The alert rule properties of the resource." - } - }, - "description": "The health alert resource for patch operations." - }, - "HealthAlertResourceCollection": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthAlertResource" - }, - "description": "the values for the alert rule resources." - } - }, - "description": "Represents a collection of alert rule resources." - }, - "HealthAlertCriteria": { - "type": "object", - "properties": { - "allOf": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthAlertCriterion" - }, - "description": "The list of metric criteria for this 'all of' operation. " - } - }, - "description": "Specifies the resource health alert criteria for a single resource that has multiple metric criteria." - }, - "HealthAlertCriterion": { - "type": "object", - "additionalProperties": { - "type": "object" - }, - "discriminator": "namespace", - "properties": { - "namespace": { - "type": "string", - "enum": [ - "GuestVmHealth" - ], - "x-ms-enum": { - "name": "HealthAlertsNamespace", - "modelAsString": true - }, - "description": "specifies the type of the alert criterion." - } - }, - "required": [ - "namespace" - ], - "description": "The rule criterion that defines the conditions of the alert rule." - }, - "VmGuestHealthAlertCriterion": { - "x-ms-discriminator-value": "GuestVmHealth", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/HealthAlertCriterion" - } - ], - "properties": { - "monitorNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Names of health monitor on which to define alert" - }, - "monitorTypes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Names of health monitor type on which to define alert" - }, - "healthStates": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthState" - }, - "description": "Health states to alert on" - } - }, - "required": [ - "healthStates" - ], - "description": "Specifies the health alert criteria to alert on." - }, - "HealthState": { - "type": "object", - "properties": { - "healthStateName": { - "type": "string", - "description": "Health state name", - "enum": [ - "Warning", - "Critical" - ], - "x-ms-enum": { - "name": "HealthStateName", - "modelAsString": true - } - }, - "severity": { - "type": "integer", - "format": "int64", - "description": "Severity of alert fired" - } - }, - "required": [ - "healthStateName", - "severity" - ], - "description": "Specifies the health state to alert on and the corresponding severity" - }, - "HealthAlertsErrorResponse": { - "description": "Describes the format of Error response.", - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/HealthAlertsErrorResponseBody" - } - } - }, - "HealthAlertsErrorResponseBody": { - "description": "Describes the format of Error response.", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string" - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string" - } - } - } - }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The Azure subscription Id." - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client Api Version." - }, - "ResourceGroupNameParameter": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group.", - "x-ms-parameter-location": "method" - }, - "RuleNameParameter": { - "name": "ruleName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the rule.", - "x-ms-parameter-location": "method" - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json deleted file mode 100644 index d840f9304236..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/createOrUpdateResourceHealthAlertRule.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "parameters": { - "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", - "resourceGroupName": "gigtest", - "ruleName": "highcpu", - "api-version": "2021-01-01-preview", - "parameters": { - "location": "global", - "properties": { - "description": "This is the description of the rule1", - "enabled": true, - "scopes": [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - "criteria": { - "allOf": [ - { - "monitorNames": [ - "root" - ], - "healthStates": [ - { - "name": "Critical", - "severity": 2 - }, - { - "name": "Warning", - "severity": 3 - } - ], - "namespace": "GuestVmHealth" - } - ] - }, - "actions": [ - { - "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } - } - ] - } - } - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", - "type": "Microsoft.AlertsManagement/resourceHealthAlerts", - "location": "global", - "properties": { - "description": "This is the description of the first rule", - "enabled": true, - "scopes": [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - "criteria": { - "allOf": [ - { - "monitorNames": "root", - "namespace": "GuestVmHealth" - } - ] - }, - "actions": [ - { - "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } - } - ] - } - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json deleted file mode 100644 index 0d5dfed02952..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/deleteResourceHealthAlertRule.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", - "resourceGroupName": "gigtest", - "ruleName": "highcpu", - "api-version": "2018-03-01" - }, - "responses": { - "200": {}, - "204": {} - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json deleted file mode 100644 index d3c9b2d6a6b5..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/getResourceHealthAlertRule.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "parameters": { - "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", - "resourceGroupName": "gigtest", - "ruleName": "highcpu", - "api-version": "2021-01-01-preview" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", - "type": "Microsoft.AlertsManagement/resourceHealthAlerts", - "location": "global", - "properties": { - "description": "This is the description of the rule1", - "enabled": true, - "scopes": [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - "criteria": { - "allOf": [ - { - "monitorNames": [ - "root" - ], - "healthStates": [ - { - "name": "Critical", - "severity": 2 - }, - { - "name": "Warning", - "severity": 3 - } - ], - "namespace": "GuestVmHealth" - } - ] - }, - "actions": [ - { - "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } - } - ] - } - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json deleted file mode 100644 index 837ec5914588..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/listResourceHealthAlertRules.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "parameters": { - "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", - "resourceGroupName": "gigtest", - "api-version": "2021-01-01-preview" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "value": [ - { - "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", - "type": "Microsoft.AlertsManagement/resourceHealthAlerts", - "location": "global", - "properties": { - "description": "This is the description of the first rule", - "enabled": true, - "scopes": [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - "criteria": { - "allOf": [ - { - "monitorNames": [ - "root" - ], - "healthStates": [ - { - "name": "Critical", - "severity": 2 - }, - { - "name": "Warning", - "severity": 3 - } - ], - "namespace": "GuestVmHealth" - } - ] - }, - "actions": [ - { - "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } - } - ] - } - } - ] - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsGet.json new file mode 100644 index 000000000000..de8e08ac4bfb --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsGet.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "subscriptionId": "70afbb35-0463-4758-badf-d5aab5bce520", + "api-version": "2021-01-01-preview", + "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "status": "Completed", + "armDeploymentName": "Migration-From-Smart-Detections-Deployment-ebf4f1bf", + "scope": [ + "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsTrigger.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsTrigger.json new file mode 100644 index 000000000000..ebc33153528d --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsTrigger.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "subscriptionId": "70afbb35-0463-4758-badf-d5aab5bce520", + "api-version": "2021-01-01-preview", + "parameters": { + "scope": [ + "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" + ], + "actionGroupCreationPolicy": "Auto" + } + }, + "responses": { + "202": { + "headers": {}, + "body": { + "id": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "status": "Starting", + "scope": [ + "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" + ] + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json deleted file mode 100644 index 186e2799dd5d..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/patchResourceHealthAlertRule.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "parameters": { - "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", - "resourceGroupName": "gigtest", - "ruleName": "highcpu", - "api-version": "2021-01-01-preview", - "parameters": { - "properties": { - "description": "This is the description of the rule1", - "enabled": true, - "scopes": [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - "criteria": { - "allOf": [ - { - "monitorNames": [ - "root" - ], - "healthStates": [ - { - "name": "Critical", - "severity": 2 - }, - { - "name": "Warning", - "severity": 3 - } - ], - "namespace": "GuestVmHealth" - } - ] - }, - "actions": [ - { - "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } - } - ] - } - } - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/Microsoft.AlertsManagement/resourceHealthAlerts/highcpu", - "type": "Microsoft.AlertsManagement/resourceHealthAlerts", - "location": "global", - "properties": { - "description": "This is the description of the rule1", - "enabled": true, - "scopes": [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - "criteria": { - "allOf": [ - { - "monitorNames": [ - "root" - ], - "healthStates": [ - { - "name": "Critical", - "severity": 2 - }, - { - "name": "Warning", - "severity": 3 - } - ], - "namespace": "GuestVmHealth" - } - ] - }, - "actions": [ - { - "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/notificationgroups/group2", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } - } - ] - } - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 98b405ba1d0b..a8124adb08db 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -52,7 +52,7 @@ These settings apply only when `--tag=package-preview-2021-01` is specified on t ```yaml $(tag) == 'package-preview-2021-01' input-file: - Microsoft.AlertsManagement/preview/2021-01-01-preview/AlertsManagement.json - - Microsoft.AlertsManagement/preview/2021-01-01-preview/ResourceHealthAlertRules.json + - Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json ``` ### Tag: package-2019-06-preview From 6c5ad148c3faed3f1ddb2208cf59e319e34278bd Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 28 Jan 2021 15:50:23 +0200 Subject: [PATCH 05/15] fix: "Client Api Version." --- .../preview/2021-01-01-preview/MigrateFromSmartDetections.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index f64db3fa5730..5b1626a699d3 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -260,7 +260,7 @@ "in": "query", "required": true, "type": "string", - "description": "Client API Version." + "description": "Client Api Version." }, "MigrationIdParameter": { "name": "migrationId", From 542294911098885a5f2ca4b827e4069b1a06671d Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 28 Jan 2021 16:58:14 +0200 Subject: [PATCH 06/15] try add x-ms-long-running-operation-options --- .../2021-01-01-preview/MigrateFromSmartDetections.json | 5 ++++- ...er.json => migrateFromSmartDetectionsStartMigration.json} | 0 2 files changed, 4 insertions(+), 1 deletion(-) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/{migrateFromSmartDetectionsTrigger.json => migrateFromSmartDetectionsStartMigration.json} (100%) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 5b1626a699d3..0fcd6144c66b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -70,7 +70,10 @@ "$ref": "./examples/migrateFromSmartDetectionsTrigger.json" } }, - "x-ms-long-running-operation": true + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "locatiion" + } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetections/{migrationId}": { diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsTrigger.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsStartMigration.json similarity index 100% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsTrigger.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsStartMigration.json From 19d5c19ef5d6a6273dc2b55b71e926344cbf2c87 Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 28 Jan 2021 17:00:55 +0200 Subject: [PATCH 07/15] some renames --- .../MigrateFromSmartDetections.json | 18 +++++++++--------- ....json => migrateFromSmartDetectionGet.json} | 0 ...grateFromSmartDetectionStartMigration.json} | 0 3 files changed, 9 insertions(+), 9 deletions(-) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/{migrateFromSmartDetectionsGet.json => migrateFromSmartDetectionGet.json} (100%) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/{migrateFromSmartDetectionsStartMigration.json => migrateFromSmartDetectionStartMigration.json} (100%) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 0fcd6144c66b..e7c74a25b9b6 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -27,13 +27,13 @@ } }, "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetections": { + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetection": { "post": { "tags": [ - "SmartDetectionsMigration" + "MigrateFromSmartDetection" ], "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource.", - "operationId": "SmartDetectionsMigration_StartMigration", + "operationId": "MigrateFromSmartDetection_StartMigration", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" @@ -67,22 +67,22 @@ }, "x-ms-examples": { "Migration Triggering": { - "$ref": "./examples/migrateFromSmartDetectionsTrigger.json" + "$ref": "./examples/migrateFromSmartDetectionStartMigration.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via": "locatiion" + "final-state-via": "location" } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetections/{migrationId}": { + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/{migrationId}": { "get": { "tags": [ - "SmartDetectionsMigration" + "MigrateFromSmartDetection" ], "description": "Retrieve the status of a migration process.", - "operationId": "SmartDetectionsMigration_Get", + "operationId": "MigrateFromSmartDetection_Get", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" @@ -110,7 +110,7 @@ }, "x-ms-examples": { "Get Migration Status": { - "$ref": "./examples/migrateFromSmartDetectionsGet.json" + "$ref": "./examples/migrateFromSmartDetectionGet.json" } } } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json similarity index 100% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsGet.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json similarity index 100% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionsStartMigration.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json From e62f880f06b4b0b45c9b08ee17bea8608c1bcb72 Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 28 Jan 2021 17:24:15 +0200 Subject: [PATCH 08/15] try to remove long operation --- .../2021-01-01-preview/MigrateFromSmartDetections.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index e7c74a25b9b6..610132bda121 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -69,10 +69,6 @@ "Migration Triggering": { "$ref": "./examples/migrateFromSmartDetectionStartMigration.json" } - }, - "x-ms-long-running-operation": true, - "x-ms-long-running-operation-options": { - "final-state-via": "location" } } }, From 66d4e73cd0ff557791641ef2a460711ba15cf435 Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 4 Feb 2021 15:51:07 +0200 Subject: [PATCH 09/15] fixes from code review --- .../2021-01-01-preview/MigrateFromSmartDetections.json | 8 ++++++-- .../examples/migrateFromSmartDetectionGet.json | 2 +- .../examples/migrateFromSmartDetectionStartMigration.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 610132bda121..8d4e29a0703e 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -108,6 +108,10 @@ "Get Migration Status": { "$ref": "./examples/migrateFromSmartDetectionGet.json" } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options" : { + "final-state-via" : "location" } } } @@ -156,12 +160,12 @@ }, "MigrationStatusResponse": { "required": [ - "id", + "migationId", "status", "scope" ], "properties": { - "id": { + "migationId": { "type": "string", "description": "The migration process unique id." }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json index de8e08ac4bfb..d8a1d833e8c0 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json @@ -8,7 +8,7 @@ "200": { "headers": {}, "body": { - "id": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "migationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", "status": "Completed", "armDeploymentName": "Migration-From-Smart-Detections-Deployment-ebf4f1bf", "scope": [ diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json index ebc33153528d..f31a264673e5 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json @@ -13,7 +13,7 @@ "202": { "headers": {}, "body": { - "id": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "migationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", "status": "Starting", "scope": [ "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" From d3f88bb1f9ac4a36dd13c7efc2fd1622eb31cb0c Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Thu, 4 Feb 2021 17:05:13 +0200 Subject: [PATCH 10/15] fix typo --- .../2021-01-01-preview/MigrateFromSmartDetections.json | 8 ++++---- .../examples/migrateFromSmartDetectionGet.json | 2 +- .../examples/migrateFromSmartDetectionStartMigration.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 8d4e29a0703e..bc36853e231f 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -110,8 +110,8 @@ } }, "x-ms-long-running-operation": true, - "x-ms-long-running-operation-options" : { - "final-state-via" : "location" + "x-ms-long-running-operation-options": { + "final-state-via": "location" } } } @@ -160,12 +160,12 @@ }, "MigrationStatusResponse": { "required": [ - "migationId", + "migrationId", "status", "scope" ], "properties": { - "migationId": { + "migrationId": { "type": "string", "description": "The migration process unique id." }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json index d8a1d833e8c0..e0951351c1bf 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json @@ -8,7 +8,7 @@ "200": { "headers": {}, "body": { - "migationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", "status": "Completed", "armDeploymentName": "Migration-From-Smart-Detections-Deployment-ebf4f1bf", "scope": [ diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json index f31a264673e5..731279627e8f 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json @@ -13,7 +13,7 @@ "202": { "headers": {}, "body": { - "migationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", "status": "Starting", "scope": [ "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" From ec28e8087bf8067a14f2303c58efc2fb075810ca Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Sun, 7 Feb 2021 10:42:55 +0200 Subject: [PATCH 11/15] code review fixes --- .../MigrateFromSmartDetections.json | 37 ++++++++++++++++--- .../migrateFromSmartDetectionGet.json | 17 ++++++--- ...grateFromSmartDetectionStartMigration.json | 21 +++++++---- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index bc36853e231f..1efaf5d04f4f 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -42,7 +42,7 @@ "$ref": "#/parameters/ApiVersionParameter" }, { - "name": "parameters", + "name": "smartDetectionMigrationRequest", "in": "body", "required": true, "schema": { @@ -69,6 +69,10 @@ "Migration Triggering": { "$ref": "./examples/migrateFromSmartDetectionStartMigration.json" } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" } } }, @@ -108,10 +112,6 @@ "Get Migration Status": { "$ref": "./examples/migrateFromSmartDetectionGet.json" } - }, - "x-ms-long-running-operation": true, - "x-ms-long-running-operation-options": { - "final-state-via": "location" } } } @@ -159,6 +159,33 @@ "description": "The Smart Detection migration request." }, "MigrationStatusResponse": { + "description": "Response for the quota submission request.", + "type": "object", + "x-ms-azure-resource": true, + "properties": { + "id": { + "description": "The migration process ID.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "The migration process name.", + "type": "string", + "readOnly": true + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Type of resource. \"Microsoft.AlertsManagement/migrateFromSmartDetection\"" + }, + "properties": { + "description": "The details of the migration response", + "x-ms-client-flatten": true, + "$ref": "#/definitions/MigrationStatusResponseProperties" + } + } + }, + "MigrationStatusResponseProperties": { "required": [ "migrationId", "status", diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json index e0951351c1bf..d68a245d50d8 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json @@ -8,12 +8,17 @@ "200": { "headers": {}, "body": { - "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", - "status": "Completed", - "armDeploymentName": "Migration-From-Smart-Detections-Deployment-ebf4f1bf", - "scope": [ - "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" - ] + "id": "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "name": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "type": "Microsoft.AlertsManagement/migrateFromSmartDetection", + "properties": { + "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "status": "Completed", + "armDeploymentName": "Migration-From-Smart-Detections-Deployment-ebf4f1bf", + "scope": [ + "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" + ] + } } } } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json index 731279627e8f..f4e6fac4de8b 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "70afbb35-0463-4758-badf-d5aab5bce520", "api-version": "2021-01-01-preview", - "parameters": { + "smartDetectionMigrationRequest": { "scope": [ "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" ], @@ -11,13 +11,20 @@ }, "responses": { "202": { - "headers": {}, + "headers": { + "location": "https://management.azure.com/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b?api-version=2021-01-01-preview" + }, "body": { - "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", - "status": "Starting", - "scope": [ - "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" - ] + "id": "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "name": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "type": "Microsoft.AlertsManagement/migrateFromSmartDetection", + "properties": { + "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "status": "Starting", + "scope": [ + "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" + ] + } } } } From 8e602df5f4c31f7ec644dee3125b7a7cdd429c02 Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Sun, 7 Feb 2021 11:13:52 +0200 Subject: [PATCH 12/15] try fix lintdiff --- .../2021-01-01-preview/MigrateFromSmartDetections.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 1efaf5d04f4f..116287da09b4 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -161,7 +161,6 @@ "MigrationStatusResponse": { "description": "Response for the quota submission request.", "type": "object", - "x-ms-azure-resource": true, "properties": { "id": { "description": "The migration process ID.", @@ -258,7 +257,8 @@ "properties": { "error": { "$ref": "#/definitions/MigrationErrorResponseBody", - "description": "The API error body." + "description": "The API error body.", + "x-ms-client-flatten": true } } }, From ef9c837bfed24bc1b53a3767dd282cfc57f39528 Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Wed, 10 Feb 2021 11:53:39 +0200 Subject: [PATCH 13/15] remove the GET from the swagger , Add 200 to the POST --- .../MigrateFromSmartDetections.json | 49 +++---------------- .../migrateFromSmartDetectionGet.json | 25 ---------- ...grateFromSmartDetectionStartMigration.json | 17 +++++++ 3 files changed, 25 insertions(+), 66 deletions(-) delete mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 116287da09b4..9fc70315e5bc 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -32,7 +32,7 @@ "tags": [ "MigrateFromSmartDetection" ], - "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource.", + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource. Use the HTTP address in the responce location header to GET the status of the migration process.", "operationId": "MigrateFromSmartDetection_StartMigration", "parameters": [ { @@ -58,6 +58,12 @@ "$ref": "#/definitions/MigrationStatusResponse" } }, + "200": { + "description": "Migration for the requested resouces was already completed.", + "schema": { + "$ref": "#/definitions/MigrationStatusResponse" + } + }, "default": { "description": "Error response describing why the operation failed.", "schema": { @@ -75,45 +81,6 @@ "final-state-via": "location" } } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/{migrationId}": { - "get": { - "tags": [ - "MigrateFromSmartDetection" - ], - "description": "Retrieve the status of a migration process.", - "operationId": "MigrateFromSmartDetection_Get", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/MigrationIdParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/MigrationStatusResponse" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/MigrationErrorResponse" - } - } - }, - "x-ms-examples": { - "Get Migration Status": { - "$ref": "./examples/migrateFromSmartDetectionGet.json" - } - } - } } }, "definitions": { @@ -163,7 +130,7 @@ "type": "object", "properties": { "id": { - "description": "The migration process ID.", + "description": "The migration resource identifier.", "type": "string", "readOnly": true }, diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json deleted file mode 100644 index d68a245d50d8..000000000000 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "subscriptionId": "70afbb35-0463-4758-badf-d5aab5bce520", - "api-version": "2021-01-01-preview", - "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b", - "name": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", - "type": "Microsoft.AlertsManagement/migrateFromSmartDetection", - "properties": { - "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", - "status": "Completed", - "armDeploymentName": "Migration-From-Smart-Detections-Deployment-ebf4f1bf", - "scope": [ - "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" - ] - } - } - } - } -} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json index f4e6fac4de8b..f8a9181eea3e 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json @@ -26,6 +26,23 @@ ] } } + }, + "200": { + "headers": { + "location": "https://management.azure.com/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b?api-version=2021-01-01-preview" + }, + "body": { + "id": "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "name": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "type": "Microsoft.AlertsManagement/migrateFromSmartDetection", + "properties": { + "migrationId": "ebf4f1bf-2f56-44b2-99b0-870867ae549b", + "status": "Completed", + "scope": [ + "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/resourceGroups/MyRg/providers/microsoft.insights/components/myai" + ] + } + } } } } From b31cfac4f0ef0f1b281f5b10f1c9d433054e697e Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Wed, 10 Feb 2021 12:08:21 +0200 Subject: [PATCH 14/15] fix spelling --- .../2021-01-01-preview/MigrateFromSmartDetections.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json index 9fc70315e5bc..6efc4980ee51 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -32,7 +32,7 @@ "tags": [ "MigrateFromSmartDetection" ], - "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource. Use the HTTP address in the responce location header to GET the status of the migration process.", + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource. Use the HTTP address in the response location header to GET the status of the migration process.", "operationId": "MigrateFromSmartDetection_StartMigration", "parameters": [ { @@ -59,7 +59,7 @@ } }, "200": { - "description": "Migration for the requested resouces was already completed.", + "description": "Migration for the requested resource was already completed.", "schema": { "$ref": "#/definitions/MigrationStatusResponse" } From 9a51dddfab0efd0abfe5d8712ab81bd6e54a2b95 Mon Sep 17 00:00:00 2001 From: Noam Dishon Date: Wed, 10 Feb 2021 13:13:11 +0200 Subject: [PATCH 15/15] remove location header from the 200 response --- .../examples/migrateFromSmartDetectionStartMigration.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json index f8a9181eea3e..f0265e776c46 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json @@ -28,9 +28,6 @@ } }, "200": { - "headers": { - "location": "https://management.azure.com/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b?api-version=2021-01-01-preview" - }, "body": { "id": "/subscriptions/70afbb35-0463-4758-badf-d5aab5bce520/providers/Microsoft.AlertsManagement/migrateFromSmartDetection/ebf4f1bf-2f56-44b2-99b0-870867ae549b", "name": "ebf4f1bf-2f56-44b2-99b0-870867ae549b",