diff --git a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py index 859b2103985..58f8555b76e 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py +++ b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py @@ -129,8 +129,7 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m ) try: - return client.begin_create(subscription_id=subscription_id, - resource_group_name=resource_group_name, + return client.begin_create(resource_group_name=resource_group_name, registry_name=registry_name, connected_registry_name=connected_registry_name, connected_registry_create_parameters=connected_registry_create_parameters) @@ -264,12 +263,10 @@ def acr_connected_registry_deactivate(cmd, resource_group_name=None): _, resource_group_name = validate_managed_registry( cmd, registry_name, resource_group_name) - subscription_id = get_subscription_id(cmd.cli_ctx) user_confirmation("Are you sure you want to deactivate the connected registry '{}' in '{}'?".format( connected_registry_name, registry_name), yes) - return client.begin_deactivate(subscription_id=subscription_id, - resource_group_name=resource_group_name, + return client.begin_deactivate(resource_group_name=resource_group_name, registry_name=registry_name, connected_registry_name=connected_registry_name) @@ -520,12 +517,16 @@ def _update_repo_permissions(cmd, return None current_actions = list(final_actions_set) logger.warning(msg) + ScopeMapUpdateParameters = cmd.get_models('ScopeMapUpdateParameters') + scope_map_update_parameters = ScopeMapUpdateParameters( + description=description, + actions=current_actions + ) return scope_map_client.begin_update( resource_group_name, registry_name, sync_scope_map_name, - description, - current_actions + scope_map_update_parameters ) diff --git a/src/azure-cli/azure/cli/command_modules/acr/scope_map.py b/src/azure-cli/azure/cli/command_modules/acr/scope_map.py index e7505dd2cde..96d903690eb 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/scope_map.py +++ b/src/azure-cli/azure/cli/command_modules/acr/scope_map.py @@ -39,10 +39,12 @@ def acr_scope_map_create(cmd, actions = parse_scope_map_actions(repository_actions_list, gateway_actions_list) - scope_map = { - 'actions': actions, - 'description': description - } + ScopeMap = cmd.get_models('ScopeMap') + + scope_map = ScopeMap( + actions=actions, + description=description + ) return client.begin_create( resource_group_name, @@ -68,7 +70,7 @@ def acr_scope_map_delete(cmd, return None resource_group_name = get_resource_group_name_by_registry_name(cmd.cli_ctx, registry_name, resource_group_name) - return client.delete(resource_group_name, registry_name, scope_map_name) + return client.begin_delete(resource_group_name, registry_name, scope_map_name) def acr_scope_map_update(cmd, @@ -106,12 +108,16 @@ def acr_scope_map_update(cmd, final_actions_set = set(current_scope_map.actions).union(add_actions_set).difference(remove_actions_set) current_actions = list(final_actions_set) - return client.update( + ScopeMapUpdateParameters = cmd.get_models('ScopeMapUpdateParameters') + scope_map_update_parameters = ScopeMapUpdateParameters( + description=description, + actions=current_actions + ) + return client.begin_update( resource_group_name, registry_name, scope_map_name, - description, - current_actions + scope_map_update_parameters )