Skip to main content

Command line Client for interacting with Duplocloud portals.

Project description

Duplocloud Py Client

Unit Tests PyPI - Version Docker Image Version

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


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.2.17.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

duplocloud_client-0.2.17-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file duplocloud-client-0.2.17.tar.gz.

File metadata

  • Download URL: duplocloud-client-0.2.17.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for duplocloud-client-0.2.17.tar.gz
Algorithm Hash digest
SHA256 be90a4c370d8a25c7b393f91a262c6e17b4644dd2d33e965f12df5fad4d9b52f
MD5 05c8852d77449c2eebf92cc6ca00653b
BLAKE2b-256 f7c56be5d364f6d89915134ce48e26203abd883ca95dc8353c5fdfb701ce7006

See more details on using hashes here.

Provenance

File details

Details for the file duplocloud_client-0.2.17-py3-none-any.whl.

File metadata

File hashes

Hashes for duplocloud_client-0.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 6f8aa35e429843184bb3db0a8a24fdf1fe55cf617edb6ea80fb1b40cbf9bec91
MD5 4db03e60efbd84d891e9eca1cbda79f8
BLAKE2b-256 72cd2799797cb5cd6f7484fe11a80d07436fd47b38c722011b32532b17a9f9ad

See more details on using hashes here.

Provenance

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