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// ModifyExecutionPlan invokes the emr.ModifyExecutionPlan API synchronously
24func (client *Client) ModifyExecutionPlan(request *ModifyExecutionPlanRequest) (response *ModifyExecutionPlanResponse, err error) {
25	response = CreateModifyExecutionPlanResponse()
26	err = client.DoAction(request, response)
27	return
28}
29
30// ModifyExecutionPlanWithChan invokes the emr.ModifyExecutionPlan API asynchronously
31func (client *Client) ModifyExecutionPlanWithChan(request *ModifyExecutionPlanRequest) (<-chan *ModifyExecutionPlanResponse, <-chan error) {
32	responseChan := make(chan *ModifyExecutionPlanResponse, 1)
33	errChan := make(chan error, 1)
34	err := client.AddAsyncTask(func() {
35		defer close(responseChan)
36		defer close(errChan)
37		response, err := client.ModifyExecutionPlan(request)
38		if err != nil {
39			errChan <- err
40		} else {
41			responseChan <- response
42		}
43	})
44	if err != nil {
45		errChan <- err
46		close(responseChan)
47		close(errChan)
48	}
49	return responseChan, errChan
50}
51
52// ModifyExecutionPlanWithCallback invokes the emr.ModifyExecutionPlan API asynchronously
53func (client *Client) ModifyExecutionPlanWithCallback(request *ModifyExecutionPlanRequest, callback func(response *ModifyExecutionPlanResponse, err error)) <-chan int {
54	result := make(chan int, 1)
55	err := client.AddAsyncTask(func() {
56		var response *ModifyExecutionPlanResponse
57		var err error
58		defer close(result)
59		response, err = client.ModifyExecutionPlan(request)
60		callback(response, err)
61		result <- 1
62	})
63	if err != nil {
64		defer close(result)
65		callback(nil, err)
66		result <- 0
67	}
68	return result
69}
70
71// ModifyExecutionPlanRequest is the request struct for api ModifyExecutionPlan
72type ModifyExecutionPlanRequest struct {
73	*requests.RpcRequest
74	ResourceOwnerId        requests.Integer                      `position:"Query" name:"ResourceOwnerId"`
75	LogPath                string                                `position:"Query" name:"LogPath"`
76	TimeInterval           requests.Integer                      `position:"Query" name:"TimeInterval"`
77	ClusterName            string                                `position:"Query" name:"ClusterName"`
78	Configurations         string                                `position:"Query" name:"Configurations"`
79	CreateClusterOnDemand  requests.Boolean                      `position:"Query" name:"CreateClusterOnDemand"`
80	StartTime              requests.Integer                      `position:"Query" name:"StartTime"`
81	BootstrapAction        *[]ModifyExecutionPlanBootstrapAction `position:"Query" name:"BootstrapAction"  type:"Repeated"`
82	EmrVer                 string                                `position:"Query" name:"EmrVer"`
83	Id                     string                                `position:"Query" name:"Id"`
84	IsOpenPublicIp         requests.Boolean                      `position:"Query" name:"IsOpenPublicIp"`
85	ExecutionPlanVersion   requests.Integer                      `position:"Query" name:"ExecutionPlanVersion"`
86	InstanceGeneration     string                                `position:"Query" name:"InstanceGeneration"`
87	ClusterType            string                                `position:"Query" name:"ClusterType"`
88	VSwitchId              string                                `position:"Query" name:"VSwitchId"`
89	OptionSoftWareList     *[]string                             `position:"Query" name:"OptionSoftWareList"  type:"Repeated"`
90	NetType                string                                `position:"Query" name:"NetType"`
91	EcsOrder               *[]ModifyExecutionPlanEcsOrder        `position:"Query" name:"EcsOrder"  type:"Repeated"`
92	Name                   string                                `position:"Query" name:"Name"`
93	ZoneId                 string                                `position:"Query" name:"ZoneId"`
94	UseCustomHiveMetaDB    requests.Boolean                      `position:"Query" name:"UseCustomHiveMetaDB"`
95	InitCustomHiveMetaDB   requests.Boolean                      `position:"Query" name:"InitCustomHiveMetaDB"`
96	IoOptimized            requests.Boolean                      `position:"Query" name:"IoOptimized"`
97	SecurityGroupId        string                                `position:"Query" name:"SecurityGroupId"`
98	EasEnable              requests.Boolean                      `position:"Query" name:"EasEnable"`
99	JobIdList              *[]string                             `position:"Query" name:"JobIdList"  type:"Repeated"`
100	DayOfMonth             string                                `position:"Query" name:"DayOfMonth"`
101	UseLocalMetaDb         requests.Boolean                      `position:"Query" name:"UseLocalMetaDb"`
102	UserDefinedEmrEcsRole  string                                `position:"Query" name:"UserDefinedEmrEcsRole"`
103	ClusterId              string                                `position:"Query" name:"ClusterId"`
104	TimeUnit               string                                `position:"Query" name:"TimeUnit"`
105	VpcId                  string                                `position:"Query" name:"VpcId"`
106	WorkflowDefinition     string                                `position:"Query" name:"WorkflowDefinition"`
107	DayOfWeek              string                                `position:"Query" name:"DayOfWeek"`
108	Strategy               string                                `position:"Query" name:"Strategy"`
109	Config                 *[]ModifyExecutionPlanConfig          `position:"Query" name:"Config"  type:"Repeated"`
110	HighAvailabilityEnable requests.Boolean                      `position:"Query" name:"HighAvailabilityEnable"`
111	LogEnable              requests.Boolean                      `position:"Query" name:"LogEnable"`
112}
113
114// ModifyExecutionPlanBootstrapAction is a repeated param struct in ModifyExecutionPlanRequest
115type ModifyExecutionPlanBootstrapAction struct {
116	Path                  string `name:"Path"`
117	ExecutionTarget       string `name:"ExecutionTarget"`
118	ExecutionMoment       string `name:"ExecutionMoment"`
119	Arg                   string `name:"Arg"`
120	Name                  string `name:"Name"`
121	ExecutionFailStrategy string `name:"ExecutionFailStrategy"`
122}
123
124// ModifyExecutionPlanEcsOrder is a repeated param struct in ModifyExecutionPlanRequest
125type ModifyExecutionPlanEcsOrder struct {
126	NodeType     string `name:"NodeType"`
127	DiskCount    string `name:"DiskCount"`
128	NodeCount    string `name:"NodeCount"`
129	DiskCapacity string `name:"DiskCapacity"`
130	Index        string `name:"Index"`
131	InstanceType string `name:"InstanceType"`
132	DiskType     string `name:"DiskType"`
133}
134
135// ModifyExecutionPlanConfig is a repeated param struct in ModifyExecutionPlanRequest
136type ModifyExecutionPlanConfig struct {
137	ConfigKey   string `name:"ConfigKey"`
138	FileName    string `name:"FileName"`
139	Encrypt     string `name:"Encrypt"`
140	Replace     string `name:"Replace"`
141	ConfigValue string `name:"ConfigValue"`
142	ServiceName string `name:"ServiceName"`
143}
144
145// ModifyExecutionPlanResponse is the response struct for api ModifyExecutionPlan
146type ModifyExecutionPlanResponse struct {
147	*responses.BaseResponse
148	RequestId string `json:"RequestId" xml:"RequestId"`
149}
150
151// CreateModifyExecutionPlanRequest creates a request to invoke ModifyExecutionPlan API
152func CreateModifyExecutionPlanRequest() (request *ModifyExecutionPlanRequest) {
153	request = &ModifyExecutionPlanRequest{
154		RpcRequest: &requests.RpcRequest{},
155	}
156	request.InitWithApiInfo("Emr", "2016-04-08", "ModifyExecutionPlan", "emr", "openAPI")
157	request.Method = requests.POST
158	return
159}
160
161// CreateModifyExecutionPlanResponse creates a response to parse from ModifyExecutionPlan response
162func CreateModifyExecutionPlanResponse() (response *ModifyExecutionPlanResponse) {
163	response = &ModifyExecutionPlanResponse{
164		BaseResponse: &responses.BaseResponse{},
165	}
166	return
167}
168