Python client for the JS7 JOC REST API
Project description
JS7 Python Client
The JS7 Python Client provides methods for accessing the JS7 JOC REST API. Its functionality is based on the JS7 UNIX CLI: JS7 UNIX CLI
Requirements
- Python version 3.8 or later
- A JS7 installation with version 2.6.5 to 2.8.3
- A Java JVM version 17 or later for (en/de)cryption functionality
Installation
pip install js7-client-python
Quick Start
The following example shows how to create a client instance and execute the first operation.
Client Initialization
Client initialization begins with configuring the JOC API endpoint and the user’s credentials.
import js7
client = js7.Client(
http_config=js7.model.HTTPConfiguration(
host="192.168.1.1",
port=4446
),
auth_config=js7.model.AuthConfiguration(
basic_auth=js7.model.BasicAuth(
username="root",
password="changeit"
)
)
)
SSL and Certificate-Based Authentication
The code snippet shows authentication using Basic Auth. However, the JS7 Python Client also supports certificate-based authentication, provided that a corresponding identity provider and account exist in JS7 JOC.
If an HTTPS certificate is required for a secure SSL connection, it can be specified in the
http_config.
Import Configurations
A common use case is the import of inventory configurations into JS7 JOC. We use the previously created client instance to import configurations.
client.inventory.manage.import_configurations(
file_path="/path/to/file/or/folder",
inventory_target_folder="/test-folder"
)
Namespaces
The Client class follows the domains of the JS7 JOC API, but groups its methods into three different namespaces:
- Manage: Used to manage existing configurations and resources or to import new ones.
- Operate: Used to change the state of the system, for example to resume a workflow or cancel an order.
- Deploy: Used to deploy configurations such as workflows.
Help
- Docs: JS7 Python Client
- Issues: JOC-2175 - Python Client for JS7 REST API
Project details
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 js7_client_python-2.0.1.0.tar.gz.
File metadata
- Download URL: js7_client_python-2.0.1.0.tar.gz
- Upload date:
- Size: 16.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
790f7376e80381df275d6ae8b09079d3d7290324248c194d297225a1c431340a
|
|
| MD5 |
d1d7827347fb42ca80ec3b83ab27336e
|
|
| BLAKE2b-256 |
c5cbfc9f804be5c857521926b675523dc152bf5c19023432f5bdfe4ae3b14e5e
|
File details
Details for the file js7_client_python-2.0.1.0-py3-none-any.whl.
File metadata
- Download URL: js7_client_python-2.0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05345cf4b526cbf7f328ffd553eb3a595dfe373e7f391ca2bdde21c94b6a726e
|
|
| MD5 |
9cb3461b3c935ac35eb79a1df08cd6aa
|
|
| BLAKE2b-256 |
6a62c9d606f116ad50ba23649e421fa8cc6b7e6890b8d4f94919a4541da16540
|