Provides the basic functionality to send a request to the Amazon Ec2 Query API

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_Abstract

 Methods

Create Amazon client.

__construct($accessKey = null, $secretKey = null, string $region = null) : void
inherited_from \Zend_Service_Amazon_Abstract::__construct()

Parameters

$accessKey

$secretKey

$region

string

Sets the AWS Region

Create Amazon client.

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

Parameters

$accessKey

$secretKey

Gets the HTTP client object.

getHttpClient() : \Zend_Http_Client
InheritedStatic

Returns

\Zend_Http_Client

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) 
Static

Parameters

$region

string

Method to fetch the Access Key

_getAccessKey() : string
Inherited

Returns

string

Method to fetch the AWS Region

_getRegion() : string

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

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

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

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

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