Преглед на файлове

由荣旸发起的TESLADAM SDK自动发布, BUILD_ID=310, 版本号:1.1.1

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao преди 7 години
родител
ревизия
8b1e0a9f6b

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2018-02-27 Version: 1.1.1
+1, Add Action API.
+
 2018-02-27 Version: 1.1.0
 1, add new api DescribeClusters,DescribeClusterLogs,DescribeClusterNodes,UpgradeClusterComponents
 

+ 94 - 0
services/tesladam/action.go

@@ -0,0 +1,94 @@
+package tesladam
+
+//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"
+)
+
+func (client *Client) Action(request *ActionRequest) (response *ActionResponse, err error) {
+	response = CreateActionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) ActionWithChan(request *ActionRequest) (<-chan *ActionResponse, <-chan error) {
+	responseChan := make(chan *ActionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.Action(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) ActionWithCallback(request *ActionRequest, callback func(response *ActionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ActionResponse
+		var err error
+		defer close(result)
+		response, err = client.Action(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type ActionRequest struct {
+	*requests.RpcRequest
+	OrderId  requests.Integer `position:"Query" name:"OrderId"`
+	StepCode string           `position:"Query" name:"StepCode"`
+}
+
+type ActionResponse struct {
+	*responses.BaseResponse
+	Status  bool   `json:"Status" xml:"Status"`
+	Message string `json:"Message" xml:"Message"`
+	Result  string `json:"Result" xml:"Result"`
+}
+
+func CreateActionRequest() (request *ActionRequest) {
+	request = &ActionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("TeslaDam", "2018-01-18", "Action", "", "")
+	return
+}
+
+func CreateActionResponse() (response *ActionResponse) {
+	response = &ActionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 1 - 1
services/tesladam/action_disk_check.go

@@ -67,8 +67,8 @@ func (client *Client) ActionDiskCheckWithCallback(request *ActionDiskCheckReques
 
 type ActionDiskCheckRequest struct {
 	*requests.RpcRequest
-	Ip        string `position:"Query" name:"Ip"`
 	DiskMount string `position:"Query" name:"DiskMount"`
+	Ip        string `position:"Query" name:"Ip"`
 }
 
 type ActionDiskCheckResponse struct {

+ 2 - 2
services/tesladam/action_disk_mask.go

@@ -67,9 +67,9 @@ func (client *Client) ActionDiskMaskWithCallback(request *ActionDiskMaskRequest,
 
 type ActionDiskMaskRequest struct {
 	*requests.RpcRequest
-	Ip        string `position:"Query" name:"Ip"`
-	DiskMount string `position:"Query" name:"DiskMount"`
 	Op        string `position:"Query" name:"Op"`
+	DiskMount string `position:"Query" name:"DiskMount"`
+	Ip        string `position:"Query" name:"Ip"`
 }
 
 type ActionDiskMaskResponse struct {

+ 4 - 4
services/tesladam/action_disk_rma.go

@@ -67,13 +67,13 @@ func (client *Client) ActionDiskRmaWithCallback(request *ActionDiskRmaRequest, c
 
 type ActionDiskRmaRequest struct {
 	*requests.RpcRequest
-	Hostname    string `position:"Query" name:"Hostname"`
-	DiskMount   string `position:"Query" name:"DiskMount"`
+	DiskName    string `position:"Query" name:"DiskName"`
 	ExecutionId string `position:"Query" name:"ExecutionId"`
 	DiskSlot    string `position:"Query" name:"DiskSlot"`
-	DiskName    string `position:"Query" name:"DiskName"`
-	DiskSn      string `position:"Query" name:"DiskSn"`
+	Hostname    string `position:"Query" name:"Hostname"`
+	DiskMount   string `position:"Query" name:"DiskMount"`
 	DiskReason  string `position:"Query" name:"DiskReason"`
+	DiskSn      string `position:"Query" name:"DiskSn"`
 }
 
 type ActionDiskRmaResponse struct {

+ 11 - 2
services/tesladam/host_gets.go

@@ -67,17 +67,26 @@ func (client *Client) HostGetsWithCallback(request *HostGetsRequest, callback fu
 
 type HostGetsRequest struct {
 	*requests.RpcRequest
-	QueryType string           `position:"Query" name:"QueryType"`
 	Query     string           `position:"Query" name:"Query"`
 	EndTime   requests.Integer `position:"Query" name:"EndTime"`
 	StartTime requests.Integer `position:"Query" name:"StartTime"`
+	QueryType string           `position:"Query" name:"QueryType"`
 }
 
 type HostGetsResponse struct {
 	*responses.BaseResponse
 	Status  bool   `json:"Status" xml:"Status"`
 	Message string `json:"Message" xml:"Message"`
-	Data    []Data `json:"Data" xml:"Data"`
+	Data    []struct {
+		Hostname         string `json:"Hostname" xml:"Hostname"`
+		Ip               string `json:"Ip" xml:"Ip"`
+		AppCode          string `json:"AppCode" xml:"AppCode"`
+		ClusterCode      string `json:"ClusterCode" xml:"ClusterCode"`
+		SshStatus        int    `json:"SshStatus" xml:"SshStatus"`
+		HeartStatus      int    `json:"heartStatus" xml:"heartStatus"`
+		HealthScoreLast  int    `json:"HealthScoreLast" xml:"HealthScoreLast"`
+		HealthReasonLast string `json:"HealthReasonLast" xml:"HealthReasonLast"`
+	} `json:"Data" xml:"Data"`
 }
 
 func CreateHostGetsRequest() (request *HostGetsRequest) {

+ 0 - 27
services/tesladam/struct_data.go

@@ -1,27 +0,0 @@
-package tesladam
-
-//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.
-
-type Data struct {
-	ClusterCode      string `json:"ClusterCode" xml:"ClusterCode"`
-	Ip               string `json:"Ip" xml:"Ip"`
-	Hostname         string `json:"Hostname" xml:"Hostname"`
-	SshStatus        int    `json:"SshStatus" xml:"SshStatus"`
-	HealthScoreLast  int    `json:"HealthScoreLast" xml:"HealthScoreLast"`
-	HealthReasonLast string `json:"HealthReasonLast" xml:"HealthReasonLast"`
-	AppCode          string `json:"AppCode" xml:"AppCode"`
-	HeartStatus      int    `json:"heartStatus" xml:"heartStatus"`
-}

+ 0 - 20
services/tesladam/struct_data_in_host_gets.go

@@ -1,20 +0,0 @@
-package tesladam
-
-//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.
-
-type DataInHostGets struct {
-	Data []Data `json:"data" xml:"data"`
-}