-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd-ref: Document ls-url command (#3996)
* cmd-ref: Document ls-url command * Update content/docs/command-reference/list-url.md Co-authored-by: Dave Berenbaum <[email protected]> * Use admonitions, consistently use list-url, fix usage * Modify example headings * Describe -R option consistently in list and list-url refs. Fix inaccuracy: dvc ls -R does not print directories. * update linked-terms.js * Add links from get-url and import-url to list-url * improve first paragraph in description Co-authored-by: Jorge Orpinel <[email protected]> Co-authored-by: Dave Berenbaum <[email protected]> Co-authored-by: Thomas Kunwar <[email protected]>
- Loading branch information
1 parent
de0e9cd
commit 2d97b3f
Showing
6 changed files
with
121 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# list-url | ||
|
||
<admon type="info"> | ||
|
||
Aliased to `dvc ls-url` | ||
|
||
</admon> | ||
|
||
List contents from a supported URL (for example `s3://`, `ssh://`, and other | ||
protocols). | ||
|
||
<admon type="tip"> | ||
|
||
Useful to find data to `dvc get-url` or `dvc import-url`. | ||
|
||
</admon> | ||
|
||
## Synopsis | ||
|
||
```usage | ||
usage: dvc list-url [-h] [-q | -v] [-R] url | ||
positional arguments: | ||
url (See supported URLs in the description) | ||
``` | ||
|
||
## Description | ||
|
||
Lists files and directories from an external location. `dvc list-url` provides a | ||
uniform interface to browse the contents of an external location using any | ||
protocol that is understood by `dvc get-url` or `dvc import-url`. For example, | ||
it is roughly equivalent to `aws s3 ls` when using the `s3://` protocol, or | ||
`ssh user@host ls -a` when using `ssh://`. | ||
|
||
The `url` argument specifies the location of the data to be listed. It supports | ||
several kinds of external data sources: | ||
|
||
| Type | Description | `url` format example | | ||
| ------- | ---------------------------- | ------------------------------------- | | ||
| `s3` | Amazon S3 | `s3://bucket/data` | | ||
| `azure` | Microsoft Azure Blob Storage | `azure://container/data` | | ||
| `gs` | Google Cloud Storage | `gs://bucket/data` | | ||
| `ssh` | SSH server | `ssh://[email protected]/path/to/data` | | ||
| `local` | Local path | `/path/to/local/data` | | ||
|
||
<admon type="info"> | ||
|
||
If you installed DVC via `pip` and plan to access cloud services as external | ||
data sources, you might need to install these optional dependencies: `[s3]`, | ||
`[azure]`, `[gs]`, `[oss]`, `[ssh]`. Alternatively, use `[all]` to include them | ||
all. The command should look like this: `pip install "dvc[s3]"`. (This example | ||
installs `boto3` library along with DVC to support S3 storage.) | ||
|
||
</admon> | ||
|
||
Only the root directory is listed by default, but the `-R` option can be used to | ||
list files recursively. | ||
|
||
## Options | ||
|
||
- `-R`, `--recursive` - recursively list files in all subdirectories. | ||
|
||
- `-h`, `--help` - prints the usage/help message, and exit. | ||
|
||
- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no | ||
problems arise, otherwise a non-zero value. | ||
|
||
- `-v`, `--verbose` - displays detailed tracing information. | ||
|
||
## Example: Amazon S3 | ||
|
||
This command will list objects and common prefixes under the specified path: | ||
|
||
```dvc | ||
$ dvc list-url s3://bucket/path | ||
``` | ||
|
||
DVC expects that AWS CLI is already | ||
[configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html). | ||
DVC will use the AWS credentials file to access S3. | ||
|
||
## Example: SSH | ||
|
||
```dvc | ||
$ dvc list-url ssh://[email protected]/path/to/data | ||
``` | ||
|
||
Using default SSH credentials, the above command lists files and directories | ||
inside `data`. | ||
|
||
## Example: local file system | ||
|
||
```dvc | ||
$ dvc list-url /local/path/to/data | ||
``` | ||
|
||
The above command will list the `/local/path/to/data` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters