Service/Rackspace/Abstract.php

Show: PublicProtectedPrivateinherited
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 license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Rackspace  

\Zend_Service_Rackspace_Abstract

Package: Zend_Service
Children
\Zend_Service_Rackspace_Files
\Zend_Service_Rackspace_Servers

Constants

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

Properties

>VPropertyprotectedstring $authUrl
Authentication URL
Details
Type
string
>VPropertyprotectedstring $cdnUrl
CDN URL
Details
Type
string
>VPropertyprotectedstring $errorCode
HTTP error code
Details
Type
string
>VPropertyprotectedstring $errorMsg
Error Msg
Details
Type
string
>VPropertyprotected\Zend_Http_Client $httpClient
>VPropertyprotectedstring $key
Rackspace Key
Details
Type
string
>VPropertyprotectedstring $managementUrl
Server management URL
Details
Type
string
>VPropertyprotectedstring $storageUrl
Storage URL
Details
Type
string
>VPropertyprotectedstring $token
Token of authentication
Details
Type
string
>VPropertyprotectedboolean $useServiceNet = false
Do we use ServiceNet?
Default valuefalseDetails
Type
boolean
>VPropertyprotectedstring $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
NameTypeDescription
$userstring
$keystring
$authUrlstring
methodpublicauthenticate() : boolean

Authentication

Returns
TypeDescription
boolean
methodpublicgetAuthUrl() : string

Get authentication URL

Returns
TypeDescription
string
methodpublicgetCdnUrl() : string | boolean

Get the CDN URL

Returns
TypeDescription
string | boolean
methodpublicgetErrorCode() : \strig

Get the error code of the last HTTP call

Returns
TypeDescription
\strig
methodpublicgetErrorMsg() : string

Get the error msg of the last HTTP call

Returns
TypeDescription
string
methodpublicgetHttpClient() : \Zend_Http_Client

get the HttpClient instance

Returns
TypeDescription
\Zend_Http_Client
methodpublicgetKey() : string

Get user key

Returns
TypeDescription
string
methodpublicgetManagementUrl() : string | boolean

Get the management server URL

Returns
TypeDescription
string | boolean
methodpublicgetServiceNet() : boolean

Get whether we're using ServiceNet

Returns
TypeDescription
boolean
methodpublicgetStorageUrl() : string | boolean

Get the storage URL

Returns
TypeDescription
string | boolean
methodpublicgetToken() : string

Get the authentication token

Returns
TypeDescription
string
methodpublicgetUser() : string

Get User account

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

HTTP call

Parameters
NameTypeDescription
$urlstring
$methodstring
$headersarray
$data
$bodystring
Returns
TypeDescription
\Zend_Http_Response
methodpublicisSuccessful() : boolean

Return true is the last call was successful

Returns
TypeDescription
boolean
methodpublicsetAuthUrl(string $url) : void

Set the Authentication URL

Parameters
NameTypeDescription
$urlstring
methodpublicsetKey(string $key) : void

Set the authentication key

Parameters
NameTypeDescription
$keystring
methodpublicsetServiceNet(boolean $useServiceNet = true) : void

Sets whether to use ServiceNet

ServiceNet is Rackspace's internal network. Bandwidth on ServiceNet is not charged.
Parameters
NameTypeDescription
$useServiceNetboolean
methodpublicsetUser(string $user) : void

Set the user account

Parameters
NameTypeDescription
$userstring
Documentation was generated by phpDocumentor 2.2.0 .