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

Swagger changes for Stop and Resume protection APIs #14250

Merged
merged 6 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -1520,6 +1520,350 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/resumeBackups": {
"post": {
pratikjoshi14 marked this conversation as resolved.
Show resolved Hide resolved
"tags": [
"BackupInstances"
],
"description": "This operation will resume backups for backup instance",
"operationId": "BackupInstances_ResumeBackups",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "backupInstanceName",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
},
"202": {
"description": "The operation will be completed asynchronously.",
"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"
}
}
Comment on lines +1559 to +1573
Copy link
Member

Choose a reason for hiding this comment

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

I don't think these headers need to be spelled out. As long as it is marked as x-ms-long-running-operation, all SDK will handle these.

On the other hand, is there empty response after LRO? If not, the response schema should be here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes the response body is empty

},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"ResumeBackups": {
"$ref": "./examples/BackupInstanceOperations/ResumeBackups.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/resumeProtection": {
"post": {
"tags": [
"BackupInstances"
],
"description": "This operation will resume protection for a stopped backup instance",
"operationId": "BackupInstances_ResumeProtection",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "backupInstanceName",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
},
"202": {
"description": "The operation will be completed asynchronously.",
"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"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"ResumeProtection": {
"$ref": "./examples/BackupInstanceOperations/ResumeProtection.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/stopProtection": {
"post": {
"tags": [
"BackupInstances"
],
"description": "This operation will stop protection of a backup instance and data will be held forever",
"operationId": "BackupInstances_StopProtection",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "backupInstanceName",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
},
"202": {
"description": "The operation will be completed asynchronously.",
"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"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"StopProtection": {
"$ref": "./examples/BackupInstanceOperations/StopProtection.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/suspendBackups": {
"post": {
"tags": [
"BackupInstances"
],
"description": "This operation will stop backups for backup instance",
"operationId": "BackupInstances_SuspendBackups",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "backupInstanceName",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
},
"202": {
"description": "The operation will be completed asynchronously.",
"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"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"SuspendBackups": {
"$ref": "./examples/BackupInstanceOperations/SuspendBackups.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/sync": {
Copy link
Member

@mentat9 mentat9 May 6, 2021

Choose a reason for hiding this comment

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

sync

Sync is a pretty general action name. Adding a description will help, but maybe there's also a more descriptive action name? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added description. This API is still in review mode and can rename before moving to stable version.

Copy link
Contributor

Choose a reason for hiding this comment

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

*preview. Thanks for the comment. We want to get the customer feedback so have released portal as well. We have noted renaming of the API and will take this as part of public preview when move to stable version in a month or so. As we will have to coordinate the change with our Portal team

"post": {
"tags": [
"BackupInstances"
],
"description": "Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state",
"operationId": "BackupInstances_SyncBackupInstance",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "backupInstanceName",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "parameters",
"in": "body",
"description": "Request body for operation",
"required": true,
"schema": {
"$ref": "#/definitions/SyncBackupInstanceRequest"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"202": {
"description": "The operation will be completed asynchronously.",
"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"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Sync BackupInstance": {
"$ref": "./examples/BackupInstanceOperations/SyncBackupInstance.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore": {
"post": {
"tags": [
Expand Down Expand Up @@ -4364,6 +4708,24 @@
}
}
},
"SyncBackupInstanceRequest": {
"description": "Sync BackupInstance Request",
"type": "object",
"properties": {
"syncType": {
"description": "Field indicating sync type e.g. to sync only in case of failure or in all cases",
"enum": [
"Default",
"ForceResync"
],
"type": "string",
"x-ms-enum": {
"name": "SyncType",
"modelAsString": true
}
}
}
},
"TaggingCriteria": {
"description": "Tagging criteria",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"subscriptionId": "04cf684a-d41f-4550-9f70-7708a3a2283b",
"resourceGroupName": "testrg",
"vaultName": "testvault",
"backupInstanceName": "testbi",
"api-version": "2021-02-01-preview"
},
"responses": {
"202": {
"headers": {
"Location": "https://api-dogfood.resources.windows-int.net/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/testrg/providers/Microsoft.DataProtection/backupInstances/testbi/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": {}
}
}
Loading