Skip to content

Commit

Permalink
Removed cluster id and cluster incarnation id parameter in find cohes…
Browse files Browse the repository at this point in the history
…ity snapshot cmdlet.
  • Loading branch information
KavishreeShanmugam11 committed Aug 18, 2023
1 parent d596a49 commit 94b7065
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 54 deletions.
41 changes: 0 additions & 41 deletions docs/cmdlets-reference/find-cohesityfilesnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,8 @@ Find-CohesityFileSnapshot -FileName "abc.txt" -SourceId 123 -JobId 11

Returns snapshot information of specified file/folder in metioned source.


### EXAMPLE 3
```
Find-CohesityFilesForRestore -Search "*txt" -Paginate $true -PaginationCookie rrrgcrsgre -PageSize 200
```

Returns next set of entries that match the search pattern "txt" based on provided Pagiantion cookie.

## PARAMETERS

### -ClusterId
Specifies the Cohesity Cluster id where the Job was created.

```yaml
Type: Int64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ClusterIncarnationId
Specifies the incarnation id of the Cohesity Cluster where the Job
was created.
An incarnation id is generated when a Cohesity Cluster is initially
created.
```yaml
Type: Int64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FileName
Specifies the name of the file or folder to find in the snapshots.
This field is required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ function Find-CohesityFileSnapshot {
.LINK
https://cohesity.github.io/cohesity-powershell-module/#/README
.EXAMPLE
Find-CohesityFileSnapshot -TaskName "restore-file-vm" -FileNames /C/data/file.txt -JobId 1234 -SourceId 843 -TargetSourceId 856 -TargetParentSourceId 828 -TargetHostCredential (Get-Credential)
Find-CohesityFileSnapshot -FileName "abc.txt" -SourceId 123 -JobId 11
#>

[OutputType('System.Array')]
[CmdletBinding()]
Param(
[Parameter(Mandatory = $false)]
# Specifies the Cohesity Cluster id where the Job was created. This field is required.
[long]$ClusterId,
[Parameter(Mandatory = $false)]
# Specifies the incarnation id of the Cohesity Cluster where the Job was created. An incarnation id is generated when a Cohesity Cluster is initially created. This field is required.
[long]$ClusterIncarnationId,
[Parameter(Mandatory = $true)]
# Specifies the name of the file or folder to find in the snapshots. This field is required.
[string[]]$FileName,
[string]$FileName,
[Parameter(Mandatory = $true)]
# Specifies the name of the Restore Task.Specifies the id of the Job that captured the snapshots. These snapshots are searched for the specified files or folders. This field is required.
[long]$JobId,
Expand All @@ -35,7 +28,7 @@ function Find-CohesityFileSnapshot {
}

Process {
$url = '/irisservices/api/v1/public/restore/files/snapshotsInformation'
$snapshotURL = '/irisservices/api/v1/public/restore/files/snapshotsInformation'

$filter = ""
if ($ClusterId) {
Expand Down Expand Up @@ -70,11 +63,11 @@ function Find-CohesityFileSnapshot {
}

if ($filter -ne "") {
$url += "?" + $filter
$snapshotURL += "?" + $filter
}

$resp = Invoke-RestApi -Method Get -Uri $url
if ($resp) {
$snapshotResp = Invoke-RestApi -Method Get -Uri $snapshotURL
if ($snapshotResp) {
# tagging reponse for display format ( configured in Cohesity.format.ps1xml )
@($resp | Add-Member -TypeName 'System.Object#FileSnapshotInformation' -PassThru)
}
Expand Down

0 comments on commit 94b7065

Please sign in to comment.