Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconcile ManagedDatabaseRestoreDetails swagger specs #8560

Merged
merged 6 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"body": {
"value": [
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testserver1/longTermRetentionDatabases/testDatabase1/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance1/longTermRetentionDatabases/testDatabase1/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000",
"name": "55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z",
"type": "Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionBackups",
"type": "Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups",
"properties": {
"managedInstanceName": "testInstance1",
"managedInstanceCreateTime": "2017-03-10T08:00:00.000Z",
Expand All @@ -21,9 +21,9 @@
}
},
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testserver2/longTermRetentionDatabases/testDatabase2/longTermRetentionManagedInstanceBackups/12341234-1234-1234-1234-123123123123;131657960820000000",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance2/longTermRetentionDatabases/testDatabase2/longTermRetentionManagedInstanceBackups/12341234-1234-1234-1234-123123123123;131657960820000000",
"name": "12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z",
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
"type": "Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups",
"properties": {
"managedInstanceName": "testInstance2",
"managedInstanceCreateTime": "2017-04-10T08:00:00.000Z",
Expand All @@ -33,7 +33,7 @@
}
},
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testserver3/longTermRetentionDatabases/testDatabase3/longTermRetentionManagedInstanceBackups/43214321-4321-4321-4321-321321321321;131677960820000000",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance3/longTermRetentionDatabases/testDatabase3/longTermRetentionManagedInstanceBackups/43214321-4321-4321-4321-321321321321;131677960820000000",
"name": "43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z",
"type": "Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups",
"properties": {
Expand Down
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": "2018-06-01-preview",
allenjzhang marked this conversation as resolved.
Show resolved Hide resolved
"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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused about this part. Do we really need this list?

}
},
"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,85 @@
}
},
"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
}
}
},
"ManagedDatabaseRestoreDetailsResult": {
"description": "A managed database restore details.",
"type": "object",
"allOf": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give me some contexts why we need extra "ProxyResource" definition?

{
"$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