-
Notifications
You must be signed in to change notification settings - Fork 284
/
EmrClient.java
527 lines (478 loc) · 21.8 KB
/
EmrClient.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* 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.
*/
package com.tencentcloudapi.emr.v20190103;
import java.lang.reflect.Type;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.AbstractClient;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.JsonResponseModel;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.emr.v20190103.models.*;
public class EmrClient extends AbstractClient{
private static String endpoint = "emr.tencentcloudapi.com";
private static String service = "emr";
private static String version = "2019-01-03";
public EmrClient(Credential credential, String region) {
this(credential, region, new ClientProfile());
}
public EmrClient(Credential credential, String region, ClientProfile profile) {
super(EmrClient.endpoint, EmrClient.version, credential, region, profile);
}
/**
*添加扩缩容规则,按负载和时间
* @param req AddMetricScaleStrategyRequest
* @return AddMetricScaleStrategyResponse
* @throws TencentCloudSDKException
*/
public AddMetricScaleStrategyResponse AddMetricScaleStrategy(AddMetricScaleStrategyRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "AddMetricScaleStrategy", AddMetricScaleStrategyResponse.class);
}
/**
*该接口支持安装了OpenLdap组件的集群。
新增用户列表(用户管理)。
* @param req AddUsersForUserManagerRequest
* @return AddUsersForUserManagerResponse
* @throws TencentCloudSDKException
*/
public AddUsersForUserManagerResponse AddUsersForUserManager(AddUsersForUserManagerRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "AddUsersForUserManager", AddUsersForUserManagerResponse.class);
}
/**
*创建EMR集群实例
* @param req CreateClusterRequest
* @return CreateClusterResponse
* @throws TencentCloudSDKException
*/
public CreateClusterResponse CreateCluster(CreateClusterRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "CreateCluster", CreateClusterResponse.class);
}
/**
*创建EMR集群实例
* @param req CreateInstanceRequest
* @return CreateInstanceResponse
* @throws TencentCloudSDKException
*/
public CreateInstanceResponse CreateInstance(CreateInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "CreateInstance", CreateInstanceResponse.class);
}
/**
*删除自动扩缩容规则,后台销毁根据该规则扩缩容出来的节点
* @param req DeleteAutoScaleStrategyRequest
* @return DeleteAutoScaleStrategyResponse
* @throws TencentCloudSDKException
*/
public DeleteAutoScaleStrategyResponse DeleteAutoScaleStrategy(DeleteAutoScaleStrategyRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DeleteAutoScaleStrategy", DeleteAutoScaleStrategyResponse.class);
}
/**
*删除用户列表(用户管理)
* @param req DeleteUserManagerUserListRequest
* @return DeleteUserManagerUserListResponse
* @throws TencentCloudSDKException
*/
public DeleteUserManagerUserListResponse DeleteUserManagerUserList(DeleteUserManagerUserListRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DeleteUserManagerUserList", DeleteUserManagerUserListResponse.class);
}
/**
*获取自动扩缩容全局配置
* @param req DescribeAutoScaleGroupGlobalConfRequest
* @return DescribeAutoScaleGroupGlobalConfResponse
* @throws TencentCloudSDKException
*/
public DescribeAutoScaleGroupGlobalConfResponse DescribeAutoScaleGroupGlobalConf(DescribeAutoScaleGroupGlobalConfRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeAutoScaleGroupGlobalConf", DescribeAutoScaleGroupGlobalConfResponse.class);
}
/**
*获取集群的自动扩缩容的详细记录
* @param req DescribeAutoScaleRecordsRequest
* @return DescribeAutoScaleRecordsResponse
* @throws TencentCloudSDKException
*/
public DescribeAutoScaleRecordsResponse DescribeAutoScaleRecords(DescribeAutoScaleRecordsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeAutoScaleRecords", DescribeAutoScaleRecordsResponse.class);
}
/**
*获取自动扩缩容规则
* @param req DescribeAutoScaleStrategiesRequest
* @return DescribeAutoScaleStrategiesResponse
* @throws TencentCloudSDKException
*/
public DescribeAutoScaleStrategiesResponse DescribeAutoScaleStrategies(DescribeAutoScaleStrategiesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeAutoScaleStrategies", DescribeAutoScaleStrategiesResponse.class);
}
/**
*查询EMR任务运行详情状态
* @param req DescribeClusterFlowStatusDetailRequest
* @return DescribeClusterFlowStatusDetailResponse
* @throws TencentCloudSDKException
*/
public DescribeClusterFlowStatusDetailResponse DescribeClusterFlowStatusDetail(DescribeClusterFlowStatusDetailRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeClusterFlowStatusDetail", DescribeClusterFlowStatusDetailResponse.class);
}
/**
*查询集群节点信息
* @param req DescribeClusterNodesRequest
* @return DescribeClusterNodesResponse
* @throws TencentCloudSDKException
*/
public DescribeClusterNodesResponse DescribeClusterNodes(DescribeClusterNodesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeClusterNodes", DescribeClusterNodesResponse.class);
}
/**
*获取账户的CVM配额
* @param req DescribeCvmQuotaRequest
* @return DescribeCvmQuotaResponse
* @throws TencentCloudSDKException
*/
public DescribeCvmQuotaResponse DescribeCvmQuota(DescribeCvmQuotaRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeCvmQuota", DescribeCvmQuotaResponse.class);
}
/**
*yarn application 统计接口查询
* @param req DescribeEmrApplicationStaticsRequest
* @return DescribeEmrApplicationStaticsResponse
* @throws TencentCloudSDKException
*/
public DescribeEmrApplicationStaticsResponse DescribeEmrApplicationStatics(DescribeEmrApplicationStaticsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeEmrApplicationStatics", DescribeEmrApplicationStaticsResponse.class);
}
/**
*查询监控概览页指标数据
* @param req DescribeEmrOverviewMetricsRequest
* @return DescribeEmrOverviewMetricsResponse
* @throws TencentCloudSDKException
*/
public DescribeEmrOverviewMetricsResponse DescribeEmrOverviewMetrics(DescribeEmrOverviewMetricsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeEmrOverviewMetrics", DescribeEmrOverviewMetricsResponse.class);
}
/**
*获取Hbase表级监控数据概览接口
* @param req DescribeHBaseTableOverviewRequest
* @return DescribeHBaseTableOverviewResponse
* @throws TencentCloudSDKException
*/
public DescribeHBaseTableOverviewResponse DescribeHBaseTableOverview(DescribeHBaseTableOverviewRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeHBaseTableOverview", DescribeHBaseTableOverviewResponse.class);
}
/**
*获取hive查询信息
* @param req DescribeHiveQueriesRequest
* @return DescribeHiveQueriesResponse
* @throws TencentCloudSDKException
*/
public DescribeHiveQueriesResponse DescribeHiveQueries(DescribeHiveQueriesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeHiveQueries", DescribeHiveQueriesResponse.class);
}
/**
*DescribeImpalaQueries
* @param req DescribeImpalaQueriesRequest
* @return DescribeImpalaQueriesResponse
* @throws TencentCloudSDKException
*/
public DescribeImpalaQueriesResponse DescribeImpalaQueries(DescribeImpalaQueriesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeImpalaQueries", DescribeImpalaQueriesResponse.class);
}
/**
*获取洞察结果信息
* @param req DescribeInsightListRequest
* @return DescribeInsightListResponse
* @throws TencentCloudSDKException
*/
public DescribeInsightListResponse DescribeInsightList(DescribeInsightListRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeInsightList", DescribeInsightListResponse.class);
}
/**
*查询待续费节点信息
* @param req DescribeInstanceRenewNodesRequest
* @return DescribeInstanceRenewNodesResponse
* @throws TencentCloudSDKException
*/
public DescribeInstanceRenewNodesResponse DescribeInstanceRenewNodes(DescribeInstanceRenewNodesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeInstanceRenewNodes", DescribeInstanceRenewNodesResponse.class);
}
/**
*查询集群实例信息
* @param req DescribeInstancesRequest
* @return DescribeInstancesResponse
* @throws TencentCloudSDKException
*/
public DescribeInstancesResponse DescribeInstances(DescribeInstancesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeInstances", DescribeInstancesResponse.class);
}
/**
*查询集群列表
* @param req DescribeInstancesListRequest
* @return DescribeInstancesListResponse
* @throws TencentCloudSDKException
*/
public DescribeInstancesListResponse DescribeInstancesList(DescribeInstancesListRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeInstancesList", DescribeInstancesListResponse.class);
}
/**
*查询流程任务
* @param req DescribeJobFlowRequest
* @return DescribeJobFlowResponse
* @throws TencentCloudSDKException
*/
public DescribeJobFlowResponse DescribeJobFlow(DescribeJobFlowRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeJobFlow", DescribeJobFlowResponse.class);
}
/**
*查询YARN资源调度数据信息
* @param req DescribeResourceScheduleRequest
* @return DescribeResourceScheduleResponse
* @throws TencentCloudSDKException
*/
public DescribeResourceScheduleResponse DescribeResourceSchedule(DescribeResourceScheduleRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeResourceSchedule", DescribeResourceScheduleResponse.class);
}
/**
*该接口支持安装了OpenLdap组件的集群。
批量导出用户。对于kerberos集群,如果需要kertab文件下载地址,可以将NeedKeytabInfo设置为true;注意SupportDownLoadKeyTab为true,但是DownLoadKeyTabUrl为空字符串,表示keytab文件在后台没有准备好(正在生成)。
* @param req DescribeUsersForUserManagerRequest
* @return DescribeUsersForUserManagerResponse
* @throws TencentCloudSDKException
*/
public DescribeUsersForUserManagerResponse DescribeUsersForUserManager(DescribeUsersForUserManagerRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeUsersForUserManager", DescribeUsersForUserManagerResponse.class);
}
/**
*DescribeYarnApplications
* @param req DescribeYarnApplicationsRequest
* @return DescribeYarnApplicationsResponse
* @throws TencentCloudSDKException
*/
public DescribeYarnApplicationsResponse DescribeYarnApplications(DescribeYarnApplicationsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "DescribeYarnApplications", DescribeYarnApplicationsResponse.class);
}
/**
*集群续费询价。
* @param req InquirePriceRenewEmrRequest
* @return InquirePriceRenewEmrResponse
* @throws TencentCloudSDKException
*/
public InquirePriceRenewEmrResponse InquirePriceRenewEmr(InquirePriceRenewEmrRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "InquirePriceRenewEmr", InquirePriceRenewEmrResponse.class);
}
/**
*创建实例询价
* @param req InquiryPriceCreateInstanceRequest
* @return InquiryPriceCreateInstanceResponse
* @throws TencentCloudSDKException
*/
public InquiryPriceCreateInstanceResponse InquiryPriceCreateInstance(InquiryPriceCreateInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "InquiryPriceCreateInstance", InquiryPriceCreateInstanceResponse.class);
}
/**
*续费询价。
* @param req InquiryPriceRenewInstanceRequest
* @return InquiryPriceRenewInstanceResponse
* @throws TencentCloudSDKException
*/
public InquiryPriceRenewInstanceResponse InquiryPriceRenewInstance(InquiryPriceRenewInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "InquiryPriceRenewInstance", InquiryPriceRenewInstanceResponse.class);
}
/**
*扩容询价. 当扩容时候,请通过该接口查询价格。
* @param req InquiryPriceScaleOutInstanceRequest
* @return InquiryPriceScaleOutInstanceResponse
* @throws TencentCloudSDKException
*/
public InquiryPriceScaleOutInstanceResponse InquiryPriceScaleOutInstance(InquiryPriceScaleOutInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "InquiryPriceScaleOutInstance", InquiryPriceScaleOutInstanceResponse.class);
}
/**
*变配询价
* @param req InquiryPriceUpdateInstanceRequest
* @return InquiryPriceUpdateInstanceResponse
* @throws TencentCloudSDKException
*/
public InquiryPriceUpdateInstanceResponse InquiryPriceUpdateInstance(InquiryPriceUpdateInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "InquiryPriceUpdateInstance", InquiryPriceUpdateInstanceResponse.class);
}
/**
*修改自动扩缩容规则
* @param req ModifyAutoScaleStrategyRequest
* @return ModifyAutoScaleStrategyResponse
* @throws TencentCloudSDKException
*/
public ModifyAutoScaleStrategyResponse ModifyAutoScaleStrategy(ModifyAutoScaleStrategyRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModifyAutoScaleStrategy", ModifyAutoScaleStrategyResponse.class);
}
/**
*刷新YARN的动态资源池
* @param req ModifyResourcePoolsRequest
* @return ModifyResourcePoolsResponse
* @throws TencentCloudSDKException
*/
public ModifyResourcePoolsResponse ModifyResourcePools(ModifyResourcePoolsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModifyResourcePools", ModifyResourcePoolsResponse.class);
}
/**
*修改YARN资源调度的资源配置
* @param req ModifyResourceScheduleConfigRequest
* @return ModifyResourceScheduleConfigResponse
* @throws TencentCloudSDKException
*/
public ModifyResourceScheduleConfigResponse ModifyResourceScheduleConfig(ModifyResourceScheduleConfigRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModifyResourceScheduleConfig", ModifyResourceScheduleConfigResponse.class);
}
/**
*修改了yarn的资源调度器,点击部署生效
* @param req ModifyResourceSchedulerRequest
* @return ModifyResourceSchedulerResponse
* @throws TencentCloudSDKException
*/
public ModifyResourceSchedulerResponse ModifyResourceScheduler(ModifyResourceSchedulerRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModifyResourceScheduler", ModifyResourceSchedulerResponse.class);
}
/**
*强制修改标签
* @param req ModifyResourcesTagsRequest
* @return ModifyResourcesTagsResponse
* @throws TencentCloudSDKException
*/
public ModifyResourcesTagsResponse ModifyResourcesTags(ModifyResourcesTagsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModifyResourcesTags", ModifyResourcesTagsResponse.class);
}
/**
*修改用户密码(用户管理)
* @param req ModifyUserManagerPwdRequest
* @return ModifyUserManagerPwdResponse
* @throws TencentCloudSDKException
*/
public ModifyUserManagerPwdResponse ModifyUserManagerPwd(ModifyUserManagerPwdRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModifyUserManagerPwd", ModifyUserManagerPwdResponse.class);
}
/**
*创建流程作业
* @param req RunJobFlowRequest
* @return RunJobFlowResponse
* @throws TencentCloudSDKException
*/
public RunJobFlowResponse RunJobFlow(RunJobFlowRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "RunJobFlow", RunJobFlowResponse.class);
}
/**
*扩容集群节点
* @param req ScaleOutClusterRequest
* @return ScaleOutClusterResponse
* @throws TencentCloudSDKException
*/
public ScaleOutClusterResponse ScaleOutCluster(ScaleOutClusterRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ScaleOutCluster", ScaleOutClusterResponse.class);
}
/**
*扩容节点
* @param req ScaleOutInstanceRequest
* @return ScaleOutInstanceResponse
* @throws TencentCloudSDKException
*/
public ScaleOutInstanceResponse ScaleOutInstance(ScaleOutInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ScaleOutInstance", ScaleOutInstanceResponse.class);
}
/**
*用于启停服务 重启服务等功能
* @param req StartStopServiceOrMonitorRequest
* @return StartStopServiceOrMonitorResponse
* @throws TencentCloudSDKException
*/
public StartStopServiceOrMonitorResponse StartStopServiceOrMonitor(StartStopServiceOrMonitorRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "StartStopServiceOrMonitor", StartStopServiceOrMonitorResponse.class);
}
/**
*EMR同步TKE中POD状态
* @param req SyncPodStateRequest
* @return SyncPodStateResponse
* @throws TencentCloudSDKException
*/
public SyncPodStateResponse SyncPodState(SyncPodStateRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "SyncPodState", SyncPodStateResponse.class);
}
/**
*销毁集群节点
* @param req TerminateClusterNodesRequest
* @return TerminateClusterNodesResponse
* @throws TencentCloudSDKException
*/
public TerminateClusterNodesResponse TerminateClusterNodes(TerminateClusterNodesRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "TerminateClusterNodes", TerminateClusterNodesResponse.class);
}
/**
*销毁EMR实例。此接口仅支持弹性MapReduce正式计费版本。
* @param req TerminateInstanceRequest
* @return TerminateInstanceResponse
* @throws TencentCloudSDKException
*/
public TerminateInstanceResponse TerminateInstance(TerminateInstanceRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "TerminateInstance", TerminateInstanceResponse.class);
}
/**
*缩容Task节点
* @param req TerminateTasksRequest
* @return TerminateTasksResponse
* @throws TencentCloudSDKException
*/
public TerminateTasksResponse TerminateTasks(TerminateTasksRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "TerminateTasks", TerminateTasksResponse.class);
}
}