Skip to content

Commit e350f21

Browse files
committed
add test
1 parent be53f20 commit e350f21

File tree

7 files changed

+834
-168
lines changed

7 files changed

+834
-168
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,22 +1476,6 @@ def load_arguments(self, _):
14761476

14771477
with self.argument_context('capacity reservation group show') as c:
14781478
c.argument('instance_view', action='store_true', options_list=['--instance-view', '-i'], help='Retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations.')
1479-
1480-
# with self.argument_context('capacity reservation') as c:
1481-
# c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group)
1482-
# c.argument('capacity_reservation_group_name', options_list=['--capacity-reservation-group', '-c'],
1483-
# help='The name of the capacity reservation group.')
1484-
# c.argument('capacity_reservation_name', options_list=['--capacity-reservation-name', '-n'],
1485-
# help='The name of the capacity reservation.')
1486-
# c.argument('capacity', type=int, help='Specify the number of virtual machines in the scale set.')
1487-
# c.argument('tags', tags_type)
1488-
#
1489-
# with self.argument_context('capacity reservation create') as c:
1490-
# c.argument('zone', zone_type, help='Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone.')
1491-
# c.argument('sku_name', options_list=['--sku', '-s'], required=True, help='The SKU of the resource for which capacity needs be reserved. Currently VM Skus with the capability called "CapacityReservationSupported" set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://learn.microsoft.com/rest/api/compute/resourceskus/list) for supported values.')
1492-
#
1493-
# with self.argument_context('capacity reservation show') as c:
1494-
# c.argument('instance_view', action='store_true', options_list=['--instance-view', '-i'], help='Retrieve a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.')
14951479
# endRegion
14961480

14971481
# region Restore point

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,6 @@ def load_command_table(self, _):
559559
from .operations.capacity_reservation import CapacityReservationUpdate, CapacityReservationShow
560560
self.command_table['capacity reservation update'] = CapacityReservationUpdate(loader=self)
561561
self.command_table['capacity reservation show'] = CapacityReservationShow(loader=self)
562-
#
563-
# g.custom_command('create', 'create_capacity_reservation', supports_no_wait=True)
564-
# g.custom_command('update', 'update_capacity_reservation', supports_no_wait=True)
565-
# g.custom_show_command('show', 'show_capacity_reservation')
566562

567563
with self.command_group('restore-point', restore_point, client_factory=cf_restore_point, min_api='2021-03-01') as g:
568564
g.custom_show_command('show', 'restore_point_show')

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

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5569,50 +5569,6 @@ def show_capacity_reservation_group(client, resource_group_name, capacity_reserv
55695569
expand=expand)
55705570

55715571

5572-
# def create_capacity_reservation(cmd, client, resource_group_name, capacity_reservation_group_name,
5573-
# capacity_reservation_name, location=None, sku_name=None, capacity=None,
5574-
# zone=None, tags=None):
5575-
# Sku = cmd.get_models('Sku')
5576-
# sku = Sku(name=sku_name, capacity=capacity)
5577-
# CapacityReservation = cmd.get_models('CapacityReservation')
5578-
# capacity_reservation = CapacityReservation(location=location, sku=sku, zones=zone, tags=tags)
5579-
# return client.begin_create_or_update(resource_group_name=resource_group_name,
5580-
# capacity_reservation_group_name=capacity_reservation_group_name,
5581-
# capacity_reservation_name=capacity_reservation_name,
5582-
# parameters=capacity_reservation)
5583-
5584-
5585-
# def update_capacity_reservation(cmd, client, resource_group_name, capacity_reservation_group_name,
5586-
# capacity_reservation_name, capacity=None, tags=None):
5587-
# Sku = cmd.get_models('Sku')
5588-
# sku = Sku(capacity=capacity)
5589-
#
5590-
# # If only the data of SKU capacity is updated, the original tags will be cleared.
5591-
# # Therefore, before the service fixes this issue, we add this temporary logic
5592-
# if tags is None:
5593-
# capacity_reservation = client.get(resource_group_name=resource_group_name,
5594-
# capacity_reservation_group_name=capacity_reservation_group_name,
5595-
# capacity_reservation_name=capacity_reservation_name)
5596-
# tags = capacity_reservation.tags
5597-
#
5598-
# CapacityReservationUpdate = cmd.get_models('CapacityReservationUpdate')
5599-
# capacity_reservation_update = CapacityReservationUpdate(sku=sku, tags=tags)
5600-
# return client.begin_update(resource_group_name=resource_group_name,
5601-
# capacity_reservation_group_name=capacity_reservation_group_name,
5602-
# capacity_reservation_name=capacity_reservation_name,
5603-
# parameters=capacity_reservation_update)
5604-
#
5605-
#
5606-
# def show_capacity_reservation(client, resource_group_name, capacity_reservation_group_name, capacity_reservation_name,
5607-
# instance_view=None):
5608-
# expand = None
5609-
# if instance_view:
5610-
# expand = 'instanceView'
5611-
# return client.get(resource_group_name=resource_group_name,
5612-
# capacity_reservation_group_name=capacity_reservation_group_name,
5613-
# capacity_reservation_name=capacity_reservation_name, expand=expand)
5614-
5615-
56165572
def set_vm_applications(cmd, vm_name, resource_group_name, application_version_ids, order_applications=False, application_configuration_overrides=None, treat_deployment_as_failure=None, no_wait=False):
56175573
from .aaz.latest.vm import Update as _VMUpdate
56185574

src/azure-cli/azure/cli/command_modules/vm/operations/capacity_reservation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
5555
blank=True
5656
)
5757

58+
return args_schema
59+
5860
def pre_operations(self):
5961
args = self.ctx.args
6062
if has_value(args.instance_view) and args.instance_view.to_serialized_data() is True:

src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_capacity_reservation_list_delete.yaml

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)