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..3177163fb8b8 --- /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": "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": { + "/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/MigrateFromSmartDetections.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json new file mode 100644 index 000000000000..610132bda121 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/MigrateFromSmartDetections.json @@ -0,0 +1,273 @@ +{ + "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/migrateFromSmartDetection": { + "post": { + "tags": [ + "MigrateFromSmartDetection" + ], + "description": "Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource.", + "operationId": "MigrateFromSmartDetection_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/migrateFromSmartDetectionStartMigration.json" + } + } + } + }, + "/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": { + "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/examples/migrateFromSmartDetectionGet.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.json new file mode 100644 index 000000000000..de8e08ac4bfb --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionGet.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/migrateFromSmartDetectionStartMigration.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.json new file mode 100644 index 000000000000..ebc33153528d --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2021-01-01-preview/examples/migrateFromSmartDetectionStartMigration.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/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 8ff3b9b877a2..a8124adb08db 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/MigrateFromSmartDetections.json +``` ### Tag: package-2019-06-preview These settings apply only when `--tag=package-2019-06-preview` is specified on the command line.