OneFuse upstream provider package for Python
Project description
This is a context manager class available to Python that facilitates easy API connectivity from a Python script host to a OneFuse host.
Installation
You will want to install the latest version that matches the version of your OneFuse appliance. To find available versions the following command will cause pip to throw an error showing available versions:
$pip install onefuse==versions
To install the OneFuse Python Module by version:
$pip install onefuse==1.3.0
To install the Latest OneFuse Python Module:
$ pip install onefuse
To upgrade OneFuse to the latest version if OneFuse is already installed:
$ pip install onefuse --upgrade
Usage
Import and instantiate a OneFuseManager:
from onefuse.admin import OneFuseManager ofm = OneFuseManager(username, password, host)
Accepted optional kwargs
- source - default ‘PYTHON’ - allows to specify source so that this class
can be called by other modules (CloudBolt, etc.). All OneFuse jobs will show this value as the Source of the job
protocol - default ‘https’ - Allows to specify non-standard protocol
port - default 443 - Allows to specify non-standard port
- verify_certs - default False - Allows to specify whether or not to verify
OneFuse certs
- logger - allows you to pass in logger information. By default will log to
onefuse.log as well as to console at the LOG_LEVEL set in configuration.globals
Authentication, headers, and url creation is handled within this class, freeing the caller from having to deal with these tasks.
Examples
Example 1 - Make custom REST calls to OneFuse:
from onefuse.admin import OneFuseManager ofm = OneFuseManager(username, password, host) response = ofm.get('/namingPolicies/')
Example 2 - Provision Naming with OOB methods:
from onefuse.admin import OneFuseManager ofm = OneFuseManager(username, password, host) naming_json = ofm.provision_naming(self, policy_name, properties_stack, tracking_id)
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
File details
Details for the file onefuse-1.3.9.2.tar.gz
.
File metadata
- Download URL: onefuse-1.3.9.2.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e0d72b2af2d5b6394d20fcac16cfa2f7f6292448abf23f22f1bdaa948ed51fb |
|
MD5 | c2a79af140c4cb79c6a580a97acf4a15 |
|
BLAKE2b-256 | 574ddaca5fcf4571ce2ea689a74073f4780510a0426a8bb3d4038aa0d71ee092 |