Skip to content

mtulio/glpi-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glpi-cli

Build Status PyPi Version

GLPI Command Line Interface.

Easy way to iterate with GLPI using Command Line Interface.

This CLI use this GLPI SDK

Config

Install from repository

git clone https://github.com/mtulio/glpi-cli
cd glpi-cli
make install-me

OR install it using pip:

pip install glpi-cli

Setup the environment with your GLPI

export GLPI_API_URL=http://path/to/glpi/apirest.php
export GLPI_USERNAME=<Your username>
export GLPI_PASSWORD=<Your password>
export GLPI_APP_TOKEN=<Your User APP Token>

USAGE

  • Get all Ticket items
$ glpi-cli --item ticket --command get_all
  • Get an Ticket by ID
$ glpi-cli --item ticket --command get_all --id 10
  • Get all Knowledge Base Titles - filtered output with json util jq
$ glpi-cli --item knowbase --command get_all |jq .[].name
  • Get Item deleted flag
$ glpi-cli -i ticket -c get -id 52 |jq .is_deleted
  • Delete Ticket
$ glpi-cli -i ticket -c delete -id 52
  • Update Ticket
$ glpi-cli -i ticket -c update -id 52 -p '{ "status": 5, "impact": 2}'
  • Update Ticket, forcing
$ glpi-cli -i ticket -c update -id 52 -p '{ "status": 5, "impact": 2}' -f
  • Update Ticket, forcing and verbosiity
$ glpi-cli -i ticket -c update -id 52 -p '{ "status": 5, "impact": 2}' -v -f

Get Involved

PR are always welcome. =]

Please make sure that the code have passed in following tests:

make  dependencies
make check-syntax
make install-me

About

>> MAIN Dev Repo: https://github.com/truly-systems/glpi-cli << GLPI Command Line Interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published