Skip to content

Commit 1e1e0f3

Browse files
authored
Swagger example/spec for Managed Database Restore Details V2022-02-01 API (#19024)
* Initial commit * Address check failures
1 parent 5d83b0b commit 1e1e0f3

File tree

2 files changed

+279
-28
lines changed

2 files changed

+279
-28
lines changed

specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/ManagedDatabaseRestoreDetails.json

Lines changed: 153 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363
},
6464
"default": {
65-
"description": "*** Error Responses: ***\n\n * 400 AutoCompleteMissingLastBackupName - Auto complete restore request must have lastBackupName parameter provided.\n\n * 400 MissingThumbprint - Can not find server certificate.\n\n * 400 BlobStorageServerFailure - Blob storage server failure has occurred.\n\n * 400 BackupSetNotFound - No backups were found to restore the database. Please contact support to restore the database.\n\n * 400 FullBackupNotFound - Full backup can not be found.\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 RetriableMissingThumbprint - Can not find server certificate.\n\n * 400 FullBackupMissingChecksum - Provided full backup is missing checksum.\n\n * 400 FullBackupDamaged - Provided full backup is damaged.\n\n * 400 MissingStripeInBackupSet - Provided backup set has one or more missing stripes.\n\n * 400 BackupsFromMultipleDatabasesDetectedInTheContainerWhileRestoreInProgress - There are backups from multiple databases in the container. Please make sure the container has backups from a single database.{0}\n\n * 400 BrokenRestorePlanWrongDiffBaseGUID - The restore plan is broken because DifferentialBaseGuid of diff backup does not match BackupSetGuid of full backup.\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 ManagedInstanceStorageLimitHit - The managed instance has reached its storage limit.\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 ExternalBackupAlreadySignaledToComplete - The restore request has already been signaled to complete.\n\n * 400 ExternalBackupRestoreHasNotBeenStarted - The restore request can only be completed once the restore has started.\n\n * 400 ExternalBackupUpgradeInProgress - The restore request cannot be completed, since upgrade is in progress.\n\n * 400 IncompatiblePhysicalLayoutTooManyXTPFiles - Database backup contains incompatible physical layout. Multiple files found in the filegroup that contains MEMORY_OPTIMIZED_DATA.\n\n * 400 BlobStorageFailure - Blob storage failure has occurred.\n\n * 400 BackupsFromMultipleDatabasesDetectedInTheContainerFromTheStart - There are backups from multiple databases in the container. Please make sure the container has backups from a single database.{0}\n\n * 400 BackupSetBroken - Backup set is broken.\n\n * 400 ManagedDatabaseNotInRestoringState - Managed database is not in Restoring state."
65+
"description": "*** Error Responses: ***\n\n * 400 AutoCompleteMissingLastBackupName - Auto complete restore request must have lastBackupName parameter provided.\n\n * 400 MissingThumbprint - Can not find server certificate.\n\n * 400 BlobStorageServerFailure - Blob storage server failure has occurred.\n\n * 400 BackupSetNotFound - No backups were found to restore the database. Please contact support to restore the database.\n\n * 400 FullBackupNotFound - Full backup can not be found.\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 TargetServerDoesNotExist - The target server {0} does not exist or is not ready yet. Please check that it exists and retry the restore request.\n\n * 400 TargetServerRestoreNotAllowed - The target server {0} is currently not in a state that allows a restore to be started.\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 FullBackupMissingChecksum - Provided full backup is missing checksum.\n\n * 400 FullBackupDamaged - Provided full backup is damaged.\n\n * 400 MissingStripeInBackupSet - Provided backup set has one or more missing stripes.\n\n * 400 BackupsFromMultipleDatabasesDetectedInTheContainerWhileRestoreInProgress - There are backups from multiple databases in the container. Please make sure the container has backups from a single database.{0}\n\n * 400 BrokenRestorePlanWrongDiffBaseGUID - The restore plan is broken because DifferentialBaseGuid of diff backup does not match BackupSetGuid of full backup.\n\n * 400 ManagedIdentityIssueDetectedWhileRestoreInProgress - Managed identity is not set up properly. Please verify and try again.\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 ManagedInstanceStorageLimitHit - The managed instance has reached its storage limit.\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 ExternalBackupAlreadySignaledToComplete - The restore request has already been signaled to complete.\n\n * 400 ExternalBackupRestoreHasNotBeenStarted - The restore request can only be completed once the restore has started.\n\n * 400 ExternalBackupUpgradeInProgress - The restore request cannot be completed, since upgrade is in progress.\n\n * 400 IncompatiblePhysicalLayoutTooManyXTPFiles - Database backup contains incompatible physical layout. Multiple files found in the filegroup that contains MEMORY_OPTIMIZED_DATA.\n\n * 400 BlobStorageFailure - Blob storage failure has occurred.\n\n * 400 BackupsFromMultipleDatabasesDetectedInTheContainerFromTheStart - There are backups from multiple databases in the container. Please make sure the container has backups from a single database.{0}\n\n * 400 ManagedIdentityIssueDetectedFromTheStart - Managed identity is not set up properly. Please verify and try again.\n\n * 400 BackupSetBroken - Backup set is broken.\n\n * 400 SqlRestoreError - Non retriable error occurred while restoring backup with index {0} - {1} {2}\n\n * 400 ManagedDatabaseNotInRestoringState - Managed database is not in Restoring state."
6666
}
6767
},
6868
"x-ms-examples": {
@@ -74,17 +74,73 @@
7474
}
7575
},
7676
"definitions": {
77+
"ManagedDatabaseRestoreDetailsBackupSetProperties": {
78+
"description": "The managed database's restore details backup set properties.",
79+
"type": "object",
80+
"properties": {
81+
"status": {
82+
"description": "Backup set status.",
83+
"type": "string",
84+
"readOnly": true
85+
},
86+
"firstStripeName": {
87+
"description": "First stripe name.",
88+
"type": "string",
89+
"readOnly": true
90+
},
91+
"numberOfStripes": {
92+
"format": "int32",
93+
"description": "Number of stripes.",
94+
"type": "integer",
95+
"readOnly": true
96+
},
97+
"backupSizeMB": {
98+
"format": "int32",
99+
"description": "Backup size.",
100+
"type": "integer",
101+
"readOnly": true
102+
},
103+
"restoreStartedTimestampUtc": {
104+
"format": "date-time",
105+
"description": "Last restored file time.",
106+
"type": "string",
107+
"readOnly": true
108+
},
109+
"restoreFinishedTimestampUtc": {
110+
"format": "date-time",
111+
"description": "Last restored file time.",
112+
"type": "string",
113+
"readOnly": true
114+
}
115+
}
116+
},
77117
"ManagedDatabaseRestoreDetailsProperties": {
78118
"description": "The managed database's restore details properties.",
79119
"type": "object",
80120
"properties": {
121+
"type": {
122+
"description": "Restore type.",
123+
"type": "string",
124+
"readOnly": true
125+
},
81126
"status": {
82127
"description": "Restore status.",
83128
"type": "string",
84129
"readOnly": true
85130
},
86-
"currentRestoringFileName": {
87-
"description": "Current restoring file name.",
131+
"blockReason": {
132+
"description": "The reason why restore is in Blocked state.",
133+
"type": "string",
134+
"readOnly": true
135+
},
136+
"lastUploadedFileName": {
137+
"description": "Last uploaded file name.",
138+
"type": "string",
139+
"readOnly": true
140+
},
141+
"lastUploadedFileTime": {
142+
"format": "date-time",
143+
"description": "Last uploaded file time.",
88144
"type": "string",
89145
"readOnly": true
90146
},
@@ -100,40 +156,104 @@
100156
"readOnly": true
101157
},
102158
"percentCompleted": {
103-
"format": "double",
159+
"format": "int32",
104160
"description": "Percent completed.",
105-
"type": "number",
161+
"type": "integer",
106162
"readOnly": true
107163
},
108-
"unrestorableFiles": {
109-
"description": "List of unrestorable files.",
110-
"type": "array",
111-
"items": {
112-
"type": "string"
113-
},
164+
"currentRestoredSizeMB": {
165+
"format": "int32",
166+
"description": "Current restored size MB.",
167+
"type": "integer",
114168
"readOnly": true
115169
},
116-
"numberOfFilesDetected": {
117-
"format": "int64",
118-
"description": "Number of files detected.",
170+
"currentRestorePlanSizeMB": {
171+
"format": "int32",
172+
"description": "Current restore plan size MB.",
119173
"type": "integer",
120174
"readOnly": true
121175
},
122-
"lastUploadedFileName": {
123-
"description": "Last uploaded file name.",
176+
"currentBackupType": {
177+
"description": "Current backup type.",
124178
"type": "string",
125179
"readOnly": true
126180
},
127-
"lastUploadedFileTime": {
128-
"format": "date-time",
129-
"description": "Last uploaded file time.",
181+
"currentRestoringFileName": {
182+
"description": "Current restoring file name.",
130183
"type": "string",
131184
"readOnly": true
132185
},
133-
"blockReason": {
134-
"description": "The reason why restore is in Blocked state.",
135-
"type": "string",
186+
"numberOfFilesDetected": {
187+
"format": "int32",
188+
"description": "Number of files detected.",
189+
"type": "integer",
190+
"readOnly": true
191+
},
192+
"numberOfFilesQueued": {
193+
"format": "int32",
194+
"description": "Number of files queued.",
195+
"type": "integer",
196+
"readOnly": true
197+
},
198+
"numberOfFilesSkipped": {
199+
"format": "int32",
200+
"description": "Number of files skipped.",
201+
"type": "integer",
202+
"readOnly": true
203+
},
204+
"numberOfFilesRestoring": {
205+
"format": "int32",
206+
"description": "Number of files restoring.",
207+
"type": "integer",
208+
"readOnly": true
209+
},
210+
"numberOfFilesRestored": {
211+
"format": "int32",
212+
"description": "Number of files restored.",
213+
"type": "integer",
214+
"readOnly": true
215+
},
216+
"numberOfFilesUnrestorable": {
217+
"format": "int32",
218+
"description": "Number of files unrestorable.",
219+
"type": "integer",
136220
"readOnly": true
221+
},
222+
"fullBackupSets": {
223+
"description": "Full backup sets.",
224+
"type": "array",
225+
"items": {
226+
"$ref": "#/definitions/ManagedDatabaseRestoreDetailsBackupSetProperties"
227+
},
228+
"readOnly": true,
229+
"x-ms-identifiers": []
230+
},
231+
"diffBackupSets": {
232+
"description": "Diff backup sets.",
233+
"type": "array",
234+
"items": {
235+
"$ref": "#/definitions/ManagedDatabaseRestoreDetailsBackupSetProperties"
236+
},
237+
"readOnly": true,
238+
"x-ms-identifiers": []
239+
},
240+
"logBackupSets": {
241+
"description": "Log backup sets.",
242+
"type": "array",
243+
"items": {
244+
"$ref": "#/definitions/ManagedDatabaseRestoreDetailsBackupSetProperties"
245+
},
246+
"readOnly": true,
247+
"x-ms-identifiers": []
248+
},
249+
"unrestorableFiles": {
250+
"description": "Unrestorable files.",
251+
"type": "array",
252+
"items": {
253+
"$ref": "#/definitions/ManagedDatabaseRestoreDetailsUnrestorableFileProperties"
254+
},
255+
"readOnly": true,
256+
"x-ms-identifiers": []
137257
}
138258
}
139259
},
@@ -152,6 +272,17 @@
152272
"x-ms-client-flatten": true
153273
}
154274
}
275+
},
276+
"ManagedDatabaseRestoreDetailsUnrestorableFileProperties": {
277+
"description": "The managed database's restore details unrestorable file properties.",
278+
"type": "object",
279+
"properties": {
280+
"name": {
281+
"description": "File name.",
282+
"type": "string",
283+
"readOnly": true
284+
}
285+
}
155286
}
156287
},
157288
"parameters": {

0 commit comments

Comments
 (0)