Hosts
Bases: DuploResourceV2
Manage Duplo Hosts
Duplo hosts are virtual machines that run your services within a tenant. You can perform lifecycle operations like creating, deleting, starting, stopping and rebooting hosts. Hosts can be created with specific configurations like instance type, AMI, and other parameters.
See more details at: https://docs.duplocloud.com/docs/welcome-to-duplocloud/application-focussed-interface/duplocloud-common-components/hosts
Commands
apply
Apply a service.
Parameters:
--file, -f, --cli-input
--wait, -w
create
Create a Host resource.
Creates a new host in the tenant with the specified configuration.
CLI Usage
Contents of thehosts.yaml file
FriendlyName: duplohost
Zone: 0
IsEbsOptimized: false
DesiredCapacity: 0
MinSize:
MaxSize:
MetaData:
- Key: OsDiskSize
Value: 30
- Key: MetadataServiceOption
Value: enabled_v2_only
UseLaunchTemplate: true
CanScaleFromZero: false
IsUserDataCombined: true
KeyPairType:
Capacity: t3.large
Base64UserData: ''
TagsCsv: ''
AgentPlatform: 7
IsMinion: true
Create a host using a one-liner
echo """
FriendlyName: duplohost
Zone: 0
IsEbsOptimized: false
DesiredCapacity: 0
MinSize:
MaxSize:
MetaData:
- Key: OsDiskSize
Value: 30
- Key: MetadataServiceOption
Value: enabled_v2_only
UseLaunchTemplate: true
CanScaleFromZero: false
IsUserDataCombined: true
KeyPairType:
Capacity: t3.large
Base64UserData: ''
TagsCsv: ''
AgentPlatform: 7
IsMinion: true
""" | duploctl hosts create -f -
Create and Wait
Supports global --wait flag to hold the terminal till the host is fully created and running.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Success message and the instance ID of the created host. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the host could not be created or the configuration is invalid. |
DuploFailedResource
|
If the host creation process fails. |
Parameters:
--file, -f, --cli-input
delete
Delete a host.
Terminates a host by its name. This operation is irreversible and will destroy all data on the instance.
Delete and Wait
Supports global --wait flag to hold the terminal till the host is fully deleted.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Success message confirming the host deletion. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the host does not exist or cannot be deleted. |
DuploFailedResource
|
If the deletion process fails. |
Parameters:
name
positional
find
list
reboot
Reboot a host.
Performs a graceful reboot of a host. This is equivalent to an operating system reboot command. The instance ID and data are preserved.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Success message confirming the reboot request. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the host does not exist or cannot be rebooted. |
Parameters:
name
positional
start
Start a host.
Starts a stopped host. The instance will retain its configuration and data from when it was stopped.
Start and Wait
Supports global --wait flag to hold the terminal till the host is fully started.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Success message confirming the host has been started. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the host does not exist or cannot be started. |
DuploFailedResource
|
If the start process fails. |
Parameters:
name
positional
stop
Stop a host.
Stops a running host. The instance can be restarted later using the start command. Stopped instances do not incur compute charges but still incur storage costs.
Stop and Wait
Supports global --wait flag to hold the terminal till the host is fully stopped.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Success message confirming the host has been stopped. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the host does not exist or cannot be stopped. |
DuploFailedResource
|
If the stop process fails. |
Parameters:
name
positional