Peer Knowledge Base

Use PowerShell to connect to the PeerGFS API


Applies to PeerGFS v4.6.0.20210402 and later.

Initializing the Toolkit

  1. Open Peer Management Center.

  2. Open Preferences, select General Configuration, and then select Web and API Configuration

  3. Enable the Enable HTTPS REST API using port: 8442 option.
    Web and API Configuration.png

  4. Click Apply and Close.

  5. Launch PowerShell and navigate to <PMC Installation Directory>\tools\powershell on the PMC server.

  6. Run .\ConfigurePeerGFSToolkit.ps1 from the PowerShell console.

  7. Start using the API.  See command examples below.

Example Commands

PowerShell
# List all Agents
$agents = Get-PeerGFSAgents
$agents.Agents | fl

# List all Jobs
$jobList = Get-PeerGFSJobs
$jobList.jobs | fl

# List all open files
$openFiles = Get-PeerGFSOpenFiles
$openFiles.openFiles | ft

# List all quarantines
$quarantines = Get-PeerGFSConflicts -FileConflictTypes QUARANTINED
$quarantines.FileConflicts | ft

# List watch set statistics
$watchSetStats = Get-PeerGFSWatchSetStats
$watchSetStats.watchSetStats | ft

# List active open and pending replication stats
$activeStats = Get-PeerGFSActiveStats
$activeStats.activeStats | ft

# List queue stats
$queueStats = Get-PeerGFSQueueStats
$queueStats.fileQueueStats | ft

# List stats about replication work that is already complete
$replStats = Get-PeerGFSReplicationStats
$replStats.replicationStats | ft

# List scan status and stats
$scanStatus = Get-PeerGFSScanStatus
$scanStatus.fileScanStatuses | ft

# List fatal job alerts
$fatalJobAlerts = Get-PeerGFSFileJobAlerts -Severities FATAL
$fatalJobAlerts.alerts | ft

# List fatal PMC alerts
$fatalPmcAlerts = Get-PeerGFSPmcAlerts -Severities FATAL
$fatalPmcAlerts.alerts | ft

# List scheduled task history
$scheduledTasks = Get-PeerGFSScheduledTasks
$scheduledTasks.scheduledTasks | ft

Page: Check .pc-trash_bin date stored times for target protection Page: Creating a Job Using Bash Scripting Page: Creating a Job Using PowerShell Scripting Page: Creating a Job Using Scripting Page: Does the EOA of NetApp ONTAPI impact PeerGFS? Page: Generating Client Code for PeerGFS API with Swagger.io Page: Getting Started with the PeerGFS REST API Page: Performing API Operations Using Bash Page: Performing API Operations Using cURL Page: Performing API Operations Using PowerShell Page: Scripting Methods for API Operations Page: Use PowerShell to connect to the PeerGFS API Page: What functions are available in PeerSync v9.4.0's PowerShell toolkit?