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

Uploaded Source

Built Distribution

duplocloud_client-0.2.5-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: duplocloud-client-0.2.5.tar.gz
  • Upload date:
  • Size: 27.1 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.5.tar.gz
Algorithm Hash digest
SHA256 59c38ed1cb0ee90888e6290c966cc743d713dfa9811eeec1de307cdea19e0e44
MD5 b2e36cb6be413d6fde341c9e40185cc5
BLAKE2b-256 50864e402b0f198ef2a39ce2352d33cf854825eb750cc17ea3f0e6e25c56fb43

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for duplocloud_client-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2f03221d52394becf26258e6555f069b84a3dfd0ff7c54f6a0f715b86f9a1366
MD5 df98093a223dee7cd0768147a08b9a34
BLAKE2b-256 1d2f59c671b3c3f1818e832bc9a2d240112b249c79b2e028a64c215eb52973a6

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