|
|
@@ -0,0 +1,118 @@
|
|
|
+package drds
|
|
|
+
|
|
|
+//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"
|
|
|
+)
|
|
|
+
|
|
|
+// CreateEvaluatePreCheckTask invokes the drds.CreateEvaluatePreCheckTask API synchronously
|
|
|
+// api document: https://help.aliyun.com/api/drds/createevaluateprechecktask.html
|
|
|
+func (client *Client) CreateEvaluatePreCheckTask(request *CreateEvaluatePreCheckTaskRequest) (response *CreateEvaluatePreCheckTaskResponse, err error) {
|
|
|
+ response = CreateCreateEvaluatePreCheckTaskResponse()
|
|
|
+ err = client.DoAction(request, response)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// CreateEvaluatePreCheckTaskWithChan invokes the drds.CreateEvaluatePreCheckTask API asynchronously
|
|
|
+// api document: https://help.aliyun.com/api/drds/createevaluateprechecktask.html
|
|
|
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
|
|
|
+func (client *Client) CreateEvaluatePreCheckTaskWithChan(request *CreateEvaluatePreCheckTaskRequest) (<-chan *CreateEvaluatePreCheckTaskResponse, <-chan error) {
|
|
|
+ responseChan := make(chan *CreateEvaluatePreCheckTaskResponse, 1)
|
|
|
+ errChan := make(chan error, 1)
|
|
|
+ err := client.AddAsyncTask(func() {
|
|
|
+ defer close(responseChan)
|
|
|
+ defer close(errChan)
|
|
|
+ response, err := client.CreateEvaluatePreCheckTask(request)
|
|
|
+ if err != nil {
|
|
|
+ errChan <- err
|
|
|
+ } else {
|
|
|
+ responseChan <- response
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ errChan <- err
|
|
|
+ close(responseChan)
|
|
|
+ close(errChan)
|
|
|
+ }
|
|
|
+ return responseChan, errChan
|
|
|
+}
|
|
|
+
|
|
|
+// CreateEvaluatePreCheckTaskWithCallback invokes the drds.CreateEvaluatePreCheckTask API asynchronously
|
|
|
+// api document: https://help.aliyun.com/api/drds/createevaluateprechecktask.html
|
|
|
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
|
|
|
+func (client *Client) CreateEvaluatePreCheckTaskWithCallback(request *CreateEvaluatePreCheckTaskRequest, callback func(response *CreateEvaluatePreCheckTaskResponse, err error)) <-chan int {
|
|
|
+ result := make(chan int, 1)
|
|
|
+ err := client.AddAsyncTask(func() {
|
|
|
+ var response *CreateEvaluatePreCheckTaskResponse
|
|
|
+ var err error
|
|
|
+ defer close(result)
|
|
|
+ response, err = client.CreateEvaluatePreCheckTask(request)
|
|
|
+ callback(response, err)
|
|
|
+ result <- 1
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ defer close(result)
|
|
|
+ callback(nil, err)
|
|
|
+ result <- 0
|
|
|
+ }
|
|
|
+ return result
|
|
|
+}
|
|
|
+
|
|
|
+// CreateEvaluatePreCheckTaskRequest is the request struct for api CreateEvaluatePreCheckTask
|
|
|
+type CreateEvaluatePreCheckTaskRequest struct {
|
|
|
+ *requests.RpcRequest
|
|
|
+ AvgQpsGrowthScale requests.Integer `position:"Query" name:"AvgQpsGrowthScale"`
|
|
|
+ TaskName string `position:"Query" name:"TaskName"`
|
|
|
+ DataGrowthScale requests.Integer `position:"Query" name:"DataGrowthScale"`
|
|
|
+ DbInfo *[]CreateEvaluatePreCheckTaskDbInfo `position:"Query" name:"DbInfo" type:"Repeated"`
|
|
|
+ EvaluateHours requests.Integer `position:"Query" name:"EvaluateHours"`
|
|
|
+}
|
|
|
+
|
|
|
+// CreateEvaluatePreCheckTaskDbInfo is a repeated param struct in CreateEvaluatePreCheckTaskRequest
|
|
|
+type CreateEvaluatePreCheckTaskDbInfo struct {
|
|
|
+ InstId string `name:"InstId"`
|
|
|
+ DbPort string `name:"DbPort"`
|
|
|
+ DbName string `name:"DbName"`
|
|
|
+ DbPassword string `name:"DbPassword"`
|
|
|
+ DbUser string `name:"DbUser"`
|
|
|
+}
|
|
|
+
|
|
|
+// CreateEvaluatePreCheckTaskResponse is the response struct for api CreateEvaluatePreCheckTask
|
|
|
+type CreateEvaluatePreCheckTaskResponse struct {
|
|
|
+ *responses.BaseResponse
|
|
|
+ RequestId string `json:"RequestId" xml:"RequestId"`
|
|
|
+ Success bool `json:"Success" xml:"Success"`
|
|
|
+ TaskId int64 `json:"TaskId" xml:"TaskId"`
|
|
|
+}
|
|
|
+
|
|
|
+// CreateCreateEvaluatePreCheckTaskRequest creates a request to invoke CreateEvaluatePreCheckTask API
|
|
|
+func CreateCreateEvaluatePreCheckTaskRequest() (request *CreateEvaluatePreCheckTaskRequest) {
|
|
|
+ request = &CreateEvaluatePreCheckTaskRequest{
|
|
|
+ RpcRequest: &requests.RpcRequest{},
|
|
|
+ }
|
|
|
+ request.InitWithApiInfo("Drds", "2019-01-23", "CreateEvaluatePreCheckTask", "Drds", "openAPI")
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// CreateCreateEvaluatePreCheckTaskResponse creates a response to parse from CreateEvaluatePreCheckTask response
|
|
|
+func CreateCreateEvaluatePreCheckTaskResponse() (response *CreateEvaluatePreCheckTaskResponse) {
|
|
|
+ response = &CreateEvaluatePreCheckTaskResponse{
|
|
|
+ BaseResponse: &responses.BaseResponse{},
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|