From 0256fe6350fc08cdc4113944a0a04704a9982001 Mon Sep 17 00:00:00 2001 From: zakinkh <78899961+zakinkh@users.noreply.github.com> Date: Fri, 12 Mar 2021 00:56:03 -0800 Subject: [PATCH] Microsoft.DataProtection swagger changes (#13334) * Microsoft.DataProtection swagger changes * Added example file FindRestorableTimeRanges.json * Adding 202 GetOperationResult (#1) * adding 202 GetOperationResult * added headers Co-authored-by: Mayank Aggarwal * pr comments fixes * prettier fixes * adding fix for x-ms-error-response * Added missed DppWorkerRequest object in swagger json * Validation fixes * changes for request * removing objectType Co-authored-by: Mayank Aggarwal Co-authored-by: Mayank Aggarwal --- .../2021-02-01-preview/dataprotection.json | 239 +++++++++++++++++- .../FindRestorableTimeRanges.json | 32 +++ .../examples/GetOperationResult.json | 6 +- 3 files changed, 271 insertions(+), 6 deletions(-) create mode 100644 specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json diff --git a/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/dataprotection.json b/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/dataprotection.json index 60b3410e75ba..3322759d5c32 100644 --- a/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/dataprotection.json +++ b/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/dataprotection.json @@ -91,6 +91,24 @@ } ], "responses": { + "202": { + "description": "Accepted", + "headers": { + "Location": { + "description": "The URL of the resource used to check the status of the asynchronous operation.", + "type": "string" + }, + "Azure-AsyncOperation": { + "description": "The URL of the resource used to check the status of the asynchronous operation.", + "type": "string" + }, + "Retry-After": { + "description": "Suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds.", + "type": "integer", + "format": "int32" + } + } + }, "200": { "description": "Contains additional information like job Id", "schema": { @@ -260,7 +278,7 @@ "BackupVaults" ], "description": "Creates or updates a BackupVault resource belonging to a resource group.", - "operationId": "BackupVaults_Put", + "operationId": "BackupVaults_CreateOrUpdate", "consumes": [ "application/json" ], @@ -720,7 +738,7 @@ "tags": [ "BackupPolicies" ], - "operationId": "BackupPolicies_Put", + "operationId": "BackupPolicies_CreateOrUpdate", "summary": "Creates or Updates a backup policy belonging to a backup vault", "produces": [ "application/json" @@ -830,7 +848,7 @@ "BackupInstances" ], "description": "Gets a backup instances belonging to a backup vault", - "operationId": "BackupInstances_GetBackupInstancesInVault", + "operationId": "BackupInstances_List", "produces": [ "application/json" ], @@ -927,7 +945,7 @@ "tags": [ "BackupInstances" ], - "operationId": "BackupInstances_Put", + "operationId": "BackupInstances_CreateOrUpdate", "produces": [ "application/json" ], @@ -1628,6 +1646,65 @@ } } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstances}/findRestorableTimeRanges": { + "post": { + "tags": [ + "FindRestorableTimeRanges" + ], + "operationId": "FindRestorableTimeRanges_Post", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "name": "backupInstances", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "Request body for operation", + "required": true, + "schema": { + "$ref": "#/definitions/AzureBackupFindRestorableTimeRangesRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AzureBackupFindRestorableTimeRangesResponseResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Find Restorable Time Ranges": { + "$ref": "./examples/BackupInstanceOperations/FindRestorableTimeRanges.json" + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}": { "get": { "tags": [ @@ -1935,6 +2012,82 @@ "type": "object", "x-ms-discriminator-value": "AzureBackupDiscreteRecoveryPoint" }, + "AzureBackupFindRestorableTimeRangesRequest": { + "description": "List Restore Ranges Request", + "required": [ + "sourceDataStoreType", + "startTime", + "endTime" + ], + "type": "object", + "properties": { + "sourceDataStoreType": { + "description": "Gets or sets the type of the source data store.", + "enum": [ + "OperationalStore", + "VaultStore", + "ArchiveStore" + ], + "type": "string", + "x-ms-enum": { + "name": "RestoreSourceDataStoreType", + "modelAsString": true + } + }, + "startTime": { + "description": "Start time for the List Restore Ranges request", + "type": "string" + }, + "endTime": { + "description": "End time for the List Restore Ranges request", + "type": "string" + } + } + }, + "AzureBackupFindRestorableTimeRangesRequestResource": { + "description": "List Restore Ranges Request", + "allOf": [ + { + "$ref": "#/definitions/DppWorkerRequest" + } + ], + "properties": { + "content": { + "$ref": "#/definitions/AzureBackupFindRestorableTimeRangesRequest", + "description": "AzureBackupFindRestorableTimeRangesRequestResource content" + } + } + }, + "AzureBackupFindRestorableTimeRangesResponse": { + "description": "List Restore Ranges Response", + "type": "object", + "properties": { + "restorableTimeRanges": { + "description": "Returns the Restore Ranges available on the Backup Instance.", + "type": "array", + "items": { + "$ref": "#/definitions/RestorableTimeRange" + } + }, + "objectType": { + "type": "string" + } + } + }, + "AzureBackupFindRestorableTimeRangesResponseResource": { + "description": "List Restore Ranges Response", + "allOf": [ + { + "$ref": "#/definitions/DppResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/AzureBackupFindRestorableTimeRangesResponse", + "description": "AzureBackupFindRestorableTimeRangesResponseResource properties" + } + } + }, "AzureBackupJob": { "description": "AzureBackup Job Class", "properties": { @@ -2298,6 +2451,26 @@ "type": "object", "x-ms-discriminator-value": "AzureBackupRestoreWithRehydrationRequest" }, + "AzureBackupRecoveryTimeBasedRestoreRequest": { + "allOf": [ + { + "$ref": "#/definitions/AzureBackupRestoreRequest" + } + ], + "description": "AzureBackup RecoveryPointTime Based Restore Request", + "properties": { + "recoveryPointTime": { + "description": "The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z.", + "type": "string" + } + }, + "required": [ + "recoveryPointTime" + ], + "title": "AzureBackupRecoveryTimeBasedRestoreRequest", + "type": "object", + "x-ms-discriminator-value": "AzureBackupRecoveryTimeBasedRestoreRequest" + }, "AzureBackupRule": { "allOf": [ { @@ -3227,6 +3400,44 @@ }, "type": "object" }, + "DppWorkerRequest": { + "type": "object", + "properties": { + "subscriptionId": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "supportedGroupVersions": { + "type": "array", + "items": { + "type": "string" + } + }, + "cultureInfo": { + "type": "string" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "httpMethod": { + "type": "string" + } + } + }, "Error": { "description": "The resource management error response.", "properties": { @@ -3806,6 +4017,26 @@ ], "type": "object" }, + "RestorableTimeRange": { + "required": [ + "startTime", + "endTime" + ], + "type": "object", + "properties": { + "startTime": { + "description": "Start time for the available restore range", + "type": "string" + }, + "endTime": { + "description": "End time for the available restore range", + "type": "string" + }, + "objectType": { + "type": "string" + } + } + }, "RetentionTag": { "description": "Retention tag", "properties": { diff --git a/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json b/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json new file mode 100644 index 000000000000..5019b2cf6725 --- /dev/null +++ b/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "subscriptionId": "04cf684a-d41f-4550-9f70-7708a3a2283b", + "resourceGroupName": "Blob-Backup", + "vaultName": "ZBlobBackupVaultBVTD3", + "backupInstances": "zblobbackuptestsa58", + "api-version": "2021-02-01-preview", + "parameters": { + "sourceDataStoreType": "OperationalStore", + "startTime": "2020-10-17T23:28:17.6829685Z", + "endTime": "2021-02-24T00:35:17.6829685Z" + } + }, + "responses": { + "200": { + "body": { + "id": "zblobbackuptestsa58", + "type": "Microsoft.DataProtection/backupVaults/backupInstances/findRestorableTimeRanges", + "properties": { + "restorableTimeRanges": [ + { + "startTime": "2021-02-23T18:33:51.6349708Z", + "endTime": "2021-02-24T00:35:17.0000000Z", + "objectType": "RestorableTimeRange" + } + ], + "objectType": "AzureBackupFindRestorableTimeRangesResponse" + } + } + } + } +} diff --git a/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/GetOperationResult.json b/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/GetOperationResult.json index 182948360e0d..e0e0ff00b3cc 100644 --- a/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/GetOperationResult.json +++ b/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2021-02-01-preview/examples/GetOperationResult.json @@ -6,12 +6,14 @@ "api-version": "2021-02-01-preview" }, "responses": { - "200": { + "202": { "headers": { "Location": "https://api-dogfood.resources.windows-int.net/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/operationResults/ZTA4YjQ0ZGYtYmNkNS00YTk1LWFjZTMtOTc1MjNmZWIxYWZlO2Y1ODg1MzA3LWJkNjItNDQ2OC05ZjZlLTJkMGM2NjNiNmJmNg==?api-version=2021-02-01-preview", "Azure-AsyncOperation": "https://api-dogfood.resources.windows-int.net/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZTA4YjQ0ZGYtYmNkNS00YTk1LWFjZTMtOTc1MjNmZWIxYWZlO2Y1ODg1MzA3LWJkNjItNDQ2OC05ZjZlLTJkMGM2NjNiNmJmNg==?api-version=2021-02-01-preview", "Retry-After": "60" - }, + } + }, + "200": { "body": { "jobId": "c60cb49-63e8-4b21-b9bd-26277b3fdfae" }