\AlibabaCloud\Client\TraitsClientTrait

Trait of the manage clients.

Summary

Methods
Properties
Constants
set()
all()
del()
flush()
getGlobalClient()
getDefaultClient()
get()
has()
load()
client()
accessKeyClient()
ramRoleArnClient()
ecsRamRoleClient()
bearerTokenClient()
stsClient()
rsaKeyPairClient()
No public properties found
No constants found
No protected methods found
$clients
N/A
No private methods found
No private properties found
N/A

Properties

$clients

$clients : array

Type

array — Containers of Clients

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