From 880d92c54865f3c4c9567685c6d81dd454e120da Mon Sep 17 00:00:00 2001 From: Jonathan He Date: Mon, 25 Jul 2022 12:35:34 -0400 Subject: [PATCH 1/6] private-cloud cmk-encryption commands, identity commands, and test cases --- src/vmware/HISTORY.md | 9 + src/vmware/azext_vmware/_help.py | 10 + src/vmware/azext_vmware/_params.py | 11 +- src/vmware/azext_vmware/commands.py | 6 +- src/vmware/azext_vmware/custom.py | 48 ++- .../tests/latest/recordings/test_vmware.yaml | 384 ++++++++++++++++-- .../latest/recordings/test_vmware_addon.yaml | 24 +- .../recordings/test_vmware_cloud_link.yaml | 8 +- .../recordings/test_vmware_datastores.yaml | 26 +- .../test_vmware_global_reach_connection.yaml | 34 +- .../latest/recordings/test_vmware_hcx.yaml | 18 +- .../test_vmware_placement_policy.yaml | 16 +- .../latest/recordings/test_vmware_script.yaml | 16 +- .../test_vmware_virtual_machines.yaml | 6 +- .../test_vmware_workload_network.yaml | 82 ++-- .../tests/latest/test_vmware_scenario.py | 8 +- 16 files changed, 525 insertions(+), 181 deletions(-) diff --git a/src/vmware/HISTORY.md b/src/vmware/HISTORY.md index ba918c7c7ec..fcb0b901cb2 100644 --- a/src/vmware/HISTORY.md +++ b/src/vmware/HISTORY.md @@ -1,5 +1,14 @@ # Release History +## 4.0.3 (2022-07) + +- Add `az vmware private-cloud enable-cmk-encryption` +- Add `az vmware private-cloud disable-cmk-encryption` +- Deprecate `az vmware private-cloud add-cmk-encryption` +- Deprecate `az vmware private-cloud delete-cmk-encryption` +- Removed `--mi-system-assigned` parameter from `az vmware private-cloud identity assign` +- Renamed `--mi-system-assigned` parameter from `az vmware private-cloud create` to `--identity` + ## 4.0.2 (2022-02) - Update `az vmware datastore disk-pool-volume create` to only accept one argument for --mount-option diff --git a/src/vmware/azext_vmware/_help.py b/src/vmware/azext_vmware/_help.py index 0a7fad71d5d..4767a501bd4 100644 --- a/src/vmware/azext_vmware/_help.py +++ b/src/vmware/azext_vmware/_help.py @@ -117,6 +117,16 @@ short-summary: Delete a Customer Managed Keys Encryption from a private cloud. """ +helps['vmware private-cloud enable-cmk-encryption'] = """ + type: command + short-summary: Enable a Customer Managed Keys Encryption to a private cloud. +""" + +helps['vmware private-cloud disable-cmk-encryption'] = """ + type: command + short-summary: Disable a Customer Managed Keys Encryption from a private cloud. +""" + helps['vmware private-cloud identity'] = """ type: group short-summary: Commands for Managed Identity in a private cloud. diff --git a/src/vmware/azext_vmware/_params.py b/src/vmware/azext_vmware/_params.py index 6275e925950..896b69c3f16 100644 --- a/src/vmware/azext_vmware/_params.py +++ b/src/vmware/azext_vmware/_params.py @@ -39,7 +39,7 @@ def load_arguments(self, _): c.argument('nsxt_password', help='NSX-T Manager password.') c.argument('accept_eula', help='Accept the end-user license agreement without prompting.') c.argument('network_block', help='A subnet at least of size /22. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22.') - c.argument('mi_system_assigned', help='Enable a system assigned identity.') + c.argument('identity', help='Enable a system assigned identity.') with self.argument_context('vmware private-cloud show') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.') @@ -60,7 +60,11 @@ def load_arguments(self, _): c.argument('secondary_zone', help='The secondary availability zone for the private cloud.') with self.argument_context('vmware private-cloud add-cmk-encryption') as c: - c.argument('enc_status', help='Status of customer managed encryption key. Possible values include "Enabled" and "Disabled".') + c.argument('enc_kv_key_name', help='The name of the encryption key vault key.') + c.argument('enc_kv_url', help='The URL of the encryption key vault.') + c.argument('enc_kv_key_version', help='The version of the encryption key vault key.') + + with self.argument_context('vmware private-cloud enable-cmk-encryption') as c: c.argument('enc_kv_key_name', help='The name of the encryption key vault key.') c.argument('enc_kv_url', help='The URL of the encryption key vault.') c.argument('enc_kv_key_version', help='The version of the encryption key vault key.') @@ -99,9 +103,6 @@ def load_arguments(self, _): c.argument('domain', help='The domain\'s dns name.') c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.') - with self.argument_context('vmware private-cloud identity') as c: - c.argument('system_assigned', help='Enable a system assigned identity.') - with self.argument_context('vmware private-cloud update') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.') diff --git a/src/vmware/azext_vmware/commands.py b/src/vmware/azext_vmware/commands.py index 24c4da38fa4..fe107aea73a 100644 --- a/src/vmware/azext_vmware/commands.py +++ b/src/vmware/azext_vmware/commands.py @@ -28,8 +28,10 @@ def load_command_table(self, _): g.custom_command('delete-identity-source', 'privatecloud_deleteidentitysource') g.custom_command('add-availability-zone', 'privatecloud_addavailabilityzone') g.custom_command('delete-availability-zone', 'privatecloud_deleteavailabilityzone') - g.custom_command('add-cmk-encryption', 'privatecloud_addcmkencryption') - g.custom_command('delete-cmk-encryption', 'privatecloud_deletecmkenryption') + g.custom_command('add-cmk-encryption', 'privatecloud_addcmkencryption', deprecate_info=g.deprecate(redirect='az vmware private-cloud enable-cmk-encryption', hide=True)) + g.custom_command('delete-cmk-encryption', 'privatecloud_deletecmkenryption', deprecate_info=g.deprecate(redirect='az vmware private-cloud disable-cmk-encryption', hide=True)) + g.custom_command('enable-cmk-encryption', 'privatecloud_addcmkencryption') + g.custom_command('disable-cmk-encryption', 'privatecloud_deletecmkenryption') g.custom_command('rotate-vcenter-password', 'privatecloud_rotate_vcenter_password') g.custom_command('rotate-nsxt-password', 'privatecloud_rotate_nsxt_password') diff --git a/src/vmware/azext_vmware/custom.py b/src/vmware/azext_vmware/custom.py index d80908c4883..7d40b98b487 100644 --- a/src/vmware/azext_vmware/custom.py +++ b/src/vmware/azext_vmware/custom.py @@ -48,7 +48,7 @@ def privatecloud_show(client: AVSClient, resource_group_name, name): return client.private_clouds.get(resource_group_name, name) -def privatecloud_create(client: AVSClient, resource_group_name, name, sku, cluster_size, network_block, location=None, internet=None, vcenter_password=None, nsxt_password=None, tags=None, accept_eula=False, mi_system_assigned=False, yes=False): +def privatecloud_create(client: AVSClient, resource_group_name, name, sku, cluster_size, network_block, location=None, internet=None, vcenter_password=None, nsxt_password=None, tags=None, identity=False, accept_eula=False, yes=False): from knack.prompting import prompt_y_n if not accept_eula: print(LEGAL_TERMS) @@ -56,14 +56,14 @@ def privatecloud_create(client: AVSClient, resource_group_name, name, sku, clust if not yes and not prompt_y_n(msg, default="n"): return None - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku, PrivateCloudIdentity + from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku, PrivateCloudIdentity, ResourceIdentityType cloud = PrivateCloud(sku=Sku(name=sku), ciruit=Circuit(), management_cluster=ManagementCluster(cluster_size=cluster_size), network_block=network_block) if location is not None: cloud.location = location if tags is not None: cloud.tags = tags - if mi_system_assigned: - cloud.identity = PrivateCloudIdentity(type='SystemAssigned') + if identity: + cloud.identity = PrivateCloudIdentity(type=ResourceIdentityType.SYSTEM_ASSIGNED) if internet is not None: cloud.internet = internet if vcenter_password is not None: @@ -74,8 +74,8 @@ def privatecloud_create(client: AVSClient, resource_group_name, name, sku, clust def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_size=None, internet=None, tags=None): - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudUpdate, ManagementCluster - private_cloud_update = PrivateCloudUpdate() + from azext_vmware.vendored_sdks.avs_client.models import ManagementCluster + private_cloud_update = client.private_clouds.get(resource_group_name, name) if tags is not None: private_cloud_update.tags = tags if cluster_size is not None: @@ -122,8 +122,8 @@ def privatecloud_deleteidentitysource(client: AVSClient, resource_group_name, na def privatecloud_addavailabilityzone(client: AVSClient, resource_group_name, private_cloud, strategy=None, zone=None, secondary_zone=None): - from azext_vmware.vendored_sdks.avs_client.models import AvailabilityProperties, PrivateCloudUpdate - pc = PrivateCloudUpdate() + from azext_vmware.vendored_sdks.avs_client.models import AvailabilityProperties + pc = client.private_clouds.get(resource_group_name, private_cloud) pc.availability = AvailabilityProperties(strategy=strategy, zone=zone, secondary_zone=secondary_zone) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) @@ -133,16 +133,15 @@ def privatecloud_deleteavailabilityzone(client: AVSClient, resource_group_name, msg = 'This will delete the availability zone. Are you sure?' if not yes and not prompt_y_n(msg, default="n"): return None - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudUpdate - pc = PrivateCloudUpdate() + pc = client.private_clouds.get(resource_group_name, private_cloud) pc.availability = None return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) -def privatecloud_addcmkencryption(client: AVSClient, resource_group_name, private_cloud, enc_status=None, enc_kv_key_name=None, enc_kv_key_version=None, enc_kv_url=None): - from azext_vmware.vendored_sdks.avs_client.models import Encryption, EncryptionKeyVaultProperties, PrivateCloudUpdate - pc = PrivateCloudUpdate() - pc.encryption = Encryption(status=enc_status, key_vault_properties=EncryptionKeyVaultProperties(key_name=enc_kv_key_name, key_version=enc_kv_key_version, key_vault_url=enc_kv_url)) +def privatecloud_addcmkencryption(client: AVSClient, resource_group_name, private_cloud, enc_kv_key_name=None, enc_kv_key_version=None, enc_kv_url=None): + from azext_vmware.vendored_sdks.avs_client.models import Encryption, EncryptionKeyVaultProperties, EncryptionState + pc = client.private_clouds.get(resource_group_name, private_cloud) + pc.encryption = Encryption(status=EncryptionState.ENABLED, key_vault_properties=EncryptionKeyVaultProperties(key_name=enc_kv_key_name, key_version=enc_kv_key_version, key_vault_url=enc_kv_url)) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) @@ -151,24 +150,23 @@ def privatecloud_deletecmkenryption(client: AVSClient, resource_group_name, priv msg = 'This will delete the managed keys encryption. Are you sure?' if not yes and not prompt_y_n(msg, default="n"): return None - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudUpdate - pc = PrivateCloudUpdate() - pc.encryption = None + from azext_vmware.vendored_sdks.avs_client.models import Encryption, EncryptionState + pc = client.private_clouds.get(resource_group_name, private_cloud) + pc.encryption = Encryption(status=EncryptionState.DISABLED) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) -def privatecloud_identity_assign(client: AVSClient, resource_group_name, private_cloud, system_assigned=False): - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudIdentity, PrivateCloudUpdate - pc = PrivateCloudUpdate() - if system_assigned: - pc.identity = PrivateCloudIdentity(type="SystemAssigned") +def privatecloud_identity_assign(client: AVSClient, resource_group_name, private_cloud): + from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudIdentity, ResourceIdentityType + pc = client.private_clouds.get(resource_group_name, private_cloud) + pc.identity = PrivateCloudIdentity(type=ResourceIdentityType.SYSTEM_ASSIGNED) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) def privatecloud_identity_remove(client: AVSClient, resource_group_name, private_cloud): - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudIdentity, PrivateCloudUpdate - pc = PrivateCloudUpdate() - pc.identity = PrivateCloudIdentity(type="None") + from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudIdentity, ResourceIdentityType + pc = client.private_clouds.get(resource_group_name, private_cloud) + pc.identity = PrivateCloudIdentity(type=ResourceIdentityType.NONE) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml index 22dd7e98827..317af7cf5d9 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:45 GMT + - Mon, 25 Jul 2022 16:14:16 GMT server: - Rocket status: @@ -61,7 +61,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:49 GMT + - Mon, 25 Jul 2022 16:14:20 GMT server: - Rocket status: @@ -93,7 +93,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:54 GMT + - Mon, 25 Jul 2022 16:14:25 GMT server: - Rocket status: @@ -132,7 +132,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:58 GMT + - Mon, 25 Jul 2022 16:14:29 GMT server: - Rocket status: @@ -164,14 +164,54 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:02 GMT + - Mon, 25 Jul 2022 16:14:33 GMT server: - Rocket status: code: 200 message: OK - request: - body: '{"properties": {"managementCluster": {"clusterSize": 4}, "internet": "Disabled"}}' + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud update + Connection: + - keep-alive + ParameterSetName: + - -g -n --cluster-size + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:14:38 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4}, "internet": "Disabled", "identitySources": [{"name": "group1", "alias": + "groupAlias", "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": + "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": + "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", + "zone": 1}, "encryption": {"status": "Enabled", "keyVaultProperties": {"keyName": + "keyname1", "keyVersion": "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json @@ -182,7 +222,7 @@ interactions: Connection: - keep-alive Content-Length: - - '81' + - '706' Content-Type: - application/json ParameterSetName: @@ -200,14 +240,56 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:06 GMT + - Mon, 25 Jul 2022 16:14:38 GMT server: - Rocket status: code: 200 message: OK - request: - body: '{"properties": {"internet": "Enabled"}}' + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud update + Connection: + - keep-alive + ParameterSetName: + - -g -n --internet + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:14:42 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", + "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, + "internet": "Enabled", "identitySources": [{"name": "group1", "alias": "groupAlias", + "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", + "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", + "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": + {"status": "Enabled", "keyVaultProperties": {"keyName": "keyname1", "keyVersion": + "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json @@ -218,7 +300,7 @@ interactions: Connection: - keep-alive Content-Length: - - '39' + - '864' Content-Type: - application/json ParameterSetName: @@ -236,7 +318,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:11 GMT + - Mon, 25 Jul 2022 16:14:42 GMT server: - Rocket status: @@ -265,14 +347,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/myauthname?api-version=2021-12-01 response: body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1","name":"authorization1","type":"Microsoft.AVS/privateClouds/authorizations","properties":{"provisioningState":"Succeeded","expressRouteAuthorizationId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth","expressRouteAuthorizationKey":"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc"}}' + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1","name":"authorization1","type":"Microsoft.AVS/privateClouds/authorizations","properties":{"provisioningState":"Succeeded","expressRouteAuthorizationId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth","expressRouteAuthorizationKey":"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc","expressRouteId":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"}}' headers: content-length: - - '564' + - '791' content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:15 GMT + - Mon, 25 Jul 2022 16:14:46 GMT server: - Rocket status: @@ -304,7 +386,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:19 GMT + - Mon, 25 Jul 2022 16:14:50 GMT server: - Rocket status: @@ -337,7 +419,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:23 GMT + - Mon, 25 Jul 2022 16:14:55 GMT server: - Rocket status: @@ -387,7 +469,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:23 GMT + - Mon, 25 Jul 2022 16:14:55 GMT server: - Rocket status: @@ -419,7 +501,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:28 GMT + - Mon, 25 Jul 2022 16:14:59 GMT server: - Rocket status: @@ -451,7 +533,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:32 GMT + - Mon, 25 Jul 2022 16:15:03 GMT server: - Rocket status: @@ -488,7 +570,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:37 GMT + - Mon, 25 Jul 2022 16:15:08 GMT server: - Rocket status: @@ -520,7 +602,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:41 GMT + - Mon, 25 Jul 2022 16:15:12 GMT server: - Rocket status: @@ -556,7 +638,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:45 GMT + - Mon, 25 Jul 2022 16:15:16 GMT server: - Rocket status: @@ -588,7 +670,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:50 GMT + - Mon, 25 Jul 2022 16:15:21 GMT server: - Rocket status: @@ -620,14 +702,56 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:54 GMT + - Mon, 25 Jul 2022 16:15:25 GMT server: - Rocket status: code: 200 message: OK - request: - body: '{"identity": {"type": "SystemAssigned"}, "properties": {"internet": "Disabled"}}' + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud identity assign + Connection: + - keep-alive + ParameterSetName: + - -g -c + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:15:29 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", + "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, + "internet": "Disabled", "identitySources": [{"name": "group1", "alias": "groupAlias", + "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", + "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", + "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": + {"status": "Enabled", "keyVaultProperties": {"keyName": "keyname1", "keyVersion": + "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json @@ -638,11 +762,11 @@ interactions: Connection: - keep-alive Content-Length: - - '80' + - '865' Content-Type: - application/json ParameterSetName: - - -g -c --system-assigned + - -g -c User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -656,14 +780,55 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:59 GMT + - Mon, 25 Jul 2022 16:15:29 GMT server: - Rocket status: code: 200 message: OK - request: - body: '{"identity": {"type": "None"}, "properties": {"internet": "Disabled"}}' + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud identity remove + Connection: + - keep-alive + ParameterSetName: + - -g -c + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:15:33 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": + {"type": "None"}, "properties": {"managementCluster": {"clusterSize": 4, "hosts": + ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", "fakehost20.nyc1.kubernetes.center", + "fakehost21.nyc1.kubernetes.center"]}, "internet": "Disabled", "identitySources": + [{"name": "group1", "alias": "groupAlias", "domain": "domain1", "baseUserDN": + "ou=baseUser", "baseGroupDN": "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", + "secondaryServer": "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": + {"strategy": "SingleZone", "zone": 1}, "encryption": {"status": "Enabled", "keyVaultProperties": + {"keyName": "keyname1", "keyVersion": "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json @@ -674,7 +839,7 @@ interactions: Connection: - keep-alive Content-Length: - - '70' + - '855' Content-Type: - application/json ParameterSetName: @@ -692,7 +857,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:02 GMT + - Mon, 25 Jul 2022 16:15:33 GMT server: - Rocket status: @@ -724,7 +889,160 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:08 GMT + - Mon, 25 Jul 2022 16:15:38 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud enable-cmk-encryption + Connection: + - keep-alive + ParameterSetName: + - -c -g --enc-kv-key-name --enc-kv-key-version --enc-kv-url + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:15:42 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", + "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, + "internet": "Disabled", "identitySources": [{"name": "group1", "alias": "groupAlias", + "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", + "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", + "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": + {"status": "Enabled", "keyVaultProperties": {"keyName": "test-key-name", "keyVersion": + "1", "keyVaultUrl": "test-url"}}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud enable-cmk-encryption + Connection: + - keep-alive + Content-Length: + - '827' + Content-Type: + - application/json + ParameterSetName: + - -c -g --enc-kv-key-name --enc-kv-key-version --enc-kv-url + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: PATCH + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]}}' + headers: + content-length: + - '1770' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:15:42 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud disable-cmk-encryption + Connection: + - keep-alive + ParameterSetName: + - -c -g --yes + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:15:46 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", + "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, + "internet": "Disabled", "identitySources": [{"name": "group1", "alias": "groupAlias", + "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", + "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", + "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": + {"status": "Disabled"}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud disable-cmk-encryption + Connection: + - keep-alive + Content-Length: + - '730' + Content-Type: + - application/json + ParameterSetName: + - -c -g --yes + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: PATCH + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]}}' + headers: + content-length: + - '1770' + content-type: + - application/json + date: + - Mon, 25 Jul 2022 16:15:46 GMT server: - Rocket status: @@ -756,7 +1074,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:12 GMT + - Mon, 25 Jul 2022 16:15:50 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_addon.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_addon.yaml index 81a8b813fe1..031d66a7acd 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_addon.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_addon.yaml @@ -30,7 +30,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:37 GMT + - Mon, 25 Jul 2022 16:06:39 GMT server: - Rocket status: @@ -62,7 +62,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:42 GMT + - Mon, 25 Jul 2022 16:06:43 GMT server: - Rocket status: @@ -98,7 +98,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:46 GMT + - Mon, 25 Jul 2022 16:06:48 GMT server: - Rocket status: @@ -130,7 +130,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:50 GMT + - Mon, 25 Jul 2022 16:06:52 GMT server: - Rocket status: @@ -162,7 +162,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:54 GMT + - Mon, 25 Jul 2022 16:06:56 GMT server: - Rocket status: @@ -194,7 +194,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:47:58 GMT + - Mon, 25 Jul 2022 16:07:01 GMT server: - Rocket status: @@ -226,7 +226,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:03 GMT + - Mon, 25 Jul 2022 16:07:05 GMT server: - Rocket status: @@ -262,7 +262,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:07 GMT + - Mon, 25 Jul 2022 16:07:09 GMT server: - Rocket status: @@ -294,7 +294,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:11 GMT + - Mon, 25 Jul 2022 16:07:14 GMT server: - Rocket status: @@ -326,7 +326,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:15 GMT + - Mon, 25 Jul 2022 16:07:18 GMT server: - Rocket status: @@ -358,7 +358,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:48:20 GMT + - Mon, 25 Jul 2022 16:07:22 GMT server: - Rocket status: @@ -390,7 +390,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:24 GMT + - Mon, 25 Jul 2022 16:07:26 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_cloud_link.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_cloud_link.yaml index 120987e7dba..89f17c83d40 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_cloud_link.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_cloud_link.yaml @@ -29,7 +29,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:37 GMT + - Mon, 25 Jul 2022 16:06:39 GMT server: - Rocket status: @@ -61,7 +61,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:41 GMT + - Mon, 25 Jul 2022 16:06:43 GMT server: - Rocket status: @@ -93,7 +93,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:46 GMT + - Mon, 25 Jul 2022 16:06:48 GMT server: - Rocket status: @@ -125,7 +125,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:47:50 GMT + - Mon, 25 Jul 2022 16:06:52 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_datastores.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_datastores.yaml index aa87ed22c25..16351ca9e6b 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_datastores.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_datastores.yaml @@ -23,14 +23,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rasivagu-sddc-rg/providers/Microsoft.AVS/privateClouds/rasivagu-mock-sddc/clusters/Cluster-1/datastores/iSCSIDatastore1?api-version=2021-12-01 response: body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"}}}' + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"},"status":"Accessible"}}' headers: content-length: - - '479' + - '501' content-type: - application/json date: - - Tue, 08 Feb 2022 17:28:50 GMT + - Mon, 25 Jul 2022 16:06:39 GMT server: - Rocket status: @@ -55,14 +55,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rasivagu-sddc-rg/providers/Microsoft.AVS/privateClouds/rasivagu-mock-sddc/clusters/Cluster-1/datastores/iSCSIDatastore1?api-version=2021-12-01 response: body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"}}}' + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"},"status":"Accessible"}}' headers: content-length: - - '479' + - '501' content-type: - application/json date: - - Tue, 08 Feb 2022 17:28:55 GMT + - Mon, 25 Jul 2022 16:06:43 GMT server: - Rocket status: @@ -87,14 +87,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rasivagu-sddc-rg/providers/Microsoft.AVS/privateClouds/rasivagu-mock-sddc/clusters/Cluster-1/datastores?api-version=2021-12-01 response: body: - string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"}}},{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore2","name":"datastore2","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","diskPoolVolume":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.StoragePool/diskPools/DiskPool1/targets/Target1","lunName":"lun0","mountOption":"MOUNT","path":"/vmfs/devices/disks/naa.6001405f75f6bdf7f6f49db8b4b21723"}}}]}' + string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"},"status":"Accessible"}},{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore2","name":"datastore2","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","diskPoolVolume":{"targetId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.StoragePool/diskPools/DiskPool1/targets/Target1","lunName":"lun0","mountOption":"MOUNT","path":"/vmfs/devices/disks/naa.6001405f75f6bdf7f6f49db8b4b21723"},"status":"Accessible"}}]}' headers: content-length: - - '1051' + - '1095' content-type: - application/json date: - - Tue, 08 Feb 2022 17:28:59 GMT + - Mon, 25 Jul 2022 16:06:48 GMT server: - Rocket status: @@ -126,7 +126,7 @@ interactions: content-length: - '0' date: - - Tue, 08 Feb 2022 17:29:03 GMT + - Mon, 25 Jul 2022 16:06:52 GMT server: - Rocket status: @@ -156,14 +156,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rasivagu-sddc-rg/providers/Microsoft.AVS/privateClouds/rasivagu-mock-sddc/clusters/Cluster-1/datastores/iSCSIDatastore1?api-version=2021-12-01 response: body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"}}}' + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1","name":"datastore1","type":"Microsoft.AVS/privateClouds/clusters/datastores","properties":{"provisioningState":"Succeeded","netAppVolume":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"},"status":"Accessible"}}' headers: content-length: - - '479' + - '501' content-type: - application/json date: - - Tue, 08 Feb 2022 17:29:07 GMT + - Mon, 25 Jul 2022 16:06:56 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_global_reach_connection.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_global_reach_connection.yaml index 3c36594e9cd..d08da3e7f3e 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_global_reach_connection.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_global_reach_connection.yaml @@ -32,7 +32,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:37 GMT + - Mon, 25 Jul 2022 16:06:39 GMT server: - Rocket status: @@ -57,14 +57,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware_hcx000001/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections?api-version=2021-12-01 response: body: - string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"}}]}' + string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer","expressRouteId":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"}}]}' headers: content-length: - - '569' + - '796' content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:42 GMT + - Mon, 25 Jul 2022 16:06:43 GMT server: - Rocket status: @@ -95,14 +95,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware_hcx000001/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1?api-version=2021-12-01 response: body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"}}' + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer","expressRouteId":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"}}' headers: content-length: - - '557' + - '784' content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:46 GMT + - Mon, 25 Jul 2022 16:06:48 GMT server: - Rocket status: @@ -127,14 +127,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware_hcx000001/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections?api-version=2021-12-01 response: body: - string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"}}]}' + string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer","expressRouteId":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"}}]}' headers: content-length: - - '569' + - '796' content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:50 GMT + - Mon, 25 Jul 2022 16:06:52 GMT server: - Rocket status: @@ -159,14 +159,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware_hcx000001/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1?api-version=2021-12-01 response: body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"}}' + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer","expressRouteId":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"}}' headers: content-length: - - '557' + - '784' content-type: - application/json date: - - Thu, 18 Nov 2021 21:47:54 GMT + - Mon, 25 Jul 2022 16:06:56 GMT server: - Rocket status: @@ -198,7 +198,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:47:58 GMT + - Mon, 25 Jul 2022 16:07:01 GMT server: - Rocket status: @@ -223,14 +223,14 @@ interactions: uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware_hcx000001/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections?api-version=2021-12-01 response: body: - string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"}}]}' + string: '{"value":[{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1","name":"connection1","type":"Microsoft.AVS/privateClouds/globalReachConnections","properties":{"provisioningState":"Succeeded","addressPrefix":"10.2.3.16/29","authorizationKey":"01010101-0101-0101-0101-010101010101","circuitConnectionStatus":"Connected","peerExpressRouteCircuit":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer","expressRouteId":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"}}]}' headers: content-length: - - '569' + - '796' content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:03 GMT + - Mon, 25 Jul 2022 16:07:05 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_hcx.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_hcx.yaml index 7b1302e8672..98b4df7fb86 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_hcx.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_hcx.yaml @@ -32,7 +32,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:37 GMT + - Mon, 25 Jul 2022 16:07:39 GMT server: - Rocket status: @@ -68,7 +68,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:41 GMT + - Mon, 25 Jul 2022 16:07:44 GMT server: - Rocket status: @@ -100,7 +100,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:45 GMT + - Mon, 25 Jul 2022 16:07:48 GMT server: - Rocket status: @@ -132,7 +132,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:49 GMT + - Mon, 25 Jul 2022 16:07:52 GMT server: - Rocket status: @@ -168,7 +168,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:54 GMT + - Mon, 25 Jul 2022 16:07:56 GMT server: - Rocket status: @@ -200,7 +200,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:58 GMT + - Mon, 25 Jul 2022 16:08:01 GMT server: - Rocket status: @@ -232,7 +232,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:02 GMT + - Mon, 25 Jul 2022 16:08:05 GMT server: - Rocket status: @@ -264,7 +264,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:06 GMT + - Mon, 25 Jul 2022 16:08:09 GMT server: - Rocket status: @@ -296,7 +296,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:11 GMT + - Mon, 25 Jul 2022 16:08:13 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_placement_policy.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_placement_policy.yaml index 0a7187227d0..5f8d27c2564 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_placement_policy.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_placement_policy.yaml @@ -25,7 +25,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:03 GMT + - Mon, 25 Jul 2022 16:07:05 GMT server: - Rocket status: @@ -57,7 +57,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:07 GMT + - Mon, 25 Jul 2022 16:07:09 GMT server: - Rocket status: @@ -96,7 +96,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:11 GMT + - Mon, 25 Jul 2022 16:07:13 GMT server: - Rocket status: @@ -134,7 +134,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:15 GMT + - Mon, 25 Jul 2022 16:07:18 GMT server: - Rocket status: @@ -166,7 +166,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:48:20 GMT + - Mon, 25 Jul 2022 16:07:22 GMT server: - Rocket status: @@ -204,7 +204,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:24 GMT + - Mon, 25 Jul 2022 16:07:26 GMT server: - Rocket status: @@ -241,7 +241,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:28 GMT + - Mon, 25 Jul 2022 16:07:31 GMT server: - Rocket status: @@ -273,7 +273,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:48:32 GMT + - Mon, 25 Jul 2022 16:07:35 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_script.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_script.yaml index 8194c38fbdf..455a287b02e 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_script.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_script.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:03 GMT + - Mon, 25 Jul 2022 16:07:09 GMT server: - Rocket status: @@ -60,7 +60,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:07 GMT + - Mon, 25 Jul 2022 16:07:14 GMT server: - Rocket status: @@ -99,7 +99,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:11 GMT + - Mon, 25 Jul 2022 16:07:18 GMT server: - Rocket status: @@ -135,7 +135,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:15 GMT + - Mon, 25 Jul 2022 16:07:22 GMT server: - Rocket status: @@ -178,7 +178,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:20 GMT + - Mon, 25 Jul 2022 16:07:26 GMT server: - Rocket status: @@ -211,7 +211,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:24 GMT + - Mon, 25 Jul 2022 16:07:31 GMT server: - Rocket status: @@ -244,7 +244,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:28 GMT + - Mon, 25 Jul 2022 16:07:35 GMT server: - Rocket status: @@ -276,7 +276,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:48:32 GMT + - Mon, 25 Jul 2022 16:07:39 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_virtual_machines.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_virtual_machines.yaml index d07483b97bc..bed6c15729a 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_virtual_machines.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_virtual_machines.yaml @@ -25,7 +25,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:15 GMT + - Mon, 25 Jul 2022 16:07:18 GMT server: - Rocket status: @@ -57,7 +57,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:20 GMT + - Mon, 25 Jul 2022 16:07:22 GMT server: - Rocket status: @@ -91,7 +91,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:48:24 GMT + - Mon, 25 Jul 2022 16:07:26 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_workload_network.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_workload_network.yaml index 5c4930a9917..b1da5086f54 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_workload_network.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware_workload_network.yaml @@ -25,7 +25,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:45 GMT + - Mon, 25 Jul 2022 16:18:50 GMT server: - Rocket status: @@ -57,7 +57,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:49 GMT + - Mon, 25 Jul 2022 16:18:55 GMT server: - Rocket status: @@ -94,7 +94,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:48:54 GMT + - Mon, 25 Jul 2022 16:18:59 GMT server: - Rocket status: @@ -126,7 +126,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:48:58 GMT + - Mon, 25 Jul 2022 16:19:03 GMT server: - Rocket status: @@ -163,7 +163,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:02 GMT + - Mon, 25 Jul 2022 16:19:07 GMT server: - Rocket status: @@ -201,7 +201,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:06 GMT + - Mon, 25 Jul 2022 16:19:12 GMT server: - Rocket status: @@ -233,7 +233,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:11 GMT + - Mon, 25 Jul 2022 16:19:16 GMT server: - Rocket status: @@ -271,7 +271,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:15 GMT + - Mon, 25 Jul 2022 16:19:20 GMT server: - Rocket status: @@ -303,7 +303,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:19 GMT + - Mon, 25 Jul 2022 16:19:25 GMT server: - Rocket status: @@ -335,7 +335,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:23 GMT + - Mon, 25 Jul 2022 16:19:29 GMT server: - Rocket status: @@ -374,7 +374,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:28 GMT + - Mon, 25 Jul 2022 16:19:33 GMT server: - Rocket status: @@ -413,7 +413,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:32 GMT + - Mon, 25 Jul 2022 16:19:38 GMT server: - Rocket status: @@ -445,7 +445,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:37 GMT + - Mon, 25 Jul 2022 16:19:42 GMT server: - Rocket status: @@ -477,7 +477,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:41 GMT + - Mon, 25 Jul 2022 16:19:46 GMT server: - Rocket status: @@ -509,7 +509,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:46 GMT + - Mon, 25 Jul 2022 16:19:50 GMT server: - Rocket status: @@ -548,7 +548,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:50 GMT + - Mon, 25 Jul 2022 16:19:55 GMT server: - Rocket status: @@ -587,7 +587,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:49:54 GMT + - Mon, 25 Jul 2022 16:19:59 GMT server: - Rocket status: @@ -619,7 +619,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:49:59 GMT + - Mon, 25 Jul 2022 16:20:03 GMT server: - Rocket status: @@ -651,7 +651,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:02 GMT + - Mon, 25 Jul 2022 16:20:08 GMT server: - Rocket status: @@ -683,7 +683,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:07 GMT + - Mon, 25 Jul 2022 16:20:12 GMT server: - Rocket status: @@ -721,7 +721,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:12 GMT + - Mon, 25 Jul 2022 16:20:16 GMT server: - Rocket status: @@ -759,7 +759,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:16 GMT + - Mon, 25 Jul 2022 16:20:21 GMT server: - Rocket status: @@ -791,7 +791,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:50:21 GMT + - Mon, 25 Jul 2022 16:20:25 GMT server: - Rocket status: @@ -823,7 +823,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:25 GMT + - Mon, 25 Jul 2022 16:20:29 GMT server: - Rocket status: @@ -855,7 +855,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:30 GMT + - Mon, 25 Jul 2022 16:20:33 GMT server: - Rocket status: @@ -894,7 +894,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:34 GMT + - Mon, 25 Jul 2022 16:20:38 GMT server: - Rocket status: @@ -933,7 +933,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:39 GMT + - Mon, 25 Jul 2022 16:20:42 GMT server: - Rocket status: @@ -965,7 +965,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:50:43 GMT + - Mon, 25 Jul 2022 16:20:46 GMT server: - Rocket status: @@ -997,7 +997,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:47 GMT + - Mon, 25 Jul 2022 16:20:51 GMT server: - Rocket status: @@ -1029,7 +1029,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:52 GMT + - Mon, 25 Jul 2022 16:20:55 GMT server: - Rocket status: @@ -1066,7 +1066,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:50:56 GMT + - Mon, 25 Jul 2022 16:20:59 GMT server: - Rocket status: @@ -1098,7 +1098,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:51:01 GMT + - Mon, 25 Jul 2022 16:21:04 GMT server: - Rocket status: @@ -1130,7 +1130,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:05 GMT + - Mon, 25 Jul 2022 16:21:08 GMT server: - Rocket status: @@ -1162,7 +1162,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:09 GMT + - Mon, 25 Jul 2022 16:21:12 GMT server: - Rocket status: @@ -1199,7 +1199,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:14 GMT + - Mon, 25 Jul 2022 16:21:16 GMT server: - Rocket status: @@ -1236,7 +1236,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:18 GMT + - Mon, 25 Jul 2022 16:21:21 GMT server: - Rocket status: @@ -1268,7 +1268,7 @@ interactions: content-length: - '0' date: - - Thu, 18 Nov 2021 21:51:23 GMT + - Mon, 25 Jul 2022 16:21:25 GMT server: - Rocket status: @@ -1300,7 +1300,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:27 GMT + - Mon, 25 Jul 2022 16:21:29 GMT server: - Rocket status: @@ -1332,7 +1332,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:32 GMT + - Mon, 25 Jul 2022 16:21:34 GMT server: - Rocket status: @@ -1364,7 +1364,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:36 GMT + - Mon, 25 Jul 2022 16:21:38 GMT server: - Rocket status: @@ -1396,7 +1396,7 @@ interactions: content-type: - application/json date: - - Thu, 18 Nov 2021 21:51:40 GMT + - Mon, 25 Jul 2022 16:21:42 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py b/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py index d0e7ddb689f..a09888abcb7 100644 --- a/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py +++ b/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py @@ -96,7 +96,7 @@ def test_vmware(self): self.cmd('vmware private-cloud delete -g {rg} -n {privatecloud} --yes') # set managed identity - self.cmd('vmware private-cloud identity assign -g {rg} -c {privatecloud} --system-assigned') + self.cmd('vmware private-cloud identity assign -g {rg} -c {privatecloud}') # remove managed identity self.cmd('vmware private-cloud identity remove -g {rg} -c {privatecloud}') @@ -104,5 +104,11 @@ def test_vmware(self): # show managed identity self.cmd('vmware private-cloud identity show -g {rg} -c {privatecloud}') + # enable cmk encryption + self.cmd('az vmware private-cloud enable-cmk-encryption -c {privatecloud} -g {rg} --enc-kv-key-name test-key-name --enc-kv-key-version 1 --enc-kv-url test-url') + + # disable cmk encyrption + self.cmd('az vmware private-cloud disable-cmk-encryption -c {privatecloud} -g {rg} --yes') + count = len(self.cmd('vmware private-cloud list -g {rg}').get_output_in_json()) self.assertEqual(count, 1, 'private cloud count expected to be 1') From 8c44e3e7676ee3591b733ba4f2f7841920ce49ce Mon Sep 17 00:00:00 2001 From: Jonathan He Date: Tue, 26 Jul 2022 12:04:25 -0400 Subject: [PATCH 2/6] fixed PR comments --- src/vmware/HISTORY.md | 8 +- src/vmware/azext_vmware/_params.py | 3 +- src/vmware/azext_vmware/commands.py | 2 +- src/vmware/azext_vmware/custom.py | 16 +- .../tests/latest/recordings/test_vmware.yaml | 174 +++++++----------- .../tests/latest/test_vmware_scenario.py | 15 +- src/vmware/setup.py | 2 +- 7 files changed, 96 insertions(+), 124 deletions(-) diff --git a/src/vmware/HISTORY.md b/src/vmware/HISTORY.md index fcb0b901cb2..e19861d90ff 100644 --- a/src/vmware/HISTORY.md +++ b/src/vmware/HISTORY.md @@ -1,13 +1,15 @@ # Release History -## 4.0.3 (2022-07) +## 4.1.0 (2022-07) +- Add new parameter `--identity` to `az vmware private-cloud create` +- Add new parameter `--identity` to `az vmware private-cloud update` - Add `az vmware private-cloud enable-cmk-encryption` - Add `az vmware private-cloud disable-cmk-encryption` - Deprecate `az vmware private-cloud add-cmk-encryption` - Deprecate `az vmware private-cloud delete-cmk-encryption` -- Removed `--mi-system-assigned` parameter from `az vmware private-cloud identity assign` -- Renamed `--mi-system-assigned` parameter from `az vmware private-cloud create` to `--identity` +- Deprecate `--mi-system-assigned` parameter from `az vmware private-cloud create` +- Deprecate `az vmware private-cloud identity` command group ## 4.0.2 (2022-02) diff --git a/src/vmware/azext_vmware/_params.py b/src/vmware/azext_vmware/_params.py index 896b69c3f16..a5d18c44e19 100644 --- a/src/vmware/azext_vmware/_params.py +++ b/src/vmware/azext_vmware/_params.py @@ -24,6 +24,7 @@ def load_arguments(self, _): c.argument('cluster_size', help='Number of hosts for the default management cluster. Minimum of 3 and maximum of 16.') c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".') c.argument('yes', help='Delete without confirmation.') + c.argument('identity', help='Enable a system assigned identity.', arg_type=get_enum_type(['SystemAssigned', 'None'])) with self.argument_context('vmware cluster') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the cluster.') @@ -39,7 +40,7 @@ def load_arguments(self, _): c.argument('nsxt_password', help='NSX-T Manager password.') c.argument('accept_eula', help='Accept the end-user license agreement without prompting.') c.argument('network_block', help='A subnet at least of size /22. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22.') - c.argument('identity', help='Enable a system assigned identity.') + c.argument('mi_system_assigned', help='Enable a system assigned identity.', arg_type=get_enum_type(['SystemAssigned', 'None']), deprecate_info=c.deprecate(redirect='--identity', hide=True)) with self.argument_context('vmware private-cloud show') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.') diff --git a/src/vmware/azext_vmware/commands.py b/src/vmware/azext_vmware/commands.py index fe107aea73a..a05366b26ff 100644 --- a/src/vmware/azext_vmware/commands.py +++ b/src/vmware/azext_vmware/commands.py @@ -35,7 +35,7 @@ def load_command_table(self, _): g.custom_command('rotate-vcenter-password', 'privatecloud_rotate_vcenter_password') g.custom_command('rotate-nsxt-password', 'privatecloud_rotate_nsxt_password') - with self.command_group('vmware private-cloud identity', vmware_sdk, client_factory=cf_vmware) as g: + with self.command_group('vmware private-cloud identity', vmware_sdk, client_factory=cf_vmware, deprecate_info=self.deprecate(redirect='az vmware private cloud update', hide=True)) as g: g.custom_command('assign', 'privatecloud_identity_assign') g.custom_command('remove', 'privatecloud_identity_remove') g.custom_show_command('show', 'privatecloud_identity_get') diff --git a/src/vmware/azext_vmware/custom.py b/src/vmware/azext_vmware/custom.py index 7d40b98b487..df32ffbfae3 100644 --- a/src/vmware/azext_vmware/custom.py +++ b/src/vmware/azext_vmware/custom.py @@ -48,7 +48,7 @@ def privatecloud_show(client: AVSClient, resource_group_name, name): return client.private_clouds.get(resource_group_name, name) -def privatecloud_create(client: AVSClient, resource_group_name, name, sku, cluster_size, network_block, location=None, internet=None, vcenter_password=None, nsxt_password=None, tags=None, identity=False, accept_eula=False, yes=False): +def privatecloud_create(client: AVSClient, resource_group_name, name, sku, cluster_size, network_block, location=None, internet=None, vcenter_password=None, nsxt_password=None, tags=None, identity=None, mi_system_assigned=None, accept_eula=False, yes=False): from knack.prompting import prompt_y_n if not accept_eula: print(LEGAL_TERMS) @@ -56,14 +56,16 @@ def privatecloud_create(client: AVSClient, resource_group_name, name, sku, clust if not yes and not prompt_y_n(msg, default="n"): return None - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku, PrivateCloudIdentity, ResourceIdentityType + from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku, PrivateCloudIdentity cloud = PrivateCloud(sku=Sku(name=sku), ciruit=Circuit(), management_cluster=ManagementCluster(cluster_size=cluster_size), network_block=network_block) if location is not None: cloud.location = location if tags is not None: cloud.tags = tags - if identity: - cloud.identity = PrivateCloudIdentity(type=ResourceIdentityType.SYSTEM_ASSIGNED) + if identity is not None: + cloud.identity = PrivateCloudIdentity(type=identity) + elif mi_system_assigned is not None: + cloud.identity = PrivateCloudIdentity(type=mi_system_assigned) if internet is not None: cloud.internet = internet if vcenter_password is not None: @@ -73,8 +75,8 @@ def privatecloud_create(client: AVSClient, resource_group_name, name, sku, clust return client.private_clouds.begin_create_or_update(resource_group_name, name, cloud) -def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_size=None, internet=None, tags=None): - from azext_vmware.vendored_sdks.avs_client.models import ManagementCluster +def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_size=None, internet=None, tags=None, identity=None): + from azext_vmware.vendored_sdks.avs_client.models import ManagementCluster, PrivateCloudIdentity private_cloud_update = client.private_clouds.get(resource_group_name, name) if tags is not None: private_cloud_update.tags = tags @@ -82,6 +84,8 @@ def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_si private_cloud_update.management_cluster = ManagementCluster(cluster_size=cluster_size) if internet is not None: private_cloud_update.internet = internet + if identity is not None: + private_cloud_update.identity = PrivateCloudIdentity(type=identity) return client.private_clouds.begin_update(resource_group_name, name, private_cloud_update) diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml index 317af7cf5d9..d99a2f66752 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:16 GMT + - Tue, 26 Jul 2022 16:01:17 GMT server: - Rocket status: @@ -61,7 +61,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:20 GMT + - Tue, 26 Jul 2022 16:01:22 GMT server: - Rocket status: @@ -93,7 +93,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:25 GMT + - Tue, 26 Jul 2022 16:01:26 GMT server: - Rocket status: @@ -132,7 +132,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:29 GMT + - Tue, 26 Jul 2022 16:01:30 GMT server: - Rocket status: @@ -164,7 +164,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:33 GMT + - Tue, 26 Jul 2022 16:01:35 GMT server: - Rocket status: @@ -196,7 +196,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:38 GMT + - Tue, 26 Jul 2022 16:01:39 GMT server: - Rocket status: @@ -240,7 +240,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:38 GMT + - Tue, 26 Jul 2022 16:01:39 GMT server: - Rocket status: @@ -272,7 +272,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:42 GMT + - Tue, 26 Jul 2022 16:01:43 GMT server: - Rocket status: @@ -318,7 +318,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:42 GMT + - Tue, 26 Jul 2022 16:01:43 GMT server: - Rocket status: @@ -354,7 +354,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:46 GMT + - Tue, 26 Jul 2022 16:01:47 GMT server: - Rocket status: @@ -386,7 +386,7 @@ interactions: content-length: - '0' date: - - Mon, 25 Jul 2022 16:14:50 GMT + - Tue, 26 Jul 2022 16:01:52 GMT server: - Rocket status: @@ -419,7 +419,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:55 GMT + - Tue, 26 Jul 2022 16:01:56 GMT server: - Rocket status: @@ -469,7 +469,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:55 GMT + - Tue, 26 Jul 2022 16:01:56 GMT server: - Rocket status: @@ -501,7 +501,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:14:59 GMT + - Tue, 26 Jul 2022 16:02:00 GMT server: - Rocket status: @@ -533,7 +533,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:03 GMT + - Tue, 26 Jul 2022 16:02:05 GMT server: - Rocket status: @@ -570,7 +570,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:08 GMT + - Tue, 26 Jul 2022 16:02:09 GMT server: - Rocket status: @@ -602,7 +602,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:12 GMT + - Tue, 26 Jul 2022 16:02:13 GMT server: - Rocket status: @@ -638,7 +638,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:16 GMT + - Tue, 26 Jul 2022 16:02:18 GMT server: - Rocket status: @@ -670,7 +670,7 @@ interactions: content-length: - '0' date: - - Mon, 25 Jul 2022 16:15:21 GMT + - Tue, 26 Jul 2022 16:02:22 GMT server: - Rocket status: @@ -702,7 +702,7 @@ interactions: content-length: - '0' date: - - Mon, 25 Jul 2022 16:15:25 GMT + - Tue, 26 Jul 2022 16:02:26 GMT server: - Rocket status: @@ -716,11 +716,11 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud identity assign + - vmware private-cloud enable-cmk-encryption Connection: - keep-alive ParameterSetName: - - -g -c + - -c -g --enc-kv-key-name --enc-kv-key-version --enc-kv-url User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: GET @@ -734,7 +734,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:29 GMT + - Tue, 26 Jul 2022 16:02:31 GMT server: - Rocket status: @@ -749,24 +749,23 @@ interactions: "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": - {"status": "Enabled", "keyVaultProperties": {"keyName": "keyname1", "keyVersion": - "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, - "circuit": {}, "networkBlock": "192.168.48.0/22"}}' + {"status": "Enabled", "keyVaultProperties": {"keyName": "test-key-name", "keyVersion": + "1", "keyVaultUrl": "test-url"}}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud identity assign + - vmware private-cloud enable-cmk-encryption Connection: - keep-alive Content-Length: - - '865' + - '827' Content-Type: - application/json ParameterSetName: - - -g -c + - -c -g --enc-kv-key-name --enc-kv-key-version --enc-kv-url User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -780,7 +779,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:29 GMT + - Tue, 26 Jul 2022 16:02:31 GMT server: - Rocket status: @@ -794,11 +793,11 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud identity remove + - vmware private-cloud disable-cmk-encryption Connection: - keep-alive ParameterSetName: - - -g -c + - -c -g --yes User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: GET @@ -812,7 +811,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:33 GMT + - Tue, 26 Jul 2022 16:02:35 GMT server: - Rocket status: @@ -820,30 +819,29 @@ interactions: message: OK - request: body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": - {"type": "None"}, "properties": {"managementCluster": {"clusterSize": 4, "hosts": - ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", "fakehost20.nyc1.kubernetes.center", - "fakehost21.nyc1.kubernetes.center"]}, "internet": "Disabled", "identitySources": - [{"name": "group1", "alias": "groupAlias", "domain": "domain1", "baseUserDN": - "ou=baseUser", "baseGroupDN": "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", - "secondaryServer": "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": - {"strategy": "SingleZone", "zone": 1}, "encryption": {"status": "Enabled", "keyVaultProperties": - {"keyName": "keyname1", "keyVersion": "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, - "circuit": {}, "networkBlock": "192.168.48.0/22"}}' + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", + "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, + "internet": "Disabled", "identitySources": [{"name": "group1", "alias": "groupAlias", + "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", + "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", + "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": + {"status": "Disabled"}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud identity remove + - vmware private-cloud disable-cmk-encryption Connection: - keep-alive Content-Length: - - '855' + - '730' Content-Type: - application/json ParameterSetName: - - -g -c + - -c -g --yes User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -857,39 +855,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:33 GMT - server: - - Rocket - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - vmware private-cloud identity show - Connection: - - keep-alive - ParameterSetName: - - -g -c - User-Agent: - - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 - response: - body: - string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' - headers: - content-length: - - '1933' - content-type: - - application/json - date: - - Mon, 25 Jul 2022 16:15:38 GMT + - Tue, 26 Jul 2022 16:02:35 GMT server: - Rocket status: @@ -903,11 +869,11 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud enable-cmk-encryption + - vmware private-cloud update Connection: - keep-alive ParameterSetName: - - -c -g --enc-kv-key-name --enc-kv-key-version --enc-kv-url + - -n -g --identity User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: GET @@ -921,7 +887,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:42 GMT + - Tue, 26 Jul 2022 16:02:39 GMT server: - Rocket status: @@ -936,23 +902,24 @@ interactions: "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": - {"status": "Enabled", "keyVaultProperties": {"keyName": "test-key-name", "keyVersion": - "1", "keyVaultUrl": "test-url"}}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' + {"status": "Enabled", "keyVaultProperties": {"keyName": "keyname1", "keyVersion": + "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud enable-cmk-encryption + - vmware private-cloud update Connection: - keep-alive Content-Length: - - '827' + - '865' Content-Type: - application/json ParameterSetName: - - -c -g --enc-kv-key-name --enc-kv-key-version --enc-kv-url + - -n -g --identity User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -966,7 +933,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:42 GMT + - Tue, 26 Jul 2022 16:02:39 GMT server: - Rocket status: @@ -980,11 +947,11 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud disable-cmk-encryption + - vmware private-cloud update Connection: - keep-alive ParameterSetName: - - -c -g --yes + - -n -g --identity User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: GET @@ -998,7 +965,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:46 GMT + - Tue, 26 Jul 2022 16:02:43 GMT server: - Rocket status: @@ -1006,29 +973,30 @@ interactions: message: OK - request: body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": - {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": - 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", - "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, - "internet": "Disabled", "identitySources": [{"name": "group1", "alias": "groupAlias", - "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", - "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", - "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": - {"status": "Disabled"}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' + {"type": "None"}, "properties": {"managementCluster": {"clusterSize": 4, "hosts": + ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", "fakehost20.nyc1.kubernetes.center", + "fakehost21.nyc1.kubernetes.center"]}, "internet": "Disabled", "identitySources": + [{"name": "group1", "alias": "groupAlias", "domain": "domain1", "baseUserDN": + "ou=baseUser", "baseGroupDN": "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", + "secondaryServer": "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": + {"strategy": "SingleZone", "zone": 1}, "encryption": {"status": "Enabled", "keyVaultProperties": + {"keyName": "keyname1", "keyVersion": "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud disable-cmk-encryption + - vmware private-cloud update Connection: - keep-alive Content-Length: - - '730' + - '855' Content-Type: - application/json ParameterSetName: - - -c -g --yes + - -n -g --identity User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -1042,7 +1010,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:46 GMT + - Tue, 26 Jul 2022 16:02:43 GMT server: - Rocket status: @@ -1074,7 +1042,7 @@ interactions: content-type: - application/json date: - - Mon, 25 Jul 2022 16:15:50 GMT + - Tue, 26 Jul 2022 16:02:48 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py b/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py index a09888abcb7..cdea0321e67 100644 --- a/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py +++ b/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py @@ -95,20 +95,17 @@ def test_vmware(self): # delete the private cloud self.cmd('vmware private-cloud delete -g {rg} -n {privatecloud} --yes') - # set managed identity - self.cmd('vmware private-cloud identity assign -g {rg} -c {privatecloud}') - - # remove managed identity - self.cmd('vmware private-cloud identity remove -g {rg} -c {privatecloud}') - - # show managed identity - self.cmd('vmware private-cloud identity show -g {rg} -c {privatecloud}') - # enable cmk encryption self.cmd('az vmware private-cloud enable-cmk-encryption -c {privatecloud} -g {rg} --enc-kv-key-name test-key-name --enc-kv-key-version 1 --enc-kv-url test-url') # disable cmk encyrption self.cmd('az vmware private-cloud disable-cmk-encryption -c {privatecloud} -g {rg} --yes') + # enable system assigned identity + self.cmd('az vmware private-cloud update -n {privatecloud} -g {rg} --identity SystemAssigned') + + # disable system assigned identity + self.cmd('az vmware private-cloud update -n {privatecloud} -g {rg} --identity None') + count = len(self.cmd('vmware private-cloud list -g {rg}').get_output_in_json()) self.assertEqual(count, 1, 'private cloud count expected to be 1') diff --git a/src/vmware/setup.py b/src/vmware/setup.py index 357f2b0a17b..e02e85d251a 100644 --- a/src/vmware/setup.py +++ b/src/vmware/setup.py @@ -8,7 +8,7 @@ from io import open from setuptools import setup, find_packages -VERSION = "4.0.2" +VERSION = "4.1.0" with open('README.md', encoding='utf-8') as f: readme = f.read() From 167be2b73a8a12981e48b6ec6179efa3d28a70f0 Mon Sep 17 00:00:00 2001 From: Jonathan He Date: Wed, 27 Jul 2022 15:35:05 -0400 Subject: [PATCH 3/6] updated help text for --identity in private-cloud create --- src/vmware/azext_vmware/_params.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vmware/azext_vmware/_params.py b/src/vmware/azext_vmware/_params.py index a5d18c44e19..ed47fdba4bd 100644 --- a/src/vmware/azext_vmware/_params.py +++ b/src/vmware/azext_vmware/_params.py @@ -9,11 +9,15 @@ from azure.cli.core.commands.parameters import get_enum_type from ._validators import server_addresses_length +def clean_help(helpText): + return ' '.join(helpText.split()) + def load_arguments(self, _): from azure.cli.core.commands.parameters import tags_type from azure.cli.core.commands.validators import get_default_location_from_resource_group + from azext_vmware.vendored_sdks.avs_client.models import ResourceIdentityType with self.argument_context('vmware') as c: c.argument('tags', tags_type) @@ -24,7 +28,7 @@ def load_arguments(self, _): c.argument('cluster_size', help='Number of hosts for the default management cluster. Minimum of 3 and maximum of 16.') c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".') c.argument('yes', help='Delete without confirmation.') - c.argument('identity', help='Enable a system assigned identity.', arg_type=get_enum_type(['SystemAssigned', 'None'])) + c.argument('identity', help=clean_help(ResourceIdentityType.__doc__), arg_type=get_enum_type([identityType.value for identityType in ResourceIdentityType])) with self.argument_context('vmware cluster') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the cluster.') @@ -40,7 +44,7 @@ def load_arguments(self, _): c.argument('nsxt_password', help='NSX-T Manager password.') c.argument('accept_eula', help='Accept the end-user license agreement without prompting.') c.argument('network_block', help='A subnet at least of size /22. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22.') - c.argument('mi_system_assigned', help='Enable a system assigned identity.', arg_type=get_enum_type(['SystemAssigned', 'None']), deprecate_info=c.deprecate(redirect='--identity', hide=True)) + c.argument('mi_system_assigned', help=clean_help(ResourceIdentityType.__doc__), arg_type=get_enum_type([identityType.value for identityType in ResourceIdentityType]), deprecate_info=c.deprecate(redirect='--identity', hide=True)) with self.argument_context('vmware private-cloud show') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.') From 753f0517bbb2e26272f57f29796a5204725914ec Mon Sep 17 00:00:00 2001 From: Jonathan He Date: Thu, 28 Jul 2022 12:23:42 -0400 Subject: [PATCH 4/6] undo changes for vmware private-cloud identity --- src/vmware/HISTORY.md | 5 +- src/vmware/azext_vmware/_params.py | 10 +- src/vmware/azext_vmware/commands.py | 2 +- src/vmware/azext_vmware/custom.py | 28 ++-- .../tests/latest/recordings/test_vmware.yaml | 134 +++++++++++------- .../tests/latest/test_vmware_scenario.py | 11 +- 6 files changed, 115 insertions(+), 75 deletions(-) diff --git a/src/vmware/HISTORY.md b/src/vmware/HISTORY.md index e19861d90ff..de1809b567a 100644 --- a/src/vmware/HISTORY.md +++ b/src/vmware/HISTORY.md @@ -2,14 +2,11 @@ ## 4.1.0 (2022-07) -- Add new parameter `--identity` to `az vmware private-cloud create` -- Add new parameter `--identity` to `az vmware private-cloud update` - Add `az vmware private-cloud enable-cmk-encryption` - Add `az vmware private-cloud disable-cmk-encryption` - Deprecate `az vmware private-cloud add-cmk-encryption` - Deprecate `az vmware private-cloud delete-cmk-encryption` -- Deprecate `--mi-system-assigned` parameter from `az vmware private-cloud create` -- Deprecate `az vmware private-cloud identity` command group +- Add `--system-assigned` parameter to `az vmware private-cloud identity remove` ## 4.0.2 (2022-02) diff --git a/src/vmware/azext_vmware/_params.py b/src/vmware/azext_vmware/_params.py index ed47fdba4bd..6e7aa25783b 100644 --- a/src/vmware/azext_vmware/_params.py +++ b/src/vmware/azext_vmware/_params.py @@ -9,6 +9,7 @@ from azure.cli.core.commands.parameters import get_enum_type from ._validators import server_addresses_length + def clean_help(helpText): return ' '.join(helpText.split()) @@ -28,7 +29,6 @@ def load_arguments(self, _): c.argument('cluster_size', help='Number of hosts for the default management cluster. Minimum of 3 and maximum of 16.') c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".') c.argument('yes', help='Delete without confirmation.') - c.argument('identity', help=clean_help(ResourceIdentityType.__doc__), arg_type=get_enum_type([identityType.value for identityType in ResourceIdentityType])) with self.argument_context('vmware cluster') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the cluster.') @@ -44,7 +44,7 @@ def load_arguments(self, _): c.argument('nsxt_password', help='NSX-T Manager password.') c.argument('accept_eula', help='Accept the end-user license agreement without prompting.') c.argument('network_block', help='A subnet at least of size /22. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22.') - c.argument('mi_system_assigned', help=clean_help(ResourceIdentityType.__doc__), arg_type=get_enum_type([identityType.value for identityType in ResourceIdentityType]), deprecate_info=c.deprecate(redirect='--identity', hide=True)) + c.argument('mi_system_assigned', help='Enable a system assigned identity.') with self.argument_context('vmware private-cloud show') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.') @@ -108,6 +108,12 @@ def load_arguments(self, _): c.argument('domain', help='The domain\'s dns name.') c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.') + with self.argument_context('vmware private-cloud identity assign') as c: + c.argument('system_assigned', help='Enable a system assigned identity.') + + with self.argument_context('vmware private-cloud identity remove') as c: + c.argument('system_assigned', help='Disable a system assigned identity.') + with self.argument_context('vmware private-cloud update') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.') diff --git a/src/vmware/azext_vmware/commands.py b/src/vmware/azext_vmware/commands.py index a05366b26ff..fe107aea73a 100644 --- a/src/vmware/azext_vmware/commands.py +++ b/src/vmware/azext_vmware/commands.py @@ -35,7 +35,7 @@ def load_command_table(self, _): g.custom_command('rotate-vcenter-password', 'privatecloud_rotate_vcenter_password') g.custom_command('rotate-nsxt-password', 'privatecloud_rotate_nsxt_password') - with self.command_group('vmware private-cloud identity', vmware_sdk, client_factory=cf_vmware, deprecate_info=self.deprecate(redirect='az vmware private cloud update', hide=True)) as g: + with self.command_group('vmware private-cloud identity', vmware_sdk, client_factory=cf_vmware) as g: g.custom_command('assign', 'privatecloud_identity_assign') g.custom_command('remove', 'privatecloud_identity_remove') g.custom_show_command('show', 'privatecloud_identity_get') diff --git a/src/vmware/azext_vmware/custom.py b/src/vmware/azext_vmware/custom.py index df32ffbfae3..9bd44221d60 100644 --- a/src/vmware/azext_vmware/custom.py +++ b/src/vmware/azext_vmware/custom.py @@ -48,7 +48,7 @@ def privatecloud_show(client: AVSClient, resource_group_name, name): return client.private_clouds.get(resource_group_name, name) -def privatecloud_create(client: AVSClient, resource_group_name, name, sku, cluster_size, network_block, location=None, internet=None, vcenter_password=None, nsxt_password=None, tags=None, identity=None, mi_system_assigned=None, accept_eula=False, yes=False): +def privatecloud_create(client: AVSClient, resource_group_name, name, sku, cluster_size, network_block, location=None, internet=None, vcenter_password=None, nsxt_password=None, tags=None, accept_eula=False, mi_system_assigned=False, yes=False): from knack.prompting import prompt_y_n if not accept_eula: print(LEGAL_TERMS) @@ -56,16 +56,16 @@ def privatecloud_create(client: AVSClient, resource_group_name, name, sku, clust if not yes and not prompt_y_n(msg, default="n"): return None - from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku, PrivateCloudIdentity + from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku, PrivateCloudIdentity, ResourceIdentityType cloud = PrivateCloud(sku=Sku(name=sku), ciruit=Circuit(), management_cluster=ManagementCluster(cluster_size=cluster_size), network_block=network_block) if location is not None: cloud.location = location if tags is not None: cloud.tags = tags - if identity is not None: - cloud.identity = PrivateCloudIdentity(type=identity) - elif mi_system_assigned is not None: - cloud.identity = PrivateCloudIdentity(type=mi_system_assigned) + if mi_system_assigned: + cloud.identity = PrivateCloudIdentity(type=ResourceIdentityType.SYSTEM_ASSIGNED) + else: + cloud.identity = PrivateCloudIdentity(type=ResourceIdentityType.NONE) if internet is not None: cloud.internet = internet if vcenter_password is not None: @@ -75,8 +75,8 @@ def privatecloud_create(client: AVSClient, resource_group_name, name, sku, clust return client.private_clouds.begin_create_or_update(resource_group_name, name, cloud) -def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_size=None, internet=None, tags=None, identity=None): - from azext_vmware.vendored_sdks.avs_client.models import ManagementCluster, PrivateCloudIdentity +def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_size=None, internet=None, tags=None): + from azext_vmware.vendored_sdks.avs_client.models import ManagementCluster private_cloud_update = client.private_clouds.get(resource_group_name, name) if tags is not None: private_cloud_update.tags = tags @@ -84,8 +84,6 @@ def privatecloud_update(client: AVSClient, resource_group_name, name, cluster_si private_cloud_update.management_cluster = ManagementCluster(cluster_size=cluster_size) if internet is not None: private_cloud_update.internet = internet - if identity is not None: - private_cloud_update.identity = PrivateCloudIdentity(type=identity) return client.private_clouds.begin_update(resource_group_name, name, private_cloud_update) @@ -160,17 +158,19 @@ def privatecloud_deletecmkenryption(client: AVSClient, resource_group_name, priv return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) -def privatecloud_identity_assign(client: AVSClient, resource_group_name, private_cloud): +def privatecloud_identity_assign(client: AVSClient, resource_group_name, private_cloud, system_assigned=False): from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudIdentity, ResourceIdentityType pc = client.private_clouds.get(resource_group_name, private_cloud) - pc.identity = PrivateCloudIdentity(type=ResourceIdentityType.SYSTEM_ASSIGNED) + if system_assigned: + pc.identity = PrivateCloudIdentity(type=ResourceIdentityType.SYSTEM_ASSIGNED) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) -def privatecloud_identity_remove(client: AVSClient, resource_group_name, private_cloud): +def privatecloud_identity_remove(client: AVSClient, resource_group_name, private_cloud, system_assigned=False): from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudIdentity, ResourceIdentityType pc = client.private_clouds.get(resource_group_name, private_cloud) - pc.identity = PrivateCloudIdentity(type=ResourceIdentityType.NONE) + if system_assigned: + pc.identity = PrivateCloudIdentity(type=ResourceIdentityType.NONE) return client.private_clouds.begin_update(resource_group_name=resource_group_name, private_cloud_name=private_cloud, private_cloud_update=pc) diff --git a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml index d99a2f66752..339867cf614 100644 --- a/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml +++ b/src/vmware/azext_vmware/tests/latest/recordings/test_vmware.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:17 GMT + - Thu, 28 Jul 2022 15:40:03 GMT server: - Rocket status: @@ -61,7 +61,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:22 GMT + - Thu, 28 Jul 2022 15:40:08 GMT server: - Rocket status: @@ -93,16 +93,17 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:26 GMT + - Thu, 28 Jul 2022 15:40:12 GMT server: - Rocket status: code: 200 message: OK - request: - body: '{"location": "centralus", "sku": {"name": "av20"}, "properties": {"managementCluster": - {"clusterSize": 3}, "internet": "Disabled", "networkBlock": "192.168.48.0/22", - "vcenterPassword": "UpfBXae9ZquZSDXk(", "nsxtPassword": "5rqdLj4GF3cePUe6("}}' + body: '{"location": "centralus", "sku": {"name": "av20"}, "identity": {"type": + "None"}, "properties": {"managementCluster": {"clusterSize": 3}, "internet": + "Disabled", "networkBlock": "192.168.48.0/22", "vcenterPassword": "UpfBXae9ZquZSDXk(", + "nsxtPassword": "5rqdLj4GF3cePUe6("}}' headers: Accept: - application/json @@ -113,7 +114,7 @@ interactions: Connection: - keep-alive Content-Length: - - '243' + - '273' Content-Type: - application/json ParameterSetName: @@ -132,7 +133,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:30 GMT + - Thu, 28 Jul 2022 15:40:16 GMT server: - Rocket status: @@ -164,7 +165,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:35 GMT + - Thu, 28 Jul 2022 15:40:21 GMT server: - Rocket status: @@ -196,7 +197,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:39 GMT + - Thu, 28 Jul 2022 15:40:25 GMT server: - Rocket status: @@ -240,7 +241,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:39 GMT + - Thu, 28 Jul 2022 15:40:25 GMT server: - Rocket status: @@ -272,7 +273,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:43 GMT + - Thu, 28 Jul 2022 15:40:30 GMT server: - Rocket status: @@ -318,7 +319,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:43 GMT + - Thu, 28 Jul 2022 15:40:30 GMT server: - Rocket status: @@ -354,7 +355,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:47 GMT + - Thu, 28 Jul 2022 15:40:34 GMT server: - Rocket status: @@ -386,7 +387,7 @@ interactions: content-length: - '0' date: - - Tue, 26 Jul 2022 16:01:52 GMT + - Thu, 28 Jul 2022 15:40:38 GMT server: - Rocket status: @@ -419,7 +420,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:56 GMT + - Thu, 28 Jul 2022 15:40:43 GMT server: - Rocket status: @@ -469,7 +470,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:01:56 GMT + - Thu, 28 Jul 2022 15:40:42 GMT server: - Rocket status: @@ -501,7 +502,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:00 GMT + - Thu, 28 Jul 2022 15:40:47 GMT server: - Rocket status: @@ -533,7 +534,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:05 GMT + - Thu, 28 Jul 2022 15:40:51 GMT server: - Rocket status: @@ -570,7 +571,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:09 GMT + - Thu, 28 Jul 2022 15:40:56 GMT server: - Rocket status: @@ -602,7 +603,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:13 GMT + - Thu, 28 Jul 2022 15:41:00 GMT server: - Rocket status: @@ -638,7 +639,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:18 GMT + - Thu, 28 Jul 2022 15:41:05 GMT server: - Rocket status: @@ -670,7 +671,7 @@ interactions: content-length: - '0' date: - - Tue, 26 Jul 2022 16:02:22 GMT + - Thu, 28 Jul 2022 15:41:09 GMT server: - Rocket status: @@ -702,7 +703,7 @@ interactions: content-length: - '0' date: - - Tue, 26 Jul 2022 16:02:26 GMT + - Thu, 28 Jul 2022 15:41:14 GMT server: - Rocket status: @@ -734,7 +735,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:31 GMT + - Thu, 28 Jul 2022 15:41:18 GMT server: - Rocket status: @@ -779,7 +780,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:31 GMT + - Thu, 28 Jul 2022 15:41:18 GMT server: - Rocket status: @@ -811,7 +812,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:35 GMT + - Thu, 28 Jul 2022 15:41:22 GMT server: - Rocket status: @@ -855,7 +856,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:35 GMT + - Thu, 28 Jul 2022 15:41:22 GMT server: - Rocket status: @@ -869,11 +870,11 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud update + - vmware private-cloud identity assign Connection: - keep-alive ParameterSetName: - - -n -g --identity + - -g -c --system-assigned User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: GET @@ -887,7 +888,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:39 GMT + - Thu, 28 Jul 2022 15:41:27 GMT server: - Rocket status: @@ -911,7 +912,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud update + - vmware private-cloud identity assign Connection: - keep-alive Content-Length: @@ -919,7 +920,7 @@ interactions: Content-Type: - application/json ParameterSetName: - - -n -g --identity + - -g -c --system-assigned User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -933,7 +934,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:39 GMT + - Thu, 28 Jul 2022 15:41:26 GMT server: - Rocket status: @@ -947,11 +948,11 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud update + - vmware private-cloud identity remove Connection: - keep-alive ParameterSetName: - - -n -g --identity + - -g -c User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: GET @@ -965,7 +966,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:43 GMT + - Thu, 28 Jul 2022 15:41:31 GMT server: - Rocket status: @@ -973,14 +974,15 @@ interactions: message: OK - request: body: '{"location": "eastus2", "tags": {}, "sku": {"name": "AV36"}, "identity": - {"type": "None"}, "properties": {"managementCluster": {"clusterSize": 4, "hosts": - ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", "fakehost20.nyc1.kubernetes.center", - "fakehost21.nyc1.kubernetes.center"]}, "internet": "Disabled", "identitySources": - [{"name": "group1", "alias": "groupAlias", "domain": "domain1", "baseUserDN": - "ou=baseUser", "baseGroupDN": "ou=baseGroup", "primaryServer": "ldaps://1.1.1.1:636/", - "secondaryServer": "ldaps://1.1.1.2:636/", "ssl": "Enabled"}], "availability": - {"strategy": "SingleZone", "zone": 1}, "encryption": {"status": "Enabled", "keyVaultProperties": - {"keyName": "keyname1", "keyVersion": "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, + {"type": "SystemAssigned"}, "properties": {"managementCluster": {"clusterSize": + 4, "hosts": ["fakehost18.nyc1.kubernetes.center", "fakehost19.nyc1.kubernetes.center", + "fakehost20.nyc1.kubernetes.center", "fakehost21.nyc1.kubernetes.center"]}, + "internet": "Disabled", "identitySources": [{"name": "group1", "alias": "groupAlias", + "domain": "domain1", "baseUserDN": "ou=baseUser", "baseGroupDN": "ou=baseGroup", + "primaryServer": "ldaps://1.1.1.1:636/", "secondaryServer": "ldaps://1.1.1.2:636/", + "ssl": "Enabled"}], "availability": {"strategy": "SingleZone", "zone": 1}, "encryption": + {"status": "Enabled", "keyVaultProperties": {"keyName": "keyname1", "keyVersion": + "ver1.0", "keyVaultUrl": "https://keyvault1-kmip-kvault.vault.azure.net/"}}, "circuit": {}, "networkBlock": "192.168.48.0/22"}}' headers: Accept: @@ -988,15 +990,15 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - vmware private-cloud update + - vmware private-cloud identity remove Connection: - keep-alive Content-Length: - - '855' + - '865' Content-Type: - application/json ParameterSetName: - - -n -g --identity + - -g -c User-Agent: - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) method: PATCH @@ -1010,7 +1012,39 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:43 GMT + - Thu, 28 Jul 2022 15:41:31 GMT + server: + - Rocket + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmware private-cloud identity show + Connection: + - keep-alive + ParameterSetName: + - -g -c + User-Agent: + - AZURECLI/2.27.1 azsdk-python-mgmt-avs/0.1.0 Python/3.8.10 (Windows-10-10.0.22000-SP0) + method: GET + uri: https://localhost:8888/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmware000001/providers/Microsoft.AVS/privateClouds/cloud1?api-version=2021-12-01 + response: + body: + string: '{"id":"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1","name":"cloud1","type":"Microsoft.AVS/privateClouds","location":"eastus2","tags":{},"sku":{"name":"AV36"},"properties":{"managementCluster":{"clusterSize":4,"clusterId":1,"hosts":["fakehost18.nyc1.kubernetes.center","fakehost19.nyc1.kubernetes.center","fakehost20.nyc1.kubernetes.center","fakehost21.nyc1.kubernetes.center"]},"internet":"Disabled","identitySources":[{"name":"group1","alias":"groupAlias","domain":"domain1","baseUserDN":"ou=baseUser","baseGroupDN":"ou=baseGroup","primaryServer":"ldaps://1.1.1.1:636/","secondaryServer":"ldaps://1.1.1.2:636/","ssl":"Enabled"}],"availability":{"strategy":"SingleZone","zone":1},"encryption":{"status":"Enabled","keyVaultProperties":{"keyName":"keyname1","keyVersion":"ver1.0","keyVaultUrl":"https://keyvault1-kmip-kvault.vault.azure.net/","keyState":"Connected","versionType":"Fixed"}},"provisioningState":"Succeeded","circuit":{"primarySubnet":"192.168.53.0/30","secondarySubnet":"192.168.53.4/30","expressRouteID":"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect","expressRoutePrivatePeeringID":"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"},"endpoints":{"nsxtManager":"https://192.168.50.3/","vcsa":"https://192.168.50.2/","hcxCloudManager":"https://192.168.50.4/"},"networkBlock":"192.168.48.0/22","externalCloudLinks":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"]},"identity":{"principalId":"881e5573-063f-49e4-8c08-79d7df0169d8","tenantId":"881e5573-063f-49e4-8c08-79d7df0169d8","type":"SystemAssigned"}}' + headers: + content-length: + - '1933' + content-type: + - application/json + date: + - Thu, 28 Jul 2022 15:41:36 GMT server: - Rocket status: @@ -1042,7 +1076,7 @@ interactions: content-type: - application/json date: - - Tue, 26 Jul 2022 16:02:48 GMT + - Thu, 28 Jul 2022 15:41:40 GMT server: - Rocket status: diff --git a/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py b/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py index cdea0321e67..69c7855dffa 100644 --- a/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py +++ b/src/vmware/azext_vmware/tests/latest/test_vmware_scenario.py @@ -101,11 +101,14 @@ def test_vmware(self): # disable cmk encyrption self.cmd('az vmware private-cloud disable-cmk-encryption -c {privatecloud} -g {rg} --yes') - # enable system assigned identity - self.cmd('az vmware private-cloud update -n {privatecloud} -g {rg} --identity SystemAssigned') + # set managed identity + self.cmd('vmware private-cloud identity assign -g {rg} -c {privatecloud} --system-assigned') - # disable system assigned identity - self.cmd('az vmware private-cloud update -n {privatecloud} -g {rg} --identity None') + # remove managed identity + self.cmd('vmware private-cloud identity remove -g {rg} -c {privatecloud}') + + # show managed identity + self.cmd('vmware private-cloud identity show -g {rg} -c {privatecloud}') count = len(self.cmd('vmware private-cloud list -g {rg}').get_output_in_json()) self.assertEqual(count, 1, 'private cloud count expected to be 1') From 92c82074d7efe46d21baa5bf35ced51d0a756e01 Mon Sep 17 00:00:00 2001 From: Jonathan He Date: Thu, 28 Jul 2022 12:29:32 -0400 Subject: [PATCH 5/6] fixed style errors --- src/vmware/azext_vmware/_params.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vmware/azext_vmware/_params.py b/src/vmware/azext_vmware/_params.py index 6e7aa25783b..712c9a8a24f 100644 --- a/src/vmware/azext_vmware/_params.py +++ b/src/vmware/azext_vmware/_params.py @@ -18,7 +18,6 @@ def load_arguments(self, _): from azure.cli.core.commands.parameters import tags_type from azure.cli.core.commands.validators import get_default_location_from_resource_group - from azext_vmware.vendored_sdks.avs_client.models import ResourceIdentityType with self.argument_context('vmware') as c: c.argument('tags', tags_type) From 7ae453cd8a53e4f486ab3b53982cb375326bb502 Mon Sep 17 00:00:00 2001 From: Jonathan He Date: Thu, 28 Jul 2022 13:21:25 -0400 Subject: [PATCH 6/6] removed unused clean_help function --- src/vmware/azext_vmware/_params.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/vmware/azext_vmware/_params.py b/src/vmware/azext_vmware/_params.py index 712c9a8a24f..c47480d6f1a 100644 --- a/src/vmware/azext_vmware/_params.py +++ b/src/vmware/azext_vmware/_params.py @@ -10,10 +10,6 @@ from ._validators import server_addresses_length -def clean_help(helpText): - return ' '.join(helpText.split()) - - def load_arguments(self, _): from azure.cli.core.commands.parameters import tags_type