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 15 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 @@ -841,6 +841,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
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-02-25T04:11:38Z"},"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
- Tue, 25 Feb 2020 04:11:42 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-02-25T04:11:38Z"},"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
- Tue, 25 Feb 2020 04:11:43 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/10.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
- Tue, 25 Feb 2020 04:11:49 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/10.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:
- Tue, 25 Feb 2020 04:11: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-02-25T04:11:38Z"},"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
- Tue, 25 Feb 2020 04:11:49 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/10.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
- Tue, 25 Feb 2020 04:11:58 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-02-25T04:11:38Z"},"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
- Tue, 25 Feb 2020 04:11: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/10.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
- Tue, 25 Feb 2020 04:12: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 @@ -3457,6 +3457,12 @@ 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.cmd('ppg create -n {ppg2} -t ultra -g {rg}', checks=[
self.check('name', '{ppg2}'),
self.check('location', '{loc}'),
Expand Down