From 341f8f933305f1f0dff61a346bad526fb01f2086 Mon Sep 17 00:00:00 2001 From: xaliciayang <59986952+xaliciayang@users.noreply.github.com> Date: Mon, 2 Mar 2020 00:08:35 -0800 Subject: [PATCH] Reconcile ManagedDatabaseRestoreDetails swagger specs (#8560) * fixing type in example * More fixes for LTR MI example * making fixes for restore details changes * adding ProxyResource reference' * update api version in example file --- .../ManagedDatabaseRestoreDetails.json | 33 ++++ .../2019-06-01-preview/managedDatabases.json | 145 ++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/examples/ManagedDatabaseRestoreDetails.json diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/examples/ManagedDatabaseRestoreDetails.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/examples/ManagedDatabaseRestoreDetails.json new file mode 100644 index 000000000000..e9c8c6fa685c --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/examples/ManagedDatabaseRestoreDetails.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "Default-SQL-SouthEastAsia", + "managedInstanceName": "managedInstance", + "databaseName": "testdb", + "restoreDetailsName": "Default", + "api-version": "2019-06-01-preview", + "parameters": { + "tags": { + "tagKey1": "TagValue1" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "status": "Restoring", + "currentRestoringFileName": "full_0", + "percentCompleted": 0.0, + "unrestorableFiles": [], + "numberOfFilesDetected": 26, + "lastUploadedFileName": "log2_3", + "lastUploadedFileTime": "2018-06-15T11:38:33Z" + }, + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/testdb/restoreDetails/current", + "name": "current", + "type": "Microsoft.Sql/managedInstances/databases/restoreDetails" + } + } + } +} diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/managedDatabases.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/managedDatabases.json index 9e7d0c6aa202..195dd2b4ce58 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/managedDatabases.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2019-06-01-preview/managedDatabases.json @@ -16,6 +16,62 @@ "application/json" ], "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}": { + "get": { + "tags": [ + "ManagedDatabaseRestoreDetails" + ], + "description": "Gets managed database restore details.", + "operationId": "ManagedDatabaseRestoreDetails_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ManagedInstanceNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "restoreDetailsName", + "in": "path", + "description": "The name of the restore details to retrieve.", + "required": true, + "type": "string", + "enum": [ + "Default" + ], + "x-ms-enum": { + "name": "RestoreDetailsName", + "modelAsString": true + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved restore details.", + "schema": { + "$ref": "#/definitions/ManagedDatabaseRestoreDetailsResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 MissingThumbprint - Can not find server certificate.\n\n * 400 PartiallyContainedDatabaseUnsupported - \"Backup for a partially contained database is not supported.\"\n\n * 400 RequiredBackupIsNotLastRestored - Migration cannot be completed because provided backup file name is not the name of the last backup file that is restored.\n\n * 400 IncompatiblePhysicalLayoutTooFewDataFiles - Database backup contains incompatible physical layout. No data files are found in the backup.\n\n * 400 IncompatiblePhysicalLayoutNonOnlineDataFilesExist - Database backup contains incompatible physical layout. Non-online data files exist.\n\n * 400 IncompatiblePhysicalLayoutWrongNumberOfLogFiles - Database backup contains incompatible physical layout. Multiple log files are not supported.\n\n * 400 IncompatiblePhysicalLayoutNonOnlineLogFilesExist - Database backup contains incompatible physical layout. Non-online log files exist.\n\n * 400 IncompatiblePhysicalLayoutTooManyNonDataLogFiles - Database backup contains incompatible physical layout. Too many non-data/log files.\n\n * 400 BackupSetNotFound - \"No backups were found to restore the database. Please contact support to restore the database.\n\n * 400 ExternalBackupAlreadySignaledToComplete - The restore request has already been signaled to complete.\n\n * 400 FullBackupNotFound - Full backup can not be found.\n\n * 400 ExternalBackupRestoreHasNotBeenStarted - The restore request can only be completed once the restore has started.\n\n * 400 RestoreFromStripedBackupsNotEnabled - Restoring from striped backups is not supported.\n\n * 400 BrokenRestorePlanNoFullBackup - The restore plan is broken because there is no full backup.\n\n * 400 BrokenRestorePlanWrongLogBackupLSN - The restore plan is broken because firstLsn of current log backup is not <= lastLsn of next log backup.\n\n * 400 BrokenRestorePlanWrongDiffBackupLSN - The restore plan is broken because firstLsn of diff backup is not >= firstLsn of full backup.\n\n * 400 BrokenRestorePlanGapInLogBackups - The restore plan is broken because firstLsn of current log backup is not equal to lastLsn of prev log backup.\n\n * 400 XtpInitializedDuringRestore - Memory-optimized filegroup must be empty in order to be restored on General Purpose tier of SQL Database Managed Instance.\n\n * 400 ManagedInstanceStorageLimitHit - The managed instance has reached its storage limit.\n\n * 400 ManagedDatabaseNotInRestoringState - Managed database is not in Restoring state." + } + }, + "x-ms-examples": { + "Managed database restore details.": { + "$ref": "./examples/ManagedDatabaseRestoreDetails.json" + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases": { "get": { "tags": [ @@ -370,6 +426,95 @@ } }, "definitions": { + "ManagedDatabaseRestoreDetailsProperties": { + "description": "The managed database's restore details properties.", + "type": "object", + "properties": { + "status": { + "description": "Restore status.", + "type": "string", + "readOnly": true + }, + "currentRestoringFileName": { + "description": "Current restoring file name.", + "type": "string", + "readOnly": true + }, + "lastRestoredFileName": { + "description": "Last restored file name.", + "type": "string", + "readOnly": true + }, + "lastRestoredFileTime": { + "format": "date-time", + "description": "Last restored file time.", + "type": "string", + "readOnly": true + }, + "percentCompleted": { + "format": "double", + "description": "Percent completed.", + "type": "number", + "readOnly": true + }, + "unrestorableFiles": { + "description": "List of unrestorable files.", + "type": "array", + "items": { + "type": "string" + }, + "readOnly": true + }, + "numberOfFilesDetected": { + "format": "int64", + "description": "Number of files detected.", + "type": "integer", + "readOnly": true + }, + "lastUploadedFileName": { + "description": "Last uploaded file name.", + "type": "string", + "readOnly": true + }, + "lastUploadedFileTime": { + "format": "date-time", + "description": "Last uploaded file time.", + "type": "string", + "readOnly": true + }, + "blockReason": { + "description": "The reason why restore is in Blocked state.", + "type": "string", + "readOnly": true + } + } + }, + "ProxyResource": { + "description": "ARM proxy resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": {} + }, + "ManagedDatabaseRestoreDetailsResult": { + "description": "A managed database restore details.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/ManagedDatabaseRestoreDetailsProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + }, "ManagedDatabaseListResult": { "description": "A list of managed databases.", "type": "object",