Sfoglia il codice sorgente

Supported CreationOption of CreateDBCluster with CloneFromPolarDB ,CloneFromRDS,MigrationFromRDS.

sdk-team 6 anni fa
parent
commit
e63e3f9dd7

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-07-23 Version: 1.60.71
+- Supported CreationOption of CreateDBCluster with `CloneFromPolarDB `,`CloneFromRDS`,`MigrationFromRDS`.
+
 2019-07-19 Version: 1.60.70
 - QueryMonthlyBillResponse add roundDownDiscount.
 - QueryBillResponse add roundDownDiscount.

+ 25 - 0
services/polardb/client.go

@@ -16,6 +16,8 @@ package polardb
 // 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
 }

+ 109 - 0
services/polardb/close_db_cluster_migration.go

@@ -0,0 +1,109 @@
+package polardb
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// CloseDBClusterMigration invokes the polardb.CloseDBClusterMigration API synchronously
+// api document: https://help.aliyun.com/api/polardb/closedbclustermigration.html
+func (client *Client) CloseDBClusterMigration(request *CloseDBClusterMigrationRequest) (response *CloseDBClusterMigrationResponse, err error) {
+	response = CreateCloseDBClusterMigrationResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CloseDBClusterMigrationWithChan invokes the polardb.CloseDBClusterMigration API asynchronously
+// api document: https://help.aliyun.com/api/polardb/closedbclustermigration.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CloseDBClusterMigrationWithChan(request *CloseDBClusterMigrationRequest) (<-chan *CloseDBClusterMigrationResponse, <-chan error) {
+	responseChan := make(chan *CloseDBClusterMigrationResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CloseDBClusterMigration(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CloseDBClusterMigrationWithCallback invokes the polardb.CloseDBClusterMigration API asynchronously
+// api document: https://help.aliyun.com/api/polardb/closedbclustermigration.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CloseDBClusterMigrationWithCallback(request *CloseDBClusterMigrationRequest, callback func(response *CloseDBClusterMigrationResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CloseDBClusterMigrationResponse
+		var err error
+		defer close(result)
+		response, err = client.CloseDBClusterMigration(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CloseDBClusterMigrationRequest is the request struct for api CloseDBClusterMigration
+type CloseDBClusterMigrationRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ContinueEnableBinlog requests.Boolean `position:"Query" name:"ContinueEnableBinlog"`
+	SecurityToken        string           `position:"Query" name:"SecurityToken"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	DBClusterId          string           `position:"Query" name:"DBClusterId"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// CloseDBClusterMigrationResponse is the response struct for api CloseDBClusterMigration
+type CloseDBClusterMigrationResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateCloseDBClusterMigrationRequest creates a request to invoke CloseDBClusterMigration API
+func CreateCloseDBClusterMigrationRequest() (request *CloseDBClusterMigrationRequest) {
+	request = &CloseDBClusterMigrationRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "CloseDBClusterMigration", "polardb", "openAPI")
+	return
+}
+
+// CreateCloseDBClusterMigrationResponse creates a response to parse from CloseDBClusterMigration response
+func CreateCloseDBClusterMigrationResponse() (response *CloseDBClusterMigrationResponse) {
+	response = &CloseDBClusterMigrationResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 3 - 0
services/polardb/create_db_cluster.go

@@ -93,6 +93,9 @@ type CreateDBClusterRequest struct {
 	DBType               string           `position:"Query" name:"DBType"`
 	ZoneId               string           `position:"Query" name:"ZoneId"`
 	DBVersion            string           `position:"Query" name:"DBVersion"`
+	CreationOption       string           `position:"Query" name:"CreationOption"`
+	SourceResourceId     string           `position:"Query" name:"SourceResourceId"`
+	CloneDataPoint       string           `position:"Query" name:"CloneDataPoint"`
 	PayType              string           `position:"Query" name:"PayType"`
 }
 

+ 5 - 2
services/polardb/create_db_cluster_endpoint.go

@@ -76,14 +76,17 @@ func (client *Client) CreateDBClusterEndpointWithCallback(request *CreateDBClust
 // CreateDBClusterEndpointRequest is the request struct for api CreateDBClusterEndpoint
 type CreateDBClusterEndpointRequest struct {
 	*requests.RpcRequest
+	AutoAddNewNodes      string           `position:"Query" name:"AutoAddNewNodes"`
 	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
-	Nodes                string           `position:"Query" name:"Nodes"`
 	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
-	EndpointType         string           `position:"Query" name:"EndpointType"`
 	ClientToken          string           `position:"Query" name:"ClientToken"`
 	DBClusterId          string           `position:"Query" name:"DBClusterId"`
 	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	EndpointConfig       string           `position:"Query" name:"EndpointConfig"`
 	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	Nodes                string           `position:"Query" name:"Nodes"`
+	ReadWriteMode        string           `position:"Query" name:"ReadWriteMode"`
+	EndpointType         string           `position:"Query" name:"EndpointType"`
 }
 
 // CreateDBClusterEndpointResponse is the response struct for api CreateDBClusterEndpoint

+ 6 - 2
services/polardb/describe_db_cluster_attribute.go

@@ -99,12 +99,16 @@ type DescribeDBClusterAttributeResponse struct {
 	DBType               string   `json:"DBType" xml:"DBType"`
 	DBVersion            string   `json:"DBVersion" xml:"DBVersion"`
 	LockMode             string   `json:"LockMode" xml:"LockMode"`
+	DeletionLock         int      `json:"DeletionLock" xml:"DeletionLock"`
 	CreationTime         string   `json:"CreationTime" xml:"CreationTime"`
 	ExpireTime           string   `json:"ExpireTime" xml:"ExpireTime"`
 	Expired              string   `json:"Expired" xml:"Expired"`
 	MaintainTime         string   `json:"MaintainTime" xml:"MaintainTime"`
-	StorageUsed          int      `json:"StorageUsed" xml:"StorageUsed"`
-	SQLSize              int      `json:"SQLSize" xml:"SQLSize"`
+	StorageUsed          int64    `json:"StorageUsed" xml:"StorageUsed"`
+	StorageMax           int      `json:"StorageMax" xml:"StorageMax"`
+	ZoneIds              string   `json:"ZoneIds" xml:"ZoneIds"`
+	SQLSize              int64    `json:"SQLSize" xml:"SQLSize"`
+	IsLatestVersion      bool     `json:"IsLatestVersion" xml:"IsLatestVersion"`
 	Tags                 []Tag    `json:"Tags" xml:"Tags"`
 	DBNodes              []DBNode `json:"DBNodes" xml:"DBNodes"`
 }

+ 116 - 0
services/polardb/describe_db_cluster_migration.go

@@ -0,0 +1,116 @@
+package polardb
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeDBClusterMigration invokes the polardb.DescribeDBClusterMigration API synchronously
+// api document: https://help.aliyun.com/api/polardb/describedbclustermigration.html
+func (client *Client) DescribeDBClusterMigration(request *DescribeDBClusterMigrationRequest) (response *DescribeDBClusterMigrationResponse, err error) {
+	response = CreateDescribeDBClusterMigrationResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeDBClusterMigrationWithChan invokes the polardb.DescribeDBClusterMigration API asynchronously
+// api document: https://help.aliyun.com/api/polardb/describedbclustermigration.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDBClusterMigrationWithChan(request *DescribeDBClusterMigrationRequest) (<-chan *DescribeDBClusterMigrationResponse, <-chan error) {
+	responseChan := make(chan *DescribeDBClusterMigrationResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeDBClusterMigration(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeDBClusterMigrationWithCallback invokes the polardb.DescribeDBClusterMigration API asynchronously
+// api document: https://help.aliyun.com/api/polardb/describedbclustermigration.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDBClusterMigrationWithCallback(request *DescribeDBClusterMigrationRequest, callback func(response *DescribeDBClusterMigrationResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeDBClusterMigrationResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeDBClusterMigration(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeDBClusterMigrationRequest is the request struct for api DescribeDBClusterMigration
+type DescribeDBClusterMigrationRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SecurityToken        string           `position:"Query" name:"SecurityToken"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	DBClusterId          string           `position:"Query" name:"DBClusterId"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// DescribeDBClusterMigrationResponse is the response struct for api DescribeDBClusterMigration
+type DescribeDBClusterMigrationResponse struct {
+	*responses.BaseResponse
+	RequestId              string `json:"RequestId" xml:"RequestId"`
+	DBClusterId            string `json:"DBClusterId" xml:"DBClusterId"`
+	SourceRDSDBInstanceId  string `json:"SourceRDSDBInstanceId" xml:"SourceRDSDBInstanceId"`
+	MigrationStatus        string `json:"MigrationStatus" xml:"MigrationStatus"`
+	Topologies             string `json:"Topologies" xml:"Topologies"`
+	DelayedSeconds         int    `json:"DelayedSeconds" xml:"DelayedSeconds"`
+	ExpiredTime            string `json:"ExpiredTime" xml:"ExpiredTime"`
+	RdsReadWriteMode       string `json:"RdsReadWriteMode" xml:"RdsReadWriteMode"`
+	DBClusterReadWriteMode string `json:"DBClusterReadWriteMode" xml:"DBClusterReadWriteMode"`
+}
+
+// CreateDescribeDBClusterMigrationRequest creates a request to invoke DescribeDBClusterMigration API
+func CreateDescribeDBClusterMigrationRequest() (request *DescribeDBClusterMigrationRequest) {
+	request = &DescribeDBClusterMigrationRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "DescribeDBClusterMigration", "polardb", "openAPI")
+	return
+}
+
+// CreateDescribeDBClusterMigrationResponse creates a response to parse from DescribeDBClusterMigration response
+func CreateDescribeDBClusterMigrationResponse() (response *DescribeDBClusterMigrationResponse) {
+	response = &DescribeDBClusterMigrationResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 30 - 0
services/polardb/endpoint.go

@@ -0,0 +1,30 @@
+package polardb
+
+// 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":    "polardb.aliyuncs.com",
+			"cn-qingdao":     "polardb.aliyuncs.com",
+			"cn-beijing":     "polardb.aliyuncs.com",
+			"cn-shanghai":    "polardb.aliyuncs.com",
+			"cn-hongkong":    "polardb.aliyuncs.com",
+			"ap-southeast-1": "polardb.aliyuncs.com",
+			"us-east-1":      "polardb.ap-northeast-1.aliyuncs.com",
+			"us-west-1":      "polardb.us-west-1us-west-1.aliyuncs.com",
+			"cn-hangzhou":    "polardb.aliyuncs.com",
+		}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}

+ 107 - 0
services/polardb/lock_db_cluster_deletion.go

@@ -0,0 +1,107 @@
+package polardb
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// LockDBClusterDeletion invokes the polardb.LockDBClusterDeletion API synchronously
+// api document: https://help.aliyun.com/api/polardb/lockdbclusterdeletion.html
+func (client *Client) LockDBClusterDeletion(request *LockDBClusterDeletionRequest) (response *LockDBClusterDeletionResponse, err error) {
+	response = CreateLockDBClusterDeletionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// LockDBClusterDeletionWithChan invokes the polardb.LockDBClusterDeletion API asynchronously
+// api document: https://help.aliyun.com/api/polardb/lockdbclusterdeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) LockDBClusterDeletionWithChan(request *LockDBClusterDeletionRequest) (<-chan *LockDBClusterDeletionResponse, <-chan error) {
+	responseChan := make(chan *LockDBClusterDeletionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.LockDBClusterDeletion(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// LockDBClusterDeletionWithCallback invokes the polardb.LockDBClusterDeletion API asynchronously
+// api document: https://help.aliyun.com/api/polardb/lockdbclusterdeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) LockDBClusterDeletionWithCallback(request *LockDBClusterDeletionRequest, callback func(response *LockDBClusterDeletionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *LockDBClusterDeletionResponse
+		var err error
+		defer close(result)
+		response, err = client.LockDBClusterDeletion(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// LockDBClusterDeletionRequest is the request struct for api LockDBClusterDeletion
+type LockDBClusterDeletionRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	DBClusterId          string           `position:"Query" name:"DBClusterId"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// LockDBClusterDeletionResponse is the response struct for api LockDBClusterDeletion
+type LockDBClusterDeletionResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateLockDBClusterDeletionRequest creates a request to invoke LockDBClusterDeletion API
+func CreateLockDBClusterDeletionRequest() (request *LockDBClusterDeletionRequest) {
+	request = &LockDBClusterDeletionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "LockDBClusterDeletion", "polardb", "openAPI")
+	return
+}
+
+// CreateLockDBClusterDeletionResponse creates a response to parse from LockDBClusterDeletion response
+func CreateLockDBClusterDeletionResponse() (response *LockDBClusterDeletionResponse) {
+	response = &LockDBClusterDeletionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 2 - 0
services/polardb/modify_db_cluster_endpoint.go

@@ -76,8 +76,10 @@ func (client *Client) ModifyDBClusterEndpointWithCallback(request *ModifyDBClust
 // ModifyDBClusterEndpointRequest is the request struct for api ModifyDBClusterEndpoint
 type ModifyDBClusterEndpointRequest struct {
 	*requests.RpcRequest
+	AutoAddNewNodes      string           `position:"Query" name:"AutoAddNewNodes"`
 	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
 	Nodes                string           `position:"Query" name:"Nodes"`
+	ReadWriteMode        string           `position:"Query" name:"ReadWriteMode"`
 	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
 	DBClusterId          string           `position:"Query" name:"DBClusterId"`
 	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`

+ 110 - 0
services/polardb/modify_db_cluster_migration.go

@@ -0,0 +1,110 @@
+package polardb
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ModifyDBClusterMigration invokes the polardb.ModifyDBClusterMigration API synchronously
+// api document: https://help.aliyun.com/api/polardb/modifydbclustermigration.html
+func (client *Client) ModifyDBClusterMigration(request *ModifyDBClusterMigrationRequest) (response *ModifyDBClusterMigrationResponse, err error) {
+	response = CreateModifyDBClusterMigrationResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ModifyDBClusterMigrationWithChan invokes the polardb.ModifyDBClusterMigration API asynchronously
+// api document: https://help.aliyun.com/api/polardb/modifydbclustermigration.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyDBClusterMigrationWithChan(request *ModifyDBClusterMigrationRequest) (<-chan *ModifyDBClusterMigrationResponse, <-chan error) {
+	responseChan := make(chan *ModifyDBClusterMigrationResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ModifyDBClusterMigration(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ModifyDBClusterMigrationWithCallback invokes the polardb.ModifyDBClusterMigration API asynchronously
+// api document: https://help.aliyun.com/api/polardb/modifydbclustermigration.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyDBClusterMigrationWithCallback(request *ModifyDBClusterMigrationRequest, callback func(response *ModifyDBClusterMigrationResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ModifyDBClusterMigrationResponse
+		var err error
+		defer close(result)
+		response, err = client.ModifyDBClusterMigration(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ModifyDBClusterMigrationRequest is the request struct for api ModifyDBClusterMigration
+type ModifyDBClusterMigrationRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId       requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SecurityToken         string           `position:"Query" name:"SecurityToken"`
+	ResourceOwnerAccount  string           `position:"Query" name:"ResourceOwnerAccount"`
+	DBClusterId           string           `position:"Query" name:"DBClusterId"`
+	OwnerAccount          string           `position:"Query" name:"OwnerAccount"`
+	SourceRDSDBInstanceId string           `position:"Query" name:"SourceRDSDBInstanceId"`
+	NewMasterInstanceId   string           `position:"Query" name:"NewMasterInstanceId"`
+	OwnerId               requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// ModifyDBClusterMigrationResponse is the response struct for api ModifyDBClusterMigration
+type ModifyDBClusterMigrationResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateModifyDBClusterMigrationRequest creates a request to invoke ModifyDBClusterMigration API
+func CreateModifyDBClusterMigrationRequest() (request *ModifyDBClusterMigrationRequest) {
+	request = &ModifyDBClusterMigrationRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "ModifyDBClusterMigration", "polardb", "openAPI")
+	return
+}
+
+// CreateModifyDBClusterMigrationResponse creates a response to parse from ModifyDBClusterMigration response
+func CreateModifyDBClusterMigrationResponse() (response *ModifyDBClusterMigrationResponse) {
+	response = &ModifyDBClusterMigrationResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 3 - 1
services/polardb/struct_db_cluster.go

@@ -22,6 +22,7 @@ type DBCluster struct {
 	PayType              string                      `json:"PayType" xml:"PayType"`
 	DBClusterNetworkType string                      `json:"DBClusterNetworkType" xml:"DBClusterNetworkType"`
 	RegionId             string                      `json:"RegionId" xml:"RegionId"`
+	ZoneId               string                      `json:"ZoneId" xml:"ZoneId"`
 	ExpireTime           string                      `json:"ExpireTime" xml:"ExpireTime"`
 	Expired              string                      `json:"Expired" xml:"Expired"`
 	DBClusterStatus      string                      `json:"DBClusterStatus" xml:"DBClusterStatus"`
@@ -29,11 +30,12 @@ type DBCluster struct {
 	DBType               string                      `json:"DBType" xml:"DBType"`
 	DBVersion            string                      `json:"DBVersion" xml:"DBVersion"`
 	LockMode             string                      `json:"LockMode" xml:"LockMode"`
+	DeletionLock         int                         `json:"DeletionLock" xml:"DeletionLock"`
 	CreateTime           string                      `json:"CreateTime" xml:"CreateTime"`
 	VpcId                string                      `json:"VpcId" xml:"VpcId"`
 	DBNodeNumber         int                         `json:"DBNodeNumber" xml:"DBNodeNumber"`
 	DBNodeClass          string                      `json:"DBNodeClass" xml:"DBNodeClass"`
-	StorageUsed          int                         `json:"StorageUsed" xml:"StorageUsed"`
+	StorageUsed          int64                       `json:"StorageUsed" xml:"StorageUsed"`
 	DBNodes              DBNodesInDescribeDBClusters `json:"DBNodes" xml:"DBNodes"`
 	Tags                 TagsInDescribeDBClusters    `json:"Tags" xml:"Tags"`
 }

+ 7 - 5
services/polardb/struct_db_endpoint.go

@@ -17,9 +17,11 @@ package polardb
 
 // DBEndpoint is a nested struct in polardb response
 type DBEndpoint struct {
-	DBEndpointId   string    `json:"DBEndpointId" xml:"DBEndpointId"`
-	EndpointType   string    `json:"EndpointType" xml:"EndpointType"`
-	Nodes          string    `json:"Nodes" xml:"Nodes"`
-	EndpointConfig string    `json:"EndpointConfig" xml:"EndpointConfig"`
-	AddressItems   []Address `json:"AddressItems" xml:"AddressItems"`
+	DBEndpointId    string    `json:"DBEndpointId" xml:"DBEndpointId"`
+	EndpointType    string    `json:"EndpointType" xml:"EndpointType"`
+	Nodes           string    `json:"Nodes" xml:"Nodes"`
+	ReadWriteMode   string    `json:"ReadWriteMode" xml:"ReadWriteMode"`
+	AutoAddNewNodes string    `json:"AutoAddNewNodes" xml:"AutoAddNewNodes"`
+	EndpointConfig  string    `json:"EndpointConfig" xml:"EndpointConfig"`
+	AddressItems    []Address `json:"AddressItems" xml:"AddressItems"`
 }

+ 1 - 0
services/polardb/struct_db_node.go

@@ -20,6 +20,7 @@ type DBNode struct {
 	DBNodeClass    string `json:"DBNodeClass" xml:"DBNodeClass"`
 	MaxIOPS        int    `json:"MaxIOPS" xml:"MaxIOPS"`
 	DBNodeRole     string `json:"DBNodeRole" xml:"DBNodeRole"`
+	RegionId       string `json:"RegionId" xml:"RegionId"`
 	MaxConnections int    `json:"MaxConnections" xml:"MaxConnections"`
 	ZoneId         string `json:"ZoneId" xml:"ZoneId"`
 	DBNodeStatus   string `json:"DBNodeStatus" xml:"DBNodeStatus"`

+ 107 - 0
services/polardb/unlock_db_cluster_deletion.go

@@ -0,0 +1,107 @@
+package polardb
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UnlockDBClusterDeletion invokes the polardb.UnlockDBClusterDeletion API synchronously
+// api document: https://help.aliyun.com/api/polardb/unlockdbclusterdeletion.html
+func (client *Client) UnlockDBClusterDeletion(request *UnlockDBClusterDeletionRequest) (response *UnlockDBClusterDeletionResponse, err error) {
+	response = CreateUnlockDBClusterDeletionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UnlockDBClusterDeletionWithChan invokes the polardb.UnlockDBClusterDeletion API asynchronously
+// api document: https://help.aliyun.com/api/polardb/unlockdbclusterdeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UnlockDBClusterDeletionWithChan(request *UnlockDBClusterDeletionRequest) (<-chan *UnlockDBClusterDeletionResponse, <-chan error) {
+	responseChan := make(chan *UnlockDBClusterDeletionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.UnlockDBClusterDeletion(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// UnlockDBClusterDeletionWithCallback invokes the polardb.UnlockDBClusterDeletion API asynchronously
+// api document: https://help.aliyun.com/api/polardb/unlockdbclusterdeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UnlockDBClusterDeletionWithCallback(request *UnlockDBClusterDeletionRequest, callback func(response *UnlockDBClusterDeletionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *UnlockDBClusterDeletionResponse
+		var err error
+		defer close(result)
+		response, err = client.UnlockDBClusterDeletion(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// UnlockDBClusterDeletionRequest is the request struct for api UnlockDBClusterDeletion
+type UnlockDBClusterDeletionRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	DBClusterId          string           `position:"Query" name:"DBClusterId"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// UnlockDBClusterDeletionResponse is the response struct for api UnlockDBClusterDeletion
+type UnlockDBClusterDeletionResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUnlockDBClusterDeletionRequest creates a request to invoke UnlockDBClusterDeletion API
+func CreateUnlockDBClusterDeletionRequest() (request *UnlockDBClusterDeletionRequest) {
+	request = &UnlockDBClusterDeletionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "UnlockDBClusterDeletion", "polardb", "openAPI")
+	return
+}
+
+// CreateUnlockDBClusterDeletionResponse creates a response to parse from UnlockDBClusterDeletion response
+func CreateUnlockDBClusterDeletionResponse() (response *UnlockDBClusterDeletionResponse) {
+	response = &UnlockDBClusterDeletionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}