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

Public Member Functions

 __construct ($user, $key, $authUrl=self::US_AUTH_URL)
 Constructor.
 
 getUser ()
 Get User account.
 
 getKey ()
 Get user key.
 
 getAuthUrl ()
 Get authentication URL.
 
 getStorageUrl ()
 Get the storage URL.
 
 getCdnUrl ()
 Get the CDN URL.
 
 getManagementUrl ()
 Get the management server URL.
 
 setUser ($user)
 Set the user account.
 
 setKey ($key)
 Set the authentication key.
 
 setAuthUrl ($url)
 Set the Authentication URL.
 
 setServiceNet ($useServiceNet=true)
 Sets whether to use ServiceNet.
 
 getServiceNet ()
 Get whether we're using ServiceNet.
 
 getToken ()
 Get the authentication token.
 
 getErrorMsg ()
 Get the error msg of the last HTTP call.
 
 getErrorCode ()
 Get the error code of the last HTTP call.
 
 getHttpClient ()
 get the HttpClient instance
 
 isSuccessful ()
 Return true is the last call was successful.
 
 authenticate ()
 Authentication.
 

Public Attributes

const VERSION = 'v1.0'
 
const US_AUTH_URL = 'https://auth.api.rackspacecloud.com'
 
const UK_AUTH_URL = 'https://lon.auth.api.rackspacecloud.com'
 
const API_FORMAT = 'json'
 
const USER_AGENT = 'Zend_Service_Rackspace'
 
const STORAGE_URL = "X-Storage-Url"
 
const AUTHTOKEN = "X-Auth-Token"
 
const AUTHUSER_HEADER = "X-Auth-User"
 
const AUTHKEY_HEADER = "X-Auth-Key"
 
const AUTHUSER_HEADER_LEGACY = "X-Storage-User"
 
const AUTHKEY_HEADER_LEGACY = "X-Storage-Pass"
 
const AUTHTOKEN_LEGACY = "X-Storage-Token"
 
const CDNM_URL = "X-CDN-Management-Url"
 
const MANAGEMENT_URL = "X-Server-Management-Url"
 

Protected Member Functions

 httpCall ($url, $method, $headers=array(), $data=array(), $body=null)
 HTTP call.
 

Protected Attributes

 $key
 
 $user
 
 $token
 
 $authUrl
 
 $httpClient
 
 $errorMsg
 
 $errorCode
 
 $storageUrl
 
 $cdnUrl
 
 $managementUrl
 
 $useServiceNet = false
 

Constructor & Destructor Documentation

__construct (   $user,
  $key,
  $authUrl = self::US_AUTH_URL 
)

Constructor.

You must pass the account and the Rackspace authentication key. Optional: the authentication url (default is US)

Parameters
string$user
string$key
string$authUrl

Member Function Documentation

authenticate ( )

Authentication.

Returns
boolean
See Also
Zend_Service_Rackspace_Exception
getAuthUrl ( )

Get authentication URL.

Returns
string
getCdnUrl ( )

Get the CDN URL.

Returns
string|boolean
getErrorCode ( )

Get the error code of the last HTTP call.

Returns
strig
getErrorMsg ( )

Get the error msg of the last HTTP call.

Returns
string
getHttpClient ( )

get the HttpClient instance

Returns
Zend_Http_Client
getKey ( )

Get user key.

Returns
string
getManagementUrl ( )

Get the management server URL.

Returns
string|boolean
getServiceNet ( )

Get whether we're using ServiceNet.

Returns
boolean
getStorageUrl ( )

Get the storage URL.

Returns
string|boolean
getToken ( )

Get the authentication token.

Returns
string
getUser ( )

Get User account.

Returns
string
httpCall (   $url,
  $method,
  $headers = array(),
  $data = array(),
  $body = null 
)
protected

HTTP call.

Parameters
string$url
string$method
array$headers
array$get
string$body
Returns
Zend_Http_Response
isSuccessful ( )

Return true is the last call was successful.

Returns
boolean
setAuthUrl (   $url)

Set the Authentication URL.

Parameters
string$url
Returns
void
setKey (   $key)

Set the authentication key.

Parameters
string$key
Returns
void
setServiceNet (   $useServiceNet = true)

Sets whether to use ServiceNet.

ServiceNet is Rackspace's internal network. Bandwidth on ServiceNet is not charged.

Parameters
boolean$useServiceNet
setUser (   $user)

Set the user account.

Parameters
string$user
Returns
void

Member Data Documentation

$authUrl
protected
$cdnUrl
protected
$errorCode
protected
$errorMsg
protected
$httpClient
protected
$key
protected
$managementUrl
protected
$storageUrl
protected
$token
protected
$user
protected
$useServiceNet = false
protected
const API_FORMAT = 'json'
const AUTHKEY_HEADER = "X-Auth-Key"
const AUTHKEY_HEADER_LEGACY = "X-Storage-Pass"
const AUTHTOKEN = "X-Auth-Token"
const AUTHTOKEN_LEGACY = "X-Storage-Token"
const AUTHUSER_HEADER = "X-Auth-User"
const AUTHUSER_HEADER_LEGACY = "X-Storage-User"
const CDNM_URL = "X-CDN-Management-Url"
const MANAGEMENT_URL = "X-Server-Management-Url"
const STORAGE_URL = "X-Storage-Url"
const UK_AUTH_URL = 'https://lon.auth.api.rackspacecloud.com'
const US_AUTH_URL = 'https://auth.api.rackspacecloud.com'
const USER_AGENT = 'Zend_Service_Rackspace'
const VERSION = 'v1.0'