Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onefuse-2023.1.1.1.tar.gz (31.5 kB view details)

Uploaded Source

File details

Details for the file onefuse-2023.1.1.1.tar.gz.

File metadata

  • Download URL: onefuse-2023.1.1.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.11

File hashes

Hashes for onefuse-2023.1.1.1.tar.gz
Algorithm Hash digest
SHA256 79f7baa20d2289879c8a1e74e2e54b1b8c3cd66f8cfca852364bce1f6a8c28e4
MD5 a5fde2fdef26fd335988e4ae1daf6f2f
BLAKE2b-256 2f958a7874c9c225aed873b92b4ddb584e62bc5cae24fb614b172b04f3443133

See more details on using hashes here.

Supported by

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