Browse Source

Support Tag OpenAPI.

sdk-team 6 years ago
parent
commit
4bcf0c76f8

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2019-11-14 Version: 1.60.239
+- Support Tag OpenAPI.
+- Fix endpoint problem.
+
 2019-11-14 Version: 1.60.238
 2019-11-14 Version: 1.60.238
 - Initial construction.
 - Initial construction.
 - Public beta version.
 - Public beta version.

+ 44 - 17
services/adb/endpoint.go

@@ -10,23 +10,50 @@ var EndpointType = "regional"
 func GetEndpointMap() map[string]string {
 func GetEndpointMap() map[string]string {
 	if EndpointMap == nil {
 	if EndpointMap == nil {
 		EndpointMap = map[string]string{
 		EndpointMap = map[string]string{
-			"cn-shenzhen":           "adb.aliyuncs.com",
-			"cn-beijing":            "adb.aliyuncs.com",
-			"ap-south-1":            "adb.ap-northeast-1.aliyuncs.com",
-			"cn-shenzhen-finance-1": "adb.aliyuncs.com",
-			"me-east-1":             "adb.ap-northeast-1.aliyuncs.com",
-			"cn-north-2-gov-1":      "adb.aliyuncs.com",
-			"cn-qingdao":            "adb.aliyuncs.com",
-			"cn-shanghai":           "adb.aliyuncs.com",
-			"cn-shanghai-finance-1": "adb.aliyuncs.com",
-			"cn-hongkong":           "adb.aliyuncs.com",
-			"ap-southeast-1":        "adb.aliyuncs.com",
-			"ap-southeast-2":        "adb.ap-northeast-1.aliyuncs.com",
-			"cn-huhehaote":          "adb.aliyuncs.com",
-			"us-east-1":             "adb.aliyuncs.com",
-			"ap-southeast-5":        "adb.ap-northeast-1.aliyuncs.com",
-			"us-west-1":             "adb.aliyuncs.com",
-			"cn-hangzhou":           "adb.aliyuncs.com",
+			"cn-shanghai-internal-test-1": "adb.aliyuncs.com",
+			"cn-beijing-gov-1":            "adb.aliyuncs.com",
+			"cn-shenzhen-su18-b01":        "adb.aliyuncs.com",
+			"cn-beijing":                  "adb.aliyuncs.com",
+			"cn-shanghai-inner":           "adb.aliyuncs.com",
+			"cn-shenzhen-st4-d01":         "adb.aliyuncs.com",
+			"cn-haidian-cm12-c01":         "adb.aliyuncs.com",
+			"cn-hangzhou-internal-prod-1": "adb.aliyuncs.com",
+			"cn-north-2-gov-1":            "adb.aliyuncs.com",
+			"cn-yushanfang":               "adb.aliyuncs.com",
+			"cn-qingdao":                  "adb.aliyuncs.com",
+			"cn-hongkong-finance-pop":     "adb.aliyuncs.com",
+			"cn-qingdao-nebula":           "adb.aliyuncs.com",
+			"cn-shanghai":                 "adb.aliyuncs.com",
+			"cn-shanghai-finance-1":       "adb.aliyuncs.com",
+			"cn-hongkong":                 "adb.aliyuncs.com",
+			"cn-beijing-finance-pop":      "adb.aliyuncs.com",
+			"cn-wuhan":                    "adb.aliyuncs.com",
+			"us-west-1":                   "adb.aliyuncs.com",
+			"cn-shenzhen":                 "adb.aliyuncs.com",
+			"cn-zhengzhou-nebula-1":       "adb.aliyuncs.com",
+			"rus-west-1-pop":              "adb.ap-northeast-1.aliyuncs.com",
+			"cn-shanghai-et15-b01":        "adb.aliyuncs.com",
+			"cn-hangzhou-bj-b01":          "adb.aliyuncs.com",
+			"cn-hangzhou-internal-test-1": "adb.aliyuncs.com",
+			"eu-west-1-oxs":               "adb.ap-northeast-1.aliyuncs.com",
+			"cn-zhangbei-na61-b01":        "adb.aliyuncs.com",
+			"cn-beijing-finance-1":        "adb.aliyuncs.com",
+			"cn-hangzhou-internal-test-3": "adb.aliyuncs.com",
+			"cn-hangzhou-internal-test-2": "adb.aliyuncs.com",
+			"cn-shenzhen-finance-1":       "adb.aliyuncs.com",
+			"me-east-1":                   "adb.ap-northeast-1.aliyuncs.com",
+			"cn-hangzhou-test-306":        "adb.aliyuncs.com",
+			"cn-shanghai-et2-b01":         "adb.aliyuncs.com",
+			"cn-hangzhou-finance":         "adb.aliyuncs.com",
+			"ap-southeast-1":              "adb.aliyuncs.com",
+			"cn-beijing-nu16-b01":         "adb.aliyuncs.com",
+			"cn-edge-1":                   "adb.aliyuncs.com",
+			"us-east-1":                   "adb.aliyuncs.com",
+			"cn-fujian":                   "adb.aliyuncs.com",
+			"ap-northeast-2-pop":          "adb.ap-northeast-1.aliyuncs.com",
+			"cn-shenzhen-inner":           "adb.aliyuncs.com",
+			"cn-zhangjiakou-na62-a01":     "adb.aliyuncs.com",
+			"cn-hangzhou":                 "adb.aliyuncs.com",
 		}
 		}
 	}
 	}
 	return EndpointMap
 	return EndpointMap

+ 118 - 0
services/adb/list_tag_resources.go

@@ -0,0 +1,118 @@
+package adb
+
+//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 adb.ListTagResources API synchronously
+// api document: https://help.aliyun.com/api/adb/listtagresources.html
+func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) {
+	response = CreateListTagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListTagResourcesWithChan invokes the adb.ListTagResources API asynchronously
+// api document: https://help.aliyun.com/api/adb/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 adb.ListTagResources API asynchronously
+// api document: https://help.aliyun.com/api/adb/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"`
+	NextToken            string                 `position:"Query" name:"NextToken"`
+	Tag                  *[]ListTagResourcesTag `position:"Query" name:"Tag"  type:"Repeated"`
+	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"`
+	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("adb", "2019-03-15", "ListTagResources", "ads", "openAPI")
+	return
+}
+
+// CreateListTagResourcesResponse creates a response to parse from ListTagResources response
+func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) {
+	response = &ListTagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 24 - 0
services/adb/struct_tag_resource.go

@@ -0,0 +1,24 @@
+package adb
+
+//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 adb 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/adb/struct_tag_resources.go

@@ -0,0 +1,21 @@
+package adb
+
+//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 adb response
+type TagResources struct {
+	TagResource []TagResource `json:"TagResource" xml:"TagResource"`
+}

+ 115 - 0
services/adb/tag_resources.go

@@ -0,0 +1,115 @@
+package adb
+
+//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 adb.TagResources API synchronously
+// api document: https://help.aliyun.com/api/adb/tagresources.html
+func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) {
+	response = CreateTagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// TagResourcesWithChan invokes the adb.TagResources API asynchronously
+// api document: https://help.aliyun.com/api/adb/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 adb.TagResources API asynchronously
+// api document: https://help.aliyun.com/api/adb/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"`
+	Tag                  *[]TagResourcesTag `position:"Query" name:"Tag"  type:"Repeated"`
+	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"`
+	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("adb", "2019-03-15", "TagResources", "ads", "openAPI")
+	return
+}
+
+// CreateTagResourcesResponse creates a response to parse from TagResources response
+func CreateTagResourcesResponse() (response *TagResourcesResponse) {
+	response = &TagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/adb/untag_resources.go

@@ -0,0 +1,110 @@
+package adb
+
+//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 adb.UntagResources API synchronously
+// api document: https://help.aliyun.com/api/adb/untagresources.html
+func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) {
+	response = CreateUntagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UntagResourcesWithChan invokes the adb.UntagResources API asynchronously
+// api document: https://help.aliyun.com/api/adb/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 adb.UntagResources API asynchronously
+// api document: https://help.aliyun.com/api/adb/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
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	All                  requests.Boolean `position:"Query" name:"All"`
+	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"`
+	ResourceType         string           `position:"Query" name:"ResourceType"`
+	TagKey               *[]string        `position:"Query" name:"TagKey"  type:"Repeated"`
+}
+
+// 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("adb", "2019-03-15", "UntagResources", "ads", "openAPI")
+	return
+}
+
+// CreateUntagResourcesResponse creates a response to parse from UntagResources response
+func CreateUntagResourcesResponse() (response *UntagResourcesResponse) {
+	response = &UntagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}