Skip to main content

Python client for the JS7 JOC REST API

Project description

JS7 Python Client

PyPI version Python versions

The JS7 Python Client provides methods for accessing the JS7 JOC REST API. It offers functionality similar to the JS7 Unix CLI: JS7 Unix CLI.

Requirements

  • Python version 3.8 or later
  • A JS7 installation with version 2.6.5–2.8.3
  • A Java JVM version 17 or later for encryption and decryption functionality

Installation

pip install js7-client-python

Quick Start

The following example shows how to create a client instance and perform an operation.

Note: Additional examples showing how the client can be used can be found in the ./example directory of this repository.

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.14",
        port=4443
    ),
    auth_config=js7.model.AuthConfiguration(
        basic_auth=js7.model.BasicAuth(
            username="root",
            password="changeit"
        )
    )
)

SSL and Certificate-Based Authentication

The code snippet above shows authentication using Basic Auth. However, the JS7 Python Client also supports certificate-based authentication and client certificates for HTTPS connections.

client = js7.Client(
    http_config=js7.model.HTTPConfiguration(
        host="192.168.1.14",
        port=4446,
        ssl=True,
        cafile_path="./certificate.crt"
    ),
    auth_config=js7.model.AuthConfiguration(
        cert_auth=js7.model.CertAuth(
            certfile_path="./client.crt",
            keyfile_path="./client.key"
        )
    )
)

Import Inventory Configurations

A common use case is importing inventory configurations into JS7 JOC. We use the previously created client instance to import configurations.

ok = client.inventory.manage.import_configurations(
    file_path="/path/to/file/or/folder",
    inventory_target_folder="/test-folder"
)

print(f"Operation successful: {ok}")

Namespaces

The Client class follows the domains of the JS7 JOC API, but groups its methods into three namespaces:

  • Manage: Used to manage configurations and resources, such as importing, updating, or removing them.
  • Operate: Used to control runtime behavior, such as resuming a workflow or canceling an order.
  • Deploy: Used to deploy configurations, such as workflows.

Resources

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

js7_client_python-2.0.9.tar.gz (16.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

js7_client_python-2.0.9.0-py3-none-any.whl (16.8 MB view details)

Uploaded Python 3

js7_client_python-2.0.9-py3-none-any.whl (16.8 MB view details)

Uploaded Python 3

File details

Details for the file js7_client_python-2.0.9.tar.gz.

File metadata

  • Download URL: js7_client_python-2.0.9.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

Hashes for js7_client_python-2.0.9.tar.gz
Algorithm Hash digest
SHA256 9cf114edcceefa47d62cac38aa126e2a64b4696150f0ce4a2dca3fb37f174a71
MD5 8ef15a6a27b1aecc40c5849389b914e2
BLAKE2b-256 a19ff9e0878d9c3d3fd7ae42212520e90240935dd225137ab01936b500da462e

See more details on using hashes here.

File details

Details for the file js7_client_python-2.0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for js7_client_python-2.0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b56033cd17edab423d610b5c2c520f7b123490eeb374c5d6530c0163ed89f68c
MD5 64b39b18e299a597bc4b9421af75a913
BLAKE2b-256 373dccdb5bd14efc37915b3f324ba8d41a22441c0b615800b4712ff31261c0f5

See more details on using hashes here.

File details

Details for the file js7_client_python-2.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for js7_client_python-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c695564b8c3460d6535a933ebc5db34f84d56a92db3b8a6464519ecd363939e5
MD5 5a3418ee4b6c0d5e6ad391e84017813f
BLAKE2b-256 8979c9ed799f3f3768bfbad0c1c8392725ca53d03dfa8176d44a3cb6b03897f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page