From aa5da1f66ededbdfbd5efa27132b7343e77eaed2 Mon Sep 17 00:00:00 2001 From: deymadhumanti <58032062+deymadhumanti@users.noreply.github.com> Date: Mon, 6 Apr 2020 11:03:04 +0530 Subject: [PATCH] Added swagger for private link resource API (#8655) * Added GEt-privateLinkResources API and managedIdentity changes for Vaults * Fixed PrettierCheck failure * Update vaults.json * Update vaults.json * Resolved PR commens related to PrivateLinkResources * Resolved PR comments * resolved PR comments * Using x-ms-client-flatten for PrivateLinkResourceProperties * Fixing examples for PrivateLinkResources * Revert "Fixing examples for PrivateLinkResources" This reverts commit b0d62a2886af2d771e23c4808781865aef36cd6d. * Revert "Using x-ms-client-flatten for PrivateLinkResourceProperties" This reverts commit 31ba2d0ec394b13bdf9e41dc249d1a0d769206b2. * Using x-ms-client-flatten for PrivateLinkResourceProperties * Fixing examples for PrivateLinkResources * Adding description for privateLinkResourceProperties * Resolved PR comments. Fixed SpellCheck and PrettierCheck and Java SDK failures * Changing operationId for PrivateLinkResource to PrivateLinkResources * Renaming PrivateLinkResourceList to PrivateLinkResources Co-authored-by: deymadhumanti Co-authored-by: asmaskar Co-authored-by: asmaskar <58723769+asmaskar@users.noreply.github.com> Co-authored-by: Aman Chandna --- .../stable/2016-06-01/examples/GETVault.json | 25 +- .../examples/GetPrivateLinkResources.json | 36 ++ .../examples/ListPrivateLinkResources.json | 60 ++++ .../stable/2016-06-01/examples/PUTVault.json | 15 +- .../stable/2016-06-01/vaults.json | 333 +++++++++++++++++- 5 files changed, 452 insertions(+), 17 deletions(-) create mode 100644 specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GetPrivateLinkResources.json create mode 100644 specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/ListPrivateLinkResources.json diff --git a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GETVault.json b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GETVault.json index 501c08fe4a58..3d2afa463e73 100644 --- a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GETVault.json +++ b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GETVault.json @@ -14,8 +14,31 @@ "tags": { "TestUpdatedKey": "TestUpdatedValue" }, + "identity": { + "tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b", + "principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247", + "type": "SystemAssigned" + }, "properties": { - "provisioningState": "Succeeded" + "provisioningState": "Succeeded", + "privateEndpointConnections": [ + { + "id": "/subscriptions/6c48fa17-39c7-45f1-90ac-47a587128ace/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/Vaults/pemsi-ecy-rsv2/privateEndpointConnections/pe114-pemsi-ecy-rsv.5944358949303501042.backup.75061caa-cba4-4849-8e09-608da4914aad", + "properties": { + "provisioningState": "Succeeded", + "privateEndpoint": { + "id": "/subscriptions/6c48fa17-39c7-45f1-90ac-47a587128ace/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.Network/privateEndpoints/pe114-pemsi-ecy-rsv" + }, + "privateLinkServiceConnectionState": { + "status": "Approved", + "description": "None", + "actionsRequired": "None" + } + } + } + ], + "privateEndpointStateForBackup": "Enabled", + "privateEndpointStateForSiteRecovery": "None" }, "id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample", "type": "Microsoft.RecoveryServices/vaults", diff --git a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GetPrivateLinkResources.json b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GetPrivateLinkResources.json new file mode 100644 index 000000000000..eb4c7a1cbb1a --- /dev/null +++ b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/GetPrivateLinkResources.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "subscriptionId": "6c48fa17-39c7-45f1-90ac-47a587128ace", + "resourceGroupName": "petesting", + "vaultName": "pemsi-ecy-rsv2", + "api-version": "2016-06-01", + "privateLinkResourceName": "backupResource" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/6c48fa17-39c7-45f1-90ac-47a587128ace/resourceGroups/petesting/providers/Microsoft.RecoveryServices/Vaults/pemsi-ecy-rsv2/privateLinkResources/backupResource", + "name": "backupResource", + "type": "Microsoft.RecoveryServices/Vaults/privateLinkResources", + "properties": { + "groupId": "AzureBackup", + "requiredMembers": [ + "backup-fab1", + "backup-rec2", + "backup-prot1", + "backup-ecs1", + "backup-tel1", + "backup-wbcm1", + "backup-fc1", + "backup-id1" + ], + "requiredZoneNames": [ + "privatelink.ecy.backup.windowsazure.com", + "privatelink.queue.core.windows.net", + "privatelink.blob.core.windows.net" + ] + } + } + } + } +} diff --git a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/ListPrivateLinkResources.json b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/ListPrivateLinkResources.json new file mode 100644 index 000000000000..3a245b92f5ac --- /dev/null +++ b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/ListPrivateLinkResources.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "subscriptionId": "6c48fa17-39c7-45f1-90ac-47a587128ace", + "resourceGroupName": "petesting", + "vaultName": "pemsi-ecy-rsv2", + "api-version": "2016-06-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/6c48fa17-39c7-45f1-90ac-47a587128ace/resourceGroups/petesting/providers/Microsoft.RecoveryServices/Vaults/pemsi-ecy-rsv2/privateLinkResources/backupResource", + "name": "backupResource", + "type": "Microsoft.RecoveryServices/Vaults/privateLinkResources", + "properties": { + "groupId": "AzureBackup", + "requiredMembers": [ + "backup-fab1", + "backup-rec2", + "backup-prot1", + "backup-ecs1", + "backup-tel1", + "backup-wbcm1", + "backup-fc1", + "backup-id1" + ], + "requiredZoneNames": [ + "privatelink.ecy.backup.windowsazure.com", + "privatelink.queue.core.windows.net", + "privatelink.blob.core.windows.net" + ] + } + }, + { + "id": "/subscriptions/6c48fa17-39c7-45f1-90ac-47a587128ace/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/amchandnTest2702A/privateLinkResources/siteRecoveryResource", + "name": "siteRecoveryResource", + "type": "Microsoft.RecoveryServices/vaults/privateLinkResources", + "properties": { + "groupId": "AzureSiteRecovery", + "requiredMembers": [ + "siteRecovery-rcm1", + "siteRecovery-prot2", + "siteRecovery-tel1", + "siteRecovery-srs1", + "siteRecovery-prot2b", + "siteRecovery-id1" + ], + "requiredZoneNames": [ + "privatelink.ecy.siterecovery.windowsazure.com", + "privatelink.queue.core.windows.net", + "privatelink.blob.core.windows.net" + ] + } + } + ] + } + } + } +} diff --git a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/PUTVault.json b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/PUTVault.json index d2a9dca8334c..9f7a754d4a1c 100644 --- a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/PUTVault.json +++ b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/examples/PUTVault.json @@ -9,7 +9,10 @@ "sku": { "name": "Standard" }, - "location": "West US" + "location": "West US", + "identity": { + "type": "SystemAssigned" + } } }, "responses": { @@ -21,6 +24,11 @@ "tags": { "TestUpdatedKey": "TestUpdatedValue" }, + "identity": { + "tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b", + "principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247", + "type": "SystemAssigned" + }, "properties": { "provisioningState": "Succeeded" }, @@ -39,6 +47,11 @@ "tags": { "TestUpdatedKey": "TestUpdatedValue" }, + "identity": { + "tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b", + "principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247", + "type": "SystemAssigned" + }, "properties": { "provisioningState": "Succeeded" }, diff --git a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/vaults.json b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/vaults.json index fba28afd72a3..120ec809c638 100644 --- a/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/vaults.json +++ b/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2016-06-01/vaults.json @@ -18,6 +18,96 @@ "application/json" ], "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources": { + "get": { + "tags": [ + "ListPrivateLinkResources" + ], + "summary": "Returns the list of private link resources that need to be created for Backup and SiteRecovery", + "operationId": "PrivateLinkResources_List", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ApiVersion" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PrivateLinkResources" + } + } + }, + "deprecated": false, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + }, + "x-ms-examples": { + "List PrivateLinkResources": { + "$ref": "./examples/ListPrivateLinkResources.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}": { + "get": { + "tags": [ + "GetPrivateLinkResources" + ], + "summary": "Returns a specified private link resource that need to be created for Backup and SiteRecovery", + "operationId": "PrivateLinkResources_Get", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/VaultName" + }, + { + "$ref": "#/parameters/ApiVersion" + }, + { + "name": "privateLinkResourceName", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PrivateLinkResource" + } + } + }, + "deprecated": false, + "x-ms-examples": { + "Get PrivateLinkResource": { + "$ref": "./examples/GetPrivateLinkResources.json" + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability": { "post": { "tags": [ @@ -62,7 +152,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/CheckNameAvailabilityResultResource" + "$ref": "#/definitions/CheckNameAvailabilityResult" } } }, @@ -548,20 +638,6 @@ } } }, - "CheckNameAvailabilityResultResource": { - "description": "Response for check name availability API. Resource provider will set availability as true | false.", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "$ref": "#/definitions/CheckNameAvailabilityResult", - "description": "CheckNameAvailabilityResultResource properties" - } - } - }, "ClientDiscoveryDisplay": { "description": "Localized display information of an operation.", "type": "object", @@ -839,6 +915,9 @@ } ], "properties": { + "identity": { + "$ref": "#/definitions/IdentityData" + }, "properties": { "$ref": "#/definitions/VaultProperties" }, @@ -928,6 +1007,230 @@ }, "upgradeDetails": { "$ref": "#/definitions/UpgradeDetails" + }, + "privateEndpointConnections": { + "type": "array", + "items": { + "$ref": "#/definitions/PrivateEndpointConnectionVaultProperties" + }, + "description": "List of private endpoint connection.", + "readOnly": true + }, + "privateEndpointStateForBackup": { + "description": "Private endpoint state for backup.", + "enum": [ + "None", + "Enabled" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "VaultPrivateEndpointState", + "modelAsString": true + } + }, + "privateEndpointStateForSiteRecovery": { + "description": "Private endpoint state for site recovery.", + "enum": [ + "None", + "Enabled" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "VaultPrivateEndpointState", + "modelAsString": true + } + } + } + }, + "IdentityData": { + "required": [ + "type" + ], + "type": "object", + "description": "Identity for the resource.", + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal ID of resource identity." + }, + "tenantId": { + "readOnly": true, + "type": "string", + "description": "The tenant ID of resource." + }, + "type": { + "type": "string", + "description": "The identity type.", + "enum": [ + "SystemAssigned", + "None" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": true + } + } + } + }, + "PrivateEndpointConnectionVaultProperties": { + "description": "Information to be stored in Vault properties as an element of privateEndpointConnections List.", + "readOnly": true, + "type": "object", + "properties": { + "id": { + "description": "Format of id subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}.", + "readOnly": true, + "type": "string" + }, + "properties": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + } + }, + "PrivateEndpointConnection": { + "description": "Private Endpoint Connection Response Properties.", + "readOnly": true, + "type": "object", + "properties": { + "provisioningState": { + "description": "Gets or sets provisioning state of the private endpoint connection.", + "readOnly": true, + "enum": [ + "Succeeded", + "Deleting", + "Failed", + "Pending" + ], + "type": "string", + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "privateEndpoint": { + "$ref": "#/definitions/PrivateEndpoint" + }, + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/PrivateLinkServiceConnectionState" + } + } + }, + "PrivateEndpoint": { + "description": "The Private Endpoint network resource that is linked to the Private Endpoint connection.", + "readOnly": true, + "type": "object", + "properties": { + "id": { + "description": "Gets or sets id.", + "readOnly": true, + "type": "string" + } + } + }, + "PrivateLinkServiceConnectionState": { + "description": "Gets or sets private link service connection state.", + "readOnly": true, + "type": "object", + "properties": { + "status": { + "description": "Gets or sets the status.", + "readOnly": true, + "enum": [ + "Pending", + "Approved", + "Rejected", + "Disconnected" + ], + "type": "string", + "x-ms-enum": { + "name": "PrivateEndpointConnectionStatus", + "modelAsString": true + } + }, + "description": { + "description": "Gets or sets description.", + "readOnly": true, + "type": "string" + }, + "actionsRequired": { + "description": "Gets or sets actions required.", + "readOnly": true, + "type": "string" + } + } + }, + "PrivateLinkResources": { + "description": "Class which represent the stamps associated with the vault.", + "readOnly": true, + "type": "object", + "properties": { + "value": { + "description": "A collection of private link resources", + "type": "array", + "items": { + "$ref": "#/definitions/PrivateLinkResource" + } + }, + "nextLink": { + "description": "Link to the next chunk of the response", + "type": "string" + } + } + }, + "PrivateLinkResource": { + "description": "Information of the private link resource.", + "readOnly": true, + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/PrivateLinkResourceProperties", + "description": "Resource properties", + "x-ms-client-flatten": true + }, + "id": { + "description": "Fully qualified identifier of the resource.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "Name of the resource.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "e.g. Microsoft.RecoveryServices/vaults/privateLinkResources", + "readOnly": true, + "type": "string" + } + } + }, + "PrivateLinkResourceProperties": { + "type": "object", + "description": "Properties of the private link resource.", + "properties": { + "groupId": { + "description": "e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery)", + "readOnly": true, + "type": "string" + }, + "requiredMembers": { + "description": "[backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1]", + "readOnly": true, + "type": "array", + "items": { + "type": "string" + } + }, + "requiredZoneNames": { + "description": "The private link resource Private link DNS zone name.", + "readOnly": true, + "type": "array", + "items": { + "type": "string" + } } } }