|
@@ -136,6 +136,18 @@ func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret,
|
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (client *Client) InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (err error) {
|
|
|
|
|
+ config := client.InitClientConfig()
|
|
|
|
|
+ credential := &credentials.RamRoleArnCredential{
|
|
|
|
|
+ AccessKeyId: accessKeyId,
|
|
|
|
|
+ AccessKeySecret: accessKeySecret,
|
|
|
|
|
+ RoleArn: roleArn,
|
|
|
|
|
+ RoleSessionName: roleSessionName,
|
|
|
|
|
+ Policy: policy,
|
|
|
|
|
+ }
|
|
|
|
|
+ return client.InitWithOptions(regionId, config, credential)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) {
|
|
func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) {
|
|
|
config := client.InitClientConfig()
|
|
config := client.InitClientConfig()
|
|
|
credential := &credentials.RsaKeyPairCredential{
|
|
credential := &credentials.RsaKeyPairCredential{
|
|
@@ -392,6 +404,12 @@ func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, role
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
|
|
|
|
|
+ client = &Client{}
|
|
|
|
|
+ err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
|
|
|
|
|
+ return
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
|
|
func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
|
|
|
client = &Client{}
|
|
client = &Client{}
|
|
|
err = client.InitWithEcsRamRole(regionId, roleName)
|
|
err = client.InitWithEcsRamRole(regionId, roleName)
|