diff --git a/src/azure-cli/azure/cli/command_modules/vm/_params.py b/src/azure-cli/azure/cli/command_modules/vm/_params.py index d3e8e154d3e..890289c4155 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -842,6 +842,9 @@ def load_arguments(self, _): c.argument('ppg_type', options_list=['--type', '-t'], help="The type of the proximity placement group. Allowed values: Standard.") c.argument('tags', tags_type) + with self.argument_context('ppg show', min_api='2019-07-01') as c: + c.argument('include_colocation_status', action='store_true', help='Enable fetching the colocation status of all the resources in the proximity placement group.') + for scope, item in [('vm create', 'VM'), ('vmss create', 'VMSS'), ('vm availability-set create', 'availability set'), ('vm update', 'VM'), ('vmss update', 'VMSS'), diff --git a/src/azure-cli/azure/cli/command_modules/vm/commands.py b/src/azure-cli/azure/cli/command_modules/vm/commands.py index f1237945467..a992c964786 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/commands.py @@ -464,7 +464,7 @@ def load_command_table(self, _): g.wait_command('wait') with self.command_group('ppg', compute_proximity_placement_groups_sdk, min_api='2018-04-01', client_factory=cf_proximity_placement_groups) as g: - g.command('show', 'get') + g.show_command('show', 'get') g.custom_command('create', 'create_proximity_placement_group') g.custom_command('list', 'list_proximity_placement_groups') g.generic_update_command('update') diff --git a/src/azure-cli/azure/cli/command_modules/vm/custom.py b/src/azure-cli/azure/cli/command_modules/vm/custom.py index f634de84770..a01cc96aaa3 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -2876,7 +2876,7 @@ def set_vmss_extension(cmd, resource_group_name, vmss_name, extension_name, publ extensions = extension_profile.extensions if extensions: extension_profile.extensions = [x for x in extensions if - x.type.lower() != extension_name.lower() or x.publisher.lower() != publisher.lower()] # pylint: disable=line-too-long + x.type1.lower() != extension_name.lower() or x.publisher.lower() != publisher.lower()] # pylint: disable=line-too-long ext = VirtualMachineScaleSetExtension(name=extension_instance_name, publisher=publisher, diff --git a/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py b/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py index b931a27541e..52836414d52 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py +++ b/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py @@ -481,7 +481,7 @@ def decrypt_vmss(cmd, resource_group_name, vmss_name, volume_type=None, force=Fa extensions = vmss.virtual_machine_profile.extension_profile.extensions ade_extension = [x for x in extensions if - x.type.lower() == extension['name'].lower() and x.publisher.lower() == extension['publisher'].lower()] # pylint: disable=line-too-long + x.type1.lower() == extension['name'].lower() and x.publisher.lower() == extension['publisher'].lower()] # pylint: disable=line-too-long if not ade_extension: from knack.util import CLIError raise CLIError("VM scale set '{}' was not encrypted".format(vmss_name)) diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_proximity_placement_group.yaml b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_proximity_placement_group.yaml index 5a99fc8db78..7c9a73d603d 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_proximity_placement_group.yaml +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_proximity_placement_group.yaml @@ -13,15 +13,15 @@ interactions: ParameterSetName: - -n -g -t User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_ppg_cmds_000001?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-11-01T08:56:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-03-04T03:25:32Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:48 GMT + - Wed, 04 Mar 2020 03:25:38 GMT expires: - '-1' pragma: @@ -58,15 +58,15 @@ interactions: ParameterSetName: - -n -t -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_ppg_cmds_000001?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-11-01T08:56:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-03-04T03:25:32Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -75,7 +75,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:48 GMT + - Wed, 04 Mar 2020 03:25:40 GMT expires: - '-1' pragma: @@ -108,8 +108,8 @@ interactions: ParameterSetName: - -n -t -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-compute/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-compute/11.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: PUT @@ -128,7 +128,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:51 GMT + - Wed, 04 Mar 2020 03:25:47 GMT expires: - '-1' pragma: @@ -141,12 +141,71 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutDeletePPG3Min;99,Microsoft.Compute/PutDeletePPG30Min;499 + - Microsoft.Compute/PutDeletePPG3Min;99,Microsoft.Compute/PutDeletePPG30Min;498 x-ms-ratelimit-remaining-subscription-writes: - - '1183' + - '1199' status: code: 201 message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - ppg show + Connection: + - keep-alive + ParameterSetName: + - -g -n --include-colocation-status + User-Agent: + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-compute/11.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001/providers/Microsoft.Compute/proximityPlacementGroups/my_ppg_1?includeColocationStatus=True&api-version=2019-07-01 + response: + body: + string: "{\r\n \"name\": \"my_ppg_1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001/providers/Microsoft.Compute/proximityPlacementGroups/my_ppg_1\",\r\n + \ \"type\": \"Microsoft.Compute/proximityPlacementGroups\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"proximityPlacementGroupType\": + \"Standard\",\r\n \"virtualMachines\": [],\r\n \"virtualMachineScaleSets\": + [],\r\n \"availabilitySets\": [],\r\n \"colocationStatus\": {\r\n \"code\": + \"ColocationStatus/Aligned\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": + \"Aligned\",\r\n \"message\": \"All resources in the proximity placement + group are aligned.\"\r\n }\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '722' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Mar 2020 03:25:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/HighCostGet3Min;137,Microsoft.Compute/HighCostGet30Min;697 + status: + code: 200 + message: OK - request: body: null headers: @@ -161,15 +220,15 @@ interactions: ParameterSetName: - -n -t -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_ppg_cmds_000001?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-11-01T08:56:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-03-04T03:25:32Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -178,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:52 GMT + - Wed, 04 Mar 2020 03:25:50 GMT expires: - '-1' pragma: @@ -211,8 +270,8 @@ interactions: ParameterSetName: - -n -t -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-compute/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-compute/11.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: PUT @@ -231,7 +290,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:55 GMT + - Wed, 04 Mar 2020 03:25:56 GMT expires: - '-1' pragma: @@ -244,9 +303,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutDeletePPG3Min;98,Microsoft.Compute/PutDeletePPG30Min;498 + - Microsoft.Compute/PutDeletePPG3Min;98,Microsoft.Compute/PutDeletePPG30Min;497 x-ms-ratelimit-remaining-subscription-writes: - - '1177' + - '1199' status: code: 201 message: Created @@ -264,15 +323,15 @@ interactions: ParameterSetName: - -n -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_ppg_cmds_000001?api-version=2019-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-11-01T08:56:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_ppg_cmds_000001","name":"cli_test_ppg_cmds_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-03-04T03:25:32Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -281,7 +340,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:55 GMT + - Wed, 04 Mar 2020 03:25:58 GMT expires: - '-1' pragma: @@ -313,8 +372,8 @@ interactions: ParameterSetName: - -n -g User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-compute/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.1 (Windows-10-10.0.17763-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-compute/11.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 accept-language: - en-US method: PUT @@ -333,7 +392,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Nov 2019 08:56:59 GMT + - Wed, 04 Mar 2020 03:26:06 GMT expires: - '-1' pragma: @@ -346,9 +405,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutDeletePPG3Min;97,Microsoft.Compute/PutDeletePPG30Min;497 + - Microsoft.Compute/PutDeletePPG3Min;97,Microsoft.Compute/PutDeletePPG30Min;496 x-ms-ratelimit-remaining-subscription-writes: - - '1173' + - '1199' status: code: 201 message: Created diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index 1b5a2806ee5..fa7dcb526e9 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -1412,7 +1412,7 @@ def test_vmss_extension_instance_name(self): '--protected-settings "{config_file}" --extension-instance-name {ext_name}') self.cmd('vmss extension show --resource-group {rg} --vmss-name {vmss} --name {ext_name}', checks=[ self.check('name', '{ext_name}'), - self.check('type', '{ext_type}') + self.check('type1', '{ext_type}') ]) self.cmd('vmss extension delete --resource-group {rg} --vmss-name {vmss} --name {ext_name}') @@ -3459,6 +3459,13 @@ def test_proximity_placement_group(self, resource_group, resource_group_location self.check('proximityPlacementGroupType', 'Standard') ]) + self.cmd('ppg show -g {rg} -n {ppg1} --include-colocation-status', checks=[ + self.check('name', '{ppg1}'), + self.check('location', '{loc}'), + self.check('proximityPlacementGroupType', 'Standard'), + self.exists('colocationStatus') + ]) + self.cmd('ppg create -n {ppg2} -t ultra -g {rg}', checks=[ self.check('name', '{ppg2}'), self.check('location', '{loc}'), diff --git a/src/azure-cli/requirements.py3.Darwin.txt b/src/azure-cli/requirements.py3.Darwin.txt index 5a93beb6b61..b67a0414a15 100644 --- a/src/azure-cli/requirements.py3.Darwin.txt +++ b/src/azure-cli/requirements.py3.Darwin.txt @@ -27,7 +27,7 @@ azure-mgmt-billing==0.2.0 azure-mgmt-botservice==0.2.0 azure-mgmt-cdn==4.0.0 azure-mgmt-cognitiveservices==5.0.0 -azure-mgmt-compute==10.0.0 +azure-mgmt-compute==11.0.0 azure-mgmt-consumption==2.0.0 azure-mgmt-containerinstance==1.5.0 azure-mgmt-containerregistry==3.0.0rc9 diff --git a/src/azure-cli/requirements.py3.Linux.txt b/src/azure-cli/requirements.py3.Linux.txt index 5a93beb6b61..b67a0414a15 100644 --- a/src/azure-cli/requirements.py3.Linux.txt +++ b/src/azure-cli/requirements.py3.Linux.txt @@ -27,7 +27,7 @@ azure-mgmt-billing==0.2.0 azure-mgmt-botservice==0.2.0 azure-mgmt-cdn==4.0.0 azure-mgmt-cognitiveservices==5.0.0 -azure-mgmt-compute==10.0.0 +azure-mgmt-compute==11.0.0 azure-mgmt-consumption==2.0.0 azure-mgmt-containerinstance==1.5.0 azure-mgmt-containerregistry==3.0.0rc9 diff --git a/src/azure-cli/requirements.py3.windows.txt b/src/azure-cli/requirements.py3.windows.txt index ca4d6e59caa..b1e1b279be1 100644 --- a/src/azure-cli/requirements.py3.windows.txt +++ b/src/azure-cli/requirements.py3.windows.txt @@ -26,7 +26,7 @@ azure-mgmt-billing==0.2.0 azure-mgmt-botservice==0.2.0 azure-mgmt-cdn==4.0.0 azure-mgmt-cognitiveservices==5.0.0 -azure-mgmt-compute==10.0.0 +azure-mgmt-compute==11.0.0 azure-mgmt-consumption==2.0.0 azure-mgmt-containerinstance==1.5.0 azure-mgmt-containerregistry==3.0.0rc9 diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index 0391a75cc23..f447b7da0a2 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -72,7 +72,7 @@ 'azure-mgmt-botservice~=0.2.0', 'azure-mgmt-cdn~=4.0.0', 'azure-mgmt-cognitiveservices~=5.0.0', - 'azure-mgmt-compute~=10.0', + 'azure-mgmt-compute~=11.0', 'azure-mgmt-consumption~=2.0', 'azure-mgmt-containerinstance~=1.4', 'azure-mgmt-containerregistry~=3.0.0rc9',