Skip to content

Commit 1bc8703

Browse files
authored
{Compute} az sig: Migrate commands using Code Gen V2 (Azure#30524)
1 parent 3fb76a9 commit 1bc8703

26 files changed

+6020
-4214
lines changed

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

-45
Original file line numberDiff line numberDiff line change
@@ -712,20 +712,6 @@
712712
--intent-vm-sizes Standard_E64s_v4 Standard_M416ms_v2
713713
"""
714714

715-
helps['sig create'] = """
716-
type: command
717-
short-summary: Create a shared image gallery.
718-
examples:
719-
- name: Create a shared image gallery
720-
text: |
721-
az sig create --resource-group MyResourceGroup --gallery-name MyGallery
722-
"""
723-
724-
helps['sig show'] = """
725-
type: command
726-
short-summary: Retrieve information about a Shared Image Gallery.
727-
"""
728-
729715
helps['sig image-definition create'] = """
730716
type: command
731717
short-summary: create a gallery image definition
@@ -1124,19 +1110,6 @@
11241110
crafted: true
11251111
"""
11261112

1127-
helps['sig list-shared'] = """
1128-
type: command
1129-
short-summary: List all shared galleries shared directly to your subscription or tenant
1130-
long-summary: List all shared galleries shared directly to your subscription or tenant
1131-
examples:
1132-
- name: List shared galleries shared directly to your subscription in a given location
1133-
text: |
1134-
az sig list-shared --location myLocation
1135-
- name: List shared galleries shared directly to your tenant in a given location
1136-
text: |
1137-
az sig list-shared --location myLocation --shared-to tenant
1138-
"""
1139-
11401113
helps['sig list-community'] = """
11411114
type: command
11421115
short-summary: List all community galleries shared directly to your subscription or tenant
@@ -1202,24 +1175,6 @@
12021175
az sig share wait --updated --resource-group MyResourceGroup --gallery-name Gallery
12031176
"""
12041177

1205-
helps['sig update'] = """
1206-
type: command
1207-
short-summary: update a share image gallery.
1208-
parameters:
1209-
- name: --select
1210-
short-summary: The select expression to apply on the operation. "Permissions" Default value is None.
1211-
examples:
1212-
- name: Enable gallery to be shared to subscription or tenant
1213-
text: |
1214-
az sig update --resource-group myResourceGroup --gallery-name myGallery \\
1215-
--permissions groups
1216-
- name: Update gallery from private to community
1217-
text: |
1218-
az sig update -g myResourceGroup --gallery-name myGallery --permissions Community \\
1219-
--publisher-uri myPublisherUri --publisher-email myPublisherEmail \\
1220-
--eula myEula --public-name-prefix myPublicNamePrefix
1221-
"""
1222-
12231178
helps['sig gallery-application'] = """
12241179
type: group
12251180
short-summary: Manage gallery application

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

-36
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from argcomplete.completers import FilesCompleter
88

99
from knack.arguments import CLIArgumentType
10-
from knack.deprecation import Deprecated
1110

1211
from azure.cli.core.profiles import ResourceType
1312
from azure.cli.core.commands.parameters import get_datetime_type
@@ -42,7 +41,6 @@ def load_arguments(self, _):
4241
DedicatedHostLicenseTypes = self.get_models('DedicatedHostLicenseTypes')
4342
OrchestrationServiceNames, OrchestrationServiceStateAction = self.get_models('OrchestrationServiceNames', 'OrchestrationServiceStateAction', operation_group='virtual_machine_scale_sets')
4443
RebootSetting, VMGuestPatchClassificationWindows, VMGuestPatchClassificationLinux = self.get_models('VMGuestPatchRebootSetting', 'VMGuestPatchClassificationWindows', 'VMGuestPatchClassificationLinux')
45-
GallerySharingPermissionTypes = self.get_models('GallerySharingPermissionTypes', operation_group='shared_galleries')
4644
ReplicationMode = self.get_models('ReplicationMode', operation_group='gallery_image_versions')
4745
DiskControllerTypes = self.get_models('DiskControllerTypes', operation_group='virtual_machines')
4846

@@ -1255,18 +1253,6 @@ def load_arguments(self, _):
12551253
c.argument('gallery_image_name', options_list=['--gallery-image-definition', '-i'], help='gallery image definition')
12561254
c.argument('gallery_image_version', options_list=['--gallery-image-version', '-e'], help='gallery image version')
12571255

1258-
with self.argument_context('sig show') as c:
1259-
c.argument('gallery_name', options_list=['--gallery-name', '-r'], id_part='name', help='gallery name')
1260-
c.argument('gallery_image_name', options_list=['--gallery-image-definition', '-i'], id_part='child_name_1', help='gallery image definition')
1261-
1262-
with self.argument_context('sig show') as c:
1263-
c.argument('select', help='The select expression to apply on the operation.')
1264-
c.argument('sharing_groups', action='store_true', help='The expand query option to query shared gallery groups')
1265-
1266-
with self.argument_context('sig list-shared') as c:
1267-
c.argument('location', arg_type=get_location_type(self.cli_ctx))
1268-
c.argument('shared_to', shared_to_type)
1269-
12701256
for scope in ['sig share add', 'sig share remove']:
12711257
with self.argument_context(scope) as c:
12721258
c.argument('gallery_name', type=str, help='The name of the Shared Image Gallery.', id_part='name')
@@ -1316,28 +1302,6 @@ def load_arguments(self, _):
13161302
c.argument('marker', arg_type=marker_type)
13171303
c.argument('show_next_marker', action='store_true', help='Show nextMarker in result when specified.')
13181304

1319-
with self.argument_context('sig create') as c:
1320-
c.argument('description', help='the description of the gallery')
1321-
1322-
with self.argument_context('sig update') as c:
1323-
c.ignore('gallery')
1324-
1325-
for scope in ['sig create', 'sig update']:
1326-
with self.argument_context(scope) as c:
1327-
c.argument('permissions', arg_type=get_enum_type(GallerySharingPermissionTypes),
1328-
arg_group='Sharing Profile',
1329-
min_api='2020-09-30',
1330-
help='This property allows you to specify the permission of sharing gallery.')
1331-
c.argument('soft_delete', arg_type=get_three_state_flag(), min_api='2021-03-01',
1332-
deprecate_info=Deprecated(self.cli_ctx, hide=True, message_func=lambda x: "Argument '--soft-delete' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus"),
1333-
help='Enable soft-deletion for resources in this gallery, '
1334-
'allowing them to be recovered within retention time.')
1335-
c.argument('publisher_uri', help='Community gallery publisher uri.')
1336-
c.argument('publisher_contact', options_list=['--publisher-email'],
1337-
help='Community gallery publisher contact email.')
1338-
c.argument('eula', help='Community gallery publisher eula.')
1339-
c.argument('public_name_prefix', help='Community gallery public name prefix.')
1340-
13411305
with self.argument_context('sig image-definition create') as c:
13421306
c.argument('description', help='the description of the gallery image definition')
13431307
with self.argument_context('sig image-definition update') as c:

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

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

1111
from .__cmd_group import *
12+
from ._create import *
1213
from ._delete import *
1314
from ._list import *
15+
from ._list_shared import *
16+
from ._show import *
1417
from ._show_community import *
1518
from ._show_shared import *
19+
from ._update import *
20+
from ._wait import *

0 commit comments

Comments
 (0)