Skip to content

Tenant

Bases: DuploResource

Duplo Tenant Resource

The tenant resource provides a set of commands to manage tenants in the Duplo system.

Basic CLI Use
duploctl tenant <action>

add_user

Add User to Tenant

CLI Usage
duploctl tenant add_user <user> --tenant <tenant_name>

Parameters:

Name Type Description Default
name NAME

The name of the user to add to the tenant.

required

Returns:

Name Type Description
message dict

A message indicating the user was added to the tenant.

billing

Tenant Billing Information

Get the spend for the tenant.

Basic CLI Use
duploctl tenant billing <tenant-name>

Parameters:

Name Type Description Default
name NAME

The name of the tenant to get billing information for.

None

Returns:

Name Type Description
billing dict

The billing information for the tenant.

config

Manage Tenant Settings

Send a series of new settings and even some to delete.

Basic CLI Use
duploctl tenant config <tenant-name> --setvar <key> <value> --deletevar key3

Parameters:

Name Type Description Default
name NAME

The name of the tenant to manage.

None
setvar SETVAR

A series of key value pairs to set.

[]
deletevar DELETEVAR

The keys to delete.

[]

Returns:

Name Type Description
message dict

The message that the tenant settings were updated.

create

Create Tenant.

Create a new tenant with a new body for a tenant.

Basic CLI Use
duploctl tenant create --file tenant.yaml
Tenant Body

Contents of the tenant.yaml file

AccountName: duploctl
PlanID: default
TenantBlueprint: None

Create One Liner

Here is how to create a tenant in one line.

echo """
AccountName: duploctl
PlanID: default
TenantBlueprint: None
""" | duploctl tenant create -f -

Parameters:

Name Type Description Default
body BODY

The body of the tenant to create.

required
wait WAIT

Wait for the tenant to be created.

False

Returns:

Name Type Description
message dict

The message that the tenant was created

delete

Delete Tenant

Delete a tenant by name.

Basic CLI Use
duploctl tenant delete <name>

Parameters:

Name Type Description Default
name NAME

The name of the tenant to delete.

None

Returns:

Name Type Description
message dict

The message that the tenant was deleted.

dns_config

Tenant DNS Config

Retrieve DNS configuration for a tenant by name..

Basic CLI Use
duploctl tenant dns_config <name>

Parameters:

Name Type Description Default
name NAME

The name of the tenant.

None

Returns:

Name Type Description
dns_config dict

A dictionary containing the DNS configuration of the tenant.

faults

Tenant Faults

Retrieves the list of faults for a tenant.

Basic CLI Use
duploctl tenant faults <tenant-name>

Parameters:

Name Type Description Default
name NAME

The name of the tenant to get faults for.

None
id str

The id of the tenant to get faults for. Optional and code only.

None

Returns:

Name Type Description
faults list

A list of faults.

find

Find a tenant.

Find a tenant by name or id. Passing in a name directly takes highest precedence. If a name is not passed in, the id is second highest precedence. Lastly if the global tenant name is set, that will be used.

The global tenant id takes care of the commandline. For other code, sometimes the id needs to be passed in directly. If this happens, that id takes most precedence.

Basic CLI Use
duploctl tenant find <name>

Parameters:

Name Type Description Default
name NAME

The name or id of the tenant to find.

None
id str

The id of the tenant to find. Optional and code only.

None

Returns:

Name Type Description
tenant dict

The tenant.

host_images

Available Duplo Host Images

Get the list of host images for the tenant. These AMI's are region scoped.

Basic CLI Use
duploctl tenant host_images <tenant-name>

Parameters:

Name Type Description Default
name NAME

The name of the tenant to get host images for.

None

Returns:

Name Type Description
host_images list

A list of host images.

list

List Tenants

Retrieve a list of all tenants in the Duplo system.

Basic CLI Use
duploctl tenant list

Returns:

Name Type Description
tenants list

A list of tenants.

list_users

List users assigned to a tenant

Retrieve a list of all users with access to a tenant

Basic CLI Use
duploctl tenant list_users

Returns:

Name Type Description
users list

A list of users with access to the tenants, their readonly status, and if they're an admin user

logging

Toggle Loggine

Enable or disable logging for a tenant.

Basic CLI Use
duploctl tenant logging <tenant-name> (default: true) // false not supported

Parameters:

Name Type Description Default
name NAME

The name of the tenant to toggle logging.

None
enable ENABLE

Enable or disable logging.

True

Returns:

Name Type Description
message dict

The message that the tenant logging was toggled

region

Tenant Region

Get the region the tenants infrastructure is placed in.

Basic CLI Use
duploctl tenant region <tenant-name>

Parameters:

Name Type Description Default
name NAME

The name of the tenant to get the region for.

None

Returns:

Name Type Description
region dict

The region the tenant is in.

remove_user

Remove a User from a Tenant

CLI Usage
duploctl tenant remove_user <user> --tenant <tenant_name>

Parameters:

Name Type Description Default
name NAME

The name of the user to remove from the tenant.

required

Returns:

Name Type Description
message dict

A message indicating the user was removed from the tenant.

shutdown

Shutdown Tenant

Shutdown a tenant by name and with a schedule.

Basic CLI Use
// Below command shutdown the tenant after 5 minutes (default)
duploctl tenant shutdown <tenant-name>
// Below command shutdown the tenant after given time 'minutes'(m), 'hours'(h) and 'day'(d) and it also support overriding the shutdown time.
duploctl tenant shutdown <tenant-name> <time) // Example: 5m, 2h, 1d

Parameters:

Name Type Description Default
name NAME

The name of the tenant to shutdown.

None
schedule SCHEDULE

The schedule to shutdown the tenant.

None

Returns:

Name Type Description
message dict

The message that the tenant was shutdown

start

Start Tenant All Resources

Starts all resources of a tenant.

Basic CLI Use
duploctl tenant start

Parameters:

Name Type Description Default
wait WAIT

Wait for the resources to start.

False
exclude optional

A list of resources to exclude from starting. Can include: - hosts/: Exclude a specific host. - rds/: Exclude a specific RDS instance. - hosts/at/: Exclude hosts with specific allocation tags.

None

Returns:

Name Type Description
message dict

A success message.

stop

Stop Tenant All Resources

Stops all resources of a tenant.

Basic CLI Use
duploctl tenant stop

Parameters:

Name Type Description Default
wait WAIT

Wait for the resources to stop.

False
exclude optional

A list of resources to exclude from stopping. Can include: - hosts/: Exclude a specific host. - rds/: Exclude a specific RDS instance. - hosts/at/: Exclude hosts with specific allocation tags.

None

Returns:

Name Type Description
message dict

A success message.