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

Fixing swagger correctness and completeness issues for RecoveryServicesBackup #15024

Merged
merged 6 commits into from
Jul 8, 2021
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 @@ -18,6 +18,149 @@
"application/json"
],
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig": {
Copy link
Member

Choose a reason for hiding this comment

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

The api-version 2018-12-20 has the same path, but the tag is different. So it's conflict. Pls fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @ruowan In this PR the API BackupResourceStorageConfigs which is already present in the version 2018-12-20, is being added in the version 2021-04-01(which routes the request to the active stamp) with different operationId and tag which will ensure a new SDK function is generated for this API that routes the request specifically to active stamp.

We have followed similar procedure for a number of other APIs and the SDK generation has always worked in the past. This is an example of such a scenario : This is the API in 2021-04-01 :

"/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries": {

This is the same API in 2018-12-20 with different operationId and tag :
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries": {

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems you changed the tags of the below api in the new api version , this caused conflict.
$.paths["/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.RecoveryServices/vaults/vaultName/backupstorageconfig/vaultstorageconfig"].get

Copy link
Contributor

Choose a reason for hiding this comment

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

discussed offline, accept this change as this situation exists for historical reason, and cannot easily fix.

"get": {
"tags": [
"BackupResourceStorageConfigsNonCRR"
],
"description": "Fetches resource storage config.",
"operationId": "BackupResourceStorageConfigsNonCRR_Get",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/BackupResourceConfigResource"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/NewErrorResponse"
}
}
},
"x-ms-examples": {
"Get Vault Storage Configuration": {
"$ref": "./examples/Common/BackupStorageConfig_Get.json"
}
}
},
"put": {
"tags": [
"BackupResourceStorageConfigsNonCRR"
],
"description": "Updates vault storage model type.",
"operationId": "BackupResourceStorageConfigsNonCRR_Update",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "parameters",
"in": "body",
"description": "Vault storage config request",
"required": true,
"schema": {
"$ref": "#/definitions/BackupResourceConfigResource"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/BackupResourceConfigResource"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/NewErrorResponse"
}
}
},
"x-ms-examples": {
"Update Vault Storage Configuration": {
"$ref": "./examples/Common/BackupStorageConfig_Put.json"
}
}
},
"patch": {
"tags": [
"BackupResourceStorageConfigsNonCRR"
],
"description": "Updates vault storage model type.",
"operationId": "BackupResourceStorageConfigsNonCRR_patch",
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
},
{
"$ref": "#/parameters/ResourceGroupName"
},
{
"$ref": "#/parameters/SubscriptionId"
},
{
"name": "parameters",
"in": "body",
"description": "Vault storage config request",
"required": true,
"schema": {
"$ref": "#/definitions/BackupResourceConfigResource"
}
}
],
"responses": {
"204": {
"description": "NoContent"
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/NewErrorResponse"
}
}
},
"x-ms-examples": {
"Update Vault Storage Configuration": {
"$ref": "./examples/Common/BackupStorageConfig_Patch.json"
}
}
}
},
"/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection": {
"post": {
"tags": [
Expand Down Expand Up @@ -5885,6 +6028,73 @@
},
"x-ms-discriminator-value": "DpmJob"
},
"BackupResourceConfigResource": {
"description": "The resource storage details.",
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/BackupResourceConfig",
"description": "BackupResourceConfigResource properties"
}
}
},
"BackupResourceConfig": {
"description": "The resource storage details.",
"type": "object",
"properties": {
"storageModelType": {
"description": "Storage type",
"enum": [
"Invalid",
"GeoRedundant",
"LocallyRedundant",
"ZoneRedundant",
"ReadAccessGeoZoneRedundant"
],
"type": "string",
"x-ms-enum": {
"name": "StorageType",
"modelAsString": true
}
},
"storageType": {
"description": "Storage type.",
"enum": [
"Invalid",
"GeoRedundant",
"LocallyRedundant",
"ZoneRedundant",
"ReadAccessGeoZoneRedundant"
],
"type": "string",
"x-ms-enum": {
"name": "StorageType",
"modelAsString": true
}
},
"storageTypeState": {
"description": "Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked.",
"enum": [
"Invalid",
"Locked",
"Unlocked"
],
"type": "string",
"x-ms-enum": {
"name": "StorageTypeState",
"modelAsString": true
}
},
"crossRegionRestoreFlag": {
"description": "Opt in details of Cross Region Restore feature.",
"type": "boolean"
}
}
},
"DpmJobExtendedInfo": {
"description": "Additional information on the DPM workload-specific job.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"fabricName": "Azure",
"containerName": "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall",
"protectedItemName": "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall",
"api-version": "2021-01-01"
"api-version": "2019-05-13"
},
"responses": {
"200": {
Expand All @@ -27,18 +27,13 @@
"recoveryPointTierDetails": [
{
"type": "InstantRP",
"status": "Deleted"
"status": "Valid"
},
{
"type": "HardenedRP",
"status": "Valid"
}
],
"recoveryPointMoveReadinessInfo": {
"Archive": {
"isReadyForMove": true
}
},
"isManagedVirtualMachine": true,
"virtualMachineSize": "Standard_D1",
"originalStorageAccountOption": false
Expand All @@ -59,26 +54,13 @@
"recoveryPointTierDetails": [
{
"type": "InstantRP",
"status": "Deleted"
"status": "Valid"
},
{
"type": "HardenedRP",
"status": "Deleted"
},
{
"type": "ArchivedRP",
"status": "Rehydrated",
"extendedInfo": {
"RehydratedRPExpiryTime": "2020-12-21T22:48:25.4353958Z"
}
"status": "Valid"
}
],
"recoveryPointMoveReadinessInfo": {
"ArchivedRP": {
"isReadyForMove": false,
"additionalInfo": "Recovery point cannot be moved to archive tier since it has already been moved."
}
},
"isManagedVirtualMachine": true,
"virtualMachineSize": "Standard_D1",
"originalStorageAccountOption": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "PythonSDKBackupTestRg",
"vaultName": "PySDKBackupTestRsVault",
"api-version": "2016-12-01"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig",
"name": "vaultstorageconfig",
"type": "Microsoft.RecoveryServices/vaults/backupstorageconfig",
"properties": {
"storageModelType": "GeoRedundant",
"storageType": "GeoRedundant",
"storageTypeState": "Locked"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "PythonSDKBackupTestRg",
"vaultName": "PySDKBackupTestRsVault",
"api-version": "2016-12-01",
"parameters": {
"properties": {
"storageType": "LocallyRedundant",
"storageTypeState": "Unlocked"
}
}
},
"responses": {
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "PythonSDKBackupTestRg",
"vaultName": "PySDKBackupTestRsVault",
"api-version": "2016-12-01",
"parameters": {
"properties": {
"storageType": "LocallyRedundant",
"storageTypeState": "Unlocked"
}
}
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig",
"name": "vaultstorageconfig",
"type": "Microsoft.RecoveryServices/vaults/backupstorageconfig",
"properties": {
"storageModelType": "LocallyRedundant",
"storageType": "LocallyRedundant",
"storageTypeState": "Unlocked"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "00000000-0000-0000-0000-000000000000",
"status": "InProgress",
"startTime": "2017-08-03T06:52:53.886027Z",
"endTime": "0001-01-01T00:00:00.00000Z"
"endTime": "2017-09-03T06:52:53.886027Z"
}
}
}
Expand Down