PHP Class Scalr\Service\OpenStack\Client\RestClient

Since: 06.12.2012
Author: Vitaliy Demidov ([email protected])
Inheritance: implements Scalr\Service\OpenStack\Client\ClientInterface
Show file Open project: scalr/scalr

Protected Properties

Property Type Description
$config Scalr\Service\OpenStack\OpenStackConfig OpenStack config

Public Methods

Method Description
__construct ( OpenStackConfig $config ) Constructor
auth ( ) : object Performs an authentication request
call ( $service, $path = '/', array $options = null, $verb = 'GET', Scalr\Service\OpenStack\Type\AppFormat $accept = null, $auth = true )
getConfig ( ) : OpenStackConfig Gets OpenStack config
resetDebug ( ) : RestClient Resets debug mode
setDebug ( boolean $bDebug = true ) : RestClient Sets debug mode

Protected Methods

Method Description
createHttpRequest ( ) : Scalr\System\Http\Client\Request Creates new http Request object
tryCall ( Scalr\System\Http\Client\Request $httpRequest, integer $attempts = 1, integer $interval = 200 ) : http\Client\Response Tries to send request on several attempts.

Method Details

__construct() public method

Constructor
public __construct ( OpenStackConfig $config )
$config Scalr\Service\OpenStack\OpenStackConfig A OpenStack config.

auth() public method

Performs an authentication request
public auth ( ) : object
return object Returns result

call() public method

public call ( $service, $path = '/', array $options = null, $verb = 'GET', Scalr\Service\OpenStack\Type\AppFormat $accept = null, $auth = true )
$options array
$accept Scalr\Service\OpenStack\Type\AppFormat

createHttpRequest() protected method

Creates new http Request object
protected createHttpRequest ( ) : Scalr\System\Http\Client\Request
return Scalr\System\Http\Client\Request Returns new http Request object

getConfig() public method

Gets OpenStack config
public getConfig ( ) : OpenStackConfig
return Scalr\Service\OpenStack\OpenStackConfig A OpenStack config.

resetDebug() public method

Resets debug mode
public resetDebug ( ) : RestClient
return RestClient

setDebug() public method

Sets debug mode
public setDebug ( boolean $bDebug = true ) : RestClient
$bDebug boolean ptional If true it will output debug per request into stdout
return RestClient

tryCall() protected method

Tries to send request on several attempts.
protected tryCall ( Scalr\System\Http\Client\Request $httpRequest, integer $attempts = 1, integer $interval = 200 ) : http\Client\Response
$httpRequest Scalr\System\Http\Client\Request
$attempts integer Attempts count.
$interval integer An sleep interval between an attempts in microseconds.
return http\Client\Response Returns http Response if success.

Property Details

$config protected property

OpenStack config
protected OpenStackConfig,Scalr\Service\OpenStack $config
return Scalr\Service\OpenStack\OpenStackConfig