Skip to content

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

duploctl hosts create -f 'hosts.yaml'
Contents of the hosts.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.

cli
duploctl hosts delete <name>

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.

cli usage
duploctl hosts find <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

Retrieve a List of Hosts

cli usage
duploctl hosts list

Returns:

Name Type Description
list list

A list of Hosts.

reboot

Reboot a host

Reboots a host by name.

cli
duploctl hosts reboot <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.

cli
duploctl hosts start <name>

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.

stop

Stop a host.

Stops a host by name. If the host is already stopped, it will return a success message.

cli
duploctl hosts stop <name>

Parameters:

Name Type Description Default
name NAME

The name of the host to stop.

required
wait WAIT

Wait for the host to stop.

False

Returns:

Name Type Description
message dict

A success message.