-
Notifications
You must be signed in to change notification settings - Fork 30
/
aws.go
3952 lines (3226 loc) · 105 KB
/
aws.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
package aws
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
"strconv"
"time"
"github.com/spotinst/spotinst-sdk-go/spotinst"
"github.com/spotinst/spotinst-sdk-go/spotinst/client"
"github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil"
"github.com/spotinst/spotinst-sdk-go/spotinst/util/uritemplates"
)
// A Product represents the type of an operating system.
type Product int
const (
// ProductWindows represents the Windows product.
ProductWindows Product = iota
// ProductWindowsVPC represents the Windows (Amazon VPC) product.
ProductWindowsVPC
// ProductLinuxUnix represents the Linux/Unix product.
ProductLinuxUnix
// ProductLinuxUnixVPC represents the Linux/Unix (Amazon VPC) product.
ProductLinuxUnixVPC
// ProductSUSELinux represents the SUSE Linux product.
ProductSUSELinux
// ProductSUSELinuxVPC represents the SUSE Linux (Amazon VPC) product.
ProductSUSELinuxVPC
)
var ProductName = map[Product]string{
ProductWindows: "Windows",
ProductWindowsVPC: "Windows (Amazon VPC)",
ProductLinuxUnix: "Linux/UNIX",
ProductLinuxUnixVPC: "Linux/UNIX (Amazon VPC)",
ProductSUSELinux: "SUSE Linux",
ProductSUSELinuxVPC: "SUSE Linux (Amazon VPC)",
}
var ProductValue = map[string]Product{
"Windows": ProductWindows,
"Windows (Amazon VPC)": ProductWindowsVPC,
"Linux/UNIX": ProductLinuxUnix,
"Linux/UNIX (Amazon VPC)": ProductLinuxUnixVPC,
"SUSE Linux": ProductSUSELinux,
"SUSE Linux (Amazon VPC)": ProductSUSELinuxVPC,
}
func (p Product) String() string {
return ProductName[p]
}
type Group struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Region *string `json:"region,omitempty"`
Capacity *Capacity `json:"capacity,omitempty"`
Compute *Compute `json:"compute,omitempty"`
Strategy *Strategy `json:"strategy,omitempty"`
Scaling *Scaling `json:"scaling,omitempty"`
Scheduling *Scheduling `json:"scheduling,omitempty"`
Integration *Integration `json:"thirdPartiesIntegration,omitempty"`
// Read-only fields.
CreatedAt *time.Time `json:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
// forceSendFields is a list of field names (e.g. "Keys") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
forceSendFields []string
// nullFields is a list of field names (e.g. "Keys") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
nullFields []string
}
type Integration struct {
EC2ContainerService *EC2ContainerServiceIntegration `json:"ecs,omitempty"`
ElasticBeanstalk *ElasticBeanstalkIntegration `json:"elasticBeanstalk,omitempty"`
CodeDeploy *CodeDeployIntegration `json:"codeDeploy,omitempty"`
OpsWorks *OpsWorksIntegration `json:"opsWorks,omitempty"`
Rancher *RancherIntegration `json:"rancher,omitempty"`
Kubernetes *KubernetesIntegration `json:"kubernetes,omitempty"`
Mesosphere *MesosphereIntegration `json:"mesosphere,omitempty"`
Multai *MultaiIntegration `json:"mlbRuntime,omitempty"`
Nomad *NomadIntegration `json:"nomad,omitempty"`
Chef *ChefIntegration `json:"chef,omitempty"`
Gitlab *GitlabIntegration `json:"gitlab,omitempty"`
Route53 *Route53Integration `json:"route53,omitempty"`
DockerSwarm *DockerSwarmIntegration `json:"dockerSwarm,omitempty"`
forceSendFields []string
nullFields []string
}
type InstanceHealth struct {
InstanceID *string `json:"instanceId,omitempty"`
SpotRequestID *string `json:"spotRequestId,omitempty"`
GroupID *string `json:"groupId,omitempty"`
AvailabilityZone *string `json:"availabilityZone,omitempty"`
LifeCycle *string `json:"lifeCycle,omitempty"`
HealthStatus *string `json:"healthStatus,omitempty"`
}
type AutoScale struct {
IsEnabled *bool `json:"isEnabled,omitempty"`
IsAutoConfig *bool `json:"isAutoConfig,omitempty"`
Cooldown *int `json:"cooldown,omitempty"`
Headroom *AutoScaleHeadroom `json:"headroom,omitempty"`
Down *AutoScaleDown `json:"down,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleECS struct {
AutoScale // embedding
Attributes []*AutoScaleAttributes `json:"attributes,omitempty"`
ShouldScaleDownNonServiceTasks *bool `json:"shouldScaleDownNonServiceTasks,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleKubernetes struct {
AutoScale // embedding
Labels []*AutoScaleLabel `json:"labels,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleNomad struct {
AutoScale // embedding
Constraints []*AutoScaleConstraint `json:"constraints,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleDockerSwarm struct {
AutoScale // embedding
forceSendFields []string
nullFields []string
}
type AutoScaleHeadroom struct {
CPUPerUnit *int `json:"cpuPerUnit,omitempty"`
GPUPerUnit *int `json:"gpuPerUnit,omitempty"`
MemoryPerUnit *int `json:"memoryPerUnit,omitempty"`
NumOfUnits *int `json:"numOfUnits,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleDown struct {
EvaluationPeriods *int `json:"evaluationPeriods,omitempty"`
MaxScaleDownPercentage *int `json:"maxScaleDownPercentage,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleConstraint struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleLabel struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
forceSendFields []string
nullFields []string
}
type AutoScaleAttributes struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
forceSendFields []string
nullFields []string
}
type ElasticBeanstalkIntegration struct {
EnvironmentID *string `json:"environmentId,omitempty"`
ManagedActions *BeanstalkManagedActions `json:"managedActions,omitempty"`
DeploymentPreferences *BeanstalkDeploymentPreferences `json:"deploymentPreferences,omitempty"`
forceSendFields []string
nullFields []string
}
type BeanstalkManagedActions struct {
PlatformUpdate *BeanstalkPlatformUpdate `json:"platformUpdate,omitempty"`
forceSendFields []string
nullFields []string
}
type BeanstalkPlatformUpdate struct {
PerformAt *string `json:"performAt,omitempty"`
TimeWindow *string `json:"timeWindow,omitempty"`
UpdateLevel *string `json:"updateLevel,omitempty"`
forceSendFields []string
nullFields []string
}
type BeanstalkDeploymentPreferences struct {
AutomaticRoll *bool `json:"automaticRoll,omitempty"`
BatchSizePercentage *int `json:"batchSizePercentage,omitempty"`
GracePeriod *int `json:"gracePeriod,omitempty"`
Strategy *BeanstalkDeploymentStrategy `json:"strategy,omitempty"`
forceSendFields []string
nullFields []string
}
type BeanstalkDeploymentStrategy struct {
Action *string `json:"action,omitempty"`
ShouldDrainInstances *bool `json:"shouldDrainInstances,omitempty"`
forceSendFields []string
nullFields []string
}
type CodeDeployIntegration struct {
DeploymentGroups []*DeploymentGroup `json:"deploymentGroups,omitempty"`
CleanUpOnFailure *bool `json:"cleanUpOnFailure,omitempty"`
TerminateInstanceOnFailure *bool `json:"terminateInstanceOnFailure,omitempty"`
forceSendFields []string
nullFields []string
}
type DeploymentGroup struct {
ApplicationName *string `json:"applicationName,omitempty"`
DeploymentGroupName *string `json:"deploymentGroupName,omitempty"`
forceSendFields []string
nullFields []string
}
type OpsWorksIntegration struct {
LayerID *string `json:"layerId,omitempty"`
StackType *string `json:"stackType,omitempty"`
forceSendFields []string
nullFields []string
}
type RancherIntegration struct {
MasterHost *string `json:"masterHost,omitempty"`
AccessKey *string `json:"accessKey,omitempty"`
SecretKey *string `json:"secretKey,omitempty"`
Version *string `json:"version,omitempty"`
forceSendFields []string
nullFields []string
}
type EC2ContainerServiceIntegration struct {
ClusterName *string `json:"clusterName,omitempty"`
AutoScale *AutoScaleECS `json:"autoScale,omitempty"`
forceSendFields []string
nullFields []string
}
type KubernetesIntegration struct {
IntegrationMode *string `json:"integrationMode,omitempty"`
ClusterIdentifier *string `json:"clusterIdentifier,omitempty"`
Server *string `json:"apiServer,omitempty"`
Token *string `json:"token,omitempty"`
AutoScale *AutoScaleKubernetes `json:"autoScale,omitempty"`
forceSendFields []string
nullFields []string
}
type MesosphereIntegration struct {
Server *string `json:"apiServer,omitempty"`
forceSendFields []string
nullFields []string
}
type MultaiIntegration struct {
DeploymentID *string `json:"deploymentId,omitempty"`
forceSendFields []string
nullFields []string
}
type NomadIntegration struct {
MasterHost *string `json:"masterHost,omitempty"`
MasterPort *int `json:"masterPort,omitempty"`
ACLToken *string `json:"aclToken,omitempty"`
AutoScale *AutoScaleNomad `json:"autoScale,omitempty"`
forceSendFields []string
nullFields []string
}
type ChefIntegration struct {
Server *string `json:"chefServer,omitempty"`
Organization *string `json:"organization,omitempty"`
User *string `json:"user,omitempty"`
PEMKey *string `json:"pemKey,omitempty"`
Version *string `json:"chefVersion,omitempty"`
forceSendFields []string
nullFields []string
}
type DockerSwarmIntegration struct {
MasterHost *string `json:"masterHost,omitempty"`
MasterPort *int `json:"masterPort,omitempty"`
AutoScale *AutoScaleDockerSwarm `json:"autoScale,omitempty"`
forceSendFields []string
nullFields []string
}
type Route53Integration struct {
Domains []*Domain `json:"domains,omitempty"`
forceSendFields []string
nullFields []string
}
type Domain struct {
HostedZoneID *string `json:"hostedZoneId,omitempty"`
SpotinstAccountID *string `json:"spotinstAccountId,omitempty"`
RecordSets []*RecordSet `json:"recordSets,omitempty"`
forceSendFields []string
nullFields []string
}
type RecordSet struct {
UsePublicIP *bool `json:"usePublicIp,omitempty"`
Name *string `json:"name,omitempty"`
forceSendFields []string
nullFields []string
}
type GitlabIntegration struct {
Runner *GitlabRunner `json:"runner,omitempty"`
forceSendFields []string
nullFields []string
}
type GitlabRunner struct {
IsEnabled *bool `json:"isEnabled,omitempty"`
forceSendFields []string
nullFields []string
}
type Scheduling struct {
Tasks []*Task `json:"tasks,omitempty"`
forceSendFields []string
nullFields []string
}
type Task struct {
IsEnabled *bool `json:"isEnabled,omitempty"`
Type *string `json:"taskType,omitempty"`
Frequency *string `json:"frequency,omitempty"`
CronExpression *string `json:"cronExpression,omitempty"`
StartTime *string `json:"startTime,omitempty"`
ScaleTargetCapacity *int `json:"scaleTargetCapacity,omitempty"`
ScaleMinCapacity *int `json:"scaleMinCapacity,omitempty"`
ScaleMaxCapacity *int `json:"scaleMaxCapacity,omitempty"`
BatchSizePercentage *int `json:"batchSizePercentage,omitempty"`
GracePeriod *int `json:"gracePeriod,omitempty"`
TargetCapacity *int `json:"targetCapacity,omitempty"`
MinCapacity *int `json:"minCapacity,omitempty"`
MaxCapacity *int `json:"maxCapacity,omitempty"`
Adjustment *int `json:"adjustment,omitempty"`
AdjustmentPercentage *int `json:"adjustmentPercentage,omitempty"`
forceSendFields []string
nullFields []string
}
type Scaling struct {
Up []*ScalingPolicy `json:"up,omitempty"`
Down []*ScalingPolicy `json:"down,omitempty"`
Target []*ScalingPolicy `json:"target,omitempty"`
forceSendFields []string
nullFields []string
}
type ScalingPolicy struct {
PolicyName *string `json:"policyName,omitempty"`
MetricName *string `json:"metricName,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Source *string `json:"source,omitempty"`
Statistic *string `json:"statistic,omitempty"`
Unit *string `json:"unit,omitempty"`
Threshold *float64 `json:"threshold,omitempty"`
Adjustment *int `json:"adjustment,omitempty"`
MinTargetCapacity *int `json:"minTargetCapacity,omitempty"`
MaxTargetCapacity *int `json:"maxTargetCapacity,omitempty"`
EvaluationPeriods *int `json:"evaluationPeriods,omitempty"`
Period *int `json:"period,omitempty"`
Cooldown *int `json:"cooldown,omitempty"`
Operator *string `json:"operator,omitempty"`
Dimensions []*Dimension `json:"dimensions,omitempty"`
Action *Action `json:"action,omitempty"`
Target *float64 `json:"target,omitempty"`
IsEnabled *bool `json:"isEnabled,omitempty"`
Predictive *Predictive `json:"predictive,omitempty"`
forceSendFields []string
nullFields []string
}
type Action struct {
Type *string `json:"type,omitempty"`
Adjustment *string `json:"adjustment,omitempty"`
MinTargetCapacity *string `json:"minTargetCapacity,omitempty"`
MaxTargetCapacity *string `json:"maxTargetCapacity,omitempty"`
Maximum *string `json:"maximum,omitempty"`
Minimum *string `json:"minimum,omitempty"`
Target *string `json:"target,omitempty"`
forceSendFields []string
nullFields []string
}
type Dimension struct {
Name *string `json:"name,omitempty"`
Value *string `json:"value,omitempty"`
forceSendFields []string
nullFields []string
}
type Predictive struct {
Mode *string `json:"mode,omitempty"`
forceSendFields []string
nullFields []string
}
type Strategy struct {
Risk *float64 `json:"risk,omitempty"`
OnDemandCount *int `json:"onDemandCount,omitempty"`
DrainingTimeout *int `json:"drainingTimeout,omitempty"`
AvailabilityVsCost *string `json:"availabilityVsCost,omitempty"`
LifetimePeriod *string `json:"lifetimePeriod,omitempty"`
UtilizeReservedInstances *bool `json:"utilizeReservedInstances,omitempty"`
FallbackToOnDemand *bool `json:"fallbackToOd,omitempty"`
SpinUpTime *int `json:"spinUpTime,omitempty"`
Signals []*Signal `json:"signals,omitempty"`
Persistence *Persistence `json:"persistence,omitempty"`
RevertToSpot *RevertToSpot `json:"revertToSpot,omitempty"`
ScalingStrategy *ScalingStrategy `json:"scalingStrategy,omitempty"`
forceSendFields []string
nullFields []string
}
type Persistence struct {
ShouldPersistPrivateIP *bool `json:"shouldPersistPrivateIp,omitempty"`
ShouldPersistBlockDevices *bool `json:"shouldPersistBlockDevices,omitempty"`
ShouldPersistRootDevice *bool `json:"shouldPersistRootDevice,omitempty"`
BlockDevicesMode *string `json:"blockDevicesMode,omitempty"`
forceSendFields []string
nullFields []string
}
type RevertToSpot struct {
PerformAt *string `json:"performAt,omitempty"`
TimeWindows []string `json:"timeWindows,omitempty"`
forceSendFields []string
nullFields []string
}
type ScalingStrategy struct {
TerminateAtEndOfBillingHour *bool `json:"terminateAtEndOfBillingHour,omitempty"`
TerminationPolicy *string `json:"terminationPolicy,omitempty"`
forceSendFields []string
nullFields []string
}
type Signal struct {
Name *string `json:"name,omitempty"`
Timeout *int `json:"timeout,omitempty"`
forceSendFields []string
nullFields []string
}
type Capacity struct {
Minimum *int `json:"minimum,omitempty"`
Maximum *int `json:"maximum,omitempty"`
Target *int `json:"target,omitempty"`
Unit *string `json:"unit,omitempty"`
forceSendFields []string
nullFields []string
}
type Compute struct {
Product *string `json:"product,omitempty"`
InstanceTypes *InstanceTypes `json:"instanceTypes,omitempty"`
LaunchSpecification *LaunchSpecification `json:"launchSpecification,omitempty"`
AvailabilityZones []*AvailabilityZone `json:"availabilityZones,omitempty"`
PreferredAvailabilityZones []string `json:"preferredAvailabilityZones,omitempty"`
ElasticIPs []string `json:"elasticIps,omitempty"`
EBSVolumePool []*EBSVolume `json:"ebsVolumePool,omitempty"`
PrivateIPs []string `json:"privateIps,omitempty"`
SubnetIDs []string `json:"subnetIds,omitempty"`
forceSendFields []string
nullFields []string
}
type EBSVolume struct {
DeviceName *string `json:"deviceName,omitempty"`
VolumeIDs []string `json:"volumeIds,omitempty"`
forceSendFields []string
nullFields []string
}
type InstanceTypes struct {
OnDemand *string `json:"ondemand,omitempty"`
Spot []string `json:"spot,omitempty"`
PreferredSpot []string `json:"preferredSpot,omitempty"`
Weights []*InstanceTypeWeight `json:"weights,omitempty"`
forceSendFields []string
nullFields []string
}
type InstanceTypeWeight struct {
InstanceType *string `json:"instanceType,omitempty"`
Weight *int `json:"weightedCapacity,omitempty"`
forceSendFields []string
nullFields []string
}
type AvailabilityZone struct {
Name *string `json:"name,omitempty"`
SubnetID *string `json:"subnetId,omitempty"`
PlacementGroupName *string `json:"placementGroupName,omitempty"`
forceSendFields []string
nullFields []string
}
type LaunchSpecification struct {
LoadBalancerNames []string `json:"loadBalancerNames,omitempty"`
LoadBalancersConfig *LoadBalancersConfig `json:"loadBalancersConfig,omitempty"`
SecurityGroupIDs []string `json:"securityGroupIds,omitempty"`
HealthCheckType *string `json:"healthCheckType,omitempty"`
HealthCheckGracePeriod *int `json:"healthCheckGracePeriod,omitempty"`
HealthCheckUnhealthyDurationBeforeReplacement *int `json:"healthCheckUnhealthyDurationBeforeReplacement,omitempty"`
ImageID *string `json:"imageId,omitempty"`
KeyPair *string `json:"keyPair,omitempty"`
UserData *string `json:"userData,omitempty"`
ShutdownScript *string `json:"shutdownScript,omitempty"`
Tenancy *string `json:"tenancy,omitempty"`
Monitoring *bool `json:"monitoring,omitempty"`
EBSOptimized *bool `json:"ebsOptimized,omitempty"`
IAMInstanceProfile *IAMInstanceProfile `json:"iamRole,omitempty"`
CreditSpecification *CreditSpecification `json:"creditSpecification,omitempty"`
BlockDeviceMappings []*BlockDeviceMapping `json:"blockDeviceMappings,omitempty"`
NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
Tags []*Tag `json:"tags,omitempty"`
forceSendFields []string
nullFields []string
}
type LoadBalancersConfig struct {
LoadBalancers []*LoadBalancer `json:"loadBalancers,omitempty"`
forceSendFields []string
nullFields []string
}
type LoadBalancer struct {
Name *string `json:"name,omitempty"`
Arn *string `json:"arn,omitempty"`
Type *string `json:"type,omitempty"`
BalancerID *string `json:"balancerId,omitempty"`
TargetSetID *string `json:"targetSetId,omitempty"`
ZoneAwareness *bool `json:"azAwareness,omitempty"`
AutoWeight *bool `json:"autoWeight,omitempty"`
forceSendFields []string
nullFields []string
}
type NetworkInterface struct {
ID *string `json:"networkInterfaceId,omitempty"`
Description *string `json:"description,omitempty"`
DeviceIndex *int `json:"deviceIndex,omitempty"`
SecondaryPrivateIPAddressCount *int `json:"secondaryPrivateIpAddressCount,omitempty"`
AssociatePublicIPAddress *bool `json:"associatePublicIpAddress,omitempty"`
AssociateIPV6Address *bool `json:"associateIpv6Address,omitempty"`
DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"`
SecurityGroupsIDs []string `json:"groups,omitempty"`
PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
SubnetID *string `json:"subnetId,omitempty"`
forceSendFields []string
nullFields []string
}
type BlockDeviceMapping struct {
DeviceName *string `json:"deviceName,omitempty"`
VirtualName *string `json:"virtualName,omitempty"`
EBS *EBS `json:"ebs,omitempty"`
forceSendFields []string
nullFields []string
}
type EBS struct {
DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"`
Encrypted *bool `json:"encrypted,omitempty"`
KmsKeyId *string `json:"kmsKeyId,omitempty"`
SnapshotID *string `json:"snapshotId,omitempty"`
VolumeType *string `json:"volumeType,omitempty"`
VolumeSize *int `json:"volumeSize,omitempty"`
IOPS *int `json:"iops,omitempty"`
forceSendFields []string
nullFields []string
}
type IAMInstanceProfile struct {
Name *string `json:"name,omitempty"`
Arn *string `json:"arn,omitempty"`
forceSendFields []string
nullFields []string
}
type CreditSpecification struct {
CPUCredits *string `json:"cpuCredits,omitempty"`
forceSendFields []string
nullFields []string
}
type Instance struct {
ID *string `json:"instanceId,omitempty"`
SpotRequestID *string `json:"spotInstanceRequestId,omitempty"`
InstanceType *string `json:"instanceType,omitempty"`
Status *string `json:"status,omitempty"`
Product *string `json:"product,omitempty"`
AvailabilityZone *string `json:"availabilityZone,omitempty"`
PrivateIP *string `json:"privateIp,omitempty"`
PublicIP *string `json:"publicIp,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
}
type RollStrategy struct {
Action *string `json:"action,omitempty"`
ShouldDrainInstances *bool `json:"shouldDrainInstances,omitempty"`
BatchMinHealthyPercentage *int `json:"batchMinHealthyPercentage,omitempty"`
forceSendFields []string
nullFields []string
}
type StatefulDeallocation struct {
ShouldDeleteImages *bool `json:"shouldDeleteImages,omitempty"`
ShouldDeleteNetworkInterfaces *bool `json:"shouldDeleteNetworkInterfaces,omitempty"`
ShouldDeleteVolumes *bool `json:"shouldDeleteVolumes,omitempty"`
ShouldDeleteSnapshots *bool `json:"shouldDeleteSnapshots,omitempty"`
}
type GetInstanceHealthinessInput struct {
GroupID *string `json:"groupId,omitempty"`
}
type GetInstanceHealthinessOutput struct {
Instances []*InstanceHealth `json:"instances,omitempty"`
}
type GetGroupEventsInput struct {
GroupID *string `json:"groupId,omitempty"`
FromDate *string `json:"fromDate,omitempty"`
}
type GetGroupEventsOutput struct {
GroupEvents []*GroupEvent `json:"groupEvents,omitempty"`
}
type GroupEvent struct {
GroupID *string `json:"groupId,omitempty"`
EventType *string `json:"eventType,omitempty"`
CreatedAt *string `json:"createdAt,omitempty"`
SubEvents []*SubEvent `json:"subEvents,omitempty"`
}
type SubEvent struct {
// common fields
Type *string `json:"type,omitempty"`
// type scaleUp
NewSpots []*Spot `json:"newSpots,omitempty"`
NewInstances []*NewInstance `json:"newInstances,omitempty"`
// type scaleDown
TerminatedSpots []*Spot `json:"terminatedSpots,omitempty"`
TerminatedInstances []*TerminatedInstance `json:"terminatedInstances,omitempty"`
// type scaleReason
ScalingPolicyName *string `json:"scalingPolicyName,omitempty"`
Value *int `json:"value,omitempty"`
Unit *string `json:"unit,omitempty"`
Threshold *int `json:"threshold,omitempty"`
// type detachedInstance
InstanceID *string `json:"instanceId,omitempty"`
// type unhealthyInstances
InstanceIDs []*string `json:"instanceIds,omitempty"`
// type rollInfo
ID *string `json:"id,omitempty"`
GroupID *string `json:"groupId,omitempty"`
CurrentBatch *int `json:"currentBatch,omitempty"`
Status *string `json:"status,omitempty"`
CreatedAt *string `json:"createdAt,omitempty"`
NumberOfBatches *int `json:"numOfBatches,omitempty"`
GracePeriod *int `json:"gracePeriod,omitempty"`
// type recoverInstances
OldSpotRequestIDs []*string `json:"oldSpotRequestIDs,omitempty"`
NewSpotRequestIDs []*string `json:"newSpotRequestIDs,omitempty"`
OldInstanceIDs []*string `json:"oldInstanceIDs,omitempty"`
NewInstanceIDs []*string `json:"newInstanceIDs,omitempty"`
}
type Spot struct {
SpotInstanceRequestID *string `json:"spotInstanceRequestId,omitempty"`
}
type NewInstance struct {
}
type TerminatedInstance struct {
}
type ListGroupsInput struct{}
type ListGroupsOutput struct {
Groups []*Group `json:"groups,omitempty"`
}
type CreateGroupInput struct {
Group *Group `json:"group,omitempty"`
}
type CreateGroupOutput struct {
Group *Group `json:"group,omitempty"`
}
type ReadGroupInput struct {
GroupID *string `json:"groupId,omitempty"`
}
type ReadGroupOutput struct {
Group *Group `json:"group,omitempty"`
}
type UpdateGroupInput struct {
Group *Group `json:"group,omitempty"`
ShouldResumeStateful *bool `json:"-"`
AutoApplyTags *bool `json:"-"`
}
type UpdateGroupOutput struct {
Group *Group `json:"group,omitempty"`
}
type DeleteGroupInput struct {
GroupID *string `json:"groupId,omitempty"`
StatefulDeallocation *StatefulDeallocation `json:"statefulDeallocation,omitempty"`
}
type DeleteGroupOutput struct{}
type StatusGroupInput struct {
GroupID *string `json:"groupId,omitempty"`
}
type StatusGroupOutput struct {
Instances []*Instance `json:"instances,omitempty"`
}
type DetachGroupInput struct {
GroupID *string `json:"groupId,omitempty"`
InstanceIDs []string `json:"instancesToDetach,omitempty"`
ShouldDecrementTargetCapacity *bool `json:"shouldDecrementTargetCapacity,omitempty"`
ShouldTerminateInstances *bool `json:"shouldTerminateInstances,omitempty"`
DrainingTimeout *int `json:"drainingTimeout,omitempty"`
}
type DetachGroupOutput struct{}
type DeploymentStatusInput struct {
GroupID *string `json:"groupId,omitempty"`
RollID *string `json:"id,omitempty"`
}
type Roll struct {
Status *string `json:"status,omitempty"`
}
type RollGroupInput struct {
GroupID *string `json:"groupId,omitempty"`
BatchSizePercentage *int `json:"batchSizePercentage,omitempty"`
GracePeriod *int `json:"gracePeriod,omitempty"`
HealthCheckType *string `json:"healthCheckType,omitempty"`
Strategy *RollStrategy `json:"strategy,omitempty"`
}
type RollECSGroupInput struct {
GroupID *string `json:"groupId,omitempty"`
Roll *RollECSWrapper `json:"roll,omitempty"`
}
type RollECSWrapper struct {
BatchSizePercentage *int `json:"batchSizePercentage,omitempty"`
Comment *string `json:"comment,omitempty"`
}
type RollGroupOutput struct {
RollGroupStatus []*RollGroupStatus `json:"groupDeploymentStatus,omitempty"`
}
type RollGroupStatus struct {
RollID *string `json:"id,omitempty"`
RollStatus *string `json:"status,omitempty"`
Progress *Progress `json:"progress,omitempty"`
CreatedAt *string `json:"createdAt,omitempty"`
UpdatedAt *string `json:"updatedAt,omitempty"`
}
type Progress struct {
Unit *string `json:"unit,omitempty"`
Value *int `json:"value,omitempty"`
}
type StopDeploymentInput struct {
GroupID *string `json:"groupId,omitempty"`
RollID *string `json:"id,omitempty"`
Roll *Roll `json:"roll,omitempty"`
}
type StopDeploymentOutput struct{}
func deploymentStatusFromJSON(in []byte) (*RollGroupStatus, error) {
b := new(RollGroupStatus)
if err := json.Unmarshal(in, b); err != nil {
return nil, err
}
return b, nil
}
func deploymentStatusesFromJSON(in []byte) ([]*RollGroupStatus, error) {
var rw client.Response
if err := json.Unmarshal(in, &rw); err != nil {
return nil, err
}
out := make([]*RollGroupStatus, len(rw.Response.Items))
if len(out) == 0 {
return out, nil
}
for i, rb := range rw.Response.Items {
b, err := deploymentStatusFromJSON(rb)
if err != nil {
return nil, err
}
out[i] = b
}
return out, nil
}
func deploymentStatusFromHttpResponse(resp *http.Response) ([]*RollGroupStatus, error) {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
return deploymentStatusesFromJSON(body)
}
func groupFromJSON(in []byte) (*Group, error) {
b := new(Group)
if err := json.Unmarshal(in, b); err != nil {
return nil, err
}
return b, nil
}
func groupsFromJSON(in []byte) ([]*Group, error) {
var rw client.Response
if err := json.Unmarshal(in, &rw); err != nil {
return nil, err
}
out := make([]*Group, len(rw.Response.Items))
if len(out) == 0 {
return out, nil
}
for i, rb := range rw.Response.Items {
b, err := groupFromJSON(rb)
if err != nil {
return nil, err
}
out[i] = b
}
return out, nil
}
func groupsFromHttpResponse(resp *http.Response) ([]*Group, error) {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
return groupsFromJSON(body)
}
func instanceFromJSON(in []byte) (*Instance, error) {
b := new(Instance)
if err := json.Unmarshal(in, b); err != nil {
return nil, err
}
return b, nil
}
func instancesFromJSON(in []byte) ([]*Instance, error) {
var rw client.Response
if err := json.Unmarshal(in, &rw); err != nil {
return nil, err
}
out := make([]*Instance, len(rw.Response.Items))
if len(out) == 0 {
return out, nil
}
for i, rb := range rw.Response.Items {
b, err := instanceFromJSON(rb)
if err != nil {
return nil, err
}
out[i] = b
}
return out, nil
}
func instancesFromHttpResponse(resp *http.Response) ([]*Instance, error) {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
return instancesFromJSON(body)
}