Explorar el Código

POLARDB SDK Auto Released By zhigang.xzg,Version:1.57.1

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

+ 5 - 0
ChangeLog.txt

@@ -1,3 +1,8 @@
+2019-04-22 Version: 1.57.1
+1, Add interface ModifyDBNodeClass.
+2, Add interface ModifyAutoRenewAttribute and DescribeAutoRenewAttribute.
+3, Param AutoRenew is supported in interface CreateDBCluster.
+
 2019-04-22 Version: 1.57.0
 1, Add a new api, QueryDomainByDomainName.
 

+ 1 - 0
services/polardb/create_db_cluster.go

@@ -87,6 +87,7 @@ type CreateDBClusterRequest struct {
 	ClusterNetworkType   string           `position:"Query" name:"ClusterNetworkType"`
 	VSwitchId            string           `position:"Query" name:"VSwitchId"`
 	DBNodeClass          string           `position:"Query" name:"DBNodeClass"`
+	AutoRenew            requests.Boolean `position:"Query" name:"AutoRenew"`
 	Engine               string           `position:"Query" name:"Engine"`
 	VPCId                string           `position:"Query" name:"VPCId"`
 	DBType               string           `position:"Query" name:"DBType"`

+ 113 - 0
services/polardb/describe_auto_renew_attribute.go

@@ -0,0 +1,113 @@
+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"
+)
+
+// DescribeAutoRenewAttribute invokes the polardb.DescribeAutoRenewAttribute API synchronously
+// api document: https://help.aliyun.com/api/polardb/describeautorenewattribute.html
+func (client *Client) DescribeAutoRenewAttribute(request *DescribeAutoRenewAttributeRequest) (response *DescribeAutoRenewAttributeResponse, err error) {
+	response = CreateDescribeAutoRenewAttributeResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeAutoRenewAttributeWithChan invokes the polardb.DescribeAutoRenewAttribute API asynchronously
+// api document: https://help.aliyun.com/api/polardb/describeautorenewattribute.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeAutoRenewAttributeWithChan(request *DescribeAutoRenewAttributeRequest) (<-chan *DescribeAutoRenewAttributeResponse, <-chan error) {
+	responseChan := make(chan *DescribeAutoRenewAttributeResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeAutoRenewAttribute(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeAutoRenewAttributeWithCallback invokes the polardb.DescribeAutoRenewAttribute API asynchronously
+// api document: https://help.aliyun.com/api/polardb/describeautorenewattribute.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeAutoRenewAttributeWithCallback(request *DescribeAutoRenewAttributeRequest, callback func(response *DescribeAutoRenewAttributeResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeAutoRenewAttributeResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeAutoRenewAttribute(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeAutoRenewAttributeRequest is the request struct for api DescribeAutoRenewAttribute
+type DescribeAutoRenewAttributeRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	PageSize             requests.Integer `position:"Query" name:"PageSize"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	PageNumber           requests.Integer `position:"Query" name:"PageNumber"`
+	DBClusterIds         string           `position:"Query" name:"DBClusterIds"`
+}
+
+// DescribeAutoRenewAttributeResponse is the response struct for api DescribeAutoRenewAttribute
+type DescribeAutoRenewAttributeResponse struct {
+	*responses.BaseResponse
+	RequestId        string                            `json:"RequestId" xml:"RequestId"`
+	PageNumber       int                               `json:"PageNumber" xml:"PageNumber"`
+	TotalRecordCount int                               `json:"TotalRecordCount" xml:"TotalRecordCount"`
+	PageRecordCount  int                               `json:"PageRecordCount" xml:"PageRecordCount"`
+	Items            ItemsInDescribeAutoRenewAttribute `json:"Items" xml:"Items"`
+}
+
+// CreateDescribeAutoRenewAttributeRequest creates a request to invoke DescribeAutoRenewAttribute API
+func CreateDescribeAutoRenewAttributeRequest() (request *DescribeAutoRenewAttributeRequest) {
+	request = &DescribeAutoRenewAttributeRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "DescribeAutoRenewAttribute", "polardb", "openAPI")
+	return
+}
+
+// CreateDescribeAutoRenewAttributeResponse creates a response to parse from DescribeAutoRenewAttribute response
+func CreateDescribeAutoRenewAttributeResponse() (response *DescribeAutoRenewAttributeResponse) {
+	response = &DescribeAutoRenewAttributeResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/polardb/modify_auto_renew_attribute.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"
+)
+
+// ModifyAutoRenewAttribute invokes the polardb.ModifyAutoRenewAttribute API synchronously
+// api document: https://help.aliyun.com/api/polardb/modifyautorenewattribute.html
+func (client *Client) ModifyAutoRenewAttribute(request *ModifyAutoRenewAttributeRequest) (response *ModifyAutoRenewAttributeResponse, err error) {
+	response = CreateModifyAutoRenewAttributeResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ModifyAutoRenewAttributeWithChan invokes the polardb.ModifyAutoRenewAttribute API asynchronously
+// api document: https://help.aliyun.com/api/polardb/modifyautorenewattribute.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyAutoRenewAttributeWithChan(request *ModifyAutoRenewAttributeRequest) (<-chan *ModifyAutoRenewAttributeResponse, <-chan error) {
+	responseChan := make(chan *ModifyAutoRenewAttributeResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ModifyAutoRenewAttribute(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ModifyAutoRenewAttributeWithCallback invokes the polardb.ModifyAutoRenewAttribute API asynchronously
+// api document: https://help.aliyun.com/api/polardb/modifyautorenewattribute.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyAutoRenewAttributeWithCallback(request *ModifyAutoRenewAttributeRequest, callback func(response *ModifyAutoRenewAttributeResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ModifyAutoRenewAttributeResponse
+		var err error
+		defer close(result)
+		response, err = client.ModifyAutoRenewAttribute(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ModifyAutoRenewAttributeRequest is the request struct for api ModifyAutoRenewAttribute
+type ModifyAutoRenewAttributeRequest struct {
+	*requests.RpcRequest
+	Duration             string           `position:"Query" name:"Duration"`
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	PeriodUnit           string           `position:"Query" name:"PeriodUnit"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	RenewalStatus        string           `position:"Query" name:"RenewalStatus"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	DBClusterIds         string           `position:"Query" name:"DBClusterIds"`
+}
+
+// ModifyAutoRenewAttributeResponse is the response struct for api ModifyAutoRenewAttribute
+type ModifyAutoRenewAttributeResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateModifyAutoRenewAttributeRequest creates a request to invoke ModifyAutoRenewAttribute API
+func CreateModifyAutoRenewAttributeRequest() (request *ModifyAutoRenewAttributeRequest) {
+	request = &ModifyAutoRenewAttributeRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "ModifyAutoRenewAttribute", "polardb", "openAPI")
+	return
+}
+
+// CreateModifyAutoRenewAttributeResponse creates a response to parse from ModifyAutoRenewAttribute response
+func CreateModifyAutoRenewAttributeResponse() (response *ModifyAutoRenewAttributeResponse) {
+	response = &ModifyAutoRenewAttributeResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 112 - 0
services/polardb/modify_db_node_class.go

@@ -0,0 +1,112 @@
+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"
+)
+
+// ModifyDBNodeClass invokes the polardb.ModifyDBNodeClass API synchronously
+// api document: https://help.aliyun.com/api/polardb/modifydbnodeclass.html
+func (client *Client) ModifyDBNodeClass(request *ModifyDBNodeClassRequest) (response *ModifyDBNodeClassResponse, err error) {
+	response = CreateModifyDBNodeClassResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ModifyDBNodeClassWithChan invokes the polardb.ModifyDBNodeClass API asynchronously
+// api document: https://help.aliyun.com/api/polardb/modifydbnodeclass.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyDBNodeClassWithChan(request *ModifyDBNodeClassRequest) (<-chan *ModifyDBNodeClassResponse, <-chan error) {
+	responseChan := make(chan *ModifyDBNodeClassResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ModifyDBNodeClass(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ModifyDBNodeClassWithCallback invokes the polardb.ModifyDBNodeClass API asynchronously
+// api document: https://help.aliyun.com/api/polardb/modifydbnodeclass.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyDBNodeClassWithCallback(request *ModifyDBNodeClassRequest, callback func(response *ModifyDBNodeClassResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ModifyDBNodeClassResponse
+		var err error
+		defer close(result)
+		response, err = client.ModifyDBNodeClass(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ModifyDBNodeClassRequest is the request struct for api ModifyDBNodeClass
+type ModifyDBNodeClassRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	ClientToken          string           `position:"Query" name:"ClientToken"`
+	DBClusterId          string           `position:"Query" name:"DBClusterId"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	ModifyType           string           `position:"Query" name:"ModifyType"`
+	DBNodeTargetClass    string           `position:"Query" name:"DBNodeTargetClass"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// ModifyDBNodeClassResponse is the response struct for api ModifyDBNodeClass
+type ModifyDBNodeClassResponse struct {
+	*responses.BaseResponse
+	RequestId   string `json:"RequestId" xml:"RequestId"`
+	DBClusterId string `json:"DBClusterId" xml:"DBClusterId"`
+	OrderId     string `json:"OrderId" xml:"OrderId"`
+}
+
+// CreateModifyDBNodeClassRequest creates a request to invoke ModifyDBNodeClass API
+func CreateModifyDBNodeClassRequest() (request *ModifyDBNodeClassRequest) {
+	request = &ModifyDBNodeClassRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "ModifyDBNodeClass", "polardb", "openAPI")
+	return
+}
+
+// CreateModifyDBNodeClassResponse creates a response to parse from ModifyDBNodeClass response
+func CreateModifyDBNodeClassResponse() (response *ModifyDBNodeClassResponse) {
+	response = &ModifyDBNodeClassResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 26 - 0
services/polardb/struct_auto_renew_attribute.go

@@ -0,0 +1,26 @@
+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.
+
+// AutoRenewAttribute is a nested struct in polardb response
+type AutoRenewAttribute struct {
+	DBClusterId      string `json:"DBClusterId" xml:"DBClusterId"`
+	RegionId         string `json:"RegionId" xml:"RegionId"`
+	AutoRenewEnabled bool   `json:"AutoRenewEnabled" xml:"AutoRenewEnabled"`
+	Duration         int    `json:"Duration" xml:"Duration"`
+	PeriodUnit       string `json:"PeriodUnit" xml:"PeriodUnit"`
+	RenewalStatus    string `json:"RenewalStatus" xml:"RenewalStatus"`
+}

+ 21 - 0
services/polardb/struct_items_in_describe_auto_renew_attribute.go

@@ -0,0 +1,21 @@
+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.
+
+// ItemsInDescribeAutoRenewAttribute is a nested struct in polardb response
+type ItemsInDescribeAutoRenewAttribute struct {
+	AutoRenewAttribute []AutoRenewAttribute `json:"AutoRenewAttribute" xml:"AutoRenewAttribute"`
+}