1package emr
2
3//Licensed under the Apache License, Version 2.0 (the "License");
4//you may not use this file except in compliance with the License.
5//You may obtain a copy of the License at
6//
7//http://www.apache.org/licenses/LICENSE-2.0
8//
9//Unless required by applicable law or agreed to in writing, software
10//distributed under the License is distributed on an "AS IS" BASIS,
11//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//See the License for the specific language governing permissions and
13//limitations under the License.
14//
15// Code generated by Alibaba Cloud SDK Code Generator.
16// Changes may cause incorrect behavior and will be lost if the code is regenerated.
17
18import (
19	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
20	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
21)
22
23// ModifyExecutionPlanClusterInfo invokes the emr.ModifyExecutionPlanClusterInfo API synchronously
24// api document: https://help.aliyun.com/api/emr/modifyexecutionplanclusterinfo.html
25func (client *Client) ModifyExecutionPlanClusterInfo(request *ModifyExecutionPlanClusterInfoRequest) (response *ModifyExecutionPlanClusterInfoResponse, err error) {
26	response = CreateModifyExecutionPlanClusterInfoResponse()
27	err = client.DoAction(request, response)
28	return
29}
30
31// ModifyExecutionPlanClusterInfoWithChan invokes the emr.ModifyExecutionPlanClusterInfo API asynchronously
32// api document: https://help.aliyun.com/api/emr/modifyexecutionplanclusterinfo.html
33// asynchronous document: https://help.aliyun.com/document_detail/66220.html
34func (client *Client) ModifyExecutionPlanClusterInfoWithChan(request *ModifyExecutionPlanClusterInfoRequest) (<-chan *ModifyExecutionPlanClusterInfoResponse, <-chan error) {
35	responseChan := make(chan *ModifyExecutionPlanClusterInfoResponse, 1)
36	errChan := make(chan error, 1)
37	err := client.AddAsyncTask(func() {
38		defer close(responseChan)
39		defer close(errChan)
40		response, err := client.ModifyExecutionPlanClusterInfo(request)
41		if err != nil {
42			errChan <- err
43		} else {
44			responseChan <- response
45		}
46	})
47	if err != nil {
48		errChan <- err
49		close(responseChan)
50		close(errChan)
51	}
52	return responseChan, errChan
53}
54
55// ModifyExecutionPlanClusterInfoWithCallback invokes the emr.ModifyExecutionPlanClusterInfo API asynchronously
56// api document: https://help.aliyun.com/api/emr/modifyexecutionplanclusterinfo.html
57// asynchronous document: https://help.aliyun.com/document_detail/66220.html
58func (client *Client) ModifyExecutionPlanClusterInfoWithCallback(request *ModifyExecutionPlanClusterInfoRequest, callback func(response *ModifyExecutionPlanClusterInfoResponse, err error)) <-chan int {
59	result := make(chan int, 1)
60	err := client.AddAsyncTask(func() {
61		var response *ModifyExecutionPlanClusterInfoResponse
62		var err error
63		defer close(result)
64		response, err = client.ModifyExecutionPlanClusterInfo(request)
65		callback(response, err)
66		result <- 1
67	})
68	if err != nil {
69		defer close(result)
70		callback(nil, err)
71		result <- 0
72	}
73	return result
74}
75
76// ModifyExecutionPlanClusterInfoRequest is the request struct for api ModifyExecutionPlanClusterInfo
77type ModifyExecutionPlanClusterInfoRequest struct {
78	*requests.RpcRequest
79	ResourceOwnerId        requests.Integer                                 `position:"Query" name:"ResourceOwnerId"`
80	LogPath                string                                           `position:"Query" name:"LogPath"`
81	ClusterName            string                                           `position:"Query" name:"ClusterName"`
82	Configurations         string                                           `position:"Query" name:"Configurations"`
83	IoOptimized            requests.Boolean                                 `position:"Query" name:"IoOptimized"`
84	SecurityGroupId        string                                           `position:"Query" name:"SecurityGroupId"`
85	EasEnable              requests.Boolean                                 `position:"Query" name:"EasEnable"`
86	CreateClusterOnDemand  requests.Boolean                                 `position:"Query" name:"CreateClusterOnDemand"`
87	BootstrapAction        *[]ModifyExecutionPlanClusterInfoBootstrapAction `position:"Query" name:"BootstrapAction"  type:"Repeated"`
88	UseLocalMetaDb         requests.Boolean                                 `position:"Query" name:"UseLocalMetaDb"`
89	EmrVer                 string                                           `position:"Query" name:"EmrVer"`
90	Id                     string                                           `position:"Query" name:"Id"`
91	IsOpenPublicIp         requests.Boolean                                 `position:"Query" name:"IsOpenPublicIp"`
92	ClusterId              string                                           `position:"Query" name:"ClusterId"`
93	InstanceGeneration     string                                           `position:"Query" name:"InstanceGeneration"`
94	ClusterType            string                                           `position:"Query" name:"ClusterType"`
95	VSwitchId              string                                           `position:"Query" name:"VSwitchId"`
96	OptionSoftWareList     *[]string                                        `position:"Query" name:"OptionSoftWareList"  type:"Repeated"`
97	VpcId                  string                                           `position:"Query" name:"VpcId"`
98	NetType                string                                           `position:"Query" name:"NetType"`
99	EcsOrder               *[]ModifyExecutionPlanClusterInfoEcsOrder        `position:"Query" name:"EcsOrder"  type:"Repeated"`
100	ZoneId                 string                                           `position:"Query" name:"ZoneId"`
101	HighAvailabilityEnable requests.Boolean                                 `position:"Query" name:"HighAvailabilityEnable"`
102	LogEnable              requests.Boolean                                 `position:"Query" name:"LogEnable"`
103}
104
105// ModifyExecutionPlanClusterInfoBootstrapAction is a repeated param struct in ModifyExecutionPlanClusterInfoRequest
106type ModifyExecutionPlanClusterInfoBootstrapAction struct {
107	Path string `name:"Path"`
108	Arg  string `name:"Arg"`
109	Name string `name:"Name"`
110}
111
112// ModifyExecutionPlanClusterInfoEcsOrder is a repeated param struct in ModifyExecutionPlanClusterInfoRequest
113type ModifyExecutionPlanClusterInfoEcsOrder struct {
114	NodeType     string `name:"NodeType"`
115	DiskCount    string `name:"DiskCount"`
116	NodeCount    string `name:"NodeCount"`
117	DiskCapacity string `name:"DiskCapacity"`
118	Index        string `name:"Index"`
119	InstanceType string `name:"InstanceType"`
120	DiskType     string `name:"DiskType"`
121}
122
123// ModifyExecutionPlanClusterInfoResponse is the response struct for api ModifyExecutionPlanClusterInfo
124type ModifyExecutionPlanClusterInfoResponse struct {
125	*responses.BaseResponse
126	RequestId string `json:"RequestId" xml:"RequestId"`
127}
128
129// CreateModifyExecutionPlanClusterInfoRequest creates a request to invoke ModifyExecutionPlanClusterInfo API
130func CreateModifyExecutionPlanClusterInfoRequest() (request *ModifyExecutionPlanClusterInfoRequest) {
131	request = &ModifyExecutionPlanClusterInfoRequest{
132		RpcRequest: &requests.RpcRequest{},
133	}
134	request.InitWithApiInfo("Emr", "2016-04-08", "ModifyExecutionPlanClusterInfo", "emr", "openAPI")
135	return
136}
137
138// CreateModifyExecutionPlanClusterInfoResponse creates a response to parse from ModifyExecutionPlanClusterInfo response
139func CreateModifyExecutionPlanClusterInfoResponse() (response *ModifyExecutionPlanClusterInfoResponse) {
140	response = &ModifyExecutionPlanClusterInfoResponse{
141		BaseResponse: &responses.BaseResponse{},
142	}
143	return
144}
145