Use PowerShell to connect to the PeerGFS API
Applies to PeerGFS v4.6.0.20210402 and later.
Initializing the Toolkit
- Open Peer Management Center.
- Open Preferences, select General Configuration, and then select Web and API Configuration
- Enable the Enable HTTPS REST API using port: 8442 option.
- Click Apply and Close.
- Launch PowerShell and navigate to <PMC Installation Directory>\tools\powershell on the PMC server.
- Run .\ConfigurePeerGFSToolkit.ps1 from the PowerShell console.
- Start using the API. See command examples below.
Example Commands
Sample PowerShell Calls
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