Simple REST-client for jinjamator
Project description
simple_jinjamator is a simplified REST client for jinjamator
Features
- simple_catalyst_center has following features:
manage login
download files
upload files
run tasks with environment support and basic enforcement of required parameters
wait for job results
check job status
CRUD interface for all possible API URLs
Installation
Install by running:
pip3 install simple_jinjamator
Examples
run a task and download all generated files
import os
import sys
from simple_jinjamator import JinjamatorClient
import logging
from getpass import getpass
base_url = input("Please Enter Jinjamator URL: ") or "http://localhost:5000"
username = input("Please Enter Jinjamator username: ") or "root"
password = getpass("Please Enter Jinjamator password: ") or "<not set>"
URL=f"{base_url}/api"
jm_client = JinjamatorClient(URL, ssl_verify=False)
print("login to jinjamator with username and password using the local aaa povider")
jm_client.login(username, password, "local")
api = jm_client.api
print("start job in environment some/env with the parameter command and get the job id")
job_id=jm_client.run("/tasks/jinjamator101/discover_cisco_device",environment="some/env",command="show interface status")
print("poll job status and wait for success or failure (default timeout is 300s, default pollrate=10s) ")
jm_client.wait_for_job(job_id)
print("download all generated files to /tmp")
jm_client.download_job_files(job_id,"/tmp")
for all options have a look at the JinjamatorClient class in simple_jinjamator/__init__.py
Contribute
Issue Tracker: https://github.com/jinjamator/simple_jinjamator/issues
Source Code: https://github.com/jinjamator/simple_jinjamator
Roadmap
- Selected Roadmap items:
add more documentation
add some more examples
For documentation please refer to https://simple_jinjamator.readthedocs.io/en/latest/
License
This project is licensed under the Apache License Version 2.0
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 Distributions
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 simple_jinjamator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: simple_jinjamator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f12c7bc0d79752df0d83caaeeebf0680d9d399a5f8b01f5e3a24815dc2bf892c
|
|
| MD5 |
20a33d63f807af11907ed44578dd3d74
|
|
| BLAKE2b-256 |
23abe04e907f5af2d0f3d319393e55afa598dc9b11d52c4b7977220d4f05637e
|