Generic DuploClient for Python apps.
Project description
Duplocloud Py Client
A package to spawn service clients for working with Duplocloud. This is a cli for interacting with duplocloud resources. This is great within cli pipelines. Built to be as extensible as possible and can be used as normal python module as well as cli.
Installation
From PyPi:
pip install duplocloud-client
Usage
This project may bes used as a cli or as a python module in your own unique script.
Configuration
The following inputs are global:
Arg | Env Var | Description | Default | Required |
---|---|---|---|---|
--host, -H | DUPLO_HOST | The host to connect to | Yes | |
--token, -T | DUPLO_TOKEN | The token to use for auth | Yes | |
--tenant, -t | DUPLO_TENANT | The tenant to use for auth | default | No |
CLI
Here is a quick template on how the cli breaks down.
duploctl <resource> <command> <args...>
Python Module
Here is how to spawn your own client the quick way from args and env.
duplo = DuploClient.from_env()
out = duplo.run("tenant", "list")
Here we show how to spawn a client with a custom host and token.
duplo = DuploClient(host="https://example.duplocloud.com", token="mytoken")
svc = duplo.load("tenant")
t = svc.find("mytenant")
print(t)
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
duplocloud-client-0.1.4.tar.gz
(14.2 kB
view hashes)
Built Distribution
Close
Hashes for duplocloud_client-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8c4817c9f53e05b93819fe2ac94cc4116f8369111cc65d5e1629d9c17b3511d |
|
MD5 | e74d52b3ffcdd2689a982bd1265b1380 |
|
BLAKE2b-256 | b218eca279fa51c911c437b3d37840b0f194e29d174b5beb418cf0c80fd31821 |