|
@@ -92,7 +92,7 @@ func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret s
|
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (client *Client) InitWithRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) {
|
|
|
|
|
|
|
+func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) {
|
|
|
config := client.InitClientConfig()
|
|
config := client.InitClientConfig()
|
|
|
credential := &credentials.StsAssumeRoleCredential{
|
|
credential := &credentials.StsAssumeRoleCredential{
|
|
|
AccessKeyId: accessKeyId,
|
|
AccessKeyId: accessKeyId,
|
|
@@ -103,7 +103,7 @@ func (client *Client) InitWithRoleArn(regionId, accessKeyId, accessKeySecret, ro
|
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (client *Client) InitWithKeyPair(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.KeyPairCredential{
|
|
credential := &credentials.KeyPairCredential{
|
|
|
PrivateKey: privateKey,
|
|
PrivateKey: privateKey,
|
|
@@ -113,7 +113,7 @@ func (client *Client) InitWithKeyPair(regionId, publicKeyId, privateKey string,
|
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
return client.InitWithOptions(regionId, config, credential)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (client *Client) InitWithEcsInstance(regionId, roleName string) (err error) {
|
|
|
|
|
|
|
+func (client *Client) InitWithRamRoleNameOnEcs(regionId, roleName string) (err error) {
|
|
|
config := client.InitClientConfig()
|
|
config := client.InitClientConfig()
|
|
|
credential := &credentials.EcsInstanceCredential{
|
|
credential := &credentials.EcsInstanceCredential{
|
|
|
RoleName: roleName,
|
|
RoleName: roleName,
|
|
@@ -146,12 +146,12 @@ func (client *Client) DoActionWithSigner(request requests.AcsRequest, response r
|
|
|
|
|
|
|
|
// resolve endpoint
|
|
// resolve endpoint
|
|
|
resolveParam := &endpoints.ResolveParam{
|
|
resolveParam := &endpoints.ResolveParam{
|
|
|
- Domain: request.GetDomain(),
|
|
|
|
|
- Product: request.GetProduct(),
|
|
|
|
|
- RegionId: client.regionId,
|
|
|
|
|
- LocationProduct: request.GetLocationServiceCode(),
|
|
|
|
|
- LocationEndpoint: request.GetLocationEndpointType(),
|
|
|
|
|
- CommonApi: client.ProcessCommonRequest,
|
|
|
|
|
|
|
+ Domain: request.GetDomain(),
|
|
|
|
|
+ Product: request.GetProduct(),
|
|
|
|
|
+ RegionId: regionId,
|
|
|
|
|
+ LocationProduct: request.GetLocationServiceCode(),
|
|
|
|
|
+ LocationEndpointType: request.GetLocationEndpointType(),
|
|
|
|
|
+ CommonApi: client.ProcessCommonRequest,
|
|
|
}
|
|
}
|
|
|
endpoint, err := endpoints.Resolve(resolveParam)
|
|
endpoint, err := endpoints.Resolve(resolveParam)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -251,24 +251,24 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func NewClientWithKeyPair(regionId string, config *Config, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
|
|
|
|
|
|
|
+func NewClientWithRsaKeyPair(regionId string, config *Config, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
|
|
|
client = &Client{}
|
|
client = &Client{}
|
|
|
client.config = config
|
|
client.config = config
|
|
|
- err = client.InitWithKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
|
|
|
|
|
|
|
+ err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func NewClientWithEcsInstance(regionId string, config *Config, roleName string) (client *Client, err error) {
|
|
|
|
|
|
|
+func NewClientWithRamRoleNameOnEcs(regionId string, config *Config, roleName string) (client *Client, err error) {
|
|
|
client = &Client{}
|
|
client = &Client{}
|
|
|
client.config = config
|
|
client.config = config
|
|
|
- err = client.InitWithEcsInstance(regionId, roleName)
|
|
|
|
|
|
|
+ err = client.InitWithRamRoleNameOnEcs(regionId, roleName)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func NewClientWithRoleArn(regionId string, config *Config, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
|
|
|
|
|
|
|
+func NewClientWithRamRoleArn(regionId string, config *Config, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
|
|
|
client = &Client{}
|
|
client = &Client{}
|
|
|
client.config = config
|
|
client.config = config
|
|
|
- err = client.InitWithRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
|
|
|
|
|
|
|
+ err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|