Service/Rackspace/Abstract.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Rackspace  

\Zend_Service_Rackspace_Abstract

Package: Default
Children
\Zend_Service_Rackspace_Files
\Zend_Service_Rackspace_Servers

Constants

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

Properties

Propertyprotectedstring $authUrl =

Authentication URL

Details
Type
string
Propertyprotectedstring $cdnUrl =

CDN URL

Details
Type
string
Propertyprotectedstring $errorCode =

HTTP error code

Details
Type
string
Propertyprotectedstring $errorMsg =

Error Msg

Details
Type
string
Propertyprotected\Zend_Http_Client $httpClient =

Details
Type
\Zend_Http_Client
Propertyprotectedstring $key =

Rackspace Key

Details
Type
string
Propertyprotectedstring $managementUrl =

Server management URL

Details
Type
string
Propertyprotectedstring $storageUrl =

Storage URL

Details
Type
string
Propertyprotectedstring $token =

Token of authentication

Details
Type
string
Propertyprotectedboolean $useServiceNet = false

Do we use ServiceNet?

Default valuefalseDetails
Type
boolean
Propertyprotectedstring $user =

Rackspace account name

Details
Type
string

Methods

methodpublic__construct(string $user, string $key, string $authUrl = self::US_AUTH_URL) : void

Constructor

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

Parameters
Name Type Description
$user string
$key string
$authUrl string
methodpublicauthenticate() : boolean

Authentication

Returns
Type Description
boolean
methodpublicgetAuthUrl() : string

Get authentication URL

Returns
Type Description
string
methodpublicgetCdnUrl() : string | boolean

Get the CDN URL

Returns
Type Description
string | boolean
methodpublicgetErrorCode() : \strig

Get the error code of the last HTTP call

Returns
Type Description
\strig
methodpublicgetErrorMsg() : string

Get the error msg of the last HTTP call

Returns
Type Description
string
methodpublicgetHttpClient() : \Zend_Http_Client

get the HttpClient instance

Returns
Type Description
\Zend_Http_Client
methodpublicgetKey() : string

Get user key

Returns
Type Description
string
methodpublicgetManagementUrl() : string | boolean

Get the management server URL

Returns
Type Description
string | boolean
methodpublicgetServiceNet() : boolean

Get whether we're using ServiceNet

Returns
Type Description
boolean
methodpublicgetStorageUrl() : string | boolean

Get the storage URL

Returns
Type Description
string | boolean
methodpublicgetToken() : string

Get the authentication token

Returns
Type Description
string
methodpublicgetUser() : string

Get User account

Returns
Type Description
string
methodprotectedhttpCall(string $url, string $method, array $headers = array(),  $data = array(), string $body = null) : \Zend_Http_Response

HTTP call

Parameters
Name Type Description
$url string
$method string
$headers array
$data
$body string
Returns
Type Description
\Zend_Http_Response
methodpublicisSuccessful() : boolean

Return true is the last call was successful

Returns
Type Description
boolean
methodpublicsetAuthUrl(string $url) : void

Set the Authentication URL

Parameters
Name Type Description
$url string
methodpublicsetKey(string $key) : void

Set the authentication key

Parameters
Name Type Description
$key string
methodpublicsetServiceNet(boolean $useServiceNet = true) : void

Sets whether to use ServiceNet

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

Parameters
Name Type Description
$useServiceNet boolean
methodpublicsetUser(string $user) : void

Set the user account

Parameters
Name Type Description
$user string
Documentation was generated by phpDocumentor 2.0.0a8.