Tenant
Bases: DuploResource
Duplo Tenant Resource
The tenant resource provides a set of commands to manage tenants in the Duplo system.
add_user
Add User to Tenant
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.
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.
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.
Tenant Body
Contents of the tenant.yaml
file
Create One Liner
Here is how to create a tenant in one line.
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.
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..
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
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.
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
list
List Tenants
Retrieve a list of all tenants in the Duplo system.
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
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
region
Tenant Region
Get the region the tenants infrastructure is placed in.
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
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.
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/ |
None
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
A success message. |
stop
Stop Tenant All Resources
Stops all resources of a tenant.
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/ |
None
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
A success message. |