The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::Gandi::Hosting::VM - Interface to manage VM.

DESCRIPTION

A VM (Virtual Machine) describes a server’s resources and state.

list

Returns the list of VMs associated with apikey, matched by filters, if specified.

Available params are:

  • id

  • memory

  • state

  • shares

  • hostname

  • cores

  • datacenter_id

  • items_per_page

  • page

  • sort_by

count

Returns the number of VMs associated with apikey, matched by filters, if specified.

Available params are:

  • id

  • memory

  • state

  • shares

  • hostname

  • cores

  • datacenter_id

info

Return a mapping of the VM attributes.

Parameter: None

    use Net::Gandi;

    my $vm   = Net::Gandi::Hosting::VM->new( apikey => 'myapikey', id => 42 );
    my $info = $vm->info;

create

Creates a VM and returns the corresponding operations.

create_from

Creates a Disk, and then, a VM, and returns the corresponding operations. It combines the API method disk.create, and vm.create. This is a convenient method to do the disk.create and vm.create in a single API call. Three operations are created and returned (in this order): disk_create, iface_create, create

update

Updates a VM.

disk_attach

Attach a disk to a VM. The account associated with apikey MUST own both VM and disk. A disk can only be attached to one VM.

Params: disk_id

disk_detach

Detach a disk from a VM. The disk MUST not be mounted on the VM. If the disk position is 0, the VM MUST be halted to detach the disk

Params: disk_id

start

Starts a VM and return the corresponding operation Parameter: None

stop

Stops a VM and returns the corresponding operation. Parameter: None

reboot

Reboots a VM and returns the corresponding operation Parameter: None

Deletes a VM. Deletes the disk attached in position 0, the disk used as system disk. Also deletes the first network interface. Detach all extra disks and network interfaces. Parameter: None

AUTHOR

Natal Ngétal, <hobbestig@cpan.org>