Skip to content

Commit

Permalink
Swagger changes for Stop and Resume protection APIs (Azure#14250)
Browse files Browse the repository at this point in the history
* Added Suspend/Resume APIs

* Prettier changes

* spell check fix

* Fixing version in example

* PR feedback changes

* changes
  • Loading branch information
pratikjoshi14 authored and mkarmark committed Jul 20, 2021
1 parent 0a5b167 commit 3773ec2
Show file tree
Hide file tree
Showing 6 changed files with 460 additions and 0 deletions.
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": {
"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"
}
}
},
"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": {
"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

0 comments on commit 3773ec2

Please sign in to comment.