This is a CLI for taking the inventory from the Lansweeper API and the employees from the IAM API, parsing it, and supplying the information to the PEAKS application.
A CLI that utilizes the IAM Employees List, Lansweeper Equipment List, and the Peaks Employees and Equipment List. The functionality is as follows:
- List Peaks Employees: Lists the employees who are currently in the Peaks Database. It can be displayed as a list and/or in table form on the console.
- List Peaks Equipment: Lists the equipment who are currently in the Peaks Database. It can be displayed as a list and/or in table form on the console.
- List IAM Employees: Lists the employees who are currently in the IAM Database. It can be displayed as a list and/or in table form on the console.
- List Lansweeper Equipment: Lists the equipment who are currently in the Lansweeper Database. It can be displayed as a list and/or in table form on the console.
- Search IAM Employees: Search through the IAM list with parameters IAM ID, Supervisor ID, or Kerberos ID. It can be displayed as a list and/or in table form on the console.
- Search Lansweeper Equipment: Search through the Lansweeper list with the parameters Equipment Name, Type, Model, and Key. It can be displayed as a list and/or in table form on the console.
- Update Equipment Peaks: Checks Lansweeper and Peaks for new Equipment and adds them if there is any changes.
- Update Employee Peaks: Checks IAM and Peaks for new Employees and adds them if there is any changes.
The cron runs every day at 7 am to start the functions for equipment and employee updates.
- Clone this repository
- Checkout the branch you want to work on
- Get .env from Google Cloud repository and put it into
./deploy/compose/ucdlib-inventory-cron-local-dev
- Build images by
docker-compose build --no-cache
- Run
docker-compose run cron
to run the cron container that runs 7 am - Run
docker-compose run cli sh
to bash into the CLI to run
To run CLI:
In folder ./deploy/compose/ucdlib-inventory-cron-local-dev
run docker-compose run cli sh
To run commands type: node inventory.js [command] [options]
Examples
node inventory.js people pls
node inventory.js equipment lls
node inventory.js people search *username*
Usage: node inventory.js [command] [options]
people
: query and interact with employees in inventory
equipment
: Query and interact with equipment in inventory
help
[command]: display help for command
Usage: node inventory.js people [command] [options]
Options:
-h, --help
display help for command
Commands:
iam-list|ils [options]
: List IAM people records
peaks-list|pls [options]
: List PEAKS people records
update
: Check update for people records
search [options]
: Search assets based on id, supervisorId, or kerberos
help [command]
: display help for command
Usage: node inventory.js equipment [command] [options]
Options:
-h, --help
display help for command
Commands:
lansweeper-list|lls [options]
: List Lansweeper equipment records
peaks-list|pls [options]
: List PEAKS people records
update
: Check update for people records
search [options]
: Search assets based on name, type, model, or key
help [command]
: display help for command