public interface InstanceApi
| Modifier and Type | Interface and Description |
|---|---|
static class |
InstanceApi.InstancePages |
| Modifier and Type | Method and Description |
|---|---|
Operation |
addAccessConfigToNic(String instance,
Instance.NetworkInterface.AccessConfig accessConfig,
String networkInterfaceName)
Adds an access config to an instance's network interface.
|
Operation |
attachDisk(String instance,
AttachDisk attachDiskOptions)
Attaches a disk to an instance
|
Operation |
create(NewInstance template)
Creates a instance resource in the specified project using the data included in the request.
|
Operation |
delete(String instance)
Deletes an instance by name and returns the operation in progress, or null if not found.
|
Operation |
deleteAccessConfigFromNic(String instance,
String accessConfigName,
String networkInterfaceName)
Deletes an access config from an instance's network interface.
|
Operation |
detachDisk(String instance,
String deviceName)
Detaches an attached disk from an instance
|
Instance |
get(String instance)
Returns an instance by name or null if not found.
|
Instance.SerialPortOutput |
getSerialPortOutput(String instance)
Returns the specified instance's serial port output.
|
Instance.SerialPortOutput |
getSerialPortOutput(String instance,
int port)
Returns the specified instance's serial port output.
|
Iterator<ListPage<Instance>> |
list() |
Iterator<ListPage<Instance>> |
list(ListOptions options) |
ListPage<Instance> |
listPage(String pageToken,
ListOptions listOptions)
Retrieves the list of instance resources available to the specified project.
|
Operation |
reset(String instance)
Hard-resets the instance.
|
Operation |
setDiskAutoDelete(String instanceName,
String deviceName,
boolean autoDelete)
Sets the auto-delete flag for a disk attached to an instance
|
Operation |
setMetadata(String instance,
Metadata metadata)
Sets metadata for an instance using the data included in the request.
|
Operation |
setScheduling(String instanceName,
Instance.Scheduling.OnHostMaintenance onHostMaintenance,
boolean automaticRestart,
boolean preemptible)
Sets an instance's scheduling options.
|
Operation |
setTags(String instance,
Iterable<String> items,
String fingerprint)
Lists items for an instance
|
Operation |
start(String instance)
This method starts an instance that was stopped using the using the
stop(String) method. |
Operation |
stop(String instance)
This method stops a running instance, shutting it down cleanly, and allows you to restart
the instance at a later time.
|
@Named(value="Instances:get") @Nullable Instance get(String instance)
@Named(value="Instances:insert") Operation create(NewInstance template)
template - the instance template@Named(value="Instances:delete") @Nullable Operation delete(String instance)
@Named(value="Instances:addAccessConfig") Operation addAccessConfigToNic(String instance, Instance.NetworkInterface.AccessConfig accessConfig, String networkInterfaceName)
instance - the instance name.accessConfig - the AccessConfig to add.networkInterfaceName - network interface name.@Named(value="Instances:deleteAccessConfig") Operation deleteAccessConfigFromNic(String instance, String accessConfigName, String networkInterfaceName)
instance - the instance name.accessConfigName - the name of the access config to deletenetworkInterfaceName - network interface name.@Named(value="Instances:getSerialPortOutput") Instance.SerialPortOutput getSerialPortOutput(String instance)
instance - the instance name.@Named(value="Instances:getSerialPortOutput") Instance.SerialPortOutput getSerialPortOutput(String instance, int port)
instance - the instance name.@Named(value="Instances:reset") Operation reset(String instance)
instance - the instance name@Named(value="Instances:attachDisk") Operation attachDisk(String instance, AttachDisk attachDiskOptions)
instance - The instance name to attach toattachDiskOptions - The options for attaching the disk.@Named(value="Instances:detachDisk") Operation detachDisk(String instance, String deviceName)
instance - The instance name to attach todeviceName - The device name of the disk to detach.@Named(value="Instances:setMetadata") Operation setMetadata(String instance, Metadata metadata)
Metadata update = instanceApi.get("myInstance").metadata().clone();
update.put("newItem","newItemValue");
instanceApi.setMetadata("myInstance", update);
instance - The name of the instancemetadata - the metadata to set@Named(value="Instances:setTags") Operation setTags(String instance, Iterable<String> items, String fingerprint)
instance - the name of the instanceitems - A set of itemsfingerprint - The current fingerprint for the items@Named(value="Instances:setDiskAutoDelete") Operation setDiskAutoDelete(String instanceName, String deviceName, boolean autoDelete)
instanceName - The name of the instancedeviceName - Disk device name to modify.autoDelete - Whether to auto-delete the disk when the instance is deleted@Named(value="Instances:setScheduling") Operation setScheduling(String instanceName, Instance.Scheduling.OnHostMaintenance onHostMaintenance, boolean automaticRestart, boolean preemptible)
instanceName - The name of the instanceonHostMaintenance - either MIGRATE or TERMINATE the default is MIGRATE (Live Migration).automaticRestart - Defines whether the Instance should be automatically
restarted when it is terminated by Compute Engine (not terminated by user).
Used when onHostMaintenance is set to TERMINATE.preemptible - Defines whether the Instance should be launched as spot instance@Named(value="Instances:start") Operation start(String instance)
stop(String) method.instance - - name of the instance to be started@Named(value="Instances:stop") Operation stop(String instance)
instance - @Named(value="Instances:list") ListPage<Instance> listPage(@Nullable String pageToken, ListOptions listOptions)
pageToken - marks the beginning of the next list pagelistOptions - listing options@Named(value="Instances:list") Iterator<ListPage<Instance>> list()
listPage(String, ListOptions)@Named(value="Instances:list") Iterator<ListPage<Instance>> list(ListOptions options)
listPage(String, ListOptions)Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.