Skip to content

Commit

Permalink
migrate to codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
yanzhudd committed Feb 11, 2025
1 parent cf83ff0 commit f6aa010
Show file tree
Hide file tree
Showing 33 changed files with 9,866 additions and 5,123 deletions.
42 changes: 0 additions & 42 deletions src/azure-cli/azure/cli/command_modules/vm/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,48 +670,6 @@
az image builder show -n mytemplate -g my-group
"""

helps['ppg create'] = """
type: command
short-summary: Create a proximity placement group
examples:
- name: Create a proximity placement group (autogenerated)
text: |
az ppg create --name MyProximityPlacementGroup --resource-group MyResourceGroup
crafted: true
- name: Create a proximity placement group with specifying VM sizes that can be created.
text: |
az ppg create --name MyProximityPlacementGroup --resource-group MyResourceGroup \\
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2
- name: Create a proximity placement group with specifying VM sizes that can be created and availability zone.
text: |
az ppg create --name MyProximityPlacementGroup --resource-group MyResourceGroup \\
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2 --zone 1
"""

helps['ppg list'] = """
type: command
short-summary: List proximity placement groups
examples:
- name: List proximity placement groups (autogenerated)
text: |
az ppg list --resource-group MyResourceGroup
crafted: true
"""

helps['ppg update'] = """
type: command
short-summary: Update a proximity placement group
parameters:
- name: --include-colocation-status
short-summary: includeColocationStatus=true enables fetching the colocation status of all the resources in the
proximity placement group. Default value is None.
examples:
- name: Update a proximity placement group with specifying VM sizes that can be created.
text: |
az ppg update --name MyProximityPlacementGroup --resource-group MyResourceGroup \\
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2
"""

helps['sig image-definition create'] = """
type: command
short-summary: create a gallery image definition
Expand Down
13 changes: 0 additions & 13 deletions src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,19 +1443,6 @@ def load_arguments(self, _):
'used for decommissioning purposes. This property is updatable.', arg_group='Publishing Profile')
# endregion

# region Proximity Placement Group
with self.argument_context('ppg', min_api='2018-04-01') as c:
c.argument('proximity_placement_group_name', arg_type=name_arg_type, help="The name of the proximity placement group.")

with self.argument_context('ppg create') as c:
c.argument('tags', tags_type, min_api='2018-04-01')
c.argument('zone', zone_type, min_api='2021-11-01')

for scope in ['ppg create', 'ppg update']:
with self.argument_context(scope) as c:
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.")
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.")

with self.argument_context('vm create', min_api='2018-04-01') as c:
c.argument('proximity_placement_group', options_list=['--ppg'], help="The name or ID of the proximity placement group the VM should be associated with.",
validator=_validate_proximity_placement_group)
Expand Down
10 changes: 0 additions & 10 deletions src/azure-cli/azure/cli/command_modules/vm/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,6 @@ def _disk_encryption_set_format(cmd, namespace, name):
# endregion


def process_ppg_create_namespace(namespace):
validate_tags(namespace)
# The availability zone can be provided only when an intent is provided
if namespace.zone and not namespace.intent_vm_sizes:
raise RequiredArgumentMissingError('The --zone can be provided only when an intent is provided. '
'Please use parameter --intent-vm-sizes to specify possible sizes of '
'virtual machines that can be created in the proximity placement group.')
# endregion


def process_image_version_create_namespace(cmd, namespace):
validate_tags(namespace)
process_gallery_image_version_namespace(cmd, namespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._delete import *
from ._list import *
from ._show import *
from ._update import *
Loading

0 comments on commit f6aa010

Please sign in to comment.