Skip to main content

Generic DuploClient for Python apps.

Project description

Duplocloud Py Client

Tests PyPI - Version

duploctl is a package that spawns service clients that work with Duplocloud. 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

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

Get AWS Console URL:

duploctl jit aws

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

Uploaded Source

Built Distribution

duplocloud_client-0.2.9-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for duplocloud-client-0.2.9.tar.gz
Algorithm Hash digest
SHA256 98c49c539757750ae1c786b74481706c651c259e88374b9f97aa865ef7af97e7
MD5 c1d0dbf8ef239b153580e70ba4840f0b
BLAKE2b-256 0c31a8708e76b68aa59189985ed13cb066f0d6af56d2928f45b56eaed3dcb105

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for duplocloud_client-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 93615d56e84e204d9f3cbacf29b870019531e7678e714efc62e8dd3a4ad602dd
MD5 e676c9bc03f04e2f7adc637622b81714
BLAKE2b-256 2b1c4747f64e3d7e7e366e4ca95518b2d9a7c45d66e0dce1409e1f23157e8600

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