Data ONTAP® PowerShell Toolkit

Switch to Data ONTAP 7-mode documentation.

Cmdlet: Get-NcSnapshot


NAME
Get-NcSnapshot

SYNOPSIS
Get a list of snapshot objects.

SYNTAX
Get-NcSnapshot [[-Volume] <String[]>] [[-SnapName] <String[]>] [-Vserver <St
ring[]>] [-Attributes <SnapshotInfo>] [-Controller <NcController[]>] [<Commo
nParameters>]

Get-NcSnapshot -Template [-Controller <NcController[]>] [<CommonParameters>]

Get-NcSnapshot -Query <SnapshotInfo> [-Attributes <SnapshotInfo>] [-Controll
er <NcController[]>] [<CommonParameters>]


DESCRIPTION
Get a list of snapshot objects.


PARAMETERS
-Volume <String[]>
Restrict results to the specified volumes. Data ONTAP wildcards are per
mitted.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-SnapName <String[]>
The name of one or more snapshots to get. Data ONTAP wildcards are perm
itted.

Required? false
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Vserver <String[]>
Restrict results to the specified vservers. Data ONTAP wildcards are pe
rmitted.

Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Attributes <SnapshotInfo>
For improved scalability in large clusters, provide a SnapshotInfo objec
t with various fields set to indicate which fields to return on all obje
cts. Undesired fields should remain set to null. Use "Get-NcSnapshot -
Template" to get the initially empty SnapshotInfo object. If not specif
ied, all data is returned for each object.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Controller <NcController[]>
A clustered Data ONTAP controller to receive this cmdlet, as embodied by
an NcController object. This parameter is returned by the Connect-NcCo
ntroller cmdlet. If not specified, the value in the global variable Cur
rentNcController is used. In the latter case, if CurrentNcController co
ntains a collection of NcController objects, this cmdlet is invoked on e
ach controller in succession.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-Template
Specify to get an empty SnapshotInfo object for use with advanced querie
s involving the Query attribute.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Query <SnapshotInfo>
For advanced queries, provide a SnapshotInfo object with various fields
set to indicate which records to retrieve. Other fields should remain s
et to null. Use "Get-NcSnapshot -Template" to get the initially empty S
napshotInfo object.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
DataONTAP.C.Types.Snapshot.SnapshotInfo


NOTES


Category: snapshot
API: snapshot-get-iter
Family: cluster, vserver

-------------- Example 1 --------------

C:\PS>Get-NcSnapshot vol2


Get the snapshots from volume 'vol2'.


Name Volume Vserver
---- ------ -------
clone_vol2clone.0 vol2 vserver1
clone_vol2clone.1 vol2 vserver1
clone_vol2clone.2 vol2 vserver1
clone_vol2clone.3 vol2 vserver1
clone_vol2clone.4 vol2 vserver1
weekly.2011-09-04_0015 vol2 vserver1
deleteMeAgain vol2 vserver1
daily.2011-09-11_0010 vol2 vserver1
weekly.2011-09-11_0015 vol2 vserver1
daily.2011-09-12_0010 vol2 vserver1
hourly.2011-09-12_0905 vol2 vserver1
hourly.2011-09-12_1005 vol2 vserver1
hourly.2011-09-12_1105 vol2 vserver1
hourly.2011-09-12_1205 vol2 vserver1
hourly.2011-09-12_1305 vol2 vserver1
hourly.2011-09-12_1405 vol2 vserver1


-------------- Example 2 --------------

C:\PS>$query = Get-NcSnapshot -Template
$query.CumulativeTotalBlocks = ">" + (1mb/1kb)
Get-NcSnapshot -Query $query | select Name, Volume


Get all snapshots whose total cumulative space is greater than 1 MB. Note t
hat the space must be specified in the number of 1024 byte blocks.


Name Volume
---- ------
weekly.2011-09-04_0015 bigvol
daily.2011-09-11_0010 bigvol
weekly.2011-09-11_0015 bigvol
daily.2011-09-12_0010 bigvol
weekly.2011-09-04_0015 vol1
daily.2011-09-11_0010 vol1
clone_vol2clone.0 vol2
clone_vol2clone.1 vol2
clone_vol2clone.2 vol2
clone_vol2clone.3 vol2
clone_vol2clone.4 vol2
weekly.2011-09-04_0015 vol2
deleteMeAgain vol2
clone_vol2clone.4 vol2clone
weekly.2011-09-04_0015 vol2clone


-------------- Example 3 --------------

C:\PS>Get-NcSnapshot -SnapName weekly* -Vserver vserver1,vserver2


List all weekly snapshots in vservers "vserver1" and "vserver2".


Name Volume Vserver
---- ------ -------
weekly.2011-09-04_0015 bigvol vserver1
weekly.2011-09-11_0015 bigvol vserver1
weekly.2011-09-04_0015 georgeVol1 vserver1
weekly.2011-09-11_0015 georgeVol1 vserver1
weekly.2011-09-04_0015 vol1 vserver1
weekly.2011-09-11_0015 vol1 vserver1
weekly.2011-09-04_0015 vol2 vserver1
weekly.2011-09-11_0015 vol2 vserver1
weekly.2011-09-04_0015 vol2clone vserver1
weekly.2011-09-11_0015 vol2clone vserver1
weekly.2011-09-04_0015 vol_test vserver1
weekly.2011-09-11_0015 vol_test vserver1
weekly.2011-09-04_0015 vserver1vol0 vserver1
weekly.2011-09-11_0015 vserver1vol0 vserver1
weekly.2011-09-04_0015 vserver2vol0 vserver2
weekly.2011-09-11_0015 vserver2vol0 vserver2



RELATED LINKS
New-NcSnapshot
Remove-NcSnapshot







 Data ONTAP® PowerShell Toolkit