package Zend_Service
inherited_from \Zend_Service_Rackspace_Abstract

 Methods

Constructor

__construct(string $user, string $key, string $authUrl = self::US_AUTH_URL
Inherited

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

Parameters

$user

string

$key

string

$authUrl

string

Authentication

authenticate() : boolean
Inherited

Returns

boolean

Change the backup schedule of a server

changeBackupSchedule(string $id, string $weekly, string $daily) : boolean

Parameters

$id

string

server's Id

$weekly

string

$daily

string

Returns

boolean

Change the server's name

changeServerName(string $id, string $name) : boolean

Parameters

$id

string

$name

string

Returns

boolean

Change the admin password of the server

changeServerPassword(string $id, string $password) : boolean

Parameters

$id

string

$password

string

Returns

boolean

Confirm resize of a server

confirmResizeServer(string $id) : boolean

During a resize operation, the original server is saved for a period of time to allow roll back if there is a problem. Once the newly resized server is tested and has been confirmed to be functioning properly, use this operation to confirm the resize. After confirmation, the original server is removed and cannot be rolled back to. All resizes are automatically confirmed after 24 hours if they are not explicitly confirmed or reverted.

Parameters

$id

string

Returns

boolean

Create an image for a serverId

createImage(string $serverId, string $name) : \Zend_Service_Rackspace_Servers_Image

Parameters

$serverId

string

$name

string

Returns

\Zend_Service_Rackspace_Servers_Image

Create a new server

createServer(array $data, array $metadata = array(), array $files = array()) : \Zend_Service_Rackspace_Servers_Server | boolean

The required parameters are specified in $data (name, imageId, falvorId) The $files is an associative array with 'serverPath' => 'localPath'

Parameters

$data

array

$metadata

array

$files

array

Returns

\Zend_Service_Rackspace_Servers_Serverboolean

Create a shared Ip group

createSharedIpGroup(string $name, string $serverId) : array | boolean

Parameters

$name

string

$serverId

string

Returns

arrayboolean

Delete an image

deleteImage(string $id) : boolean

Parameters

$id

string

Returns

boolean

Delete a server

deleteServer(string $id) : boolean

Parameters

$id

string

Returns

boolean

Delete a Shared Ip Group

deleteSharedIpGroup(integer $id) : boolean

Parameters

$id

integer

Returns

boolean

Disable the backup schedule for a server

disableBackupSchedule(string $id) : boolean

Parameters

$id

string

server's Id

Returns

boolean

Get authentication URL

getAuthUrl() : string
Inherited

Returns

string

Get the backup schedule of a server

getBackupSchedule(string $id) : array | boolean

Parameters

$id

string

server's Id

Returns

arrayboolean

Get the CDN URL

getCdnUrl() : string | boolean
Inherited

Returns

stringboolean

Get the error code of the last HTTP call

getErrorCode() : \strig
Inherited

Returns

\strig

Get the error msg of the last HTTP call

getErrorMsg() : string
Inherited

Returns

string

Get the detail of a flavor

getFlavor(string $flavorId) : array | boolean

Parameters

$flavorId

string

Returns

arrayboolean

get the HttpClient instance

getHttpClient() : \Zend_Http_Client
Inherited

Returns

\Zend_Http_Client

Get detail about an image

getImage(string $id) : \Zend_Service_Rackspace_Servers_Image | boolean

Parameters

$id

string

Returns

\Zend_Service_Rackspace_Servers_Imageboolean

Get user key

getKey() : string
Inherited

Returns

string

Get the management server URL

getManagementUrl() : string | boolean
Inherited

Returns

stringboolean

Get the specified server

getServer(string $id) : \Zend_Service_Rackspace_Servers_Server

Parameters

$id

string

Returns

\Zend_Service_Rackspace_Servers_Server

Get the server's IPs (public and private)

getServerIp(string $id) : array | boolean

Parameters

$id

string

Returns

arrayboolean

Get the Private IPs of a server

getServerPrivateIp(string $id) : array | boolean

Parameters

$id

string

Returns

arrayboolean

Get the Public IPs of a server

getServerPublicIp(string $id) : array | boolean

Parameters

$id

string

Returns

arrayboolean

Get whether we're using ServiceNet

getServiceNet() : boolean
Inherited

Returns

boolean

Get the shared IP group

getSharedIpGroup(integer $id) : \Zend_Service_Rackspace_Servers_SharedIpGroup | boolean

Parameters

$id

integer

Returns

\Zend_Service_Rackspace_Servers_SharedIpGroupboolean

Get the storage URL

getStorageUrl() : string | boolean
Inherited

Returns

stringboolean

Get the authentication token

getToken() : string
Inherited

Returns

string

Get User account

getUser() : string
Inherited

Returns

string

Return true is the last call was successful

isSuccessful() : boolean
Inherited

Returns

boolean

Get the list of the flavors

listFlavors(boolean $details = false) : array | boolean

If $details is true returns detail info

Parameters

$details

boolean

Returns

arrayboolean

Get the list of the images

listImages(boolean $details = false) : \Zend_Service_Rackspace_Servers_ImageList | boolean

Parameters

$details

boolean

Returns

\Zend_Service_Rackspace_Servers_ImageListboolean

Get the list of the servers If $details is true returns detail info

listServers(boolean $details = false) : \Zend_Service_Rackspace_Servers_ServerList | boolean

Parameters

$details

boolean

Returns

\Zend_Service_Rackspace_Servers_ServerListboolean

Get the list of shared IP groups

listSharedIpGroups(boolean $details = false) : \Zend_Service_Rackspace_Servers_SharedIpGroupList | boolean

Parameters

$details

boolean

Returns

\Zend_Service_Rackspace_Servers_SharedIpGroupListboolean

Reboot a server

rebootServer(string $id, boolean $hard = false) : boolean

$hard true is the equivalent of power cycling the server $hard false is a graceful shutdown

Parameters

$id

string

$hard

boolean

Returns

boolean

Rebuild a server

rebuildServer(string $id, string $imageId) : boolean

The rebuild function removes all data on the server and replaces it with the specified image, serverId and IP addresses will remain the same.

Parameters

$id

string

$imageId

string

Returns

boolean

Resize a server

resizeServer(string $id, string $flavorId) : boolean

The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. The original server is saved for a period of time to allow rollback if there is a problem. All resizes should be tested and explicitly confirmed, at which time the original server is removed. All resizes are automatically confirmed after 24 hours if they are not explicitly confirmed or reverted.

Parameters

$id

string

$flavorId

string

Returns

boolean

Revert resize of a server

revertResizeServer(string $id) : boolean

During a resize operation, the original server is saved for a period of time to allow for roll back if there is a problem. If you determine there is a problem with a newly resized server, use this operation to revert the resize and roll back to the original server. All resizes are automatically confirmed after 24 hours if they have not already been confirmed explicitly or reverted.

Parameters

$id

string

Returns

boolean

Set the Authentication URL

setAuthUrl(string $url) : void
Inherited

Parameters

$url

string

Set the authentication key

setKey(string $key) : void
Inherited

Parameters

$key

string

Sets whether to use ServiceNet

setServiceNet(boolean $useServiceNet = true
Inherited

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

Parameters

$useServiceNet

boolean

Set the user account

setUser(string $user) : void
Inherited

Parameters

$user

string

Share an ip address for a server (id)

shareIpAddress(string $id, string $ip, string $groupId, $configure = true) : boolean

Parameters

$id

string

server

$ip

string

$groupId

string

$configure

Returns

boolean

Unshare IP address for a server ($id)

unshareIpAddress(string $id, string $ip) : boolean

Parameters

$id

string

$ip

string

Returns

boolean

HTTP call

httpCall(string $url, string $method, array $headers = array(), $data = array(), string $body = null) : \Zend_Http_Response
Inherited

Parameters

$url

string

$method

string

$headers

array

$data

$body

string

Returns

\Zend_Http_Response

Change the name or the admin password for a server

updateServer(string $id, string $name = null, string $password = null) : boolean

Parameters

$id

string

$name

string

$password

string

Returns

boolean

 Properties

 

Authentication URL

$authUrl : string

Default

 

CDN URL

$cdnUrl : string

Default

 

HTTP error code

$errorCode : string

Default

 

Error Msg

$errorMsg : string

Default

 

$httpClient

$httpClient : \Zend_Http_Client

Default

 

Rackspace Key

$key : string

Default

 

Server management URL

$managementUrl : string

Default

 

Storage URL

$storageUrl : string

Default

 

Token of authentication

$token : string

Default

 

Do we use ServiceNet?

$useServiceNet : boolean

Default

false
 

Rackspace account name

$user : string

Default

 Constants

 

API_FORMAT

API_FORMAT = 'json' 
 

AUTHKEY_HEADER

AUTHKEY_HEADER = "X-Auth-Key" 
 

AUTHKEY_HEADER_LEGACY

AUTHKEY_HEADER_LEGACY = "X-Storage-Pass" 
 

AUTHTOKEN

AUTHTOKEN = "X-Auth-Token" 
 

AUTHTOKEN_LEGACY

AUTHTOKEN_LEGACY = "X-Storage-Token" 
 

AUTHUSER_HEADER

AUTHUSER_HEADER = "X-Auth-User" 
 

AUTHUSER_HEADER_LEGACY

AUTHUSER_HEADER_LEGACY = "X-Storage-User" 
 

CDNM_URL

CDNM_URL = "X-CDN-Management-Url" 
 

ERROR_BUILD_IN_PROGRESS

ERROR_BUILD_IN_PROGRESS = 'The build is still in progress' 
 

ERROR_IN_PROGRESS

ERROR_IN_PROGRESS = 'The item specified is still in progress' 
 

ERROR_ITEM_NOT_FOUND

ERROR_ITEM_NOT_FOUND = 'The item specified doesn\'t exist.' 
 

ERROR_LIMIT_FILE_SIZE

ERROR_LIMIT_FILE_SIZE = 'You reached the size length of a file' 
 

ERROR_NO_FILE_EXISTS

ERROR_NO_FILE_EXISTS = 'The file specified doesn\'t exist' 
 

ERROR_OVERLIMIT

ERROR_OVERLIMIT = 'You reached the limit of requests, please wait some time before retry' 
 

ERROR_PARAM_NO_ARRAY

ERROR_PARAM_NO_ARRAY = 'You must specify an array of parameters' 
 

ERROR_PARAM_NO_DAILY

ERROR_PARAM_NO_DAILY = 'You must specify a daily backup schedule' 
 

ERROR_PARAM_NO_FLAVORID

ERROR_PARAM_NO_FLAVORID = 'You must specify the server\'s flavor ID' 
 

ERROR_PARAM_NO_ID

ERROR_PARAM_NO_ID = 'You must specify the item\'s id' 
 

ERROR_PARAM_NO_IMAGEID

ERROR_PARAM_NO_IMAGEID = 'You must specify the server\'s image ID' 
 

ERROR_PARAM_NO_NAME

ERROR_PARAM_NO_NAME = 'You must specify the name' 
 

ERROR_PARAM_NO_SERVERID

ERROR_PARAM_NO_SERVERID = 'You must specify the server Id' 
 

ERROR_PARAM_NO_WEEKLY

ERROR_PARAM_NO_WEEKLY = 'You must specify a weekly backup schedule' 
 

ERROR_RESIZE_NOT_ALLOWED

ERROR_RESIZE_NOT_ALLOWED = 'The resize is not allowed' 
 

ERROR_SERVICE_UNAVAILABLE

ERROR_SERVICE_UNAVAILABLE = 'The service is unavailable' 
 

ERROR_UNAUTHORIZED

ERROR_UNAUTHORIZED = 'Unauthorized' 
 

LIMIT_FILE_SIZE

LIMIT_FILE_SIZE = 10240 
 

LIMIT_NUM_FILE

LIMIT_NUM_FILE = 5 
 

MANAGEMENT_URL

MANAGEMENT_URL = "X-Server-Management-Url" 
 

STORAGE_URL

STORAGE_URL = "X-Storage-Url" 
 

UK_AUTH_URL

UK_AUTH_URL = 'https://lon.auth.api.rackspacecloud.com' 
 

USER_AGENT

USER_AGENT = 'Zend_Service_Rackspace' 
 

US_AUTH_URL

US_AUTH_URL = 'https://auth.api.rackspacecloud.com' 
 

VERSION

VERSION = 'v1.0'