Um cliente Python para a API do GLPI
Project description
glpipci - GLPI Python Comunicator Interface - [unofficial]
Um cliente Python para a API do GLPI.
Instalação
Para instalar o pacote, use o seguinte comando:
pip install glpipci
Uso
Básico
Exemplo de como usar o pacote
from glpipci.comunicator.v10_0.api import GLPIApiClient
client = GLPIApiClient(username="admin", password="password")
response = client.make_get("http://localhost:8090/apirest.php/some_endpoint")
print(response.json())
Variáveis de ambiente
Variáveis de ambiente (export ou arquivo .env)
GLPI_URL=https://localhost/apirest.php
USER_TOKEN=FooUserTokenFOOuserTokenFoOuSeRtOkEn
APP_TOKEN=fOOTokenFooTokenFooTokenFooToken
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/123123123123/fknsoaoknasfoknfasokafsnonkfsoknsfakonfs
ATTACHMENTS_DIR=Attachments
PERSONS_PATH=adicionais/Person.json
LOG_DIR=logs
Código:
from glpipci.comunicator.v10_0.api import GLPIApiClient
client = GLPIApiClient(username="admin", password="password")
from glpipci.comunicator.v10_0.endpoints.tickets.core import GlpiTickets
tickets = GlpiTickets(
api_client=client
)
response = tickets.get_tickets()
print(response.json())
Contribuição
Se você deseja contribuir para este projeto, siga estas etapas:
- Faça um fork do repositório.
- Crie uma nova branch (
git checkout -b feature-branch). - Faça suas alterações e commit (
git commit -m 'Add some feature'). - Envie para o repositório remoto (
git push origin feature-branch). - Crie um novo Pull Request.
- Aguarde a revisão e feedback.
Licença
Este projeto está licenciado sob a Licença MIT. Veja o arquivo LICENSE para mais detalhes.
Extras
export PYTHONPATH=$PYTHONPATH:/home/tlsabara/repos/tlsabara/pyglpi/glpipci
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glpipci-0.1.4rc5.tar.gz.
File metadata
- Download URL: glpipci-0.1.4rc5.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1626c4634fb8c7f1885121bf42bd225e157e1249b89b3915de08da7fbcb1b613
|
|
| MD5 |
51887950aebdf208dd2cabc69904c393
|
|
| BLAKE2b-256 |
0bb53d8da2608fd642ee1394b1e88e7d344f98ea96b62d5a899856be670ec06d
|
File details
Details for the file glpipci-0.1.4rc5-py3-none-any.whl.
File metadata
- Download URL: glpipci-0.1.4rc5-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f37e86435f86a1278d75ac84a2abf3fabe1a3c2ff1bbd34f832a29fa7dd7c93
|
|
| MD5 |
ffbeb2961f069f37e15c2cb5471e1603
|
|
| BLAKE2b-256 |
e1feb92cf16249d5e1a7ac595c83d549d1aabad081f0e37cc781914bae20a57e
|