Service/Rackspace/Servers.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_Servers

Package: Zend_Service
Parent(s)
\Zend_Service_Rackspace_Abstract

Constants

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

Methods

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

Change the backup schedule of a server

Parameters
NameTypeDescription
$idstring

server's Id

$weeklystring
$dailystring
Returns
TypeDescription
boolean
methodpublicchangeServerName(string $id, string $name) : boolean

Change the server's name

Parameters
NameTypeDescription
$idstring
$namestring
Returns
TypeDescription
boolean
methodpublicchangeServerPassword(string $id, string $password) : boolean

Change the admin password of the server

Parameters
NameTypeDescription
$idstring
$passwordstring
Returns
TypeDescription
boolean
methodpublicconfirmResizeServer(string $id) : boolean

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
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpubliccreateImage(string $serverId, string $name) : \Zend_Service_Rackspace_Servers_Image

Create an image for a serverId

Parameters
NameTypeDescription
$serverIdstring
$namestring
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_Image
methodpubliccreateServer(array $data, array $metadata = array(), array $files = array()) : \Zend_Service_Rackspace_Servers_Server | boolean

Create a new server

The required parameters are specified in $data (name, imageId, falvorId) The $files is an associative array with 'serverPath' => 'localPath'
Parameters
NameTypeDescription
$dataarray
$metadataarray
$filesarray
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_Server | boolean
methodpubliccreateSharedIpGroup(string $name, string $serverId) : array | boolean

Create a shared Ip group

Parameters
NameTypeDescription
$namestring
$serverIdstring
Returns
TypeDescription
array | boolean
methodpublicdeleteImage(string $id) : boolean

Delete an image

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicdeleteServer(string $id) : boolean

Delete a server

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicdeleteSharedIpGroup(integer $id) : boolean

Delete a Shared Ip Group

Parameters
NameTypeDescription
$idinteger
Returns
TypeDescription
boolean
methodpublicdisableBackupSchedule(string $id) : boolean

Disable the backup schedule for a server

Parameters
NameTypeDescription
$idstring

server's Id

Returns
TypeDescription
boolean
methodpublicgetBackupSchedule(string $id) : array | boolean

Get the backup schedule of a server

Parameters
NameTypeDescription
$idstring

server's Id

Returns
TypeDescription
array | boolean
methodpublicgetFlavor(string $flavorId) : array | boolean

Get the detail of a flavor

Parameters
NameTypeDescription
$flavorIdstring
Returns
TypeDescription
array | boolean
methodpublicgetImage(string $id) : \Zend_Service_Rackspace_Servers_Image | boolean

Get detail about an image

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_Image | boolean
methodpublicgetServer(string $id) : \Zend_Service_Rackspace_Servers_Server

Get the specified server

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_Server
methodpublicgetServerIp(string $id) : array | boolean

Get the server's IPs (public and private)

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
array | boolean
methodpublicgetServerPrivateIp(string $id) : array | boolean

Get the Private IPs of a server

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
array | boolean
methodpublicgetServerPublicIp(string $id) : array | boolean

Get the Public IPs of a server

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
array | boolean
methodpublicgetSharedIpGroup(integer $id) : \Zend_Service_Rackspace_Servers_SharedIpGroup | boolean

Get the shared IP group

Parameters
NameTypeDescription
$idinteger
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_SharedIpGroup | boolean
methodpubliclistFlavors(boolean $details = false) : array | boolean

Get the list of the flavors

If $details is true returns detail info
Parameters
NameTypeDescription
$detailsboolean
Returns
TypeDescription
array | boolean
methodpubliclistImages(boolean $details = false) : \Zend_Service_Rackspace_Servers_ImageList | boolean

Get the list of the images

Parameters
NameTypeDescription
$detailsboolean
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_ImageList | boolean
methodpubliclistServers(boolean $details = false) : \Zend_Service_Rackspace_Servers_ServerList | boolean

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

Parameters
NameTypeDescription
$detailsboolean
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_ServerList | boolean
methodpubliclistSharedIpGroups(boolean $details = false) : \Zend_Service_Rackspace_Servers_SharedIpGroupList | boolean

Get the list of shared IP groups

Parameters
NameTypeDescription
$detailsboolean
Returns
TypeDescription
\Zend_Service_Rackspace_Servers_SharedIpGroupList | boolean
methodpublicrebootServer(string $id, boolean $hard = false) : boolean

Reboot a server

$hard true is the equivalent of power cycling the server $hard false is a graceful shutdown
Parameters
NameTypeDescription
$idstring
$hardboolean
Returns
TypeDescription
boolean
methodpublicrebuildServer(string $id, string $imageId) : boolean

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
NameTypeDescription
$idstring
$imageIdstring
Returns
TypeDescription
boolean
methodpublicresizeServer(string $id, string $flavorId) : boolean

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
NameTypeDescription
$idstring
$flavorIdstring
Returns
TypeDescription
boolean
methodpublicrevertResizeServer(string $id) : boolean

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
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicshareIpAddress(string $id, string $ip, string $groupId,  $configure = true) : boolean

Share an ip address for a server (id)

Parameters
NameTypeDescription
$idstring

server

$ipstring
$groupIdstring
$configure
Returns
TypeDescription
boolean
methodpublicunshareIpAddress(string $id, string $ip) : boolean

Unshare IP address for a server ($id)

Parameters
NameTypeDescription
$idstring
$ipstring
Returns
TypeDescription
boolean
methodprotectedupdateServer(string $id, string $name = null, string $password = null) : boolean

Change the name or the admin password for a server

Parameters
NameTypeDescription
$idstring
$namestring
$passwordstring
Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.2.0 .