Skip to content

Commit 01b4428

Browse files
authored
{Compute} az ppg: Migrate to Code Gen V2 (#30802)
1 parent afba1ae commit 01b4428

33 files changed

+9866
-5123
lines changed

src/azure-cli/azure/cli/command_modules/vm/_help.py

-42
Original file line numberDiff line numberDiff line change
@@ -670,48 +670,6 @@
670670
az image builder show -n mytemplate -g my-group
671671
"""
672672

673-
helps['ppg create'] = """
674-
type: command
675-
short-summary: Create a proximity placement group
676-
examples:
677-
- name: Create a proximity placement group (autogenerated)
678-
text: |
679-
az ppg create --name MyProximityPlacementGroup --resource-group MyResourceGroup
680-
crafted: true
681-
- name: Create a proximity placement group with specifying VM sizes that can be created.
682-
text: |
683-
az ppg create --name MyProximityPlacementGroup --resource-group MyResourceGroup \\
684-
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2
685-
- name: Create a proximity placement group with specifying VM sizes that can be created and availability zone.
686-
text: |
687-
az ppg create --name MyProximityPlacementGroup --resource-group MyResourceGroup \\
688-
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2 --zone 1
689-
"""
690-
691-
helps['ppg list'] = """
692-
type: command
693-
short-summary: List proximity placement groups
694-
examples:
695-
- name: List proximity placement groups (autogenerated)
696-
text: |
697-
az ppg list --resource-group MyResourceGroup
698-
crafted: true
699-
"""
700-
701-
helps['ppg update'] = """
702-
type: command
703-
short-summary: Update a proximity placement group
704-
parameters:
705-
- name: --include-colocation-status
706-
short-summary: includeColocationStatus=true enables fetching the colocation status of all the resources in the
707-
proximity placement group. Default value is None.
708-
examples:
709-
- name: Update a proximity placement group with specifying VM sizes that can be created.
710-
text: |
711-
az ppg update --name MyProximityPlacementGroup --resource-group MyResourceGroup \\
712-
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2
713-
"""
714-
715673
helps['sig image-definition create'] = """
716674
type: command
717675
short-summary: create a gallery image definition

src/azure-cli/azure/cli/command_modules/vm/_params.py

-13
Original file line numberDiff line numberDiff line change
@@ -1408,19 +1408,6 @@ def load_arguments(self, _):
14081408

14091409
# endregion
14101410

1411-
# region Proximity Placement Group
1412-
with self.argument_context('ppg', min_api='2018-04-01') as c:
1413-
c.argument('proximity_placement_group_name', arg_type=name_arg_type, help="The name of the proximity placement group.")
1414-
1415-
with self.argument_context('ppg create') as c:
1416-
c.argument('tags', tags_type, min_api='2018-04-01')
1417-
c.argument('zone', zone_type, min_api='2021-11-01')
1418-
1419-
for scope in ['ppg create', 'ppg update']:
1420-
with self.argument_context(scope) as c:
1421-
c.argument('ppg_type', options_list=['--type', '-t'], arg_type=get_enum_type(self.get_models('ProximityPlacementGroupType')), min_api='2018-04-01', help="The type of the proximity placement group.")
1422-
c.argument('intent_vm_sizes', nargs='*', min_api='2021-11-01', help="Specify possible sizes of virtual machines that can be created in the proximity placement group.")
1423-
14241411
with self.argument_context('vm create', min_api='2018-04-01') as c:
14251412
c.argument('proximity_placement_group', options_list=['--ppg'], help="The name or ID of the proximity placement group the VM should be associated with.",
14261413
validator=_validate_proximity_placement_group)

src/azure-cli/azure/cli/command_modules/vm/_validators.py

-10
Original file line numberDiff line numberDiff line change
@@ -2445,16 +2445,6 @@ def _disk_encryption_set_format(cmd, namespace, name):
24452445
# endregion
24462446

24472447

2448-
def process_ppg_create_namespace(namespace):
2449-
validate_tags(namespace)
2450-
# The availability zone can be provided only when an intent is provided
2451-
if namespace.zone and not namespace.intent_vm_sizes:
2452-
raise RequiredArgumentMissingError('The --zone can be provided only when an intent is provided. '
2453-
'Please use parameter --intent-vm-sizes to specify possible sizes of '
2454-
'virtual machines that can be created in the proximity placement group.')
2455-
# endregion
2456-
2457-
24582448
def process_image_version_create_namespace(cmd, namespace):
24592449
validate_tags(namespace)
24602450
process_gallery_image_version_namespace(cmd, namespace)

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/ppg/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@
99
# flake8: noqa
1010

1111
from .__cmd_group import *
12+
from ._create import *
1213
from ._delete import *
14+
from ._list import *
1315
from ._show import *
16+
from ._update import *

0 commit comments

Comments
 (0)