From 24773c685796a5242117e316bbefef2755869bd3 Mon Sep 17 00:00:00 2001 From: Pratima Upadhyay Date: Sun, 19 Jul 2020 17:50:08 +0530 Subject: [PATCH] Adding new version 2020-07-01-preview for DataMove (#10059) * Adding new version 2020-07-01-preview for DataMove * Revert change in 2016-12-01 * Revert "Revert change in 2016-12-01" This reverts commit 5d13f57145b0f6d81cef446cdcbb6640221de161. * Adding missed properties in previous versions * Fix lintdiff failure * Update * Adding response code 200 for post operations in spec * Updating readme.md * Update * Fix camel casing in resource path and prettier check * Fix avocado check * Update * Adding error response confirming to ARM specification * Updating tag package * Updating ErrorResponse to NewErrorResponse * Update * Revert "Update" This reverts commit 9bbdfedc3cb32fb7e3cb5c42168049441aa28653. * Remove long running operation tag * Undo change in 2019-06-15 * Removing existing definitions from latest version * Updating according to comments * Updating path resource type name to camel case * Fixing prettier check * Update * Prettier fix --- .../stable/2020-07-01/bms.json | 453 ++++++++++++++++++ .../BackupDataMoveOperationStatus_Get.json | 20 + .../PrepareDataMoveOperationResult_Get.json | 23 + .../BackupDataMove/PrepareDataMove_Post.json | 23 + .../BackupDataMove/TriggerDataMove_Post.json | 23 + .../resource-manager/readme.md | 15 + 6 files changed, 557 insertions(+) create mode 100644 specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/bms.json create mode 100644 specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json create mode 100644 specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json create mode 100644 specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMove_Post.json create mode 100644 specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/TriggerDataMove_Post.json diff --git a/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/bms.json b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/bms.json new file mode 100644 index 000000000000..63ffc3db278b --- /dev/null +++ b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/bms.json @@ -0,0 +1,453 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-07-01", + "title": "RecoveryServicesBackupClient", + "x-ms-code-generation-settings": { + "internalConstructors": false + } + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}": { + "get": { + "tags": [ + "DataMove" + ], + "description": "Fetches operation status for data move operation on vault", + "operationId": "GetOperationStatus", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "name": "operationId", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "../2020-02-02/bms.json#/definitions/OperationStatus" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/NewErrorResponse" + } + } + }, + "x-ms-examples": { + "Get OperationStatus": { + "$ref": "./examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove": { + "post": { + "tags": [ + "DataMove" + ], + "description": "Prepares source vault for Data Move operation", + "operationId": "BMSPrepareDataMove", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "name": "parameters", + "in": "body", + "description": "Prepare data move request", + "required": true, + "schema": { + "$ref": "#/definitions/PrepareDataMoveRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/NewErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Prepare Data Move": { + "$ref": "./examples/BackupDataMove/PrepareDataMove_Post.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}": { + "get": { + "tags": [ + "BMSPrepareDataMoveOperationResult" + ], + "description": "Fetches Operation Result for Prepare Data Move", + "operationId": "BMSPrepareDataMoveOperationResult_Get", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "name": "operationId", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/VaultStorageConfigOperationResultResponse" + } + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed. ", + "schema": { + "$ref": "#/definitions/NewErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Get operation result for PrepareDataMove": { + "$ref": "./examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove": { + "post": { + "tags": [ + "DataMove" + ], + "description": "Triggers Data Move Operation on target vault", + "operationId": "BMSTriggerDataMove", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "name": "parameters", + "in": "body", + "description": "Trigger data move request", + "required": true, + "schema": { + "$ref": "#/definitions/TriggerDataMoveRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/NewErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Trigger Data Move": { + "$ref": "./examples/BackupDataMove/TriggerDataMove_Post.json" + } + } + } + } + }, + "definitions": { + "NewErrorResponse": { + "properties": { + "error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "The error code." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "The error message." + }, + "target": { + "readOnly": true, + "type": "string", + "description": "The error target." + }, + "details": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/NewErrorResponse" + }, + "description": "The error details." + }, + "additionalInfo": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorAdditionalInfo" + }, + "description": "The error additional info." + } + } + } + }, + "description": "The resource management error response." + }, + "VaultStorageConfigOperationResultResponse": { + "description": "Operation result response for VaultStorageConfig", + "type": "object", + "properties": { + "objectType": { + "type": "string" + } + }, + "required": [ + "objectType" + ], + "x-ms-discriminator-value": "objectType" + }, + "PrepareDataMoveRequest": { + "description": "Prepare DataMove Request", + "required": [ + "targetResourceId", + "targetRegion", + "dataMoveLevel" + ], + "type": "object", + "properties": { + "targetResourceId": { + "description": "ARM Id of target vault", + "type": "string" + }, + "targetRegion": { + "description": "Target Region", + "type": "string" + }, + "dataMoveLevel": { + "description": "DataMove Level", + "enum": [ + "Invalid", + "Vault", + "Container" + ], + "type": "string", + "x-ms-enum": { + "name": "DataMoveLevel", + "modelAsString": true + } + }, + "sourceContainerArmIds": { + "description": "Source Container ArmIds\r\nThis needs to be populated only if DataMoveLevel is set to container", + "type": "array", + "items": { + "type": "string" + } + }, + "ignoreMoved": { + "description": "Ignore the artifacts which are already moved.", + "type": "boolean" + } + } + }, + "PrepareDataMoveResponse": { + "description": "Prepare DataMove Response", + "type": "object", + "properties": { + "correlationId": { + "description": "Co-relationId for move operation", + "type": "string" + }, + "sourceVaultProperties": { + "description": "Source Vault Properties", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "TriggerDataMoveRequest": { + "description": "Trigger DataMove Request", + "required": [ + "sourceResourceId", + "sourceRegion", + "dataMoveLevel", + "correlationId" + ], + "type": "object", + "properties": { + "sourceResourceId": { + "description": "ARM Id of source vault", + "type": "string" + }, + "sourceRegion": { + "description": "Source Region", + "type": "string" + }, + "dataMoveLevel": { + "description": "DataMove Level", + "enum": [ + "Invalid", + "Vault", + "Container" + ], + "type": "string", + "x-ms-enum": { + "name": "DataMoveLevel", + "modelAsString": true + } + }, + "correlationId": { + "description": "Correlation Id", + "type": "string" + }, + "sourceContainerArmIds": { + "description": "Source Container ArmIds", + "type": "array", + "items": { + "type": "string" + } + }, + "pauseGC": { + "description": "Pause GC", + "type": "boolean" + } + } + } + }, + "parameters": { + "SubscriptionId": { + "name": "subscriptionId", + "in": "path", + "description": "The subscription Id.", + "required": true, + "type": "string" + }, + "ResourceGroupName": { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the resource group where the recovery services vault is present.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "VaultName": { + "name": "vaultName", + "in": "path", + "description": "The name of the recovery services vault.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ApiVersion": { + "name": "api-version", + "in": "query", + "description": "Client Api Version.", + "required": true, + "type": "string" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account." + } + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ] +} diff --git a/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json new file mode 100644 index 000000000000..6fa5b56b594b --- /dev/null +++ b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sourceRG", + "vaultName": "source-rsv", + "operationId": "00000000-0000-0000-0000-000000000000", + "api-version": "2020-07-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "0f48183b-0a44-4dca-aec1-bba5daab888a", + "name": "0f48183b-0a44-4dca-aec1-bba5daab888a", + "status": "Succeeded", + "startTime": "2020-02-27T11:59:47.5901592Z", + "endTime": "2020-02-27T11:59:47.5901592Z" + } + } + } +} diff --git a/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json new file mode 100644 index 000000000000..288110e5d164 --- /dev/null +++ b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sourceRG", + "vaultName": "source-rsv", + "operationId": "00000000-0000-0000-0000-000000000000", + "api-version": "2020-07-01-preview" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv/backupStorageConfig/vaultStorageConfig/operationResult/00000000-0000-0000-0000-000000000000?api-version=2020-07-01-preview", + "Azure-AsyncOperation": "https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv/backupStorageConfig/vaultStorageConfig/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2020-07-01-preview", + "Retry-After": 60 + } + }, + "200": { + "body": { + "objectType": "" + } + } + } +} diff --git a/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMove_Post.json b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMove_Post.json new file mode 100644 index 000000000000..f34889a19780 --- /dev/null +++ b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/PrepareDataMove_Post.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sourceRG", + "vaultName": "source-rsv", + "api-version": "2020-07-01-preview", + "parameters": { + "targetResourceId": "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv", + "targetRegion": "USGov Virginia", + "dataMoveLevel": "Vault" + } + }, + "responses": { + "200": {}, + "202": { + "headers": { + "Location": "https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv/backupStorageConfig/vaultStorageConfig/prepareDataMove/operationResult/00000000-0000-0000-0000-000000000000?api-version=2020-07-01-preview", + "Azure-AsyncOperation": "https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv/backupStorageConfig/vaultStorageConfig/backupDataMove/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2020-07-01-preview", + "Retry-After": 60 + } + } + } +} diff --git a/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/TriggerDataMove_Post.json b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/TriggerDataMove_Post.json new file mode 100644 index 000000000000..f4eab59a3d39 --- /dev/null +++ b/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2020-07-01/examples/BackupDataMove/TriggerDataMove_Post.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "targetRG", + "vaultName": "target-rsv", + "api-version": "2020-07-01-preview", + "parameters": { + "sourceResourceId": "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv", + "sourceRegion": "USGov Iowa", + "dataMoveLevel": "Vault", + "correlationId": "MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE=" + } + }, + "responses": { + "200": {}, + "202": { + "headers": { + "Azure-AsyncOperation": "https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv/backupStorageConfig/vaultStorageConfig/backupDataMove/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2020-07-01-preview", + "Retry-After": 60 + } + } + } +} diff --git a/specification/recoveryservicesbackup/resource-manager/readme.md b/specification/recoveryservicesbackup/resource-manager/readme.md index fcb830f7613c..889a03f365b2 100644 --- a/specification/recoveryservicesbackup/resource-manager/readme.md +++ b/specification/recoveryservicesbackup/resource-manager/readme.md @@ -45,6 +45,20 @@ model-validator: true semantic-validator: true message-format: json ``` +### Tag: package-2020-07 + +These settings apply only when `--tag=package-2020-07` is specified on the command line. + +``` yaml $(tag) == 'package-2020-07' +input-file: +- Microsoft.RecoveryServices/stable/2020-07-01/bms.json +- Microsoft.RecoveryServices/stable/2020-02-02/bms.json +- Microsoft.RecoveryServices/stable/2019-06-15/bms.json +- Microsoft.RecoveryServices/stable/2017-07-01/bms.json +- Microsoft.RecoveryServices/stable/2016-12-01/bms.json +- Microsoft.RecoveryServices/stable/2016-08-10/operations.json +``` + ### Tag: package-2020-02 These settings apply only when `--tag=package-2020-02` is specified on the command line. @@ -190,6 +204,7 @@ require: $(this-folder)/../../../profiles/readme.md # all the input files across all versions input-file: + - $(this-folder)/Microsoft.RecoveryServices/stable/2020-07-01/bms.json - $(this-folder)/Microsoft.RecoveryServices/stable/2020-02-02/bms.json - $(this-folder)/Microsoft.RecoveryServices/stable/2019-06-15/bms.json - $(this-folder)/Microsoft.RecoveryServices/stable/2017-07-01/bms.json