-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Added cmdlet for finding remote file snapshot 2. Added cmdlet to restore remote file/folder 3. Fixed issue in enum value in backupRun model. Added additional enum 'kWarning'
- Loading branch information
1 parent
c67ccb5
commit 5c1875b
Showing
11 changed files
with
859 additions
and
18 deletions.
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
docs/cmdlets-reference/find-cohesityremotefilesnapshot.md
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,107 @@ | ||
# Find-CohesityRemoteFileSnapshot | ||
|
||
## SYNOPSIS | ||
Get the information about snapshots from an external target that contain the specified file or folder. In addition, information about the file or folder is provided. | ||
|
||
## SYNTAX | ||
|
||
``` | ||
Find-CohesityRemoteFileSnapshot [-DoNotIncludeIndexedSnapshotsOnly] [-FileName <String>] [-JobId <Int64>][-SourceId <Int64>] [<CommonParameters>] | ||
``` | ||
|
||
## EXAMPLES | ||
|
||
### EXAMPLE 1 | ||
``` | ||
Find-CohesityRemoteFileSnapshot -FileName "abc.txt" -SourceId 123 -JobId 11 | ||
``` | ||
|
||
Returns indexed remote snapshot information of specified file/folder in metioned source. | ||
|
||
### EXAMPLE 2 | ||
``` | ||
Find-CohesityRemoteFileSnapshot -FileName "abc.txt" -SourceId 123 -JobId 11 -DoNotIncludeIndexedSnapshots | ||
``` | ||
|
||
Returns remote snapshot information of specified file/folder in metioned source, that are not indexed. | ||
|
||
## PARAMETERS | ||
|
||
### -FileName | ||
Specifies the name of the file or folder to find in the snapshots. | ||
This field is required. | ||
|
||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -JobId | ||
Specifies the id of the Job that captured the snapshots. | ||
These snapshots are searched for the specified files or folders. | ||
This field is required. | ||
```yaml | ||
Type: Int64 | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -SourceId | ||
Specifies the id of the Protection Source object (such as a VM) to search. | ||
When a Job Run executes, snapshots of the specified Protection Source | ||
object are captured. This operation searches the snapshots of the | ||
object for the file or folder. This field is required. | ||
```yaml | ||
Type: Int64 | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -DoNotIncludeIndexedSnapshots | ||
Specifies whether to return indexed snapshots or not. In an indexed snapshot files are guaranteed to exist, while in a non-indexed snapshot files may not exist. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
## OUTPUTS | ||
### Cohesity.Model.IndexedObjectSnapshot | ||
## NOTES | ||
## RELATED LINKS | ||
[Read More](https://cohesity.github.io/cohesity-powershell-module/#/README) |
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,263 @@ | ||
# Restore-CohesityRemoteFileV2 | ||
|
||
## SYNOPSIS | ||
Restores the specified files or folders from a previous remote backup based on Cohesity V2 Rest APIs. | ||
|
||
## SYNTAX | ||
|
||
``` | ||
Restore-CohesityFileV2 [-TaskName <String>] [-FileName <String>] [-JobId <Int64>] [-SourceId <Int64>] | ||
[-TargetSourceId <Int64>] [-NewBaseDirectory <String>] [-SnapshotId <String>] [-OverwriteExisting] | ||
[-ContinueOnError] [-EncryptionEnabled] [-PreserveAttributes] [-SaveSuccessFiles] [-RecoverMethod <String>] | ||
[-TargetVMCredential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
Request to create a task for recovering the specified files or folders from a previous remote backup based on Cohesity V2 Rest APIs. | ||
|
||
## EXAMPLES | ||
|
||
### EXAMPLE 1 | ||
``` | ||
Restore-CohesityRemoteFileV2 -TaskName "restore-file-vm" -FileName /C/data/file.txt -JobId 1234 -SourceId 843 -TargetSourceId 856 -RestoreMethod AutoDeploy -TargetVMCredential (Get-Credential) | ||
``` | ||
Restores the specified file/folder to the target VM with specified source id from the latest external target backup. | ||
|
||
### EXAMPLE 2 | ||
``` | ||
Restore-CohesityRemoteFileV2 -FileName "C:\myFolder\abc.txt" -NewBaseDirectory "C:\temp\restore" -JobId 61592 -SourceId 3517 | ||
``` | ||
Restores the specified file/folder in the same server from the latest external target backup. | ||
|
||
### EXAMPLE # | ||
``` | ||
Restore-CohesityRemoteFileV2 -FileName "/C/myFolder" -NewBaseDirectory "C:\temp\restore" -JobId 61592 -SourceId 3517 -SnapshotId "exchjik" | ||
``` | ||
Restores the specified file/folder in the same server from the specified external target backup.``` | ||
|
||
## PARAMETERS | ||
|
||
### -ContinueOnError | ||
Specifies whether to continue recovering other files if one of files or folders failed to recover. | ||
|
||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -EncryptionEnabled | ||
Specifies whether encryption should be enabled during recovery. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -FileName | ||
Specifies the full name of the files or folders to be restored. | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -JobId | ||
Specifies the job id that backed up the files and will be used for this restore. | ||
```yaml | ||
Type: Int64 | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: 0 | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -NewBaseDirectory | ||
Specifies an optional base directory where the specified files and folders will be restored. | ||
By default, files and folders are restored to their original path. | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: "/tmp/recover_files_/" + (Get-Date -UFormat "%b_%d_%Y_%I_%M_%p") | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -OverwriteExisting | ||
Specifies whether to overwrite the existing files. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -PreserveAttributes | ||
Specifies whether to preserve original attributes. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -RecoverMethod | ||
Specifies the method to recover files and folders. | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
Accepted values: ExistingAgent, AutoDeploy, VMTools | ||
|
||
Required: False | ||
Position: Named | ||
Default value: ExistingAgent | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -SaveSuccessFiles | ||
Specifies whether to save success files or not. Default value is false. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -SnapshotId | ||
Specifies the remote snapshot id. | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: 0 | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -SourceId | ||
Specifies the id of the original protection source (that was backed up) containing the files and folders. | ||
```yaml | ||
Type: Int64 | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: 0 | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -TargetSourceId | ||
Specifies the id of the target source (such as a VM or Physical server) where the files and folders are to be restored. | ||
```yaml | ||
Type: Int64 | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -TargetVMCredential | ||
Specifies the credentials for the target VM. This is mandatory if the recoverMethod is AutoDeploy or VMTools. | ||
```yaml | ||
Type: PSCredential | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -TaskName | ||
Specifies the name of the Restore Task. | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: "Recover_File_" + (Get-Date -UFormat "%b_%d_%Y_%I_%M_%p") | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
## OUTPUTS | ||
## NOTES | ||
Currently this commandlet supports only source of environment type either VMware or Physical server or Isilon. | ||
## RELATED LINKS | ||
[Read More](https://cohesity.github.io/cohesity-powershell-module/#/README) |
Oops, something went wrong.