Zend Framework  1.12
Public Member Functions | Public Attributes | List of all members
Zend_Service_Amazon_Ec2_Instance Class Reference

Public Member Functions

 run (array $options)
 Launches a specified number of Instances.
 
 describe ($instanceId=null, $ignoreTerminated=false)
 Returns information about instances that you own.
 
 describeByImageId ($imageId, $ignoreTerminated=false)
 Returns information about instances that you own that were started from a specific imageId.
 
 terminate ($instanceId)
 Shuts down one or more instances.
 
 reboot ($instanceId)
 Requests a reboot of one or more instances.
 
 consoleOutput ($instanceId)
 Retrieves console output for the specified instance.
 
 confirmProduct ($productCode, $instanceId)
 Returns true if the specified product code is attached to the specified instance.
 
 monitor ($instanceId)
 Turn on Amazon CloudWatch Monitoring for an instance or a list of instances.
 
 unmonitor ($instanceId)
 Turn off Amazon CloudWatch Monitoring for an instance or a list of instances.
 
- Public Member Functions inherited from Zend_Service_Amazon_Ec2_Abstract
 __construct ($accessKey=null, $secretKey=null, $region=null)
 Create Amazon client.
 
- Public Member Functions inherited from Zend_Service_Amazon_Abstract
 __construct ($accessKey=null, $secretKey=null)
 Create Amazon client.
 

Public Attributes

const MICRO = 't1.micro'
 Constant for Micro Instance Type.
 
const SMALL = 'm1.small'
 Constant for Small Instance TYpe.
 
const LARGE = 'm1.large'
 Constant for Large Instance TYpe.
 
const XLARGE = 'm1.xlarge'
 Constant for X-Large Instance TYpe.
 
const HCPU_MEDIUM = 'c1.medium'
 Constant for High CPU Medium Instance TYpe.
 
const HCPU_XLARGE = 'c1.xlarge'
 Constant for High CPU X-Large Instance TYpe.
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Service_Amazon_Ec2_Abstract
static setRegion ($region)
 Set which region you are working in.
 
- Protected Member Functions inherited from Zend_Service_Amazon_Ec2_Abstract
 _getRegion ()
 Method to fetch the AWS Region.
 
 sendRequest (array $params=array())
 Sends a HTTP request to the queue service using Zend_Http_Client.
 
 addRequiredParameters (array $parameters)
 Adds required authentication and version parameters to an array of parameters.
 
 signParameters (array $paramaters)
 Computes the RFC 2104-compliant HMAC signature for request parameters.
 
- Protected Attributes inherited from Zend_Service_Amazon_Ec2_Abstract
 $_ec2Endpoint = 'ec2.amazonaws.com'
 The HTTP query server.
 
 $_ec2ApiVersion = '2009-04-04'
 The API version to use.
 
 $_ec2SignatureVersion = '2'
 Signature Version.
 
 $_ec2SignatureMethod = 'HmacSHA256'
 Signature Encoding Method.
 
 $_httpTimeout = 10
 Period after which HTTP request will timeout in seconds.
 
 $_region
 
- Static Protected Attributes inherited from Zend_Service_Amazon_Ec2_Abstract
static $_defaultRegion = null
 
static $_validEc2Regions = array('eu-west-1', 'us-east-1')
 

Member Function Documentation

confirmProduct (   $productCode,
  $instanceId 
)

Returns true if the specified product code is attached to the specified instance.

The operation returns false if the product code is not attached to the instance.

The confirmProduct operation can only be executed by the owner of the AMI. This feature is useful when an AMI owner is providing support and wants to verify whether a user's instance is eligible.

Parameters
string$productCodeThe product code to confirm.
string$instanceIdThe instance for which to confirm the product code.
Returns
array|boolean An array if the product code is attached to the instance, false if it is not.
consoleOutput (   $instanceId)

Retrieves console output for the specified instance.

Instance console output is buffered and posted shortly after instance boot, reboot, and termination. Amazon EC2 preserves the most recent 64 KB output which will be available for at least one hour after the most recent post.

Parameters
string$instanceIdAn instance ID
Returns
array
describe (   $instanceId = null,
  $ignoreTerminated = false 
)

Returns information about instances that you own.

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.

Parameters
string | array$instaceIdSet of instances IDs of which to get the status.
booleanTure to ignore Terminated Instances.
Returns
array
describeByImageId (   $imageId,
  $ignoreTerminated = false 
)

Returns information about instances that you own that were started from a specific imageId.

Recently terminated instances might appear in the returned results. This interval is usually less than one hour.

Parameters
string$imageIdThe imageId used to start the Instance.
booleanTure to ignore Terminated Instances.
Returns
array
monitor (   $instanceId)

Turn on Amazon CloudWatch Monitoring for an instance or a list of instances.

Parameters
array | string$instanceIdThe instance or list of instances you want to enable monitoring for
Returns
array
reboot (   $instanceId)

Requests a reboot of one or more instances.

This operation is asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed if the instances are valid and belong to the user. Requests to reboot terminated instances are ignored.

Parameters
string | array$instanceIdOne or more instance IDs.
Returns
boolean
run ( array  $options)

Launches a specified number of Instances.

If Amazon EC2 cannot launch the minimum number AMIs you request, no instances launch. If there is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches as many as possible to satisfy the requested maximum values.

Every instance is launched in a security group. If you do not specify a security group at launch, the instances start in your default security group. For more information on creating security groups, see CreateSecurityGroup.

An optional instance type can be specified. For information about instance types, see Instance Types.

You can provide an optional key pair ID for each image in the launch request (for more information, see CreateKeyPair). All instances that are created from images that use this key pair will have access to the associated public key at boot. You can use this key to provide secure access to an instance of an image on a per-instance basis. Amazon EC2 public images use this feature to provide secure access without passwords.

Launching public images without a key pair ID will leave them inaccessible.

Parameters
array$optionsAn array that contins the options to start an instance. Required Values: imageId string ID of the AMI with which to launch instances. Optional Values: minCount integer Minimum number of instances to launch. maxCount integer Maximum number of instances to launch. keyName string Name of the key pair with which to launch instances. securityGruop string|array Names of the security groups with which to associate the instances. userData string The user data available to the launched instances. This should not be Base64 encoded. instanceType constant Specifies the instance type. placement string Specifies the availability zone in which to launch the instance(s). By default, Amazon EC2 selects an availability zone for you. kernelId string The ID of the kernel with which to launch the instance. ramdiskId string The ID of the RAM disk with which to launch the instance. blockDeviceVirtualName string Specifies the virtual name to map to the corresponding device name. For example: instancestore0 blockDeviceName string Specifies the device to which you are mapping a virtual name. For example: sdb monitor boolean Turn on CloudWatch Monitoring for an instance.
Returns
array
terminate (   $instanceId)

Shuts down one or more instances.

This operation is idempotent; if you terminate an instance more than once, each call will succeed.

Terminated instances will remain visible after termination (approximately one hour).

Parameters
string | array$instanceIdOne or more instance IDs returned.
Returns
array
unmonitor (   $instanceId)

Turn off Amazon CloudWatch Monitoring for an instance or a list of instances.

Parameters
array | string$instanceIdThe instance or list of instances you want to disable monitoring for
Returns
array

Member Data Documentation

const HCPU_MEDIUM = 'c1.medium'

Constant for High CPU Medium Instance TYpe.

const HCPU_XLARGE = 'c1.xlarge'

Constant for High CPU X-Large Instance TYpe.

const LARGE = 'm1.large'

Constant for Large Instance TYpe.

const MICRO = 't1.micro'

Constant for Micro Instance Type.

const SMALL = 'm1.small'

Constant for Small Instance TYpe.

const XLARGE = 'm1.xlarge'

Constant for X-Large Instance TYpe.