volume snapshot list
Displays info about a set of snapshots.
You can specify the snapshots by volumes or paths, or by specifying a filter to select volumes with certain characteristics.
Syntax
- CLI
-
/opt/mapr/bin/maprcli volume snapshot list [ -cluster <cluster name> ] [ -columns <fields> ] ( -filter <filter> ] [ -path <volume path list> ] [ -volume <volume list> ] [ -limit <rows> ] [ -output (terse|verbose) ] [ -start <offset> ]
- REST
Request Type GET Request URL http[s]://<host>:<port>/rest/volume/snapshot/list[?<parameters>]
Parameters
Either volume
or path
can be used if you wish the
specify the snapshots. In addition, filter
can be used with
volume
and path
, or independently.
Parameter | Description |
---|---|
cluster |
The cluster on which to run the command. |
columns |
A comma-separated list of fields to return in the query. See the Fields table below. Default: none |
filter |
A filter specifying snapshots to list. See Filters for more information. |
limit |
The number of rows to return, beginning at start. Default:
2147483647 |
output |
Specifies whether the output should be terse or
verbose . Default: verbose
|
path |
A comma-separated list of paths for which to list snapshots. |
start |
The offset from the starting row. Default: 0 |
volume |
A comma-separated list of volumes for which to list snapshots. |
Fields
The following table lists the fields used in the columns
parameter, and
returned as output.
Field Name | Short Name | Description |
---|---|---|
snapshotid |
id |
Unique snapshot ID. |
sharedSize |
shSz | Size of data (in MB) that the snapshot shares with previous snapshots. |
volumename |
vn |
Name of the read-write volume associated with the snapshot. |
ownername |
on |
Owner (user or group) associated with the volume. |
cumulativeReclaimSizeMB |
cs |
Disk space (in MB) used/owned by the snapshot |
numSizeUpdates |
numSizeUpdates | Number of times the size of the snapshot has been updated. The size of a snapshot is updated a few times at different intervals, as a snapshot's size takes time to settle to the correct value. |
snapshotname |
n |
Snapshot name. |
ownedsize |
owSz | Size of data (in MB) owned by a snapshot, as opposed to sharedSize (owned by previous snapshots). |
sizeUpdateRequestedAt |
sizeUpdateRequestedAt | Internal field to determine the time at which a snapshot's size update is first queued. |
ownertype |
ot |
Owner type for the owner of the volume:
|
numSizeUpdatesDesired |
numSizeUpdatesDesired | Number of times a snapshot's size should be updated to fetch and record the correct size of the snapshot (refer to @numSizeUpdates field description). |
volumeid |
vid |
ID of the volume associated with the snapshot. |
creationtime |
ct |
Snapshot creation time. Date time string (verbose output) or milliseconds since 1970 (terse output). |
volumepath |
vp |
Path to the volume associated with the snapshot. |
expirytime |
et |
The time until which the snapshot should be maintained. Expired snapshots are purged (deleted) periodically. Date time string (verbose output), or milliseconds since 1970 (terse output); 0 = never expires. |
volumeSnapshotAces |
N/A | Access Control Expression (ACE) permissions for read and write on the volume snapshot. Use
-json to view the ACE permissions. |
sizeUpdatedAt |
sizeUpdatedAt | The time at which the size of the snapshot was last updated. |
Output
This sample output is based on using the following code to create a snapshot called
uservolume
for the volume named users
.
/opt/mapr/bin/maprcli volume snapshot create -snapshotname uservolsnap -volume users
Sample Output
# /opt/mapr/bin/maprcli volume snapshot list
snapshotid sharedSize volumename ownername cumulativeReclaimSizeMB numSizeUpdates snapshotname ownedsize sizeUpdateRequestedAt ownertype numSizeUpdatesDesired volumeid creationtime volumepath volumeSnapshotAces sizeUpdatedAt
256000049 0 sampleVol1 root 0 1 sampleVol1snapshot1 0 Mon Dec 03 14:44:07 PST 2018 1 1 181800573 Mon Dec 03 14:44:07 PST 2018 ... Mon Dec 03 14:53:13 PST 2018
Examples
List all snapshots:
# /opt/mapr/bin/maprcli volume snapshot list
snapshotid sharedSize volumename ownername cumulativeReclaimSizeMB numSizeUpdates snapshotname ownedsize sizeUpdateRequestedAt ownertype numSizeUpdatesDesired volumeid creationtime volumepath volumeSnapshotAces sizeUpdatedAt
256000049 0 sampleVol1 root 0 1 sampleVol1snapshot1 0 Mon Dec 03 14:44:07 PST 2018 1 1 181800573 Mon Dec 03 14:44:07 PST 2018 ... Mon Dec 03 14:53:13 PST 2018
256000050 0 sampleVol1 root 0 1 sampleVol1snapshot2 0 Mon Dec 03 14:44:25 PST 2018 1 1 181800573 Mon Dec 03 14:44:25 PST 2018 ... Mon Dec 03 14:53:13 PST 2018
curl -k -X GET 'https://abc.sj.us:8443/rest/volume/snapshot/list' --user mapr:mapr
{"timestamp":1537984492448,"timeofday":"2018-09-26 10:54:52.448 GMT-0700 AM","status":"OK","total":3,"data":[{"ownername":"mapr","ownertype":"1","volumeid":"29379677","volumename":"egVol","volumepath":"/egVol","snapshotid":"256000049","snapshotname":"egVol-snapshot","creationtime":"Wed Sep 26 10:42:52 PDT 2018","cumulativeReclaimSizeMB":"0","ownedsize":"0","sharedSize":"0","volumeSnapshotAces":{"readAce":"p","writeAce":"p"}},{"ownername":"mapr","ownertype":"1","volumeid":"212450174","volumename":"users","volumepath":"/user","snapshotid":"256000051","snapshotname":"uservolsnap","creationtime":"Wed Sep 26 10:45:27 PDT 2018","cumulativeReclaimSizeMB":"0","ownedsize":"0","sharedSize":"0","volumeSnapshotAces":{"readAce":"p","writeAce":"p"}},{"ownername":"mapr","ownertype":"1","volumeid":"29379677","volumename":"egVol","volumepath":"/egVol","snapshotid":"256000050","snapshotname":"egVolSnapshot","creationtime":"Wed Sep 26 10:43:12 PDT 2018","cumulativeReclaimSizeMB":"0","ownedsize":"0","sharedSize":"0","volumeSnapshotAces":{"readAce":"p","writeAce":"p"}}]}
List all snapshots and format the output:
# /opt/mapr/bin/maprcli volume snapshot list -json
{
"timestamp":1543906761613,
"timeofday":"2018-12-03 10:59:21.613 GMT-0800 PM",
"status":"OK",
"total":2,
"data":[
{
"ownername":"root",
"ownertype":"1",
"volumeid":"181800573",
"volumename":"sampleVol1",
"volumepath":"",
"snapshotid":"256000049",
"snapshotname":"sampleVol1snapshot1",
"creationtime":"Mon Dec 03 14:44:07 PST 2018",
"cumulativeReclaimSizeMB":"0",
"ownedsize":"0",
"sharedSize":"0",
"numSizeUpdatesDesired":1,
"numSizeUpdates":1,
"sizeUpdateRequestedAt":"Mon Dec 03 14:44:07 PST 2018",
"sizeUpdatedAt":"Mon Dec 03 14:53:13 PST 2018",
"volumeSnapshotAces":{
"readAce":"p",
"writeAce":"p"
}
},
{
"ownername":"root",
"ownertype":"1",
"volumeid":"181800573",
"volumename":"sampleVol1",
"volumepath":"",
"snapshotid":"256000050",
"snapshotname":"sampleVol1snapshot2",
"creationtime":"Mon Dec 03 14:44:25 PST 2018",
"cumulativeReclaimSizeMB":"0",
"ownedsize":"0",
"sharedSize":"0",
"numSizeUpdatesDesired":1,
"numSizeUpdates":1,
"sizeUpdateRequestedAt":"Mon Dec 03 14:44:25 PST 2018",
"sizeUpdatedAt":"Mon Dec 03 14:53:13 PST 2018",
"volumeSnapshotAces":{
"readAce":"p",
"writeAce":"p"
}
}
]
}