forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
3270 lines (2596 loc) · 103 KB
/
api.go
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
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package emr provides a client for Amazon Elastic MapReduce.
package emr
import (
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/service"
)
const opAddInstanceGroups = "AddInstanceGroups"
// AddInstanceGroupsRequest generates a request for the AddInstanceGroups operation.
func (c *EMR) AddInstanceGroupsRequest(input *AddInstanceGroupsInput) (req *service.Request, output *AddInstanceGroupsOutput) {
op := &service.Operation{
Name: opAddInstanceGroups,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AddInstanceGroupsInput{}
}
req = c.newRequest(op, input, output)
output = &AddInstanceGroupsOutput{}
req.Data = output
return
}
// AddInstanceGroups adds an instance group to a running cluster.
func (c *EMR) AddInstanceGroups(input *AddInstanceGroupsInput) (*AddInstanceGroupsOutput, error) {
req, out := c.AddInstanceGroupsRequest(input)
err := req.Send()
return out, err
}
const opAddJobFlowSteps = "AddJobFlowSteps"
// AddJobFlowStepsRequest generates a request for the AddJobFlowSteps operation.
func (c *EMR) AddJobFlowStepsRequest(input *AddJobFlowStepsInput) (req *service.Request, output *AddJobFlowStepsOutput) {
op := &service.Operation{
Name: opAddJobFlowSteps,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AddJobFlowStepsInput{}
}
req = c.newRequest(op, input, output)
output = &AddJobFlowStepsOutput{}
req.Data = output
return
}
// AddJobFlowSteps adds new steps to a running job flow. A maximum of 256 steps
// are allowed in each job flow.
//
// If your job flow is long-running (such as a Hive data warehouse) or complex,
// you may require more than 256 steps to process your data. You can bypass
// the 256-step limitation in various ways, including using the SSH shell to
// connect to the master node and submitting queries directly to the software
// running on the master node, such as Hive and Hadoop. For more information
// on how to do this, go to Add More than 256 Steps to a Job Flow (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/AddMoreThan256Steps.html)
// in the Amazon Elastic MapReduce Developer's Guide.
//
// A step specifies the location of a JAR file stored either on the master
// node of the job flow or in Amazon S3. Each step is performed by the main
// function of the main class of the JAR file. The main class can be specified
// either in the manifest of the JAR or by using the MainFunction parameter
// of the step.
//
// Elastic MapReduce executes each step in the order listed. For a step to
// be considered complete, the main function must exit with a zero exit code
// and all Hadoop jobs started while the step was running must have completed
// and run successfully.
//
// You can only add steps to a job flow that is in one of the following states:
// STARTING, BOOTSTRAPPING, RUNNING, or WAITING.
func (c *EMR) AddJobFlowSteps(input *AddJobFlowStepsInput) (*AddJobFlowStepsOutput, error) {
req, out := c.AddJobFlowStepsRequest(input)
err := req.Send()
return out, err
}
const opAddTags = "AddTags"
// AddTagsRequest generates a request for the AddTags operation.
func (c *EMR) AddTagsRequest(input *AddTagsInput) (req *service.Request, output *AddTagsOutput) {
op := &service.Operation{
Name: opAddTags,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AddTagsInput{}
}
req = c.newRequest(op, input, output)
output = &AddTagsOutput{}
req.Data = output
return
}
// Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters
// in various ways, such as grouping clusters to track your Amazon EMR resource
// allocation costs. For more information, see Tagging Amazon EMR Resources
// (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.html).
func (c *EMR) AddTags(input *AddTagsInput) (*AddTagsOutput, error) {
req, out := c.AddTagsRequest(input)
err := req.Send()
return out, err
}
const opDescribeCluster = "DescribeCluster"
// DescribeClusterRequest generates a request for the DescribeCluster operation.
func (c *EMR) DescribeClusterRequest(input *DescribeClusterInput) (req *service.Request, output *DescribeClusterOutput) {
op := &service.Operation{
Name: opDescribeCluster,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeClusterInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeClusterOutput{}
req.Data = output
return
}
// Provides cluster-level details including status, hardware and software configuration,
// VPC settings, and so on. For information about the cluster steps, see ListSteps.
func (c *EMR) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) {
req, out := c.DescribeClusterRequest(input)
err := req.Send()
return out, err
}
const opDescribeJobFlows = "DescribeJobFlows"
// DescribeJobFlowsRequest generates a request for the DescribeJobFlows operation.
func (c *EMR) DescribeJobFlowsRequest(input *DescribeJobFlowsInput) (req *service.Request, output *DescribeJobFlowsOutput) {
op := &service.Operation{
Name: opDescribeJobFlows,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeJobFlowsInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeJobFlowsOutput{}
req.Data = output
return
}
// This API is deprecated and will eventually be removed. We recommend you use
// ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions
// instead.
//
// DescribeJobFlows returns a list of job flows that match all of the supplied
// parameters. The parameters can include a list of job flow IDs, job flow states,
// and restrictions on job flow creation date and time.
//
// Regardless of supplied parameters, only job flows created within the last
// two months are returned.
//
// If no parameters are supplied, then job flows matching either of the following
// criteria are returned:
//
// Job flows created and completed in the last two weeks Job flows created
// within the last two months that are in one of the following states: RUNNING,
// WAITING, SHUTTING_DOWN, STARTING Amazon Elastic MapReduce can return a
// maximum of 512 job flow descriptions.
func (c *EMR) DescribeJobFlows(input *DescribeJobFlowsInput) (*DescribeJobFlowsOutput, error) {
req, out := c.DescribeJobFlowsRequest(input)
err := req.Send()
return out, err
}
const opDescribeStep = "DescribeStep"
// DescribeStepRequest generates a request for the DescribeStep operation.
func (c *EMR) DescribeStepRequest(input *DescribeStepInput) (req *service.Request, output *DescribeStepOutput) {
op := &service.Operation{
Name: opDescribeStep,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeStepInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeStepOutput{}
req.Data = output
return
}
// Provides more detail about the cluster step.
func (c *EMR) DescribeStep(input *DescribeStepInput) (*DescribeStepOutput, error) {
req, out := c.DescribeStepRequest(input)
err := req.Send()
return out, err
}
const opListBootstrapActions = "ListBootstrapActions"
// ListBootstrapActionsRequest generates a request for the ListBootstrapActions operation.
func (c *EMR) ListBootstrapActionsRequest(input *ListBootstrapActionsInput) (req *service.Request, output *ListBootstrapActionsOutput) {
op := &service.Operation{
Name: opListBootstrapActions,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &service.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"Marker"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &ListBootstrapActionsInput{}
}
req = c.newRequest(op, input, output)
output = &ListBootstrapActionsOutput{}
req.Data = output
return
}
// Provides information about the bootstrap actions associated with a cluster.
func (c *EMR) ListBootstrapActions(input *ListBootstrapActionsInput) (*ListBootstrapActionsOutput, error) {
req, out := c.ListBootstrapActionsRequest(input)
err := req.Send()
return out, err
}
func (c *EMR) ListBootstrapActionsPages(input *ListBootstrapActionsInput, fn func(p *ListBootstrapActionsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListBootstrapActionsRequest(input)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListBootstrapActionsOutput), lastPage)
})
}
const opListClusters = "ListClusters"
// ListClustersRequest generates a request for the ListClusters operation.
func (c *EMR) ListClustersRequest(input *ListClustersInput) (req *service.Request, output *ListClustersOutput) {
op := &service.Operation{
Name: opListClusters,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &service.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"Marker"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &ListClustersInput{}
}
req = c.newRequest(op, input, output)
output = &ListClustersOutput{}
req.Data = output
return
}
// Provides the status of all clusters visible to this AWS account. Allows you
// to filter the list of clusters based on certain criteria; for example, filtering
// by cluster creation date and time or by status. This call returns a maximum
// of 50 clusters per call, but returns a marker to track the paging of the
// cluster list across multiple ListClusters calls.
func (c *EMR) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) {
req, out := c.ListClustersRequest(input)
err := req.Send()
return out, err
}
func (c *EMR) ListClustersPages(input *ListClustersInput, fn func(p *ListClustersOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListClustersRequest(input)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListClustersOutput), lastPage)
})
}
const opListInstanceGroups = "ListInstanceGroups"
// ListInstanceGroupsRequest generates a request for the ListInstanceGroups operation.
func (c *EMR) ListInstanceGroupsRequest(input *ListInstanceGroupsInput) (req *service.Request, output *ListInstanceGroupsOutput) {
op := &service.Operation{
Name: opListInstanceGroups,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &service.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"Marker"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &ListInstanceGroupsInput{}
}
req = c.newRequest(op, input, output)
output = &ListInstanceGroupsOutput{}
req.Data = output
return
}
// Provides all available details about the instance groups in a cluster.
func (c *EMR) ListInstanceGroups(input *ListInstanceGroupsInput) (*ListInstanceGroupsOutput, error) {
req, out := c.ListInstanceGroupsRequest(input)
err := req.Send()
return out, err
}
func (c *EMR) ListInstanceGroupsPages(input *ListInstanceGroupsInput, fn func(p *ListInstanceGroupsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListInstanceGroupsRequest(input)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListInstanceGroupsOutput), lastPage)
})
}
const opListInstances = "ListInstances"
// ListInstancesRequest generates a request for the ListInstances operation.
func (c *EMR) ListInstancesRequest(input *ListInstancesInput) (req *service.Request, output *ListInstancesOutput) {
op := &service.Operation{
Name: opListInstances,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &service.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"Marker"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &ListInstancesInput{}
}
req = c.newRequest(op, input, output)
output = &ListInstancesOutput{}
req.Data = output
return
}
// Provides information about the cluster instances that Amazon EMR provisions
// on behalf of a user when it creates the cluster. For example, this operation
// indicates when the EC2 instances reach the Ready state, when instances become
// available to Amazon EMR to use for jobs, and the IP addresses for cluster
// instances, etc.
func (c *EMR) ListInstances(input *ListInstancesInput) (*ListInstancesOutput, error) {
req, out := c.ListInstancesRequest(input)
err := req.Send()
return out, err
}
func (c *EMR) ListInstancesPages(input *ListInstancesInput, fn func(p *ListInstancesOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListInstancesRequest(input)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListInstancesOutput), lastPage)
})
}
const opListSteps = "ListSteps"
// ListStepsRequest generates a request for the ListSteps operation.
func (c *EMR) ListStepsRequest(input *ListStepsInput) (req *service.Request, output *ListStepsOutput) {
op := &service.Operation{
Name: opListSteps,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &service.Paginator{
InputTokens: []string{"Marker"},
OutputTokens: []string{"Marker"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &ListStepsInput{}
}
req = c.newRequest(op, input, output)
output = &ListStepsOutput{}
req.Data = output
return
}
// Provides a list of steps for the cluster.
func (c *EMR) ListSteps(input *ListStepsInput) (*ListStepsOutput, error) {
req, out := c.ListStepsRequest(input)
err := req.Send()
return out, err
}
func (c *EMR) ListStepsPages(input *ListStepsInput, fn func(p *ListStepsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListStepsRequest(input)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListStepsOutput), lastPage)
})
}
const opModifyInstanceGroups = "ModifyInstanceGroups"
// ModifyInstanceGroupsRequest generates a request for the ModifyInstanceGroups operation.
func (c *EMR) ModifyInstanceGroupsRequest(input *ModifyInstanceGroupsInput) (req *service.Request, output *ModifyInstanceGroupsOutput) {
op := &service.Operation{
Name: opModifyInstanceGroups,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ModifyInstanceGroupsInput{}
}
req = c.newRequest(op, input, output)
output = &ModifyInstanceGroupsOutput{}
req.Data = output
return
}
// ModifyInstanceGroups modifies the number of nodes and configuration settings
// of an instance group. The input parameters include the new target instance
// count for the group and the instance group ID. The call will either succeed
// or fail atomically.
func (c *EMR) ModifyInstanceGroups(input *ModifyInstanceGroupsInput) (*ModifyInstanceGroupsOutput, error) {
req, out := c.ModifyInstanceGroupsRequest(input)
err := req.Send()
return out, err
}
const opRemoveTags = "RemoveTags"
// RemoveTagsRequest generates a request for the RemoveTags operation.
func (c *EMR) RemoveTagsRequest(input *RemoveTagsInput) (req *service.Request, output *RemoveTagsOutput) {
op := &service.Operation{
Name: opRemoveTags,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RemoveTagsInput{}
}
req = c.newRequest(op, input, output)
output = &RemoveTagsOutput{}
req.Data = output
return
}
// Removes tags from an Amazon EMR resource. Tags make it easier to associate
// clusters in various ways, such as grouping clusters to track your Amazon
// EMR resource allocation costs. For more information, see Tagging Amazon EMR
// Resources (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-plan-tags.html).
//
// The following example removes the stack tag with value Prod from a cluster:
func (c *EMR) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) {
req, out := c.RemoveTagsRequest(input)
err := req.Send()
return out, err
}
const opRunJobFlow = "RunJobFlow"
// RunJobFlowRequest generates a request for the RunJobFlow operation.
func (c *EMR) RunJobFlowRequest(input *RunJobFlowInput) (req *service.Request, output *RunJobFlowOutput) {
op := &service.Operation{
Name: opRunJobFlow,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RunJobFlowInput{}
}
req = c.newRequest(op, input, output)
output = &RunJobFlowOutput{}
req.Data = output
return
}
// RunJobFlow creates and starts running a new job flow. The job flow will run
// the steps specified. Once the job flow completes, the cluster is stopped
// and the HDFS partition is lost. To prevent loss of data, configure the last
// step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig
// KeepJobFlowAliveWhenNoSteps parameter is set to TRUE, the job flow will transition
// to the WAITING state rather than shutting down once the steps have completed.
//
// For additional protection, you can set the JobFlowInstancesConfig TerminationProtected
// parameter to TRUE to lock the job flow and prevent it from being terminated
// by API call, user intervention, or in the event of a job flow error.
//
// A maximum of 256 steps are allowed in each job flow.
//
// If your job flow is long-running (such as a Hive data warehouse) or complex,
// you may require more than 256 steps to process your data. You can bypass
// the 256-step limitation in various ways, including using the SSH shell to
// connect to the master node and submitting queries directly to the software
// running on the master node, such as Hive and Hadoop. For more information
// on how to do this, go to Add More than 256 Steps to a Job Flow (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/AddMoreThan256Steps.html)
// in the Amazon Elastic MapReduce Developer's Guide.
//
// For long running job flows, we recommend that you periodically store your
// results.
func (c *EMR) RunJobFlow(input *RunJobFlowInput) (*RunJobFlowOutput, error) {
req, out := c.RunJobFlowRequest(input)
err := req.Send()
return out, err
}
const opSetTerminationProtection = "SetTerminationProtection"
// SetTerminationProtectionRequest generates a request for the SetTerminationProtection operation.
func (c *EMR) SetTerminationProtectionRequest(input *SetTerminationProtectionInput) (req *service.Request, output *SetTerminationProtectionOutput) {
op := &service.Operation{
Name: opSetTerminationProtection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &SetTerminationProtectionInput{}
}
req = c.newRequest(op, input, output)
output = &SetTerminationProtectionOutput{}
req.Data = output
return
}
// SetTerminationProtection locks a job flow so the Amazon EC2 instances in
// the cluster cannot be terminated by user intervention, an API call, or in
// the event of a job-flow error. The cluster still terminates upon successful
// completion of the job flow. Calling SetTerminationProtection on a job flow
// is analogous to calling the Amazon EC2 DisableAPITermination API on all of
// the EC2 instances in a cluster.
//
// SetTerminationProtection is used to prevent accidental termination of a
// job flow and to ensure that in the event of an error, the instances will
// persist so you can recover any data stored in their ephemeral instance storage.
//
// To terminate a job flow that has been locked by setting SetTerminationProtection
// to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection
// in which you set the value to false.
//
// For more information, go to Protecting a Job Flow from Termination (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_TerminationProtection.html)
// in the Amazon Elastic MapReduce Developer's Guide.
func (c *EMR) SetTerminationProtection(input *SetTerminationProtectionInput) (*SetTerminationProtectionOutput, error) {
req, out := c.SetTerminationProtectionRequest(input)
err := req.Send()
return out, err
}
const opSetVisibleToAllUsers = "SetVisibleToAllUsers"
// SetVisibleToAllUsersRequest generates a request for the SetVisibleToAllUsers operation.
func (c *EMR) SetVisibleToAllUsersRequest(input *SetVisibleToAllUsersInput) (req *service.Request, output *SetVisibleToAllUsersOutput) {
op := &service.Operation{
Name: opSetVisibleToAllUsers,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &SetVisibleToAllUsersInput{}
}
req = c.newRequest(op, input, output)
output = &SetVisibleToAllUsersOutput{}
req.Data = output
return
}
// Sets whether all AWS Identity and Access Management (IAM) users under your
// account can access the specified job flows. This action works on running
// job flows. You can also set the visibility of a job flow when you launch
// it using the VisibleToAllUsers parameter of RunJobFlow. The SetVisibleToAllUsers
// action can be called only by an IAM user who created the job flow or the
// AWS account that owns the job flow.
func (c *EMR) SetVisibleToAllUsers(input *SetVisibleToAllUsersInput) (*SetVisibleToAllUsersOutput, error) {
req, out := c.SetVisibleToAllUsersRequest(input)
err := req.Send()
return out, err
}
const opTerminateJobFlows = "TerminateJobFlows"
// TerminateJobFlowsRequest generates a request for the TerminateJobFlows operation.
func (c *EMR) TerminateJobFlowsRequest(input *TerminateJobFlowsInput) (req *service.Request, output *TerminateJobFlowsOutput) {
op := &service.Operation{
Name: opTerminateJobFlows,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &TerminateJobFlowsInput{}
}
req = c.newRequest(op, input, output)
output = &TerminateJobFlowsOutput{}
req.Data = output
return
}
// TerminateJobFlows shuts a list of job flows down. When a job flow is shut
// down, any step not yet completed is canceled and the EC2 instances on which
// the job flow is running are stopped. Any log files not already saved are
// uploaded to Amazon S3 if a LogUri was specified when the job flow was created.
//
// The maximum number of JobFlows allowed is 10. The call to TerminateJobFlows
// is asynchronous. Depending on the configuration of the job flow, it may take
// up to 5-20 minutes for the job flow to completely terminate and release allocated
// resources, such as Amazon EC2 instances.
func (c *EMR) TerminateJobFlows(input *TerminateJobFlowsInput) (*TerminateJobFlowsOutput, error) {
req, out := c.TerminateJobFlowsRequest(input)
err := req.Send()
return out, err
}
// Input to an AddInstanceGroups call.
type AddInstanceGroupsInput struct {
// Instance Groups to add.
InstanceGroups []*InstanceGroupConfig `type:"list" required:"true"`
// Job flow in which to add the instance groups.
JobFlowID *string `locationName:"JobFlowId" type:"string" required:"true"`
metadataAddInstanceGroupsInput `json:"-" xml:"-"`
}
type metadataAddInstanceGroupsInput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s AddInstanceGroupsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AddInstanceGroupsInput) GoString() string {
return s.String()
}
// Output from an AddInstanceGroups call.
type AddInstanceGroupsOutput struct {
// Instance group IDs of the newly created instance groups.
InstanceGroupIDs []*string `locationName:"InstanceGroupIds" type:"list"`
// The job flow ID in which the instance groups are added.
JobFlowID *string `locationName:"JobFlowId" type:"string"`
metadataAddInstanceGroupsOutput `json:"-" xml:"-"`
}
type metadataAddInstanceGroupsOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s AddInstanceGroupsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AddInstanceGroupsOutput) GoString() string {
return s.String()
}
// The input argument to the AddJobFlowSteps operation.
type AddJobFlowStepsInput struct {
// A string that uniquely identifies the job flow. This identifier is returned
// by RunJobFlow and can also be obtained from ListClusters.
JobFlowID *string `locationName:"JobFlowId" type:"string" required:"true"`
// A list of StepConfig to be executed by the job flow.
Steps []*StepConfig `type:"list" required:"true"`
metadataAddJobFlowStepsInput `json:"-" xml:"-"`
}
type metadataAddJobFlowStepsInput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s AddJobFlowStepsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AddJobFlowStepsInput) GoString() string {
return s.String()
}
// The output for the AddJobFlowSteps operation.
type AddJobFlowStepsOutput struct {
// The identifiers of the list of steps added to the job flow.
StepIDs []*string `locationName:"StepIds" type:"list"`
metadataAddJobFlowStepsOutput `json:"-" xml:"-"`
}
type metadataAddJobFlowStepsOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s AddJobFlowStepsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AddJobFlowStepsOutput) GoString() string {
return s.String()
}
// This input identifies a cluster and a list of tags to attach.
type AddTagsInput struct {
// The Amazon EMR resource identifier to which tags will be added. This value
// must be a cluster identifier.
ResourceID *string `locationName:"ResourceId" type:"string" required:"true"`
// A list of tags to associate with a cluster and propagate to Amazon EC2 instances.
// Tags are user-defined key/value pairs that consist of a required key string
// with a maximum of 128 characters, and an optional value string with a maximum
// of 256 characters.
Tags []*Tag `type:"list" required:"true"`
metadataAddTagsInput `json:"-" xml:"-"`
}
type metadataAddTagsInput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s AddTagsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AddTagsInput) GoString() string {
return s.String()
}
// This output indicates the result of adding tags to a resource.
type AddTagsOutput struct {
metadataAddTagsOutput `json:"-" xml:"-"`
}
type metadataAddTagsOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s AddTagsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AddTagsOutput) GoString() string {
return s.String()
}
// An application is any Amazon or third-party software that you can add to
// the cluster. This structure contains a list of strings that indicates the
// software to use with the cluster and accepts a user argument list. Amazon
// EMR accepts and forwards the argument list to the corresponding installation
// script as bootstrap action argument. For more information, see Launch a Job
// Flow on the MapR Distribution for Hadoop (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-mapr.html).
// Currently supported values are:
//
// "mapr-m3" - launch the job flow using MapR M3 Edition. "mapr-m5" - launch
// the job flow using MapR M5 Edition. "mapr" with the user arguments specifying
// "--edition,m3" or "--edition,m5" - launch the job flow using MapR M3 or M5
// Edition, respectively. In Amazon EMR releases 4.0 and greater, the only
// accepted parameter is the application name. To pass arguments to applications,
// you supply a configuration for each application.
type Application struct {
// This option is for advanced users only. This is meta information about third-party
// applications that third-party vendors use for testing purposes.
AdditionalInfo map[string]*string `type:"map"`
// Arguments for Amazon EMR to pass to the application.
Args []*string `type:"list"`
// The name of the application.
Name *string `type:"string"`
// The version of the application.
Version *string `type:"string"`
metadataApplication `json:"-" xml:"-"`
}
type metadataApplication struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s Application) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Application) GoString() string {
return s.String()
}
// Configuration of a bootstrap action.
type BootstrapActionConfig struct {
// The name of the bootstrap action.
Name *string `type:"string" required:"true"`
// The script run by the bootstrap action.
ScriptBootstrapAction *ScriptBootstrapActionConfig `type:"structure" required:"true"`
metadataBootstrapActionConfig `json:"-" xml:"-"`
}
type metadataBootstrapActionConfig struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s BootstrapActionConfig) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BootstrapActionConfig) GoString() string {
return s.String()
}
// Reports the configuration of a bootstrap action in a job flow.
type BootstrapActionDetail struct {
// A description of the bootstrap action.
BootstrapActionConfig *BootstrapActionConfig `type:"structure"`
metadataBootstrapActionDetail `json:"-" xml:"-"`
}
type metadataBootstrapActionDetail struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s BootstrapActionDetail) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BootstrapActionDetail) GoString() string {
return s.String()
}
// The detailed description of the cluster.
type Cluster struct {
// The applications installed on this cluster.
Applications []*Application `type:"list"`
// Specifies whether the cluster should terminate after completing all steps.
AutoTerminate *bool `type:"boolean"`
// Amazon EMR releases 4.x or later.
//
// The list of Configurations supplied to the EMR cluster.
Configurations []*Configuration `type:"list"`
// Provides information about the EC2 instances in a cluster grouped by category.
// For example, key name, subnet ID, IAM instance profile, and so on.
EC2InstanceAttributes *EC2InstanceAttributes `locationName:"Ec2InstanceAttributes" type:"structure"`
// The unique identifier for the cluster.
ID *string `locationName:"Id" type:"string"`
// The path to the Amazon S3 location where logs for this cluster are stored.
LogURI *string `locationName:"LogUri" type:"string"`
// The public DNS name of the master EC2 instance.
MasterPublicDNSName *string `locationName:"MasterPublicDnsName" type:"string"`
// The name of the cluster.
Name *string `type:"string"`
// An approximation of the cost of the job flow, represented in m1.small/hours.
// This value is incremented one time for every hour an m1.small instance runs.
// Larger instances are weighted more, so an EC2 instance that is roughly four
// times more expensive would result in the normalized instance hours being
// incremented by four. This result is only an approximation and does not reflect
// the actual billing rate.
NormalizedInstanceHours *int64 `type:"integer"`
// The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x
// AMIs, use amiVersion instead instead of ReleaseLabel.
ReleaseLabel *string `type:"string"`
// The AMI version requested for this cluster.
RequestedAMIVersion *string `locationName:"RequestedAmiVersion" type:"string"`
// The AMI version running on this cluster.
RunningAMIVersion *string `locationName:"RunningAmiVersion" type:"string"`
// The IAM role that will be assumed by the Amazon EMR service to access AWS
// resources on your behalf.
ServiceRole *string `type:"string"`
// The current status details about the cluster.
Status *ClusterStatus `type:"structure"`
// A list of tags associated with a cluster.
Tags []*Tag `type:"list"`
// Indicates whether Amazon EMR will lock the cluster to prevent the EC2 instances
// from being terminated by an API call or user intervention, or in the event
// of a cluster error.
TerminationProtected *bool `type:"boolean"`
// Indicates whether the job flow is visible to all IAM users of the AWS account
// associated with the job flow. If this value is set to true, all IAM users
// of that AWS account can view and manage the job flow if they have the proper
// policy permissions set. If this value is false, only the IAM user that created
// the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers
// action.
VisibleToAllUsers *bool `type:"boolean"`
metadataCluster `json:"-" xml:"-"`
}
type metadataCluster struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s Cluster) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Cluster) GoString() string {
return s.String()
}
// The reason that the cluster changed to its current state.
type ClusterStateChangeReason struct {
// The programmatic code for the state change reason.
Code *string `type:"string" enum:"ClusterStateChangeReasonCode"`
// The descriptive message for the state change reason.
Message *string `type:"string"`
metadataClusterStateChangeReason `json:"-" xml:"-"`
}
type metadataClusterStateChangeReason struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s ClusterStateChangeReason) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ClusterStateChangeReason) GoString() string {
return s.String()
}
// The detailed status of the cluster.
type ClusterStatus struct {
// The current state of the cluster.