Command Line Interface
This pages describes how to use a command line interface with Pathfinder.
By using the Pathfinder Linking-System the user is able to execute pathfinder commands right from a shell to e.g. automate actions like exporting reports or backing up databases.
You can use your API key here to authenticate a script or other process with Pathfinder (e.g. Pathfinder REST API or Shell Commands).
Prerequisite
In order to use pathfinder commands please first create an API key. This will allow you to login into pathfinder without the need of using your credentials (username / password) in a shell script.
Overview of all Supported Types
location (campus)
building
floor
room
component
port
networkpath
report
cable
networkmap
workorder
workorderitem
subnet
Overview of all Supported Commands
Command | Supported Types | Description | Examples |
---|---|---|---|
open | any | opens the given object in Pathfinder | pathfinder://open?type=networkpath&id=24 pathfinder://open?type=workorder&id=5 |
search | location, building, floor, room, component, port, networkpath, cable, subnet, workorder | search globally or restrict the scope by adding a type | pathfinder://search?value='Switch' pathfinder://search?type=component&value='Switch' |
export | location, building, floor, room, component (rack), networkpath, networkmap, workorder, report | export a report or a pdf view of an object | pathfinder://export?type=workorder&id=4&out='C:\path\to\file' pathfinder://export?type=report&id=2&out='C:\path\to\file' |
import | import a given set of component definitions from the online catalog | pathfinder://import?guid=id1,id2,id3 | |
process/cancel | workorder, workorderitem | process or cancel a work order or work order item | pathfinder://process?type=workorder&id=4 pathfinder://cancel?type=workorderitem&id=6 |
scan | subnet | scan a subnet | pathfinder://scan?type=subnet&id=11 |
upgrade | check for updates and update | pathfinder://upgrade | |
backupdb | create a local database backup in the data folder. File based databases are not supported. | pathfinder://backupdb?out='pathfinder123.db' | |
copydb | copy the db from source to destination. Source cannot be file based if it is currently used. | pathfinder://copydb?source=1&destination=2 | |
dbschemaupdate | apply database updates to the given database | pathfinder://dbschemaupdate?source=0 |
Optional Parameters
Parameter | Description | Example |
---|---|---|
token=<token> | Add an API-token to login automatically | pathfinder://open?type=location&id=6&token=<token> |
exitWhenDone | exit Pathfinder after executing the command | pathfinder://upgrade&exitWhenDone |
Executing Commands
There are several ways to execute a command:
by opening a link in e.g. a web browser
by executing
pathfinder.exe -link=<your action>
in Windows Command Lineby executing
start <your pathfinder-link>
in Windows PowerShell
Example using the Windows Command Line
pathfinder.exe -link="pathfinder://open?type=location&id=6&token=<token>"
Example using Windows PowerShell
start "pathfinder://backupdb?out='pathfinder123.db'&token=<token>"
Start-Sleep -s 30
start "pathfinder://export?type=report&id=2&out='C:\path\to\file'"
Start-Sleep -s 1
start "pathfinder://upgrade&exitWhenDone"
It is advised to wait a few seconds after the execution of each command to maintain the correct order, especially after starting and before closing Pathfinder.
Example importing some default component definitions
POWERSHELL
| 19" Rack 42U, 800x1200 (Server) |
Example importing Component Definitions
{660C429C-B6FD-102C-B795-001D92F3B33C}
Example backing up standard-database to local file
start pathfinder.exe -link="pathfinder://backupdb?out='pathfinder_backup'&token=<my_token>&exitWhenDone"