PHP Cloud Server implementation for RackSpace (tm)
THIS SOFTWARE IS PROVIDED "AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\Cloud\Server\Exception |
|
|---|---|
| package | Cloud |
| version | 0.3 |
| license | bsd |
| author | Aleksey Korzun |
| link | http://github.com/AlekseyKorzun/php-cloudservers/ |
| link | http://www.alekseykorzun.com |
__construct(string $username, string $key, string $location)
stringuser id that will be used for API
stringkey that was generated by Rackspace
stringlocation of API use wish to use
\Cloud\Server\Exception |
|---|
addBackupSchedule(int $serverId, string $weekly, string $daily, bool $isEnabled) : bool
intid of a server this back-up schedule is intended for
stringday of the week this back-up should run, look at $backupSchedules array and/or documentation for valid parameters
stringtime of the day this back-up should run, look at $backupSchedules array and/or documentation for valid parameters
boolshould this scheduled back-up be enabled or disabled, default is set to enabled.
\Cloud\Server\Exception |
|---|
booltrue on success and false on failureaddServerFile(string $file, string $content) : string[]
stringfull file path where file will be put (/etc/motd,etc)
stringcontent of the file (Welcome to my server, etc)
string[]returns array of all files pending injectionaddSharedIpGroup(string $name, int $serverId) : mixed
stringname of shared ip group you are creating
intid of server you wish to add to this group
mixedreturns json string containing id of created shared
ip group or false on failureauthenticate() : string | bool
stringboolreturns recieved token or false on failureconfirmResize(int $serverId) : bool
intid of server this confirmation is for
boolreturns true on success or false on failcreateImage(string $name, int $serverId) : mixed
stringname of new image
intserver id for which you wish to base this image on
mixedreturns json string containing details of created
image or false on failurecreateServer(string $name, int $imageRefId, int $flavorRefId, int $groupId) : mixed
stringserver name, must be unique
intserver image you wish to use
intserver flavor you wish to use
intoptional group id of server cluster
mixedreturns json string of server's configuration
or false on failuredeleteBackupSchedule(int $serverId) : bool
intid of server you wish to delete all scheduled back-ups for
boolreturns true on success or false on failuredeleteServer(int $serverId) : bool
intid of server you wish to delete
boolreturns true on success or false on faildeleteSharedIpGroup(int $groupId) : bool
intid of group you wish to delete
boolreturns true on success and false on failuredisableDebug()
enableDebug()
getBackupSchedule(int $serverId) : mixed
intid of server you wish to retrieve back-up schedule for
mixedreturns json string of current back-up schedule or
false on failuregetFlavor(string $flavorRefId) : mixed
stringid of a flavor you wish to retrieve details for
mixedreturns JSON string containing details for requested
flavor or false on failuregetFlavors(bool $isDetailed) : mixed
boolrequested detailed description of server flavors
mixedreturns json string containing available server configurations or
false on failuregetImage(string $imageRefId) : \Cloud\json
stringid of image you wish to retrieve details for
\Cloud\jsonstring containing details of requested imagegetImages($isDetailed) : mixed
mixedreturns json string of available images or false
on failuregetLimits() : mixed
mixedjson string containing current limits or false on failuregetServer(int $serverId) : mixed
intid of server this action is performed for
mixedjson string containing server details or false
on failuregetServerIp(int $serverId, string $type) : mixed
intid of server you wish to retrieve ips for
stringtype of addresses to retrieve could be private/public or false for both types.
mixedreturns json string of server addresses or false
of failuregetServers(bool $isDetailed) : mixed
boolshould API return more detailed server descriptions for available servers
mixedjson string containing current servers or false on failuregetSharedIpGroup(int $groupId) : mixed
intid of specific shared group you wish to retrieve details for
mixedreturns json string containing details about
requested group or false on failuregetSharedIpGroups(bool $isDetailed) : mixed
boolshould response contain an array of servers group has
mixedreturns json string of groups or false on failuregetToken() : mixed
mixedreturn authentication token or false on failurerebootServer(int $serverId, string $type) : bool
intid of server you wish to reboot
stringspecify what kind of reboot you wish to perform
boolreturns true on success or false on failrebuildServer(int $serverId, int $imageRefId) : bool
intid of server you wish to rebuild
intid of server image you wish to use for this rebuild
boolreturns true on success or false on failresizeServer(int $serverId, int $flavorRefId) : bool
intid of server you wish to resize
intid of a flavor you wish to use as a starting point
boolreturns true on success or false on failrevertResize(int $serverId) : bool
intid of server you wish to revert resize for
boolreturns true on success or false on failsetToken(string $tokenId)
stringtoken you wish to set
shareServerIp(int $serverId, string $serverIp, int $groupId, int $doConfigure) : bool
intid of server this action is performed for
stringIP you wish to unshare
intoptional group id of shared server
intautomaticly configure server
boolreturns true on success or false on failureunshareServerIp(int $serverId, string $serverIp) : bool
intid of server this action is performed for
stringIP you wish to unshare
boolreturns true on success or false on failureupdateServer(int $serverId, string $name, string $password) : mixed
intid of server you wish to update
stringnew server name
stringnew server password
mixedreturns false on failure or server configuration
on successrequest(string $method)
stringHTTP method that will be used for current request
\Cloud\Server\Exception |
|---|
$attempts : int
$authUris : string[]
$backupSchedules : string[]
$enableDebug : bool
$files : string[]
$location : string
$request : string
$resource : string
$response : string
$responseCode : int
$serverUri : string
$servers : string[]
$key : string
$token : string
$username : string
ATTEMPT_LIMIT : int
METHOD_AUTH : int
METHOD_DELETE : int
METHOD_POST : int
METHOD_PUT : int
USER_AGENT : string