Skip to content

Commit

Permalink
Reconcile ManagedDatabaseRestoreDetails swagger specs (Azure#8560)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xaliciayang authored and 00Kai0 committed Oct 12, 2020
1 parent dd390dc commit 9fe4872
Show file tree
Hide file tree
Showing 2 changed files with 178 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 9fe4872

Please sign in to comment.