Skip to content

Commit

Permalink
implement param, remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
cxznmhdcxz committed Jan 6, 2025
1 parent 43d2672 commit 33b830a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ def cf_shared_galleries(cli_ctx, *_):
return cf_vm_cl(cli_ctx).shared_galleries


def cf_gallery_sharing_profile(cli_ctx, *_):
return cf_vm_cl(cli_ctx).gallery_sharing_profile


def cf_shared_gallery_image(cli_ctx, *_):
return cf_vm_cl(cli_ctx).shared_gallery_images

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
cf_dedicated_hosts, cf_dedicated_host_groups,
cf_log_analytics_data_plane,
cf_disk_encryption_set,
cf_gallery_sharing_profile,
cf_shared_gallery_image,
cf_shared_gallery_image_version,
cf_capacity_reservation_groups,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5402,15 +5402,6 @@ def list_generator(pages, num_results=50):
return result


def sig_share_reset(cmd, client, resource_group_name, gallery_name):
SharingUpdate, SharingUpdateOperationTypes = cmd.get_models('SharingUpdate', 'SharingUpdateOperationTypes',
operation_group='shared_galleries')
sharing_update = SharingUpdate(operation_type=SharingUpdateOperationTypes.RESET)
return client.begin_update(resource_group_name=resource_group_name,
gallery_name=gallery_name,
sharing_update=sharing_update)


def sig_shared_image_definition_list(client, location, gallery_unique_name,
shared_to=None, marker=None, show_next_marker=None):
# Keep it here as it will add subscription in the future and we need to set it to None to make it work
Expand Down
9 changes: 0 additions & 9 deletions src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5395,15 +5395,6 @@ def list_generator(pages, num_results=50):
return result


def sig_share_reset(cmd, client, resource_group_name, gallery_name):
SharingUpdate, SharingUpdateOperationTypes = cmd.get_models('SharingUpdate', 'SharingUpdateOperationTypes',
operation_group='shared_galleries')
sharing_update = SharingUpdate(operation_type=SharingUpdateOperationTypes.RESET)
return client.begin_update(resource_group_name=resource_group_name,
gallery_name=gallery_name,
sharing_update=sharing_update)


def sig_shared_image_definition_list(client, location, gallery_unique_name,
shared_to=None, marker=None, show_next_marker=None):
# Keep it here as it will add subscription in the future and we need to set it to None to make it work
Expand Down
14 changes: 14 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/operations/sig_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ class SigShareEnableCommunity(_SigShareUpdate):
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.subscription_ids = AAZListArg(
options=["--subscription-ids"],
help="A list of subscription ids to share the gallery with.",
)
subscription_ids = args_schema.subscription_ids
subscription_ids.Element = AAZStrArg()

args_schema.tenant_ids = AAZListArg(
options=["--tenant-ids"],
help="A list of tenant ids to share the gallery with.",
)
tenant_ids = args_schema.tenant_ids
tenant_ids.Element = AAZStrArg()

args_schema.operation_type._required = False
args_schema.operation_type._registered = False
args_schema.operation_type._default = 'EnableCommunity'
Expand Down

0 comments on commit 33b830a

Please sign in to comment.