Browse Source

Optimize instance relevant interface.

sdk-team 6 years ago
parent
commit
8f3f1c9b10

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-10-24 Version: 1.60.214
+- Optimize instance relevant interface.
+
 2019-10-24 Version: 1.60.213
 - Generated 2017-12-14 for `BssOpenApi`.
 

+ 0 - 25
services/alikafka/client.go

@@ -16,8 +16,6 @@ package alikafka
 // 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"
@@ -28,25 +26,10 @@ 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
 }
 
@@ -61,7 +44,6 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 		pc = provider.NewProviderChain(providers)
 	}
 	err = client.InitWithProviderChain(regionId, pc)
-	SetEndpointDataToClient(client)
 	return
 }
 
@@ -70,7 +52,6 @@ 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
 }
 
@@ -79,7 +60,6 @@ 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
 }
 
@@ -88,7 +68,6 @@ 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
 }
 
@@ -97,7 +76,6 @@ 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
 }
 
@@ -106,7 +84,6 @@ 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
 }
 
@@ -115,7 +92,6 @@ 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
 }
 
@@ -124,6 +100,5 @@ 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
 }

+ 107 - 0
services/alikafka/describe_node_status.go

@@ -0,0 +1,107 @@
+package alikafka
+
+//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"
+)
+
+// DescribeNodeStatus invokes the alikafka.DescribeNodeStatus API synchronously
+// api document: https://help.aliyun.com/api/alikafka/describenodestatus.html
+func (client *Client) DescribeNodeStatus(request *DescribeNodeStatusRequest) (response *DescribeNodeStatusResponse, err error) {
+	response = CreateDescribeNodeStatusResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeNodeStatusWithChan invokes the alikafka.DescribeNodeStatus API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/describenodestatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeNodeStatusWithChan(request *DescribeNodeStatusRequest) (<-chan *DescribeNodeStatusResponse, <-chan error) {
+	responseChan := make(chan *DescribeNodeStatusResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeNodeStatus(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeNodeStatusWithCallback invokes the alikafka.DescribeNodeStatus API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/describenodestatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeNodeStatusWithCallback(request *DescribeNodeStatusRequest, callback func(response *DescribeNodeStatusResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeNodeStatusResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeNodeStatus(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeNodeStatusRequest is the request struct for api DescribeNodeStatus
+type DescribeNodeStatusRequest struct {
+	*requests.RpcRequest
+	InstanceId string `position:"Query" name:"InstanceId"`
+}
+
+// DescribeNodeStatusResponse is the response struct for api DescribeNodeStatus
+type DescribeNodeStatusResponse struct {
+	*responses.BaseResponse
+	RequestId  string     `json:"RequestId" xml:"RequestId"`
+	Success    bool       `json:"Success" xml:"Success"`
+	Code       int        `json:"Code" xml:"Code"`
+	Message    string     `json:"Message" xml:"Message"`
+	StatusList StatusList `json:"StatusList" xml:"StatusList"`
+}
+
+// CreateDescribeNodeStatusRequest creates a request to invoke DescribeNodeStatus API
+func CreateDescribeNodeStatusRequest() (request *DescribeNodeStatusRequest) {
+	request = &DescribeNodeStatusRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alikafka", "2019-09-16", "DescribeNodeStatus", "alikafka", "openAPI")
+	return
+}
+
+// CreateDescribeNodeStatusResponse creates a response to parse from DescribeNodeStatus response
+func CreateDescribeNodeStatusResponse() (response *DescribeNodeStatusResponse) {
+	response = &DescribeNodeStatusResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 3 - 2
services/alikafka/release_instance.go

@@ -76,8 +76,9 @@ func (client *Client) ReleaseInstanceWithCallback(request *ReleaseInstanceReques
 // ReleaseInstanceRequest is the request struct for api ReleaseInstance
 type ReleaseInstanceRequest struct {
 	*requests.RpcRequest
-	InstanceId        string           `position:"Query" name:"InstanceId"`
-	ReleaseIgnoreTime requests.Boolean `position:"Query" name:"ReleaseIgnoreTime"`
+	ForceDeleteInstance requests.Boolean `position:"Query" name:"ForceDeleteInstance"`
+	InstanceId          string           `position:"Query" name:"InstanceId"`
+	ReleaseIgnoreTime   requests.Boolean `position:"Query" name:"ReleaseIgnoreTime"`
 }
 
 // ReleaseInstanceResponse is the response struct for api ReleaseInstance

+ 21 - 0
services/alikafka/struct_status_list.go

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

+ 0 - 1
services/alikafka/upgrade_post_pay_order.go

@@ -81,7 +81,6 @@ type UpgradePostPayOrderRequest struct {
 	TopicQuota requests.Integer `position:"Query" name:"TopicQuota"`
 	EipMax     requests.Integer `position:"Query" name:"EipMax"`
 	InstanceId string           `position:"Query" name:"InstanceId"`
-	MsgRetain  requests.Integer `position:"Query" name:"MsgRetain"`
 }
 
 // UpgradePostPayOrderResponse is the response struct for api UpgradePostPayOrder