Skip to content

Commit 3ac6d8d

Browse files
committed
update code
1 parent 317b543 commit 3ac6d8d

File tree

7 files changed

+1752
-1800
lines changed

7 files changed

+1752
-1800
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,3 @@ def cf_capacity_reservations(cli_ctx, *_):
161161

162162
def cf_restore_point(cli_ctx, *_):
163163
return cf_vm_cl(cli_ctx).restore_points
164-
165-
166-
def cf_restore_point_collection(cli_ctx, *_):
167-
return cf_vm_cl(cli_ctx).restore_point_collections

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,23 +3015,6 @@
30153015
az restore-point collection show --resource-group "myResourceGroup" --collection-name "rpcName"
30163016
"""
30173017

3018-
helps['restore-point collection create'] = """
3019-
type: command
3020-
short-summary: "Create the restore point collection. Please refer to https://aka.ms/RestorePoints \
3021-
for more details. When updating a restore point collection, only tags may be modified."
3022-
examples:
3023-
- name: Create or update a restore point collection.
3024-
text: |-
3025-
az restore-point collection create --location "norwayeast" --source-id "/subscriptions/{subscription-id}\
3026-
/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" --tags myTag1="tagValue1" \
3027-
--resource-group "myResourceGroup" --collection-name "myRpc"
3028-
"""
3029-
3030-
helps['restore-point collection update'] = """
3031-
type: command
3032-
short-summary: "Update the restore point collection."
3033-
"""
3034-
30353018
helps['restore-point collection wait'] = """
30363019
type: command
30373020
short-summary: Place the CLI in a waiting state until a condition of the restore-point-collection is met.

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,16 +1516,6 @@ def load_arguments(self, _):
15161516
# endRegion
15171517

15181518
# region Restore point collection
1519-
with self.argument_context('restore-point collection create') as c:
1520-
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
1521-
validator=get_default_location_from_resource_group)
1522-
c.argument('tags', tags_type)
1523-
c.argument('source_id', help='Resource Id of the source resource used to create this restore point collection',
1524-
arg_group='Source')
1525-
1526-
with self.argument_context('restore-point collection update') as c:
1527-
c.argument('tags', tags_type)
1528-
15291519
with self.argument_context('restore-point collection show') as c:
15301520
c.argument('expand', help='The expand expression to apply on the operation.',
15311521
deprecate_info=c.deprecate(hide=True))

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
cf_log_analytics_data_plane,
1515
cf_capacity_reservation_groups, cf_capacity_reservations,
1616
cf_restore_point,
17-
cf_restore_point_collection, cf_community_gallery)
17+
cf_community_gallery)
1818
from azure.cli.command_modules.vm._format import (
1919
transform_ip_addresses, transform_vm, transform_vm_create_output, transform_vm_usage_list, transform_vm_list,
2020
transform_disk_create_table_output, transform_sku_for_table_output, transform_disk_show_table_output,
@@ -199,8 +199,7 @@ def load_command_table(self, _):
199199
)
200200

201201
restore_point_collection = CliCommandType(
202-
operations_tmpl='azure.mgmt.compute.operations#RestorePointCollectionsOperations.{}',
203-
client_factory=cf_restore_point_collection
202+
operations_tmpl='azure.mgmt.compute.operations#RestorePointCollectionsOperations.{}'
204203
)
205204

206205
community_gallery_sdk = CliCommandType(
@@ -562,9 +561,6 @@ def load_command_table(self, _):
562561
g.custom_command('create', 'restore_point_create', supports_no_wait=True)
563562
g.wait_command('wait')
564563

565-
with self.command_group('restore-point collection', restore_point_collection, min_api='2021-03-01',
566-
client_factory=cf_restore_point_collection) as g:
564+
with self.command_group('restore-point collection', restore_point_collection) as g:
567565
g.custom_show_command('show', 'restore_point_collection_show')
568-
g.custom_command('create', 'restore_point_collection_create')
569-
g.custom_command('update', 'restore_point_collection_update')
570566
g.wait_command('wait')

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

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5962,46 +5962,19 @@ def restore_point_show(client,
59625962

59635963

59645964
# region Restore point collection
5965-
def restore_point_collection_show(client,
5965+
def restore_point_collection_show(cmd,
59665966
resource_group_name,
59675967
restore_point_collection_name,
59685968
expand=None,
59695969
restore_points=None):
5970+
from .aaz.latest.restore_point.collection import Show
5971+
args = {
5972+
"resource_group": resource_group_name,
5973+
"restore_point_collection_name": restore_point_collection_name,
5974+
}
59705975
if restore_points is not None:
5971-
expand = 'restorePoints'
5972-
return client.get(resource_group_name=resource_group_name,
5973-
restore_point_collection_name=restore_point_collection_name,
5974-
expand=expand)
5975-
5976-
5977-
def restore_point_collection_create(client,
5978-
resource_group_name,
5979-
restore_point_collection_name,
5980-
location,
5981-
source_id,
5982-
tags=None):
5983-
parameters = {}
5984-
properties = {}
5985-
parameters['location'] = location
5986-
if tags is not None:
5987-
parameters['tags'] = tags
5988-
properties['source'] = {'id': source_id}
5989-
parameters['properties'] = properties
5990-
return client.create_or_update(resource_group_name=resource_group_name,
5991-
restore_point_collection_name=restore_point_collection_name,
5992-
parameters=parameters)
5993-
5994-
5995-
def restore_point_collection_update(client,
5996-
resource_group_name,
5997-
restore_point_collection_name,
5998-
tags=None):
5999-
parameters = {}
6000-
if tags is not None:
6001-
parameters['tags'] = tags
6002-
return client.update(resource_group_name=resource_group_name,
6003-
restore_point_collection_name=restore_point_collection_name,
6004-
parameters=parameters)
5976+
args.expand = 'restorePoints'
5977+
return Show(cli_ctx=cmd.cli_ctx)(command_args=args)
60055978

60065979
# endRegion
60075980

0 commit comments

Comments
 (0)