An Amazon EC2 interface that allows yout to run, terminate, reboot and describe Amazon Ec2 Instances.
category | Zend |
---|---|
package | Zend_Service_Amazon |
subpackage | Ec2 |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Service_Amazon_Ec2_Abstract |
__construct($accessKey= null
, $secretKey= null
) : void
confirmProduct(string $productCode, string $instanceId) : array | boolean
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.
string
The product code to confirm.
string
The instance for which to confirm the product code.
array
boolean
An array if the product code is attached to the instance, false if it is not.consoleOutput(string $instanceId) : array
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.
string
An instance ID
array
describe($instanceId= null
, $ignoreTerminated= false
) : array
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.
array
describeByImageId(string $imageId, $ignoreTerminated = false
) : array
Recently terminated instances might appear in the returned results. This interval is usually less than one hour.
string
The imageId used to start the Instance.
array
getHttpClient() : \Zend_Http_Client
\Zend_Http_Client
monitor(array|string $instanceId) : array
array
string
The instance or list of instances you want to enable monitoring for
array
reboot(string|array $instanceId) : boolean
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.
string
array
One or more instance IDs.
boolean
run(array $options) : array
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.
array
An 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.
array
setHttpClient(\Zend_Http_Client $httpClient)
\Zend_Http_Client
setKeys($accessKey, $secretKey) : void
setRegion(string $region)
string
terminate(string|array $instanceId) : array
Terminated instances will remain visible after termination (approximately one hour).
string
array
One or more instance IDs returned.
array
unmonitor(array|string $instanceId) : array
array
string
The instance or list of instances you want to disable monitoring for
array
_getAccessKey() : string
string
_getRegion() : string
string
_getSecretKey() : string
string
addRequiredParameters(array $parameters) : array
The required parameters are:
If a required parameter is already set in the $parameters array, it is overwritten.
array
the array to which to add the required parameters.
array
sendRequest(array $params = array()
) : \Zend_Service_Amazon_Ec2_Response
array
List of parameters to send with the request
\Zend_Service_Amazon_Ec2_Exception |
---|
\Zend_Service_Amazon_Ec2_Response
signParameters(array $paramaters) : string
This implements the Amazon Web Services signature, as per the following specification:
Sort all request parameters (including SignatureVersion and excluding Signature, the value of which is being created), ignoring case.
string
the signed data.checkForErrors(\Zend_Service_Amazon_Ec2_Response $response) : void
\Zend_Service_Amazon_Ec2_Response
the response object to check.
\Zend_Service_Amazon_Ec2_Exception |
if one or more errors are returned from Amazon. |
---|
$_accessKey : string
$_defaultAccessKey : string
null
$_defaultRegion : string
null
$_defaultSecretKey : string
null
$_ec2ApiVersion
'2009-04-04'
$_ec2Endpoint
'ec2.amazonaws.com'
$_ec2SignatureMethod
'HmacSHA256'
$_ec2SignatureVersion
'2'
$_httpClient : \Zend_Http_Client
null
$_httpTimeout
10
$_region : string
$_secretKey : string
$_validEc2Regions : array
array('eu-west-1', 'us-east-1')
HCPU_MEDIUM = 'c1.medium'
HCPU_XLARGE = 'c1.xlarge'
LARGE = 'm1.large'
MICRO = 't1.micro'
SMALL = 'm1.small'
XLARGE = 'm1.xlarge'