|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InstanceClient
Provides access to EC2 via their REST API.
Method Summary | |
---|---|
Set<? extends Reservation<? extends RunningInstance>> |
describeInstancesInRegion(String region,
String... instanceIds)
Returns information about instances that you own. |
Map<String,BlockDevice> |
getBlockDeviceMappingForInstanceInRegion(String region,
String instanceId)
|
Volume.InstanceInitiatedShutdownBehavior |
getInstanceInitiatedShutdownBehaviorForInstanceInRegion(String region,
String instanceId)
|
String |
getInstanceTypeForInstanceInRegion(String region,
String instanceId)
|
String |
getKernelForInstanceInRegion(String region,
String instanceId)
|
String |
getRamdiskForInstanceInRegion(String region,
String instanceId)
|
String |
getRootDeviceNameForInstanceInRegion(String region,
String instanceId)
|
String |
getUserDataForInstanceInRegion(String region,
String instanceId)
|
boolean |
isApiTerminationDisabledForInstanceInRegion(String region,
String instanceId)
|
void |
rebootInstancesInRegion(String region,
String... instanceIds)
Requests a reboot of one or more instances. |
String |
resetKernelForInstanceInRegion(String region,
String instanceId)
Resets an attribute of an instance to its default value. |
String |
resetRamdiskForInstanceInRegion(String region,
String instanceId)
Resets an attribute of an instance to its default value. |
Reservation<? extends RunningInstance> |
runInstancesInRegion(String region,
String nullableAvailabilityZone,
String imageId,
int minCount,
int maxCount,
RunInstancesOptions... options)
Launches a specified number of instances of an AMI for which you have permissions. |
void |
setApiTerminationDisabledForInstanceInRegion(String region,
String instanceId,
boolean apiTerminationDisabled)
This command works while the instance is running and controls whether or not the api can be used to terminate the instance. |
void |
setBlockDeviceMappingForInstanceInRegion(String region,
String instanceId,
Map<String,BlockDevice> blockDeviceMapping)
Sets the blockDeviceMapping used for an instance. |
void |
setInstanceInitiatedShutdownBehaviorForInstanceInRegion(String region,
String instanceId,
Volume.InstanceInitiatedShutdownBehavior instanceInitiatedShutdownBehavior)
Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down. |
void |
setInstanceTypeForInstanceInRegion(String region,
String instanceId,
String instanceType)
Sets the instanceType used for starting the instance. |
void |
setKernelForInstanceInRegion(String region,
String instanceId,
String kernel)
Sets the kernelId used for starting the instance. |
void |
setRamdiskForInstanceInRegion(String region,
String instanceId,
String ramdisk)
Sets the ramdisk used for starting the instance. |
void |
setUserDataForInstanceInRegion(String region,
String instanceId,
byte[] unencodedData)
Sets the userData used for starting the instance. |
Set<? extends InstanceStateChange> |
startInstancesInRegion(String region,
String... instanceIds)
Starts an instance that uses an Amazon EBS volume as its root device. |
Set<? extends InstanceStateChange> |
stopInstancesInRegion(String region,
boolean force,
String... instanceIds)
Stops an instance that uses an Amazon EBS volume as its root device. |
Set<? extends InstanceStateChange> |
terminateInstancesInRegion(String region,
String... instanceIds)
Shuts down one or more instances. |
Method Detail |
---|
Set<? extends Reservation<? extends RunningInstance>> describeInstancesInRegion(@Nullable String region, String... instanceIds)
If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an invalid instance ID, a fault is returned. If you specify an instance that you do not own, it will not be included in the returned results.
Recently terminated instances might appear in the returned results.This interval is usually less than one hour.
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.runInstancesInRegion(java.lang.String, java.lang.String, java.lang.String, int, int, org.jclouds.ec2.options.RunInstancesOptions...)
,
terminateInstancesInRegion(java.lang.String, java.lang.String...)
,
Reservation<? extends RunningInstance> runInstancesInRegion(@Nullable String region, @Nullable String nullableAvailabilityZone, String imageId, int minCount, int maxCount, RunInstancesOptions... options)
If Amazon EC2 cannot launch the minimum number AMIs you request, no instances will be launched. If there is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches the minimum number specified for each AMI and allocate the remaining available instances using round robin.
Note: Launching public images without a key pair ID will leave them inaccessible.
The public key material is made available to the instance at boot time by placing it in the openssh_id.pub file on a logical device that is exposed to the instance as /dev/sda2 (the instance store). The format of this file is suitable for use as an entry within ~/.ssh/authorized_keys (the OpenSSH format). This can be done at boot (e.g., as part of rc.local) allowing for secure access without passwords.
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.nullableAvailabilityZone
- Specifies the placement constraints (Availability Zones) for
launching the instances. If null, Amazon will determine the best
availability zone to place the instance.imageId
- Unique ID of a machine image, returned by a call tominCount
- Minimum number of instances to launch. If the value is more than
Amazon EC2 can launch, no instances a re launched at all.
Constraints: Between 1 and the maximum number allowed for your
account (default: 20).maxCount
- Maximum number of instances to launch. If the value is more than
Amazon EC2 can launch, the largest possible number above
minCount will be launched instead. Constraints: Between 1 and
the maximum number allowed for your account (default: 20).describeInstancesInRegion(java.lang.String, java.lang.String...)
,
terminateInstancesInRegion(java.lang.String, java.lang.String...)
,
#authorizeSecurityGroupIngressInRegion
,
#revokeSecurityGroupIngressInRegion
,
#describeSecurityGroupsInRegion
,
#createSecurityGroupInRegion
,
#createKeyPairInRegion
,
,
RunInstancesOptions
Set<? extends InstanceStateChange> terminateInstancesInRegion(@Nullable String region, String... instanceIds)
Terminated instances will remain visible after termination (approximately one hour).
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceIds
- Instance ID to terminate.describeInstancesInRegion(java.lang.String, java.lang.String...)
,
Set<? extends InstanceStateChange> stopInstancesInRegion(@Nullable String region, boolean force, String... instanceIds)
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.
Performing this operation on an instance that uses an instance store as its root device returns an error.
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.force
- Forces the instance to stop. The instance will not have an
opportunity to flush file system caches nor file system meta
data. If you use this option, you must perform file system check
and repair procedures. This option is not recommended for
Windows instances.instanceIds
- Instance ID to stop.startInstancesInRegion(java.lang.String, java.lang.String...)
,
runInstancesInRegion(java.lang.String, java.lang.String, java.lang.String, int, int, org.jclouds.ec2.options.RunInstancesOptions...)
,
describeInstancesInRegion(java.lang.String, java.lang.String...)
,
terminateInstancesInRegion(java.lang.String, java.lang.String...)
,
void rebootInstancesInRegion(@Nullable String region, String... instanceIds)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceIds
- Instance ID to reboot.startInstancesInRegion(java.lang.String, java.lang.String...)
,
runInstancesInRegion(java.lang.String, java.lang.String, java.lang.String, int, int, org.jclouds.ec2.options.RunInstancesOptions...)
,
describeInstancesInRegion(java.lang.String, java.lang.String...)
,
terminateInstancesInRegion(java.lang.String, java.lang.String...)
,
Set<? extends InstanceStateChange> startInstancesInRegion(@Nullable String region, String... instanceIds)
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.
Performing this operation on an instance that uses an instance store as its root device returns an error.
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceIds
- Instance ID to start.stopInstancesInRegion(java.lang.String, boolean, java.lang.String...)
,
runInstancesInRegion(java.lang.String, java.lang.String, java.lang.String, int, int, org.jclouds.ec2.options.RunInstancesOptions...)
,
describeInstancesInRegion(java.lang.String, java.lang.String...)
,
terminateInstancesInRegion(java.lang.String, java.lang.String...)
,
String getUserDataForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
String getRootDeviceNameForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
String getRamdiskForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
String getKernelForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
boolean isApiTerminationDisabledForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
String getInstanceTypeForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
Volume.InstanceInitiatedShutdownBehavior getInstanceInitiatedShutdownBehaviorForInstanceInRegion(String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
Map<String,BlockDevice> getBlockDeviceMappingForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to describe the attribute of
String resetRamdiskForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to reset the attribute of
String resetKernelForInstanceInRegion(@Nullable String region, String instanceId)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to reset the attribute of
void setUserDataForInstanceInRegion(@Nullable String region, String instanceId, byte[] unencodedData)
The instance needs to be in a InstanceState.STOPPED
state, which
implies two things:
InstanceState.STOPPING
to InstanceState.STOPPED
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to change the attribute ofunencodedData
- unencoded data to set as userDatavoid setRamdiskForInstanceInRegion(@Nullable String region, String instanceId, String ramdisk)
The instance needs to be in a InstanceState.STOPPED
state, which
implies two things:
InstanceState.STOPPING
to InstanceState.STOPPED
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to change the attribute oframdisk
- ramdisk used to start the instancevoid setKernelForInstanceInRegion(@Nullable String region, String instanceId, String kernel)
The instance needs to be in a InstanceState.STOPPED
state, which
implies two things:
InstanceState.STOPPING
to InstanceState.STOPPED
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to change the attribute ofkernel
- kernelId used to start the instancevoid setApiTerminationDisabledForInstanceInRegion(@Nullable String region, String instanceId, boolean apiTerminationDisabled)
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to reset the attribute ofapiTerminationDisabled
- true to disable api terminationvoid setInstanceTypeForInstanceInRegion(@Nullable String region, String instanceId, String instanceType)
The instance needs to be in a InstanceState.STOPPED
state, which
implies two things:
InstanceState.STOPPING
to InstanceState.STOPPED
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to change the attribute ofinstanceType
- instanceType used to start the instancevoid setInstanceInitiatedShutdownBehaviorForInstanceInRegion(@Nullable String region, String instanceId, Volume.InstanceInitiatedShutdownBehavior instanceInitiatedShutdownBehavior)
The instance needs to be in a InstanceState.STOPPED
state, which
implies two things:
InstanceState.STOPPING
to InstanceState.STOPPED
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to change the attribute ofinstanceInitiatedShutdownBehavior
- whether the instance's Amazon EBS volumes are stopped or
terminated when the instance is shut down.void setBlockDeviceMappingForInstanceInRegion(@Nullable String region, String instanceId, Map<String,BlockDevice> blockDeviceMapping)
The instance needs to be in a InstanceState.STOPPED
state, which
implies two things:
InstanceState.STOPPING
to InstanceState.STOPPED
BlockDevice
, the
constructor can be used with the following parameters:
BlockDevice#EbsBlockDevice(String, String, boolean)
, that are:
Note that the device names between Linux and Windows differ. For Linux, ensure that your device name is in the form /dev/sd[a-z] . For example, /dev/sda , /dev/sdb and /dev/sdh are all valid device names.
For Windows, the root device is still referred to as /dev/sda1 . For other devices, ensure that they are in the form /xvd[c-p] . For example, /xvde , /xvdf and /xvdp are all valid Windows device names.
NOTE: As of now 02/20/2010, this command only works to change the DeleteOnTermination property of the device. The volume must be attached to a stopped instance.
region
- Instances are tied to Availability Zones. However, the instance
ID is tied to the Region.instanceId
- which instance to change the attribute ofblockDeviceMapping
- blockDeviceMapping used to start the instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |