org.jclouds.joyent.cloudapi.v6_5.features
Interface MachineApi


public interface MachineApi

Provides synchronous access to Machine.

Author:
Gerald Pereira
See Also:
MachineAsyncApi, api doc

Method Summary
 Machine createWithDataset(String datasetURN)
           
 Machine createWithDataset(String datasetURN, CreateMachineOptions options)
          Allows you to provision a machine.
 void delete(String id)
          Allows you to delete a machine (the machine must be stopped before it can be deleted).
 Machine get(String id)
          Gets the details for an individual machine.
 Set<Machine> list()
          Lists all machines we have on record for your account.
 void reboot(String id)
          Allows you to reboot a machine.
 void resize(String id, String packageJoyentCloud)
          Allows you to resize a machine.
 void start(String id)
          Allows you to boot up a machine.
 void stop(String id)
          Allows you to shut down a machine.
 

Method Detail

list

Set<Machine> list()
Lists all machines we have on record for your account.

Returns:
an account's associated machine objects.

get

Machine get(String id)
Gets the details for an individual machine.

Parameters:
id - the id of the machine
Returns:

createWithDataset

Machine createWithDataset(String datasetURN,
                          CreateMachineOptions options)
Allows you to provision a machine. Note that if you do not specify a package, you'll get the datacenter defaults for it. If you do not specify a name, CloudAPI will generate a random one for you. Your machine will initially be not available for login (SmartDataCenter must provision and boot it). You can poll get(java.lang.String) for status. When the state field is equal to running, you can login.

With regards to login, if the machine is of type smartmachine, you can use any of the SSH keys managed under the keys section of CloudAPI to login, as any POSIX user on the OS. You can add/remove them over time, and the machine will automatically work with that set.

If the the machine is a virtualmachine, and of a UNIX-derived OS (e.g. Linux), you must have keys uploaded before provisioning; that entire set of keys will be written out to /root/.ssh/authorized_keys, and you can ssh in using one of those. Changing the keys over time under your account will not affect the running virtual machine in any way; those keys are statically written at provisioning-time only, and you will need to manually manage them.

If the dataset you create a machine from is set to generate passwords for you, the username/password pairs will be returned in the metadata response as a nested object, like:

Parameters:
datasetURN - urn of the dataset to install
Returns:
the newly created machine

createWithDataset

Machine createWithDataset(String datasetURN)
See Also:
#createWithDataset(CreateMachineOptions)

stop

void stop(String id)
Allows you to shut down a machine.

Parameters:
id - the id of the machine to stop

start

void start(String id)
Allows you to boot up a machine.

Parameters:
id - the id of the machine to start

reboot

void reboot(String id)
Allows you to reboot a machine.

Parameters:
id - the id of the machine to reboot

resize

void resize(String id,
            String packageJoyentCloud)
Allows you to resize a machine. (Works only for smart machines)

Parameters:
id - the id of the machine to resize
packageJoyentCloud - the package to use for the machine

delete

void delete(String id)
Allows you to delete a machine (the machine must be stopped before it can be deleted).

Parameters:
id - the id of the machine to delete


Copyright © 2009-2012 jclouds. All Rights Reserved.