PHP Class Scalr\Service\CloudStack\Client\QueryClient

Since: 4.5.2
Author: Vlad Dobrovolskiy ([email protected])
Inheritance: implements Scalr\Service\CloudStack\Client\ClientInterface
Show file Open project: scalr/scalr

Protected Properties

Property Type Description
$apiKey string
$endpoint string
$platformName string
$secretKey string Secret Access Key
$zonesCache array

Public Methods

Method Description
__construct ( $endpoint, $apiKey, $secretKey, $cloudstack, $platform = 'cloudstack' ) Constructor
call ( $command, array $args = null, $verb = 'GET' )
getSignature ( $queryString )
resetDebug ( ) : QueryClient Resets debug mode
setDebug ( boolean $bDebug = true ) : QueryClient 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 = 3, integer $interval = 200 ) : http\Client\Response Tries to send request on several attempts.

Method Details

__construct() public method

Constructor
public __construct ( $endpoint, $apiKey, $secretKey, $cloudstack, $platform = 'cloudstack' )

call() public method

public call ( $command, array $args = null, $verb = 'GET' )
$args array

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

getSignature() public method

public getSignature ( $queryString )

resetDebug() public method

Resets debug mode
public resetDebug ( ) : QueryClient
return QueryClient

setDebug() public method

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

tryCall() protected method

Tries to send request on several attempts.
protected tryCall ( Scalr\System\Http\Client\Request $httpRequest, integer $attempts = 3, 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

$apiKey protected property

protected string $apiKey
return string

$endpoint protected property

protected string $endpoint
return string

$platformName protected property

protected string $platformName
return string

$secretKey protected property

Secret Access Key
protected string $secretKey
return string

$zonesCache protected property

protected array $zonesCache
return array