Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/storage-blob-preview/azext_storage_blob_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,26 +343,6 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.extra('lease_id', help='Required if the blob has an active lease.', required=True)
c.extra('if_tags_match_condition', tags_condition_type)

with self.argument_context('storage blob list') as c:
from .track2_util import get_include_help_string
t_blob_include = self.get_sdk('_generated.models._azure_blob_storage_enums#ListBlobsIncludeItem',
resource_type=CUSTOM_DATA_STORAGE_BLOB)
c.register_container_arguments()
c.argument('delimiter',
help='When the request includes this parameter, the operation returns a BlobPrefix element in the '
'result list that acts as a placeholder for all blobs whose names begin with the same substring '
'up to the appearance of the delimiter character. The delimiter may be a single character or a '
'string.')
c.argument('include', help="Specify one or more additional datasets to include in the response. "
"Options include: {}. Can be combined.".format(get_include_help_string(t_blob_include)),
validator=validate_included_datasets_v2)
c.argument('marker', arg_type=marker_type)
c.argument('num_results', arg_type=num_results_type)
c.argument('prefix',
help='Filter the results to return only blobs whose name begins with the specified prefix.')
c.argument('show_next_marker', action='store_true', is_preview=True,
help='Show nextMarker in result when specified.')

for item in ['show', 'update']:
with self.argument_context('storage blob metadata {}'.format(item), resource_type=CUSTOM_DATA_STORAGE_BLOB) \
as c:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT
create_boolean_result_output_transformer, transform_blob_list_output
from ._validators import (process_blob_download_batch_parameters, process_blob_delete_batch_parameters,
process_blob_upload_batch_parameters)
g.storage_custom_command_oauth('list', 'list_blobs', client_factory=cf_container_client,
transform=transform_blob_list_output,
table_transformer=transform_blob_output)
g.storage_command_oauth('delete', 'delete_blob')
g.storage_custom_command_oauth('download', 'download_blob', transform=transform_blob_json_output)
g.storage_command_oauth('exists', 'exists', transform=create_boolean_result_output_transformer('exists'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,29 +537,6 @@ def generate_sas_container_uri(client, cmd, container_name, permission=None,
return sas_token


def list_blobs(client, delimiter=None, include=None, marker=None, num_results=None, prefix=None,
show_next_marker=None, **kwargs):
from ..track2_util import list_generator

if delimiter:
generator = client.walk_blobs(name_starts_with=prefix, include=include, results_per_page=num_results, **kwargs)
else:
generator = client.list_blobs(name_starts_with=prefix, include=include, results_per_page=num_results, **kwargs)

pages = generator.by_page(continuation_token=marker) # BlobPropertiesPaged
result = list_generator(pages=pages, num_results=num_results)

if show_next_marker:
next_marker = {"nextMarker": pages.continuation_token}
result.append(next_marker)
else:
if pages.continuation_token:
logger.warning('Next Marker:')
logger.warning(pages.continuation_token)

return result


def list_containers(client, include_metadata=False, include_deleted=False, marker=None,
num_results=None, prefix=None, show_next_marker=None, **kwargs):
from ..track2_util import list_generator
Expand Down
4 changes: 0 additions & 4 deletions src/storage-preview/azext_storage_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,6 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
'the file owning group, and others. Both symbolic (rwxrw-rw-) and 4-digit '
'octal notation (e.g. 0766) are supported.')

with self.argument_context('storage blob list') as c:
c.argument('include', validator=validate_included_datasets, default='mc')
c.argument('num_results', arg_type=num_results_type)

with self.argument_context('storage blob move') as c:
from ._validators import validate_move_file
c.argument('source_path', options_list=['--source-blob', '-s'], validator=validate_move_file,
Expand Down
9 changes: 0 additions & 9 deletions src/storage-preview/azext_storage_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,6 @@ def _adls_deprecate_message(self):
msg += " https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/storage/docs/ADLS%20Gen2.md"
return msg

# Change existing Blob Commands
with self.command_group('storage blob', command_type=adls_base_blob_sdk) as g:
from ._format import transform_blob_output
from ._transformers import transform_storage_list_output
g.storage_command_oauth('list', 'list_blobs', transform=transform_storage_list_output,
table_transformer=transform_blob_output,
deprecate_info=self.deprecate(redirect="az storage fs file list", hide=True,
message_func=_adls_deprecate_message))

# New Blob Commands
with self.command_group('storage blob', command_type=adls_base_blob_sdk,
custom_command_type=get_custom_sdk('blob', adls_blob_data_service_factory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ def delete_directory(client, container_name, directory_name):
logger.info("Took {} call(s) to finish moving.".format(count))


def list_blobs(client, container_name, prefix=None, num_results=None, include='mc',
delimiter=None, marker=None, timeout=None):
client.list_blobs(container_name, prefix, num_results, include,
delimiter, marker, timeout)


def list_directory(client, container_name, directory_path, prefix=None, num_results=None, include='mc',
delimiter=None, marker=None, timeout=None):
'''
Expand Down