Skip to content

Commit cc56708

Browse files
authored
{Compute} az sig share: Migrate command group to aaz based (#30606)
1 parent e60160d commit cc56708

File tree

16 files changed

+3852
-4406
lines changed

16 files changed

+3852
-4406
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,10 +161,6 @@ def cf_shared_galleries(cli_ctx, *_):
161161
return cf_vm_cl(cli_ctx).shared_galleries
162162

163163

164-
def cf_gallery_sharing_profile(cli_ctx, *_):
165-
return cf_vm_cl(cli_ctx).gallery_sharing_profile
166-
167-
168164
def cf_shared_gallery_image(cli_ctx, *_):
169165
return cf_vm_cl(cli_ctx).shared_gallery_images
170166

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

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,53 +1110,6 @@
11101110
short-summary: Manage gallery sharing profile
11111111
"""
11121112

1113-
helps['sig share add'] = """
1114-
type: command
1115-
short-summary: Share gallery with subscriptions and tenants
1116-
examples:
1117-
- name: Share entire gallery with all members of a subscription and/or tenant.
1118-
text: |
1119-
az sig share add --resource-group MyResourceGroup --gallery-name MyGallery \\
1120-
--subscription-ids subId1 subId2 --tenant-ids tenantId1 tenantId2
1121-
"""
1122-
1123-
helps['sig share remove'] = """
1124-
type: command
1125-
short-summary: stop sharing gallery with a subscription or tenant
1126-
examples:
1127-
- name: Stop sharing with a subscription or tenant ID
1128-
text: |
1129-
az sig share remove --resource-group MyResourceGroup --gallery-name MyGallery \\
1130-
--subscription-ids subId1 subId2 --tenant-ids tenantId1 tenantId2
1131-
"""
1132-
1133-
helps['sig share reset'] = """
1134-
type: command
1135-
short-summary: disable gallery from being shared with subscription or tenant
1136-
examples:
1137-
- name: Reset sharing profile of a gallery.
1138-
text: |
1139-
az sig share reset --resource-group MyResourceGroup --gallery-name MyGallery
1140-
"""
1141-
1142-
helps['sig share enable-community'] = """
1143-
type: command
1144-
short-summary: Allow to share gallery to the community
1145-
examples:
1146-
- name: Allow to share gallery to the community
1147-
text: |
1148-
az sig share enable-community --resource-group MyResourceGroup --gallery-name MyGallery
1149-
"""
1150-
1151-
helps['sig share wait'] = """
1152-
type: command
1153-
short-summary: Place the CLI in a waiting state until a condition of a shared gallery is met.
1154-
examples:
1155-
- name: Place the CLI in a waiting state until the gallery sharing object is updated.
1156-
text: |
1157-
az sig share wait --updated --resource-group MyResourceGroup --gallery-name Gallery
1158-
"""
1159-
11601113
helps['sig gallery-application'] = """
11611114
type: group
11621115
short-summary: Manage gallery application

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,23 +1257,6 @@ def load_arguments(self, _):
12571257
c.argument('gallery_image_name', options_list=['--gallery-image-definition', '-i'], help='gallery image definition')
12581258
c.argument('gallery_image_version', options_list=['--gallery-image-version', '-e'], help='gallery image version')
12591259

1260-
for scope in ['sig share add', 'sig share remove']:
1261-
with self.argument_context(scope) as c:
1262-
c.argument('gallery_name', type=str, help='The name of the Shared Image Gallery.', id_part='name')
1263-
c.argument('subscription_ids', nargs='+', help='A list of subscription ids to share the gallery.')
1264-
c.argument('tenant_ids', nargs='+', help='A list of tenant ids to share the gallery.')
1265-
1266-
with self.argument_context('sig share add') as c:
1267-
c.argument('op_type', default='Add', deprecate_info=c.deprecate(hide=True),
1268-
help='distinguish add operation and remove operation')
1269-
1270-
with self.argument_context('sig share remove') as c:
1271-
c.argument('op_type', default='Remove', deprecate_info=c.deprecate(hide=True),
1272-
help='distinguish add operation and remove operation')
1273-
1274-
with self.argument_context('sig share reset') as c:
1275-
c.argument('gallery_name', type=str, help='The name of the Shared Image Gallery.', id_part='name')
1276-
12771260
with self.argument_context('sig image-definition create') as c:
12781261
c.argument('offer', options_list=['--offer', '-f'], help='image offer')
12791262
c.argument('sku', options_list=['--sku', '-s'], help='image sku')
@@ -1418,13 +1401,6 @@ def load_arguments(self, _):
14181401
c.argument('marker', arg_type=marker_type)
14191402
c.argument('show_next_marker', action='store_true', help='Show nextMarker in result when specified.')
14201403

1421-
with self.argument_context('sig share enable-community') as c:
1422-
c.argument('gallery_name', type=str, help='The name of the Shared Image Gallery.', id_part='name')
1423-
c.argument('subscription_ids', nargs='+', help='A list of subscription ids to share the gallery.')
1424-
c.argument('tenant_ids', nargs='+', help='A list of tenant ids to share the gallery.')
1425-
c.argument('op_type', default='EnableCommunity', deprecate_info=c.deprecate(hide=True),
1426-
help='distinguish add operation and remove operation')
1427-
14281404
# endregion
14291405

14301406
# region Gallery applications
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
class __CMDGroup(AAZCommandGroup):
15+
"""Manage gallery sharing profile.
16+
"""
17+
pass
18+
19+
20+
__all__ = ["__CMDGroup"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from .__cmd_group import *
12+
from ._update import *

0 commit comments

Comments
 (0)