Command line Client for interacting with Duplocloud portals.
Project description
Duplocloud Py Client
duploctl
is a cli and package to work with a Duplocloud portal. It is a CLI for interacting with Duplocloud resources, such as Tenants, and is designed to work seamlessly within CLI-based CI/CD pipelines. It is a fully extensible package and can be used as both a Python module and a CLI.
Installation
From PyPi:
pip install duplocloud-client
From Homebrew:
brew install duplocloud/tap/duploctl
Usage
Use duploctl
as a CLI or as a standalone Python module called by your custom script.
Configuration
Use the following syntax for these global arguments:
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
CLI command syntax for invoking duploctl
duploctl <resource> <command> <args...>
Example Usages
Full documentation is in the Wiki section.
Configure duploctl
access with environment variables:
export DUPLO_HOST=https://example.duplocloud.net
export DUPLO_TOKEN=AQAAA...
export DUPLO_TENANT=dev01
List the services in a tenant:
duploctl service list
Register Profile for AWS:
duploctl jit update_aws_config myportal
Open AWS Web Console:
duploctl jit web
Get Kubernetes config:
duploctl jit update_kubeconfig myinfra
Python Module
Spawn your client from a Python script using the DuploClient.from_env()
method and arguments. The second return value are the unparsed arguments from the command line. This example uses the client as a callable using command like syntax.
duplo, args = DuploClient.from_env()
t = duplo("tenant", "find", "mytenant")
print(t)
Spawn a client with a custom host and token from a Python script. This example loads a resource and runs a method manually.
duplo = DuploClient.from_creds(host="https://example.duplocloud.net", token="mytoken")
tenants = duplo.load("tenant")
t = tenants.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
Built Distribution
File details
Details for the file duplocloud_client-0.2.35.tar.gz
.
File metadata
- Download URL: duplocloud_client-0.2.35.tar.gz
- Upload date:
- Size: 80.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 725378ffa32e7228b3258efcdf5b5528896376dbe6be0f2e79541d741a6465f8 |
|
MD5 | a5b2278617219ff86193611278942665 |
|
BLAKE2b-256 | 060e2bfcdddf5756d9fe218fb5d12ec9f6d1d07d36bfdc56033fbe22f4242210 |
Provenance
File details
Details for the file duplocloud_client-0.2.35-py3-none-any.whl
.
File metadata
- Download URL: duplocloud_client-0.2.35-py3-none-any.whl
- Upload date:
- Size: 55.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fcff29b8320634e1e1f4b11ddae26cb6a00f3c7bbd9bfec7960b81d3769c50f |
|
MD5 | f9738d7229684f1a75f3252bbe1d9a95 |
|
BLAKE2b-256 | 5579637a23c780b96617cdd1d416e331fd4182f7ca1dea0a45a865c004936d70 |