Browse Source

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

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 6 years ago
parent
commit
0d14922696

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2019-02-26 Version: 1.53.3
+1, Add interface of tag.
+2, Add tag info in DescribeDBClusters and DescribeDBClusterAttribute.
+
 2019-02-25 Version: 1.53.2
 1, add opensearch to GO sdk
 

+ 1 - 0
services/polardb/describe_db_cluster_attribute.go

@@ -105,6 +105,7 @@ type DescribeDBClusterAttributeResponse struct {
 	MaintainTime         string   `json:"MaintainTime" xml:"MaintainTime"`
 	StorageUsed          int      `json:"StorageUsed" xml:"StorageUsed"`
 	SQLSize              int      `json:"SQLSize" xml:"SQLSize"`
+	Tags                 []Tag    `json:"Tags" xml:"Tags"`
 	DBNodes              []DBNode `json:"DBNodes" xml:"DBNodes"`
 }
 

+ 17 - 10
services/polardb/describe_db_clusters.go

@@ -76,16 +76,23 @@ func (client *Client) DescribeDBClustersWithCallback(request *DescribeDBClusters
 // DescribeDBClustersRequest is the request struct for api DescribeDBClusters
 type DescribeDBClustersRequest struct {
 	*requests.RpcRequest
-	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
-	DBClusterDescription string           `position:"Query" name:"DBClusterDescription"`
-	DBClusterStatus      string           `position:"Query" name:"DBClusterStatus"`
-	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
-	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
-	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
-	PageNumber           requests.Integer `position:"Query" name:"PageNumber"`
-	DBType               string           `position:"Query" name:"DBType"`
-	PageSize             requests.Integer `position:"Query" name:"PageSize"`
-	DBClusterIds         string           `position:"Query" name:"DBClusterIds"`
+	ResourceOwnerId      requests.Integer         `position:"Query" name:"ResourceOwnerId"`
+	DBClusterDescription string                   `position:"Query" name:"DBClusterDescription"`
+	DBClusterStatus      string                   `position:"Query" name:"DBClusterStatus"`
+	ResourceOwnerAccount string                   `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string                   `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer         `position:"Query" name:"OwnerId"`
+	PageNumber           requests.Integer         `position:"Query" name:"PageNumber"`
+	DBType               string                   `position:"Query" name:"DBType"`
+	PageSize             requests.Integer         `position:"Query" name:"PageSize"`
+	Tag                  *[]DescribeDBClustersTag `position:"Query" name:"Tag"  type:"Repeated"`
+	DBClusterIds         string                   `position:"Query" name:"DBClusterIds"`
+}
+
+// DescribeDBClustersTag is a repeated param struct in DescribeDBClustersRequest
+type DescribeDBClustersTag struct {
+	Value string `name:"Value"`
+	Key   string `name:"Key"`
 }
 
 // DescribeDBClustersResponse is the response struct for api DescribeDBClusters

+ 118 - 0
services/polardb/list_tag_resources.go

@@ -0,0 +1,118 @@
+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"
+)
+
+// ListTagResources invokes the polardb.ListTagResources API synchronously
+// api document: https://help.aliyun.com/api/polardb/listtagresources.html
+func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) {
+	response = CreateListTagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListTagResourcesWithChan invokes the polardb.ListTagResources API asynchronously
+// api document: https://help.aliyun.com/api/polardb/listtagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListTagResourcesWithChan(request *ListTagResourcesRequest) (<-chan *ListTagResourcesResponse, <-chan error) {
+	responseChan := make(chan *ListTagResourcesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListTagResources(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListTagResourcesWithCallback invokes the polardb.ListTagResources API asynchronously
+// api document: https://help.aliyun.com/api/polardb/listtagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListTagResourcesWithCallback(request *ListTagResourcesRequest, callback func(response *ListTagResourcesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListTagResourcesResponse
+		var err error
+		defer close(result)
+		response, err = client.ListTagResources(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListTagResourcesRequest is the request struct for api ListTagResources
+type ListTagResourcesRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer       `position:"Query" name:"ResourceOwnerId"`
+	ResourceId           *[]string              `position:"Query" name:"ResourceId"  type:"Repeated"`
+	ResourceOwnerAccount string                 `position:"Query" name:"ResourceOwnerAccount"`
+	NextToken            string                 `position:"Query" name:"NextToken"`
+	OwnerAccount         string                 `position:"Query" name:"OwnerAccount"`
+	Tag                  *[]ListTagResourcesTag `position:"Query" name:"Tag"  type:"Repeated"`
+	OwnerId              requests.Integer       `position:"Query" name:"OwnerId"`
+	ResourceType         string                 `position:"Query" name:"ResourceType"`
+}
+
+// ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest
+type ListTagResourcesTag struct {
+	Value string `name:"Value"`
+	Key   string `name:"Key"`
+}
+
+// ListTagResourcesResponse is the response struct for api ListTagResources
+type ListTagResourcesResponse struct {
+	*responses.BaseResponse
+	RequestId    string       `json:"RequestId" xml:"RequestId"`
+	NextToken    string       `json:"NextToken" xml:"NextToken"`
+	TagResources TagResources `json:"TagResources" xml:"TagResources"`
+}
+
+// CreateListTagResourcesRequest creates a request to invoke ListTagResources API
+func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) {
+	request = &ListTagResourcesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "ListTagResources", "polardb", "openAPI")
+	return
+}
+
+// CreateListTagResourcesResponse creates a response to parse from ListTagResources response
+func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) {
+	response = &ListTagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 1 - 0
services/polardb/struct_db_cluster.go

@@ -35,4 +35,5 @@ type DBCluster struct {
 	DBNodeClass          string                      `json:"DBNodeClass" xml:"DBNodeClass"`
 	StorageUsed          int                         `json:"StorageUsed" xml:"StorageUsed"`
 	DBNodes              DBNodesInDescribeDBClusters `json:"DBNodes" xml:"DBNodes"`
+	Tags                 TagsInDescribeDBClusters    `json:"Tags" xml:"Tags"`
 }

+ 22 - 0
services/polardb/struct_tag.go

@@ -0,0 +1,22 @@
+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.
+
+// Tag is a nested struct in polardb response
+type Tag struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"Value"`
+}

+ 24 - 0
services/polardb/struct_tag_resource.go

@@ -0,0 +1,24 @@
+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.
+
+// TagResource is a nested struct in polardb response
+type TagResource struct {
+	TagKey       string `json:"TagKey" xml:"TagKey"`
+	TagValue     string `json:"TagValue" xml:"TagValue"`
+	ResourceType string `json:"ResourceType" xml:"ResourceType"`
+	ResourceId   string `json:"ResourceId" xml:"ResourceId"`
+}

+ 21 - 0
services/polardb/struct_tag_resources.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.
+
+// TagResources is a nested struct in polardb response
+type TagResources struct {
+	TagResource []TagResource `json:"TagResource" xml:"TagResource"`
+}

+ 21 - 0
services/polardb/struct_tags_in_describe_db_cluster_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.
+
+// TagsInDescribeDBClusterAttribute is a nested struct in polardb response
+type TagsInDescribeDBClusterAttribute struct {
+	Tag []Tag `json:"Tag" xml:"Tag"`
+}

+ 21 - 0
services/polardb/struct_tags_in_describe_db_clusters.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.
+
+// TagsInDescribeDBClusters is a nested struct in polardb response
+type TagsInDescribeDBClusters struct {
+	Tag []Tag `json:"Tag" xml:"Tag"`
+}

+ 115 - 0
services/polardb/tag_resources.go

@@ -0,0 +1,115 @@
+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"
+)
+
+// TagResources invokes the polardb.TagResources API synchronously
+// api document: https://help.aliyun.com/api/polardb/tagresources.html
+func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) {
+	response = CreateTagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// TagResourcesWithChan invokes the polardb.TagResources API asynchronously
+// api document: https://help.aliyun.com/api/polardb/tagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TagResourcesWithChan(request *TagResourcesRequest) (<-chan *TagResourcesResponse, <-chan error) {
+	responseChan := make(chan *TagResourcesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.TagResources(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// TagResourcesWithCallback invokes the polardb.TagResources API asynchronously
+// api document: https://help.aliyun.com/api/polardb/tagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TagResourcesWithCallback(request *TagResourcesRequest, callback func(response *TagResourcesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *TagResourcesResponse
+		var err error
+		defer close(result)
+		response, err = client.TagResources(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// TagResourcesRequest is the request struct for api TagResources
+type TagResourcesRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer   `position:"Query" name:"ResourceOwnerId"`
+	ResourceId           *[]string          `position:"Query" name:"ResourceId"  type:"Repeated"`
+	ResourceOwnerAccount string             `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string             `position:"Query" name:"OwnerAccount"`
+	Tag                  *[]TagResourcesTag `position:"Query" name:"Tag"  type:"Repeated"`
+	OwnerId              requests.Integer   `position:"Query" name:"OwnerId"`
+	ResourceType         string             `position:"Query" name:"ResourceType"`
+}
+
+// TagResourcesTag is a repeated param struct in TagResourcesRequest
+type TagResourcesTag struct {
+	Value string `name:"Value"`
+	Key   string `name:"Key"`
+}
+
+// TagResourcesResponse is the response struct for api TagResources
+type TagResourcesResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateTagResourcesRequest creates a request to invoke TagResources API
+func CreateTagResourcesRequest() (request *TagResourcesRequest) {
+	request = &TagResourcesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "TagResources", "polardb", "openAPI")
+	return
+}
+
+// CreateTagResourcesResponse creates a response to parse from TagResources response
+func CreateTagResourcesResponse() (response *TagResourcesResponse) {
+	response = &TagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/polardb/untag_resources.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"
+)
+
+// UntagResources invokes the polardb.UntagResources API synchronously
+// api document: https://help.aliyun.com/api/polardb/untagresources.html
+func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) {
+	response = CreateUntagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UntagResourcesWithChan invokes the polardb.UntagResources API asynchronously
+// api document: https://help.aliyun.com/api/polardb/untagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UntagResourcesWithChan(request *UntagResourcesRequest) (<-chan *UntagResourcesResponse, <-chan error) {
+	responseChan := make(chan *UntagResourcesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.UntagResources(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// UntagResourcesWithCallback invokes the polardb.UntagResources API asynchronously
+// api document: https://help.aliyun.com/api/polardb/untagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UntagResourcesWithCallback(request *UntagResourcesRequest, callback func(response *UntagResourcesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *UntagResourcesResponse
+		var err error
+		defer close(result)
+		response, err = client.UntagResources(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// UntagResourcesRequest is the request struct for api UntagResources
+type UntagResourcesRequest struct {
+	*requests.RpcRequest
+	All                  requests.Boolean `position:"Query" name:"All"`
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceId           *[]string        `position:"Query" name:"ResourceId"  type:"Repeated"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	TagKey               *[]string        `position:"Query" name:"TagKey"  type:"Repeated"`
+	ResourceType         string           `position:"Query" name:"ResourceType"`
+}
+
+// UntagResourcesResponse is the response struct for api UntagResources
+type UntagResourcesResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUntagResourcesRequest creates a request to invoke UntagResources API
+func CreateUntagResourcesRequest() (request *UntagResourcesRequest) {
+	request = &UntagResourcesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("polardb", "2017-08-01", "UntagResources", "polardb", "openAPI")
+	return
+}
+
+// CreateUntagResourcesResponse creates a response to parse from UntagResources response
+func CreateUntagResourcesResponse() (response *UntagResourcesResponse) {
+	response = &UntagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}