Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compute] ppg show: add --colocation-status to Enable fetching the colocation status of all the resources in the proximity placement group #12248

Merged
merged 22 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
db5103e
[Compute] vm/vmss/availability-set update: add --ppg to allowing upda…
qwordy Jan 31, 2020
f00a493
stage
qwordy Jan 31, 2020
af3e146
add test
qwordy Feb 4, 2020
2ad8529
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Feb 4, 2020
e86c337
Add help; Support translataion from name to ID
qwordy Feb 4, 2020
0c9a57e
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Feb 18, 2020
76261b7
[Compute] ppg show: add --colocation to Enable fetching the colocatio…
qwordy Feb 18, 2020
be327cb
Add test
qwordy Feb 18, 2020
47bc98e
update parameter name
qwordy Feb 19, 2020
fa891c8
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Feb 21, 2020
634cf1c
test
qwordy Feb 21, 2020
89abaef
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Feb 24, 2020
d683743
revolve some comments
qwordy Feb 24, 2020
0781f92
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Feb 25, 2020
f44d6a0
Update parameter
qwordy Feb 25, 2020
a9d257c
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Mar 4, 2020
178c394
compute 11.0.0
qwordy Mar 4, 2020
3c5fcd7
test
qwordy Mar 4, 2020
28e9e59
fix test
qwordy Mar 4, 2020
308f9c1
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Mar 4, 2020
b31ff43
Merge branch 'dev' of https://github.com/Azure/azure-cli into 11420
qwordy Mar 4, 2020
3f24d12
fix
qwordy Mar 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/vm/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
arrownj marked this conversation as resolved.
Show resolved Hide resolved

ext = VirtualMachineScaleSetExtension(name=extension_instance_name,
publisher=publisher,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down Expand Up @@ -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}'),
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down