Parcourir la source

Generated 2019-03-06 for Dbs.

sdk-team il y a 5 ans
Parent
commit
95f65ba300

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2020-02-12 Version: v1.60.358
+- Generated 2019-03-06 for `Dbs`.
+- Add Full showStorageTyp.
+
 2020-02-12 Version: v1.60.357
 - Generated 2018-01-11 for `rtc`.
 - Support mau.

+ 25 - 0
services/dbs/client.go

@@ -16,6 +16,8 @@ package dbs
 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
 
 import (
+	"reflect"
+
 	"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"
@@ -26,10 +28,25 @@ type Client struct {
 	sdk.Client
 }
 
+// SetClientProperty Set Property by Reflect
+func SetClientProperty(client *Client, propertyName string, propertyValue interface{}) {
+	v := reflect.ValueOf(client).Elem()
+	if v.FieldByName(propertyName).IsValid() && v.FieldByName(propertyName).CanSet() {
+		v.FieldByName(propertyName).Set(reflect.ValueOf(propertyValue))
+	}
+}
+
+// SetEndpointDataToClient Set EndpointMap and ENdpointType
+func SetEndpointDataToClient(client *Client) {
+	SetClientProperty(client, "EndpointMap", GetEndpointMap())
+	SetClientProperty(client, "EndpointType", GetEndpointType())
+}
+
 // NewClient creates a sdk client with environment variables
 func NewClient() (client *Client, err error) {
 	client = &Client{}
 	err = client.Init()
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -44,6 +61,7 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 		pc = provider.NewProviderChain(providers)
 	}
 	err = client.InitWithProviderChain(regionId, pc)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -52,6 +70,7 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithOptions(regionId, config, credential)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -60,6 +79,7 @@ func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.C
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -68,6 +88,7 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -76,6 +97,7 @@ func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToke
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -84,6 +106,7 @@ func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, role
 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)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -92,6 +115,7 @@ func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySec
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -100,5 +124,6 @@ func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client,
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	SetEndpointDataToClient(client)
 	return
 }

+ 6 - 5
services/dbs/describe_full_backup_list.go

@@ -76,11 +76,12 @@ func (client *Client) DescribeFullBackupListWithCallback(request *DescribeFullBa
 // DescribeFullBackupListRequest is the request struct for api DescribeFullBackupList
 type DescribeFullBackupListRequest struct {
 	*requests.RpcRequest
-	ClientToken  string           `position:"Query" name:"ClientToken"`
-	BackupPlanId string           `position:"Query" name:"BackupPlanId"`
-	PageNum      requests.Integer `position:"Query" name:"PageNum"`
-	OwnerId      string           `position:"Query" name:"OwnerId"`
-	PageSize     requests.Integer `position:"Query" name:"PageSize"`
+	ClientToken     string           `position:"Query" name:"ClientToken"`
+	BackupPlanId    string           `position:"Query" name:"BackupPlanId"`
+	PageNum         requests.Integer `position:"Query" name:"PageNum"`
+	OwnerId         string           `position:"Query" name:"OwnerId"`
+	ShowStorageType requests.Boolean `position:"Query" name:"ShowStorageType"`
+	PageSize        requests.Integer `position:"Query" name:"PageSize"`
 }
 
 // DescribeFullBackupListResponse is the response struct for api DescribeFullBackupList

+ 6 - 5
services/dbs/describe_increment_backup_list.go

@@ -76,11 +76,12 @@ func (client *Client) DescribeIncrementBackupListWithCallback(request *DescribeI
 // DescribeIncrementBackupListRequest is the request struct for api DescribeIncrementBackupList
 type DescribeIncrementBackupListRequest struct {
 	*requests.RpcRequest
-	ClientToken  string           `position:"Query" name:"ClientToken"`
-	BackupPlanId string           `position:"Query" name:"BackupPlanId"`
-	PageNum      requests.Integer `position:"Query" name:"PageNum"`
-	OwnerId      string           `position:"Query" name:"OwnerId"`
-	PageSize     requests.Integer `position:"Query" name:"PageSize"`
+	ClientToken     string           `position:"Query" name:"ClientToken"`
+	BackupPlanId    string           `position:"Query" name:"BackupPlanId"`
+	PageNum         requests.Integer `position:"Query" name:"PageNum"`
+	OwnerId         string           `position:"Query" name:"OwnerId"`
+	ShowStorageType requests.Boolean `position:"Query" name:"ShowStorageType"`
+	PageSize        requests.Integer `position:"Query" name:"PageSize"`
 }
 
 // DescribeIncrementBackupListResponse is the response struct for api DescribeIncrementBackupList

+ 39 - 0
services/dbs/endpoint.go

@@ -0,0 +1,39 @@
+package dbs
+
+// EndpointMap Endpoint Data
+var EndpointMap map[string]string
+
+// EndpointType regional or central
+var EndpointType = "regional"
+
+// GetEndpointMap Get Endpoint Data Map
+func GetEndpointMap() map[string]string {
+	if EndpointMap == nil {
+		EndpointMap = map[string]string{
+			"cn-shenzhen":           "dbs-api.cn-hangzhou.aliyuncs.com",
+			"cn-beijing":            "dbs-api.cn-hangzhou.aliyuncs.com",
+			"ap-south-1":            "dbs-api.ap-south-1.aliyuncs.com",
+			"eu-west-1":             "dbs-api.eu-west-1.aliyuncs.com",
+			"ap-northeast-1":        "dbs-api.ap-northeast-1.aliyuncs.com",
+			"cn-shenzhen-finance-1": "dbs-api.cn-hangzhou.aliyuncs.com",
+			"me-east-1":             "dbs-api.me-east-1.aliyuncs.com",
+			"cn-qingdao":            "dbs-api.cn-hangzhou.aliyuncs.com",
+			"cn-shanghai":           "dbs-api.cn-hangzhou.aliyuncs.com",
+			"cn-shanghai-finance-1": "dbs-api.cn-hangzhou.aliyuncs.com",
+			"cn-hongkong":           "dbs-api.cn-hangzhou.aliyuncs.com",
+			"cn-hangzhou-finance":   "dbs-api.cn-hangzhou.aliyuncs.com",
+			"ap-southeast-1":        "dbs-api.ap-southeast-1.aliyuncs.com",
+			"cn-huhehaote":          "dbs-api.cn-huhehaote.aliyuncs.com",
+			"us-east-1":             "dbs.cn-hangzhou.aliyuncs.com",
+			"cn-zhangjiakou":        "dbs-api.cn-hangzhou.aliyuncs.com",
+			"us-west-1":             "dbs.cn-hangzhou.aliyuncs.com",
+			"cn-hangzhou":           "dbs-api.cn-hangzhou.aliyuncs.com",
+		}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}