Skip to content

Commit

Permalink
add examples and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliehzl committed Jan 21, 2020
1 parent 90c0db5 commit 146918e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/storage/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,8 @@
text: az storage copy -s https://[account].blob.core.windows.net/[container]/[path/to/directory] -d /path/to/dir --recursive
- name: Download a subset of containers within a storage account by using a wildcard symbol (*) in the container name, and you can also specify your storage account and container information as above.
text: az storage copy -s https://[account].blob.core.windows.net/[container*name] -d /path/to/dir --recursive
- name: Download a set of files from Azure Blob using --include-pattern, and you can also specify your storage account and container information as above.
text: az storage copy -s https://[account].blob.core.windows.net/[container] --include-pattern foo* -d /path/to/dir --recursive
- name: Download a subset of files from Azure Blob. (Only jpg files and file names don't start with test will be included.)
text: az storage copy -s https://[account].blob.core.windows.net/[container] --include-pattern "*.jpg" --exclude-pattern test* -d /path/to/dir --recursive
- name: Copy a single blob to another blob, and you can also specify the storage account and container information of source and destination as above.
text: az storage copy -s https://[srcaccount].blob.core.windows.net/[container]/[path/to/blob] -d https://[destaccount].blob.core.windows.net/[container]/[path/to/blob]
- name: Copy an entire account data from blob account to another blob account, and you can also specify the storage account and container information of source and destination as above.
Expand Down Expand Up @@ -1208,8 +1208,8 @@
text: az storage remove -c MyContainer --recursive
- name: Remove all the blobs in a Storage Container.
text: az storage remove -c MyContainer -n path/to/directory
- name: Remove a subset of blobs in a virtual directory (For example, only jpg and pdf files, or if the blob name is "exactName").
text: az storage remove -c MyContainer --include-path path/to/directory --include-pattern "*.jpg;*.pdf;exactName" --recursive
- name: Remove a subset of blobs in a virtual directory (For example, only jpg and pdf files, or if the blob name is "exactName" and file names don't start with "test").
text: az storage remove -c MyContainer --include-path path/to/directory --include-pattern "*.jpg;*.pdf;exactName" --exclude-pattern "test*" --recursive
- name: Remove an entire virtual directory but exclude certain blobs from the scope (For example, every blob that starts with foo or ends with bar).
text: az storage remove -c MyContainer --include-path path/to/directory --exclude-pattern "foo*;*bar" --recursive
- name: Remove a single file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ def test_storage_blob_azcopy_remove(self, resource_group, storage_account_info,
self.cmd('storage blob list -c {} --account-name {}'.format(
container, storage_account), checks=JMESPathCheck('length(@)', 21))

self.cmd('storage remove -c {} --include-path apple --account-name {} --include-pattern "file*" --exclude-pattern "file_1*" --recursive'.format(
container, storage_account))
self.cmd('storage blob list -c {} --account-name {}'.format(
container, storage_account), checks=JMESPathCheck('length(@)', 12))

self.cmd('storage remove -c {} --account-name {} --recursive'.format(
container, storage_account))
self.cmd('storage blob list -c {} --account-name {}'.format(
Expand Down

0 comments on commit 146918e

Please sign in to comment.