Skip to main content

Command line Client for interacting with Duplocloud portals.

Project description

Duplocloud Py Client

Unit Tests PyPI - Version Docker Image Version GitHub Release Static Badge

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

duplocloud_client-0.3.7.tar.gz (120.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duplocloud_client-0.3.7-py3-none-any.whl (85.0 kB view details)

Uploaded Python 3

File details

Details for the file duplocloud_client-0.3.7.tar.gz.

File metadata

  • Download URL: duplocloud_client-0.3.7.tar.gz
  • Upload date:
  • Size: 120.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for duplocloud_client-0.3.7.tar.gz
Algorithm Hash digest
SHA256 2a20040722195e42712eb68a9a209cef53b8a248c6dabf1c672a0383e469d05c
MD5 e9b183d96ff80755a8a0691de0b054d8
BLAKE2b-256 9e945def6fdc84a8f240e1d5dba30349c0640624862d288db7594a483a8a5217

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for duplocloud_client-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 605aa145893e2e3b3f4c76d7d393b4b1dcfedfc6ad12e4b634000835743e33e3
MD5 839fe4517837f193256695e8dd455f54
BLAKE2b-256 5d9acbf6d4b2103e74fb8ef0ec77116ec07c509d1ac37cfbcc3afae5aa6ca5cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page