2021-04-01 15:16:52 +00:00
|
|
|
---
|
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: volume snapshot list'
|
|
|
|
description: |
|
|
|
|
List external volume snapshots.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Command: volume snapshot list
|
|
|
|
|
2022-08-05 20:45:30 +00:00
|
|
|
The `volume snapshot list` command lists volume snapshots known to a
|
2021-04-01 15:16:52 +00:00
|
|
|
[Container Storage Interface (CSI)][csi] storage provider. Only CSI plugins
|
|
|
|
that implement the [Controller][csi_plugins_internals] interface support this
|
|
|
|
command.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```plaintext
|
2021-07-03 00:46:41 +00:00
|
|
|
nomad volume snapshot list [-plugin plugin_id -secrets key=value]
|
2021-04-01 15:16:52 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
The `volume snapshot list` command returns a list of snapshots along with their
|
|
|
|
source volume ID as known to the external storage provider. This is not the
|
|
|
|
same as the Nomad volume ID, as the source volume may not be [registered] with
|
|
|
|
Nomad.
|
|
|
|
|
|
|
|
## General Options
|
|
|
|
|
|
|
|
@include 'general_options.mdx'
|
|
|
|
|
2022-03-01 13:47:01 +00:00
|
|
|
## Snapshot List Options
|
2021-04-01 15:16:52 +00:00
|
|
|
|
2022-03-24 14:29:50 +00:00
|
|
|
- `-page-token`: Where to start pagination.
|
|
|
|
- `-per-page`: How many results to show per page.
|
2021-04-01 15:16:52 +00:00
|
|
|
- `-plugin`: Display only snapshots managed by a particular [CSI
|
2022-03-07 14:58:29 +00:00
|
|
|
plugin][csi_plugin]. This flag is required and accepts a plugin ID
|
|
|
|
or prefix. If there is an exact match based on the provided plugin,
|
|
|
|
then that specific plugin will be queried. Otherwise, a list of
|
|
|
|
matching plugins will be displayed.
|
2022-03-01 13:47:01 +00:00
|
|
|
- `-secret`: Secrets to pass to the plugin to list snapshots. Accepts
|
|
|
|
multiple flags in the form `-secret key=value`
|
2022-03-24 14:29:50 +00:00
|
|
|
- `-verbose`: Display full information for the resulting snapshot.
|
2021-04-01 15:16:52 +00:00
|
|
|
|
|
|
|
When ACLs are enabled, this command requires a token with the
|
|
|
|
`csi-list-volumes` capability for the plugin's namespace.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
List volume snapshots for a plugin:
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ nomad volume snapshot list -plugin aws-ebs0
|
|
|
|
Snapshot ID External ID Size Creation Time Ready?
|
|
|
|
snap-12345 vol-abcdef 50GiB 2021-01-03T12:15:02Z true
|
|
|
|
snap-67890 vol-fedcba 50GiB 2021-01-04T15:45:00Z true
|
|
|
|
```
|
|
|
|
|
2021-07-03 00:46:41 +00:00
|
|
|
List volume snapshots with two secret key/value pairs:
|
|
|
|
```shell-session
|
2022-03-07 14:58:29 +00:00
|
|
|
$ nomad volume snapshot list -plugin aws-ebs0 -secret key1=value1 -secret key2=val2
|
2021-07-03 00:46:41 +00:00
|
|
|
Snapshot ID External ID Size Creation Time Ready?
|
|
|
|
snap-12345 vol-abcdef 50GiB 2021-01-03T12:15:02Z true
|
|
|
|
```
|
|
|
|
|
2021-04-01 15:16:52 +00:00
|
|
|
[csi]: https://github.com/container-storage-interface/spec
|
|
|
|
[csi_plugin]: /docs/job-specification/csi_plugin
|
|
|
|
[registered]: /docs/commands/volume/register
|
2022-07-11 20:55:33 +00:00
|
|
|
[csi_plugins_internals]: /docs/concepts/plugins/csi#csi-plugins
|