An Amazon EC2 interface to allocate, associate, describe and release Elastic IP address from your account.

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

 Methods

Create Amazon client.

__construct($accessKey = null, $secretKey = null) : void
Inherited

Parameters

$accessKey

$secretKey

Acquires an elastic IP address for use with your account

allocate() : string

Returns

stringReturns the newly Allocated IP Address

Associates an elastic IP address with an instance

associate(string $instanceId, string $publicIp) : boolean

Parameters

$instanceId

string

The instance to which the IP address is assigned

$publicIp

string

IP address that you are assigning to the instance.

Returns

boolean

Lists elastic IP addresses assigned to your account.

describe(string|array $publicIp = null) : array

Parameters

$publicIp

stringarray

Elastic IP or list of addresses to describe.

Returns

array

Disassociates the specified elastic IP address from the instance to which it is assigned.

disassocate(string $publicIp) : boolean

This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.

Parameters

$publicIp

string

IP address that you are disassociating from the instance.

Returns

boolean

Gets the HTTP client object.

getHttpClient() : \Zend_Http_Client
InheritedStatic

Returns

\Zend_Http_Client

Releases an elastic IP address that is associated with your account

release(string $publicIp) : boolean

Parameters

$publicIp

string

IP address that you are releasing from your account.

Returns

boolean

Sets the HTTP client object to use for retrieving the feeds. If none is set, the default Zend_Http_Client will be used.

setHttpClient(\Zend_Http_Client $httpClient) 
InheritedStatic

Parameters

$httpClient

\Zend_Http_Client

Set the keys to use when accessing SQS.

setKeys($accessKey, $secretKey) : void
InheritedStatic

Parameters

$accessKey

$secretKey

Set which region you are working in. It will append the end point automaticly

setRegion(string $region) 
InheritedStatic

Parameters

$region

string

Method to fetch the Access Key

_getAccessKey() : string
Inherited

Returns

string

Method to fetch the AWS Region

_getRegion() : string
Inherited

Returns

string

Method to fetch the Secret AWS Key

_getSecretKey() : string
Inherited

Returns

string

Adds required authentication and version parameters to an array of parameters

addRequiredParameters(array $parameters) : array
Inherited

The required parameters are:

  • AWSAccessKey
  • SignatureVersion
  • Timestamp
  • Version and
  • Signature

If a required parameter is already set in the $parameters array, it is overwritten.

Parameters

$parameters

array

the array to which to add the required parameters.

Returns

array

Sends a HTTP request to the queue service using Zend_Http_Client

sendRequest(array $params = array()) : \Zend_Service_Amazon_Ec2_Response
Inherited

Parameters

$params

array

List of parameters to send with the request

Exceptions

\Zend_Service_Amazon_Ec2_Exception

Returns

\Zend_Service_Amazon_Ec2_Response

Computes the RFC 2104-compliant HMAC signature for request parameters

signParameters(array $paramaters) : string
Inherited

This implements the Amazon Web Services signature, as per the following specification:

  1. Sort all request parameters (including SignatureVersion and excluding Signature, the value of which is being created), ignoring case.

  2. Iterate over the sorted list and append the parameter name (in its original case) and then its value. Do not URL-encode the parameter values before constructing this string. Do not use any separator characters when appending strings.

Parameters

$paramaters

Returns

stringthe signed data.

Checks for errors responses from Amazon

checkForErrors(\Zend_Service_Amazon_Ec2_Response $response) : void
Inherited

Parameters

$response

\Zend_Service_Amazon_Ec2_Response

the response object to check.

Exceptions

\Zend_Service_Amazon_Ec2_Exception if one or more errors are returned from Amazon.

 Properties

 

Amazon Access Key

$_accessKey : string

Default

 

Amazon Access Key

$_defaultAccessKey : string

Default

null
Static
 

Amazon Region

$_defaultRegion : string

Default

null
Static
 

Amazon Secret Key

$_defaultSecretKey : string

Default

null
Static
 

The API version to use

$_ec2ApiVersion 

Default

'2009-04-04'
 

The HTTP query server

$_ec2Endpoint 

Default

'ec2.amazonaws.com'
 

Signature Encoding Method

$_ec2SignatureMethod 

Default

'HmacSHA256'
 

Signature Version

$_ec2SignatureVersion 

Default

'2'
 

HTTP Client used to query all web services

$_httpClient : \Zend_Http_Client

Default

null
Static
 

Period after which HTTP request will timeout in seconds

$_httpTimeout 

Default

10
 

Amazon Region

$_region : string

Default

 

Amazon Secret Key

$_secretKey : string

Default

 

An array that contains all the valid Amazon Ec2 Regions.

$_validEc2Regions : array

Default

array('eu-west-1', 'us-east-1')
Static