Explorar el Código

EHPC SDK Auto Released By qianzheng.llc,Version:1.58.1

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao hace 6 años
padre
commit
6c7e87673c

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2019-04-23 Version: 1.58.1
+1, Support mounting multiple volumes using different protocol
+2, Support scaling out cross AZ
+
 2019-04-23 Version: 1.58.0
 1, Add a new api, QueryDomainByDomainName.
 

+ 28 - 5
services/ehpc/client.go

@@ -18,6 +18,7 @@ package ehpc
 import (
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
 )
 
 // Client is the sdk client struct, each func corresponds to an OpenAPI
@@ -32,6 +33,20 @@ func NewClient() (client *Client, err error) {
 	return
 }
 
+// NewClientWithProvider creates a sdk client with providers
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
+	client = &Client{}
+	var pc provider.Provider
+	if len(providers) == 0 {
+		pc = provider.DefaultChain
+	} else {
+		pc = provider.NewProviderChain(providers)
+	}
+	err = client.InitWithProviderChain(regionId, pc)
+	return
+}
+
 // NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
 // this is the common api to create a sdk client
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
@@ -41,7 +56,7 @@ func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.C
 }
 
 // NewClientWithAccessKey is a shortcut to create sdk client with accesskey
-// usage: https://help.aliyun.com/document_detail/66217.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
@@ -49,7 +64,7 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
 }
 
 // NewClientWithStsToken is a shortcut to create sdk client with sts token
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
@@ -57,15 +72,23 @@ func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToke
 }
 
 // NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
 	return
 }
 
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+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
+}
+
 // NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
-// usage: https://help.aliyun.com/document_detail/66223.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
@@ -73,7 +96,7 @@ func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client,
 }
 
 // NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
-// attention: rsa key pair auth is only Japan regions available
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)

+ 2 - 0
services/ehpc/struct_instance_type_info.go

@@ -20,4 +20,6 @@ type InstanceTypeInfo struct {
 	InstanceType   string  `json:"InstanceType" xml:"InstanceType"`
 	SpotStrategy   string  `json:"SpotStrategy" xml:"SpotStrategy"`
 	SpotPriceLimit float64 `json:"SpotPriceLimit" xml:"SpotPriceLimit"`
+	ZoneId         string  `json:"ZoneId" xml:"ZoneId"`
+	VSwitchId      string  `json:"VSwitchId" xml:"VSwitchId"`
 }

+ 3 - 0
services/ehpc/struct_node_info.go

@@ -21,17 +21,20 @@ type NodeInfo struct {
 	Expired         bool                     `json:"Expired" xml:"Expired"`
 	ExpiredTime     string                   `json:"ExpiredTime" xml:"ExpiredTime"`
 	ImageId         string                   `json:"ImageId" xml:"ImageId"`
+	VSwitchId       string                   `json:"VSwitchId" xml:"VSwitchId"`
 	Version         string                   `json:"Version" xml:"Version"`
 	ImageOwnerAlias string                   `json:"ImageOwnerAlias" xml:"ImageOwnerAlias"`
 	CreateMode      string                   `json:"CreateMode" xml:"CreateMode"`
 	Location        string                   `json:"Location" xml:"Location"`
 	RegionId        string                   `json:"RegionId" xml:"RegionId"`
+	ZoneId          string                   `json:"ZoneId" xml:"ZoneId"`
 	CreatedByEhpc   bool                     `json:"CreatedByEhpc" xml:"CreatedByEhpc"`
 	Id              string                   `json:"Id" xml:"Id"`
 	HostName        string                   `json:"HostName" xml:"HostName"`
 	Status          string                   `json:"Status" xml:"Status"`
 	AddTime         string                   `json:"AddTime" xml:"AddTime"`
 	SpotStrategy    string                   `json:"SpotStrategy" xml:"SpotStrategy"`
+	VpcId           string                   `json:"VpcId" xml:"VpcId"`
 	Roles           RolesInListNodesNoPaging `json:"Roles" xml:"Roles"`
 	TotalResources  TotalResources           `json:"TotalResources" xml:"TotalResources"`
 	UsedResources   UsedResources            `json:"UsedResources" xml:"UsedResources"`