nomad v0.6.0 NomadVirtualMachines behaviour

Summary

Callbacks

Attaches the given ‘disk’ to the specified ‘instance’ and with the provided ‘device_name’

Creates an empty persistent disk in the given ‘region’ with the specified ‘size’

Creates a bootable disk in the given ‘region’ with the specified ‘size’ and ‘image’

Creates a new Virtual Machine in the given ‘region’ using the provided ‘class’, ‘image’ and ‘auto_delete’ behaviour

Deletes the given ‘disk’ in the specified ‘region’

Deletes the Virtual Machine ‘instance’ in the given ‘region’

Detaches the given ‘disk’ from the ‘instance’

Returns the specified ‘disk’ name, size, image, status and type

Returns the Virtal Machine ‘instance’ name, status, public IP and class

Lists all available Virtual Machine classes

Lists all disks in the given ‘region’ indicating their names, sizes, images, statuses and types

Lists all available regions (and their zones if possible)

Lists all Virtual Machines in the given ‘region’ with their names, status, public IP and class

Reboots the Virtual Machine ‘instance’ in the given ‘region’

Sets the Virtual Machine ‘instance’ in the given ‘region’ to the specified ‘class’ if possible

Starts the Virtual Machine ‘instance’ in the given ‘region’

Stops the Virtual Machine ‘instance’ in the given ‘region’

Callbacks

attach_disk(region, instance, disk, device_name)

Specs

attach_disk(region :: binary, instance :: binary, disk :: binary, device_name :: binary) ::
  :ok |
  binary

Attaches the given ‘disk’ to the specified ‘instance’ and with the provided ‘device_name’.

create_disk(region, size)

Specs

create_disk(region :: binary, size :: integer) ::
  :ok |
  binary

Creates an empty persistent disk in the given ‘region’ with the specified ‘size’.

create_disk(region, size, image)

Specs

create_disk(region :: binary, size :: integer, image :: binary) ::
  :ok |
  binary

Creates a bootable disk in the given ‘region’ with the specified ‘size’ and ‘image’.

create_virtual_machine(region, class, image, auto_delete)

Specs

create_virtual_machine(region :: binary, class :: binary, image :: binary, auto_delete :: boolean) ::
  :ok |
  binary

Creates a new Virtual Machine in the given ‘region’ using the provided ‘class’, ‘image’ and ‘auto_delete’ behaviour.

delete_disk(region, disk)

Specs

delete_disk(region :: binary, disk :: binary) ::
  :ok |
  binary

Deletes the given ‘disk’ in the specified ‘region’.

delete_virtual_machine(region, instance)

Specs

delete_virtual_machine(region :: binary, instance :: binary) ::
  :ok |
  binary

Deletes the Virtual Machine ‘instance’ in the given ‘region’.

detach_disk(region, instance, disk)

Specs

detach_disk(region :: binary, instance :: binary, disk :: binary) ::
  :ok |
  binary

Detaches the given ‘disk’ from the ‘instance’.

get_disk(region, disk)

Specs

get_disk(region :: binary, disk :: binary) ::
  {binary, binary, binary, binary, binary} |
  binary

Returns the specified ‘disk’ name, size, image, status and type.

get_virtual_machine(region, instance)

Specs

get_virtual_machine(region :: binary, instance :: binary) :: {binary, binary, binary, binary}

Returns the Virtal Machine ‘instance’ name, status, public IP and class.

list_classes()

Specs

list_classes :: [binary]

Lists all available Virtual Machine classes.

list_disks(region)

Specs

list_disks(region :: binary) ::
  [{binary, binary, binary, binary, binary}] |
  binary

Lists all disks in the given ‘region’ indicating their names, sizes, images, statuses and types.

list_regions()

Specs

list_regions :: [binary] | [{binary, [binary]}]

Lists all available regions (and their zones if possible).

list_virtual_machines(region)

Specs

list_virtual_machines(region :: binary) ::
  [{binary, binary, binary, binary}] |
  binary

Lists all Virtual Machines in the given ‘region’ with their names, status, public IP and class.

reboot_virtual_machine(region, instance)

Specs

reboot_virtual_machine(region :: binary, instance :: binary) ::
  :ok |
  binary

Reboots the Virtual Machine ‘instance’ in the given ‘region’.

set_virtual_machine_class(region, instance, class)

Specs

set_virtual_machine_class(region :: binary, instance :: binary, class :: binary) ::
  :ok |
  binary

Sets the Virtual Machine ‘instance’ in the given ‘region’ to the specified ‘class’ if possible.

start_virtual_machine(region, instance)

Specs

start_virtual_machine(region :: binary, instance :: binary) ::
  :ok |
  binary

Starts the Virtual Machine ‘instance’ in the given ‘region’.

stop_virtual_machine(region, instance)

Specs

stop_virtual_machine(region :: binary, instance :: binary) ::
  :ok |
  binary

Stops the Virtual Machine ‘instance’ in the given ‘region’.