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

Public Member Functions

 listServers ($details=false)
 Get the list of the servers If $details is true returns detail info.
 
 getServer ($id)
 Get the specified server.
 
 createServer (array $data, $metadata=array(), $files=array())
 Create a new server.
 
 changeServerName ($id, $name)
 Change the server's name.
 
 changeServerPassword ($id, $password)
 Change the admin password of the server.
 
 deleteServer ($id)
 Delete a server.
 
 getServerIp ($id)
 Get the server's IPs (public and private)
 
 getServerPublicIp ($id)
 Get the Public IPs of a server.
 
 getServerPrivateIp ($id)
 Get the Private IPs of a server.
 
 shareIpAddress ($id, $ip, $groupId, $configure=true)
 Share an ip address for a server (id)
 
 unshareIpAddress ($id, $ip)
 Unshare IP address for a server ($id)
 
 rebootServer ($id, $hard=false)
 Reboot a server.
 
 rebuildServer ($id, $imageId)
 Rebuild a server.
 
 resizeServer ($id, $flavorId)
 Resize a server.
 
 confirmResizeServer ($id)
 Confirm resize of a server.
 
 revertResizeServer ($id)
 Revert resize of a server.
 
 listFlavors ($details=false)
 Get the list of the flavors.
 
 getFlavor ($flavorId)
 Get the detail of a flavor.
 
 listImages ($details=false)
 Get the list of the images.
 
 getImage ($id)
 Get detail about an image.
 
 createImage ($serverId, $name)
 Create an image for a serverId.
 
 deleteImage ($id)
 Delete an image.
 
 getBackupSchedule ($id)
 Get the backup schedule of a server.
 
 changeBackupSchedule ($id, $weekly, $daily)
 Change the backup schedule of a server.
 
 disableBackupSchedule ($id)
 Disable the backup schedule for a server.
 
 listSharedIpGroups ($details=false)
 Get the list of shared IP groups.
 
 getSharedIpGroup ($id)
 Get the shared IP group.
 
 createSharedIpGroup ($name, $serverId)
 Create a shared Ip group.
 
 deleteSharedIpGroup ($id)
 Delete a Shared Ip Group.
 
- Public Member Functions inherited from Zend_Service_Rackspace_Abstract
 __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 LIMIT_FILE_SIZE = 10240
 
const LIMIT_NUM_FILE = 5
 
const ERROR_SERVICE_UNAVAILABLE = 'The service is unavailable'
 
const ERROR_UNAUTHORIZED = 'Unauthorized'
 
const ERROR_OVERLIMIT = 'You reached the limit of requests, please wait some time before retry'
 
const ERROR_PARAM_NO_ID = 'You must specify the item\'s id'
 
const ERROR_PARAM_NO_NAME = 'You must specify the name'
 
const ERROR_PARAM_NO_SERVERID = 'You must specify the server Id'
 
const ERROR_PARAM_NO_IMAGEID = 'You must specify the server\'s image ID'
 
const ERROR_PARAM_NO_FLAVORID = 'You must specify the server\'s flavor ID'
 
const ERROR_PARAM_NO_ARRAY = 'You must specify an array of parameters'
 
const ERROR_PARAM_NO_WEEKLY = 'You must specify a weekly backup schedule'
 
const ERROR_PARAM_NO_DAILY = 'You must specify a daily backup schedule'
 
const ERROR_ITEM_NOT_FOUND = 'The item specified doesn\'t exist.'
 
const ERROR_NO_FILE_EXISTS = 'The file specified doesn\'t exist'
 
const ERROR_LIMIT_FILE_SIZE = 'You reached the size length of a file'
 
const ERROR_IN_PROGRESS = 'The item specified is still in progress'
 
const ERROR_BUILD_IN_PROGRESS = 'The build is still in progress'
 
const ERROR_RESIZE_NOT_ALLOWED = 'The resize is not allowed'
 
- Public Attributes inherited from Zend_Service_Rackspace_Abstract
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

 updateServer ($id, $name=null, $password=null)
 Change the name or the admin password for a server.
 
- Protected Member Functions inherited from Zend_Service_Rackspace_Abstract
 httpCall ($url, $method, $headers=array(), $data=array(), $body=null)
 HTTP call.
 

Additional Inherited Members

- Protected Attributes inherited from Zend_Service_Rackspace_Abstract
 $key
 
 $user
 
 $token
 
 $authUrl
 
 $httpClient
 
 $errorMsg
 
 $errorCode
 
 $storageUrl
 
 $cdnUrl
 
 $managementUrl
 
 $useServiceNet = false
 

Member Function Documentation

changeBackupSchedule (   $id,
  $weekly,
  $daily 
)

Change the backup schedule of a server.

Parameters
string$idserver's Id
string$weekly
string$daily
Returns
boolean
changeServerName (   $id,
  $name 
)

Change the server's name.

Parameters
string$id
string$name
Returns
boolean
changeServerPassword (   $id,
  $password 
)

Change the admin password of the server.

Parameters
string$id
string$password
Returns
boolean
confirmResizeServer (   $id)

Confirm resize of a server.

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
string$id
Returns
boolean
createImage (   $serverId,
  $name 
)

Create an image for a serverId.

Parameters
string$serverId
string$name
Returns
Zend_Service_Rackspace_Servers_Image
createServer ( array  $data,
  $metadata = array(),
  $files = array() 
)

Create a new server.

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

Parameters
array$data
array$metadata
array$files
Returns
Zend_Service_Rackspace_Servers_Server|boolean
createSharedIpGroup (   $name,
  $serverId 
)

Create a shared Ip group.

Parameters
string$name
string$serverId
Returns
array|boolean
deleteImage (   $id)

Delete an image.

Parameters
string$id
Returns
boolean
deleteServer (   $id)

Delete a server.

Parameters
string$id
Returns
boolean
deleteSharedIpGroup (   $id)

Delete a Shared Ip Group.

Parameters
integer$id
Returns
boolean
disableBackupSchedule (   $id)

Disable the backup schedule for a server.

Parameters
string$idserver's Id
Returns
boolean
getBackupSchedule (   $id)

Get the backup schedule of a server.

Parameters
string$idserver's Id
Returns
array|boolean
getFlavor (   $flavorId)

Get the detail of a flavor.

Parameters
string$flavorId
Returns
array|boolean
getImage (   $id)

Get detail about an image.

Parameters
string$id
Returns
Zend_Service_Rackspace_Servers_Image|boolean
getServer (   $id)

Get the specified server.

Parameters
string$id
Returns
Zend_Service_Rackspace_Servers_Server
getServerIp (   $id)

Get the server's IPs (public and private)

Parameters
string$id
Returns
array|boolean
getServerPrivateIp (   $id)

Get the Private IPs of a server.

Parameters
string$id
Returns
array|boolean
getServerPublicIp (   $id)

Get the Public IPs of a server.

Parameters
string$id
Returns
array|boolean
getSharedIpGroup (   $id)

Get the shared IP group.

Parameters
integer$id
Returns
Zend_Service_Rackspace_Servers_SharedIpGroup|boolean
listFlavors (   $details = false)

Get the list of the flavors.

If $details is true returns detail info

Parameters
boolean$details
Returns
array|boolean
listImages (   $details = false)

Get the list of the images.

Parameters
boolean$details
Returns
Zend_Service_Rackspace_Servers_ImageList|boolean
listServers (   $details = false)

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

Parameters
boolean$details
Returns
Zend_Service_Rackspace_Servers_ServerList|boolean
listSharedIpGroups (   $details = false)

Get the list of shared IP groups.

Parameters
boolean$details
Returns
Zend_Service_Rackspace_Servers_SharedIpGroupList|boolean
rebootServer (   $id,
  $hard = false 
)

Reboot a server.

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

Parameters
string$id
boolean$hard
Returns
boolean
rebuildServer (   $id,
  $imageId 
)

Rebuild a server.

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
string$id
string$imageId
Returns
boolean
resizeServer (   $id,
  $flavorId 
)

Resize a server.

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
string$id
string$flavorId
Returns
boolean
revertResizeServer (   $id)

Revert resize of a server.

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
string$id
Returns
boolean
shareIpAddress (   $id,
  $ip,
  $groupId,
  $configure = true 
)

Share an ip address for a server (id)

Parameters
string$idserver
string$ip
string$groupId
Returns
boolean
unshareIpAddress (   $id,
  $ip 
)

Unshare IP address for a server ($id)

Parameters
string$id
string$ip
Returns
boolean
updateServer (   $id,
  $name = null,
  $password = null 
)
protected

Change the name or the admin password for a server.

Parameters
string$id
string$name
string$password
Returns
boolean

Member Data Documentation

const ERROR_BUILD_IN_PROGRESS = 'The build is still in progress'
const ERROR_IN_PROGRESS = 'The item specified is still in progress'
const ERROR_ITEM_NOT_FOUND = 'The item specified doesn\'t exist.'
const ERROR_LIMIT_FILE_SIZE = 'You reached the size length of a file'
const ERROR_NO_FILE_EXISTS = 'The file specified doesn\'t exist'
const ERROR_OVERLIMIT = 'You reached the limit of requests, please wait some time before retry'
const ERROR_PARAM_NO_ARRAY = 'You must specify an array of parameters'
const ERROR_PARAM_NO_DAILY = 'You must specify a daily backup schedule'
const ERROR_PARAM_NO_FLAVORID = 'You must specify the server\'s flavor ID'
const ERROR_PARAM_NO_ID = 'You must specify the item\'s id'
const ERROR_PARAM_NO_IMAGEID = 'You must specify the server\'s image ID'
const ERROR_PARAM_NO_NAME = 'You must specify the name'
const ERROR_PARAM_NO_SERVERID = 'You must specify the server Id'
const ERROR_PARAM_NO_WEEKLY = 'You must specify a weekly backup schedule'
const ERROR_RESIZE_NOT_ALLOWED = 'The resize is not allowed'
const ERROR_SERVICE_UNAVAILABLE = 'The service is unavailable'
const ERROR_UNAUTHORIZED = 'Unauthorized'
const LIMIT_FILE_SIZE = 10240
const LIMIT_NUM_FILE = 5