You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.9 KiB
75 lines
1.9 KiB
4 months ago
|
<?php
|
||
|
|
||
|
namespace AlibabaCloud\Client\Profile;
|
||
|
|
||
|
use AlibabaCloud\Client\AlibabaCloud;
|
||
|
use AlibabaCloud\Client\Clients\Client;
|
||
|
use AlibabaCloud\Client\Exception\ClientException;
|
||
|
|
||
|
/**
|
||
|
* Class DefaultProfile
|
||
|
*
|
||
|
* @package AlibabaCloud\Client\Profile
|
||
|
* @codeCoverageIgnore
|
||
|
* @deprecated deprecated since version 2.0, Use AlibabaCloud instead.
|
||
|
*/
|
||
|
class DefaultProfile
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @param string $regionId
|
||
|
* @param string $accessKeyId
|
||
|
* @param string $accessKeySecret
|
||
|
*
|
||
|
* @return Client
|
||
|
* @throws ClientException
|
||
|
*/
|
||
|
public static function getProfile($regionId, $accessKeyId, $accessKeySecret)
|
||
|
{
|
||
|
return AlibabaCloud::accessKeyClient($accessKeyId, $accessKeySecret)
|
||
|
->regionId($regionId);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param string $regionId
|
||
|
* @param string $accessKeyId
|
||
|
* @param string $accessKeySecret
|
||
|
* @param string $roleArn
|
||
|
* @param string $roleSessionName
|
||
|
*
|
||
|
* @return Client
|
||
|
* @throws ClientException
|
||
|
*/
|
||
|
public static function getRamRoleArnProfile($regionId, $accessKeyId, $accessKeySecret, $roleArn, $roleSessionName)
|
||
|
{
|
||
|
return AlibabaCloud::ramRoleArnClient($accessKeyId, $accessKeySecret, $roleArn, $roleSessionName)
|
||
|
->regionId($regionId);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param string $regionId
|
||
|
* @param string $roleName
|
||
|
*
|
||
|
* @return Client
|
||
|
* @throws ClientException
|
||
|
*/
|
||
|
public static function getEcsRamRoleProfile($regionId, $roleName)
|
||
|
{
|
||
|
return AlibabaCloud::ecsRamRoleClient($roleName)
|
||
|
->regionId($regionId);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param string $regionId
|
||
|
* @param string $bearerToken
|
||
|
*
|
||
|
* @return Client
|
||
|
* @throws ClientException
|
||
|
*/
|
||
|
public static function getBearerTokenProfile($regionId, $bearerToken)
|
||
|
{
|
||
|
return AlibabaCloud::bearerTokenClient($bearerToken)
|
||
|
->regionId($regionId);
|
||
|
}
|
||
|
}
|