Hosts
Bases: DuploTenantResourceV2
Manage Duplo Hosts
Duplo hosts are virtual machines that run your services. You can create, delete, start, stop, and reboot hosts.
apply
Apply a service.
create
Create a Hosts resource.
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.small
Base64UserData: ''
TagsCsv: ''
AgentPlatform: 7
IsMinion: true
One liner example
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.small
Base64UserData: ''
TagsCsv: ''
AgentPlatform: 7
IsMinion: true
""" | duploctl hosts create -f -
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
BODY
|
The resource to create. |
required |
wait
|
WAIT
|
Wait for the resource to be created. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
Success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the resource could not be created. |
delete
Delete a host.
Deletes a host by name. If the host is running, it will be stopped before deletion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the host to delete. |
required |
wait
|
WAIT
|
Wait for the host to be deleted. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
A success message. |
find
Find a Hosts by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the Hosts to find. |
required |
Returns:
Name | Type | Description |
---|---|---|
resource |
dict
|
The Hosts object. |
Raises:
Type | Description |
---|---|
DuploError
|
If the {{kind}} could not be found. |
list
reboot
Reboot a host
Reboots a host by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the host to reboot. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
A success message. |
start
Start a host.
Starts a host by name. If the host is already running, it will return a success message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the host to start. |
required |
wait
|
WAIT
|
Wait for the host to start. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
A success message. |