Constants

VERSION

VERSION = '1.5.29'

Version of the Client

Properties

$clients

$clients : array

Type

array — Containers of Clients

$defaultRegionId

$defaultRegionId : string|null

Type

string|null — Default RegionId

$hosts

$hosts : array

Type

array — Host cache.

$mockQueue

$mockQueue : array

Type

array

$mock

$mock : \GuzzleHttp\Handler\MockHandler

Type

\GuzzleHttp\Handler\MockHandler

$history

$history : array

Type

array

$isRememberHistory

$isRememberHistory : boolean

Type

boolean

$logStartTime

$logStartTime : float

Type

float

$logFormat

$logFormat : string

Type

string

$ts

$ts : \DateTime

Type

\DateTime

Methods

all()

all() : array

Get all clients.

Returns

array

del()

del(string  $clientName) 

Delete the client by specifying name.

Parameters

string $clientName

Throws

\AlibabaCloud\Client\Exception\ClientException

flush()

flush() : void

Delete all clients.

getGlobalClient()

getGlobalClient() 

Throws

\AlibabaCloud\Client\Exception\ClientException

getDefaultClient()

getDefaultClient() : \AlibabaCloud\Client\Clients\Client

Get the default client.

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\Client

get()

get(string  $clientName) : \AlibabaCloud\Client\Clients\Client

Get the Client instance by name.

Parameters

string $clientName

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\Client

has()

has(string  $clientName) : boolean

Determine whether there is a client.

Parameters

string $clientName

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

boolean

load()

load() : array

A list of additional files to load.

Throws

\AlibabaCloud\Client\Exception\ClientException

when a file has a syntax error or does not exist or is not readable

Returns

array

accessKeyClient()

accessKeyClient(string  $accessKeyId, string  $accessKeySecret) : \AlibabaCloud\Client\Clients\AccessKeyClient

Use the AccessKey to complete the authentication.

Parameters

string $accessKeyId
string $accessKeySecret

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\AccessKeyClient

ramRoleArnClient()

ramRoleArnClient(string  $accessKeyId, string  $accessKeySecret, string  $roleArn, string  $roleSessionName, string|array  $policy = '') : \AlibabaCloud\Client\Clients\RamRoleArnClient

Use the AssumeRole of the RAM account to complete the authentication.

Parameters

string $accessKeyId
string $accessKeySecret
string $roleArn
string $roleSessionName
string|array $policy

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\RamRoleArnClient

ecsRamRoleClient()

ecsRamRoleClient(string  $roleName) : \AlibabaCloud\Client\Clients\EcsRamRoleClient

Use the RAM role of an ECS instance to complete the authentication.

Parameters

string $roleName

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\EcsRamRoleClient

bearerTokenClient()

bearerTokenClient(string  $bearerToken) : \AlibabaCloud\Client\Clients\BearerTokenClient

Use the Bearer Token to complete the authentication.

Parameters

string $bearerToken

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\BearerTokenClient

stsClient()

stsClient(string  $accessKeyId, string  $accessKeySecret, string  $securityToken = '') : \AlibabaCloud\Client\Clients\StsClient

Use the STS Token to complete the authentication.

Parameters

string $accessKeyId

Access key ID

string $accessKeySecret

Access Key Secret

string $securityToken

Security Token

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\StsClient

rsaKeyPairClient()

rsaKeyPairClient(string  $publicKeyId, string  $privateKeyFile) : \AlibabaCloud\Client\Clients\RsaKeyPairClient

Use the RSA key pair to complete the authentication (supported only on Japanese site)

Parameters

string $publicKeyId
string $privateKeyFile

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Clients\RsaKeyPairClient

setGlobalRegionId()

setGlobalRegionId(  $regionId) 

Parameters

$regionId

Throws

\AlibabaCloud\Client\Exception\ClientException

getGlobalRegionId()

getGlobalRegionId() : string|null

Returns

string|null

getDefaultRegionId()

getDefaultRegionId() : string|null

Get the default RegionId.

Returns

string|null

setDefaultRegionId()

setDefaultRegionId(string  $regionId) 

Set the default RegionId.

Parameters

string $regionId

Throws

\AlibabaCloud\Client\Exception\ClientException

resolveHost()

resolveHost(string  $product, string  $regionId = \AlibabaCloud\Client\Regions\LocationService::GLOBAL_REGION) : string

Resolve host based on product name and region.

Parameters

string $product
string $regionId

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

string

isGlobalProduct()

isGlobalProduct(  $productCode) : boolean

Parameters

$productCode

Returns

boolean

resolveHostByStatic()

resolveHostByStatic(string  $product, string  $regionId) : string

Parameters

string $product
string $regionId

Returns

string

addHost()

addHost(string  $product, string  $host, string  $regionId = \AlibabaCloud\Client\Regions\LocationService::GLOBAL_REGION) : void

Add host based on product name and region.

Parameters

string $product
string $host
string $regionId

Throws

\AlibabaCloud\Client\Exception\ClientException

resolveHostByRule()

resolveHostByRule(\AlibabaCloud\Client\Request\Request  $request) : string

Parameters

\AlibabaCloud\Client\Request\Request $request

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

string

appendUserAgent()

appendUserAgent(string  $name, string  $value) 

Parameters

string $name
string $value

Throws

\AlibabaCloud\Client\Exception\ClientException

withUserAgent()

withUserAgent(array  $userAgent) 

Parameters

array $userAgent

rpcRequest()

rpcRequest(array  $options = array()) : \AlibabaCloud\Client\Request\RpcRequest

Parameters

array $options

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Request\RpcRequest

rpc()

rpc(array  $options = array()) : \AlibabaCloud\Client\Request\RpcRequest

Parameters

array $options

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Request\RpcRequest

roaRequest()

roaRequest(array  $options = array()) : \AlibabaCloud\Client\Request\RoaRequest

Parameters

array $options

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Request\RoaRequest

roa()

roa(array  $options = array()) : \AlibabaCloud\Client\Request\RoaRequest

Parameters

array $options

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

\AlibabaCloud\Client\Request\RoaRequest

mockResponse()

mockResponse(integer  $status = 200, array  $headers = array(), array|string|object  $body = null) 

Parameters

integer $status
array $headers
array|string|object $body

mockRequestException()

mockRequestException(string  $message, \Psr\Http\Message\RequestInterface  $request, \Psr\Http\Message\ResponseInterface|null  $response = null, \Exception|null  $previous = null, array  $handlerContext = array()) 

Parameters

string $message
\Psr\Http\Message\RequestInterface $request
\Psr\Http\Message\ResponseInterface|null $response
\Exception|null $previous
array $handlerContext

cancelMock()

cancelMock() 

hasMock()

hasMock() : boolean

Returns

boolean

getMock()

getMock() : \GuzzleHttp\Handler\MockHandler

Returns

\GuzzleHttp\Handler\MockHandler

getHistory()

getHistory() : array

Returns

array

forgetHistory()

forgetHistory() 

notRememberHistory()

notRememberHistory() 

rememberHistory()

rememberHistory() 

isRememberHistory()

isRememberHistory() : boolean

Returns

boolean

referenceHistory()

referenceHistory() : array

Returns

array

countHistory()

countHistory() : integer

Returns

integer

getLogFormat()

getLogFormat() : string

Returns

string

setLogFormat()

setLogFormat(string  $formatter) 

Apache Common Log Format.

Parameters

string $formatter

__callStatic()

__callStatic(string  $product, array  $arguments) : object

This static method can directly call the specific service.

Parameters

string $product
array $arguments

Throws

\AlibabaCloud\Client\Exception\ClientException

Returns

object

createHandlerStack()

createHandlerStack() 

getCost()

getCost() : float|mixed

Returns

float|mixed