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 DuploCtl.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 = DuploCtl.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 = DuploCtl.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.4.2.tar.gz (179.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.4.2-py3-none-any.whl (98.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: duplocloud_client-0.4.2.tar.gz
  • Upload date:
  • Size: 179.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.4.2.tar.gz
Algorithm Hash digest
SHA256 5bc0d816f2a40ef669026a5d7d6dbf49e9ec3b03113bb3b46abb0876c0ff2d3a
MD5 31be5bc9c52576bfe55d8a9d3e2d75f8
BLAKE2b-256 2cdb323605fd2494c97c02dccd3657ebf5bcd919a972c39f4a11ac3ddb3590bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for duplocloud_client-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fb173e6319744e5840b96ebf0d5cbf47b267f8a5538b376cf2dfcb7e692de8aa
MD5 27ffd6de1d3eba0dd9f34cd9e4355d01
BLAKE2b-256 3ff9b887cc542576d60ed015bd220ae4d4fea6913970ce701a53c2f35917b578

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