forked from cPu1/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
1625 lines (1372 loc) · 51.7 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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package costexplorer
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
const opGetCostAndUsage = "GetCostAndUsage"
// GetCostAndUsageRequest generates a "aws/request.Request" representing the
// client's request for the GetCostAndUsage operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetCostAndUsage for more information on using the GetCostAndUsage
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetCostAndUsageRequest method.
// req, resp := client.GetCostAndUsageRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsage
func (c *CostExplorer) GetCostAndUsageRequest(input *GetCostAndUsageInput) (req *request.Request, output *GetCostAndUsageOutput) {
op := &request.Operation{
Name: opGetCostAndUsage,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetCostAndUsageInput{}
}
output = &GetCostAndUsageOutput{}
req = c.newRequest(op, input, output)
return
}
// GetCostAndUsage API operation for AWS Cost Explorer Service.
//
// Retrieve cost and usage metrics for your account. You can specify which cost
// and usage-related metric, such as BlendedCosts or UsageQuantity, that you
// want the request to return. You can also filter and group your data by various
// dimensions, such as AWS Service or AvailabilityZone, in a specific time range.
// See the GetDimensionValues action for a complete list of the valid dimensions.
// Master accounts in an organization have access to all member accounts.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Cost Explorer Service's
// API operation GetCostAndUsage for usage and error information.
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
// You made too many calls in a short period of time. Try again later.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsage
func (c *CostExplorer) GetCostAndUsage(input *GetCostAndUsageInput) (*GetCostAndUsageOutput, error) {
req, out := c.GetCostAndUsageRequest(input)
return out, req.Send()
}
// GetCostAndUsageWithContext is the same as GetCostAndUsage with the addition of
// the ability to pass a context and additional request options.
//
// See GetCostAndUsage for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CostExplorer) GetCostAndUsageWithContext(ctx aws.Context, input *GetCostAndUsageInput, opts ...request.Option) (*GetCostAndUsageOutput, error) {
req, out := c.GetCostAndUsageRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetDimensionValues = "GetDimensionValues"
// GetDimensionValuesRequest generates a "aws/request.Request" representing the
// client's request for the GetDimensionValues operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetDimensionValues for more information on using the GetDimensionValues
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetDimensionValuesRequest method.
// req, resp := client.GetDimensionValuesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValues
func (c *CostExplorer) GetDimensionValuesRequest(input *GetDimensionValuesInput) (req *request.Request, output *GetDimensionValuesOutput) {
op := &request.Operation{
Name: opGetDimensionValues,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetDimensionValuesInput{}
}
output = &GetDimensionValuesOutput{}
req = c.newRequest(op, input, output)
return
}
// GetDimensionValues API operation for AWS Cost Explorer Service.
//
// You can use GetDimensionValues to retrieve all available filter values for
// a specific filter over a period of time. You can search the dimension values
// for an arbitrary string.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Cost Explorer Service's
// API operation GetDimensionValues for usage and error information.
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
// You made too many calls in a short period of time. Try again later.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValues
func (c *CostExplorer) GetDimensionValues(input *GetDimensionValuesInput) (*GetDimensionValuesOutput, error) {
req, out := c.GetDimensionValuesRequest(input)
return out, req.Send()
}
// GetDimensionValuesWithContext is the same as GetDimensionValues with the addition of
// the ability to pass a context and additional request options.
//
// See GetDimensionValues for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CostExplorer) GetDimensionValuesWithContext(ctx aws.Context, input *GetDimensionValuesInput, opts ...request.Option) (*GetDimensionValuesOutput, error) {
req, out := c.GetDimensionValuesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetReservationUtilization = "GetReservationUtilization"
// GetReservationUtilizationRequest generates a "aws/request.Request" representing the
// client's request for the GetReservationUtilization operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetReservationUtilization for more information on using the GetReservationUtilization
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetReservationUtilizationRequest method.
// req, resp := client.GetReservationUtilizationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilization
func (c *CostExplorer) GetReservationUtilizationRequest(input *GetReservationUtilizationInput) (req *request.Request, output *GetReservationUtilizationOutput) {
op := &request.Operation{
Name: opGetReservationUtilization,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetReservationUtilizationInput{}
}
output = &GetReservationUtilizationOutput{}
req = c.newRequest(op, input, output)
return
}
// GetReservationUtilization API operation for AWS Cost Explorer Service.
//
// You can retrieve the Reservation utilization for your account. Master accounts
// in an organization have access to their associated member accounts. You can
// filter data by dimensions in a time period. You can use GetDimensionValues
// to determine the possible dimension values. Currently, you can group only
// by SUBSCRIPTION_ID.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Cost Explorer Service's
// API operation GetReservationUtilization for usage and error information.
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
// You made too many calls in a short period of time. Try again later.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilization
func (c *CostExplorer) GetReservationUtilization(input *GetReservationUtilizationInput) (*GetReservationUtilizationOutput, error) {
req, out := c.GetReservationUtilizationRequest(input)
return out, req.Send()
}
// GetReservationUtilizationWithContext is the same as GetReservationUtilization with the addition of
// the ability to pass a context and additional request options.
//
// See GetReservationUtilization for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CostExplorer) GetReservationUtilizationWithContext(ctx aws.Context, input *GetReservationUtilizationInput, opts ...request.Option) (*GetReservationUtilizationOutput, error) {
req, out := c.GetReservationUtilizationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetTags = "GetTags"
// GetTagsRequest generates a "aws/request.Request" representing the
// client's request for the GetTags operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetTags for more information on using the GetTags
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetTagsRequest method.
// req, resp := client.GetTagsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetTags
func (c *CostExplorer) GetTagsRequest(input *GetTagsInput) (req *request.Request, output *GetTagsOutput) {
op := &request.Operation{
Name: opGetTags,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetTagsInput{}
}
output = &GetTagsOutput{}
req = c.newRequest(op, input, output)
return
}
// GetTags API operation for AWS Cost Explorer Service.
//
// You can query for available tag keys and tag values for a specified period.
// You can search the tag values for an arbitrary string.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Cost Explorer Service's
// API operation GetTags for usage and error information.
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
// You made too many calls in a short period of time. Try again later.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetTags
func (c *CostExplorer) GetTags(input *GetTagsInput) (*GetTagsOutput, error) {
req, out := c.GetTagsRequest(input)
return out, req.Send()
}
// GetTagsWithContext is the same as GetTags with the addition of
// the ability to pass a context and additional request options.
//
// See GetTags for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CostExplorer) GetTagsWithContext(ctx aws.Context, input *GetTagsInput, opts ...request.Option) (*GetTagsOutput, error) {
req, out := c.GetTagsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// The time period that you want the usage and costs for.
type DateInterval struct {
_ struct{} `type:"structure"`
// The end of the time period that you want the usage and costs for. The end
// date is exclusive. For example, if the end is 2017-05-01, then the cost and
// usage data is retrieved from the start date but not including 2017-05-01.
//
// End is a required field
End *string `type:"string" required:"true"`
// The beginning of the time period that you want the usage and costs for. The
// start date is inclusive. For example, if start is 2017-01-01, then the cost
// and usage data is retrieved starting at 2017-01-01 up to the end date.
//
// Start is a required field
Start *string `type:"string" required:"true"`
}
// String returns the string representation
func (s DateInterval) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DateInterval) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DateInterval) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DateInterval"}
if s.End == nil {
invalidParams.Add(request.NewErrParamRequired("End"))
}
if s.Start == nil {
invalidParams.Add(request.NewErrParamRequired("Start"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEnd sets the End field's value.
func (s *DateInterval) SetEnd(v string) *DateInterval {
s.End = &v
return s
}
// SetStart sets the Start field's value.
func (s *DateInterval) SetStart(v string) *DateInterval {
s.Start = &v
return s
}
// The metadata that you can use to filter and group your results. You can use
// GetDimensionValues to find specific values.
type DimensionValues struct {
_ struct{} `type:"structure"`
// The names of the metadata types that you can use to filter and group your
// results. For example, AZ returns a list of Availability Zones.
Key *string `type:"string" enum:"Dimension"`
// The metadata values that you can use to filter and group your results. You
// can use GetDimensionValues to find specific values.
Values []*string `type:"list"`
}
// String returns the string representation
func (s DimensionValues) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DimensionValues) GoString() string {
return s.String()
}
// SetKey sets the Key field's value.
func (s *DimensionValues) SetKey(v string) *DimensionValues {
s.Key = &v
return s
}
// SetValues sets the Values field's value.
func (s *DimensionValues) SetValues(v []*string) *DimensionValues {
s.Values = v
return s
}
// The metadata of a specific type that you can use to filter and group your
// results. You can use GetDimensionValues to find specific values.
type DimensionValuesWithAttributes struct {
_ struct{} `type:"structure"`
// The attribute that applies to a specific Dimension.
Attributes map[string]*string `type:"map"`
// The value of a dimension with a specific attribute.
Value *string `type:"string"`
}
// String returns the string representation
func (s DimensionValuesWithAttributes) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DimensionValuesWithAttributes) GoString() string {
return s.String()
}
// SetAttributes sets the Attributes field's value.
func (s *DimensionValuesWithAttributes) SetAttributes(v map[string]*string) *DimensionValuesWithAttributes {
s.Attributes = v
return s
}
// SetValue sets the Value field's value.
func (s *DimensionValuesWithAttributes) SetValue(v string) *DimensionValuesWithAttributes {
s.Value = &v
return s
}
// Use Expression to filter by cost or by usage. There are two patterns:
//
// * Simple dimension values - You can set the dimension name and values
// for the filters that you plan to use. For example, you can filter for
// InstanceType==m4.xlarge OR InstanceType==c4.large. The Expression for
// that looks like this.
//
// { "Dimensions": { "Key": "InstanceType", "Values": [ "m4.xlarge", “c4.large”
// ] } }
//
// The list of dimension values are OR'd together to retrieve cost or usage
// data. You can create Expression and DimensionValues objects using either
// with* methods or set* methods in multiple lines.
//
// * Compound dimension values with logical operations - You can use multiple
// Expression types and the logical operators AND/OR/NOT to create a list
// of one or more Expression objects. This allows you to filter on more advanced
// options. For example, you can filter on ((InstanceType == m4.large OR
// InstanceType == m3.large) OR (Tag.Type == Type1)) AND (UsageType != DataTransfer).
// The Expression for that looks like this.
//
// { "And": [ {"Or": [ {"Dimensions": { "Key": "InstanceType", "Values": [ "m4.x.large",
// "c4.large" ] }}, {"Tag": { "Key": "TagName", "Values": ["Value1"] } }
// ]}, {"Not": {"dimensions": { "Key": "UsageType", "Values": ["DataTransfer"]
// }}} ] }
//
// Because each Expression can have only one operator, the service returns an
// error if more than one is specified. The following example shows an Expression
// object that will create an error.
//
// { "And": [ ... ], "DimensionValues": { "Dimension": "UsageType", "Values":
// [ "DataTransfer" ] } }
type Expression struct {
_ struct{} `type:"structure"`
// Return results that match both Dimension objects.
And []*Expression `type:"list"`
// The specific Dimension to use for Expression.
Dimensions *DimensionValues `type:"structure"`
// Return results that don't match Dimension.
Not *Expression `type:"structure"`
// Return results that match either Dimension.
Or []*Expression `type:"list"`
// The specific Tag to use for Expression.
Tags *TagValues `type:"structure"`
}
// String returns the string representation
func (s Expression) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Expression) GoString() string {
return s.String()
}
// SetAnd sets the And field's value.
func (s *Expression) SetAnd(v []*Expression) *Expression {
s.And = v
return s
}
// SetDimensions sets the Dimensions field's value.
func (s *Expression) SetDimensions(v *DimensionValues) *Expression {
s.Dimensions = v
return s
}
// SetNot sets the Not field's value.
func (s *Expression) SetNot(v *Expression) *Expression {
s.Not = v
return s
}
// SetOr sets the Or field's value.
func (s *Expression) SetOr(v []*Expression) *Expression {
s.Or = v
return s
}
// SetTags sets the Tags field's value.
func (s *Expression) SetTags(v *TagValues) *Expression {
s.Tags = v
return s
}
type GetCostAndUsageInput struct {
_ struct{} `type:"structure"`
// Filters AWS costs by different dimensions. For example, you can specify Service
// and Linked Account and get the costs associated with that account's usage
// of that service. You can nest Expression objects to define any combination
// of dimension filters. For more information, see the Expression object or
// More Examples.
Filter *Expression `type:"structure"`
// Sets the AWS cost granularity to MONTHLY or DAILY.
Granularity *string `type:"string" enum:"Granularity"`
// You can group AWS costs using up to two different groups, either dimensions,
// tag keys, or both.
//
// When you group by tag key, you get all tag values, including empty strings.
//
// Valid values are: AZ, INSTANCE_TYPE, LINKED_ACCCOUNT, OPERATION, PURCHASE_TYPE,
// SERVICE, USAGE_TYPE, TAGS, and PLATFORM.
GroupBy []*GroupDefinition `type:"list"`
// Which metrics are returned in the query. For more information about blended
// and unblended rates, see https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/.
//
// Valid values are BlendedCost, UnblendedCost, and UsageQuantity.
//
// If you return the UsageQuantity metric, the service aggregates all usage
// numbers without taking into account the units. For example, if you aggregate
// usageQuantity across all of EC2, the results aren't meaningful because EC2
// compute hours and data transfer are measured in different units (for example,
// hours vs. GB). To get more meaningful UsageQuantity metrics, filter by UsageType
// or UsageTypeGroups.
Metrics []*string `type:"list"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// Sets the start and end dates for retrieving AWS costs. The start date is
// inclusive, but the end date is exclusive. For example, if start is 2017-01-01
// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
// up to and including 2017-04-30 but not including 2017-05-01.
TimePeriod *DateInterval `type:"structure"`
}
// String returns the string representation
func (s GetCostAndUsageInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetCostAndUsageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetCostAndUsageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetCostAndUsageInput"}
if s.TimePeriod != nil {
if err := s.TimePeriod.Validate(); err != nil {
invalidParams.AddNested("TimePeriod", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetFilter sets the Filter field's value.
func (s *GetCostAndUsageInput) SetFilter(v *Expression) *GetCostAndUsageInput {
s.Filter = v
return s
}
// SetGranularity sets the Granularity field's value.
func (s *GetCostAndUsageInput) SetGranularity(v string) *GetCostAndUsageInput {
s.Granularity = &v
return s
}
// SetGroupBy sets the GroupBy field's value.
func (s *GetCostAndUsageInput) SetGroupBy(v []*GroupDefinition) *GetCostAndUsageInput {
s.GroupBy = v
return s
}
// SetMetrics sets the Metrics field's value.
func (s *GetCostAndUsageInput) SetMetrics(v []*string) *GetCostAndUsageInput {
s.Metrics = v
return s
}
// SetNextPageToken sets the NextPageToken field's value.
func (s *GetCostAndUsageInput) SetNextPageToken(v string) *GetCostAndUsageInput {
s.NextPageToken = &v
return s
}
// SetTimePeriod sets the TimePeriod field's value.
func (s *GetCostAndUsageInput) SetTimePeriod(v *DateInterval) *GetCostAndUsageInput {
s.TimePeriod = v
return s
}
type GetCostAndUsageOutput struct {
_ struct{} `type:"structure"`
// The groups specified by the the Filter or GroupBy parameters in the request.
GroupDefinitions []*GroupDefinition `type:"list"`
// The token for the next set of retrievable results. AWS provides the token
// when the response from a previous call has more results than the maximum
// page size.
NextPageToken *string `type:"string"`
// The time period covered by the results in the response.
ResultsByTime []*ResultByTime `type:"list"`
}
// String returns the string representation
func (s GetCostAndUsageOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetCostAndUsageOutput) GoString() string {
return s.String()
}
// SetGroupDefinitions sets the GroupDefinitions field's value.
func (s *GetCostAndUsageOutput) SetGroupDefinitions(v []*GroupDefinition) *GetCostAndUsageOutput {
s.GroupDefinitions = v
return s
}
// SetNextPageToken sets the NextPageToken field's value.
func (s *GetCostAndUsageOutput) SetNextPageToken(v string) *GetCostAndUsageOutput {
s.NextPageToken = &v
return s
}
// SetResultsByTime sets the ResultsByTime field's value.
func (s *GetCostAndUsageOutput) SetResultsByTime(v []*ResultByTime) *GetCostAndUsageOutput {
s.ResultsByTime = v
return s
}
type GetDimensionValuesInput struct {
_ struct{} `type:"structure"`
// The context for the call to GetDimensionValues. This can be RESERVED_INSTANCE
// or COST_AND_USAGE. The default value is COST_AND_USAGE. If the context is
// set to RESERVED_INSTANCE, the resulting dimension values can be used in the
// GetReservationUtilization action. If the context is set to COST_AND_USAGE,
// , the resulting dimension values can be used in the GetCostAndUsage operation.
//
// If you set the context to CostAndUsage, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * InstanceType - The type of EC2 instance. An example is m4.xlarge.
//
// * LinkedAccount - The description in the attribute map that includes the
// full name of the member account. The value field contains the AWS ID of
// the member account
//
// * Operation - The action performed. Examples include RunInstance and CreateBucket.
//
// * PurchaseType - The reservation type of the purchase to which this usage
// is related. Examples include: On Demand Instances and Standard Reserved
// Instances
//
// * Service - The AWS service such as DynamoDB.
//
// * UsageType -The type of usage. An example is DataTransfer-In-Bytes. The
// response for the GetDimensionValues action includes a unit attribute,
// examples of which include GB and Hrs.
//
// * UsageTypeGroup - The grouping of common usage types. An example is EC2:
// CloudWatch – Alarms. The response for this action includes a unit attribute.
//
// * RecordType - The different types of charges such as RI fees, usage costs,
// tax refunds, and credits
//
// If you set the context to ReservedInstance, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * InstanceType - The type of EC2 instance. An example is m4.xlarge.
//
// * LinkedAccount - The description in the attribute map that includes the
// full name of the member account. The value field contains the AWS ID of
// the member account
//
// * Platform - The operating system. Examples are Windows or Linux.
//
// * Region - The AWS region.
//
// * Scope - The scope of a reserved instance (RI). Values are regional or
// a single availability zone.
//
// * Tenancy - The tenancy of a resource. Examples are shared or dedicated.
Context *string `type:"string" enum:"Context"`
// The name of the dimension. Different Dimensionsare available for different
// Contexts. For more information, see Context.
//
// Dimension is a required field
Dimension *string `type:"string" required:"true" enum:"Dimension"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// The value that you want to search the filter values for.
SearchString *string `type:"string"`
// The start and end dates for retrieving the dimension values. The start date
// is inclusive, but the end date is exclusive. For example, if start is 2017-01-01
// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
// up to and including 2017-04-30 but not including 2017-05-01.
//
// TimePeriod is a required field
TimePeriod *DateInterval `type:"structure" required:"true"`
}
// String returns the string representation
func (s GetDimensionValuesInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetDimensionValuesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDimensionValuesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDimensionValuesInput"}
if s.Dimension == nil {
invalidParams.Add(request.NewErrParamRequired("Dimension"))
}
if s.TimePeriod == nil {
invalidParams.Add(request.NewErrParamRequired("TimePeriod"))
}
if s.TimePeriod != nil {
if err := s.TimePeriod.Validate(); err != nil {
invalidParams.AddNested("TimePeriod", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetContext sets the Context field's value.
func (s *GetDimensionValuesInput) SetContext(v string) *GetDimensionValuesInput {
s.Context = &v
return s
}
// SetDimension sets the Dimension field's value.
func (s *GetDimensionValuesInput) SetDimension(v string) *GetDimensionValuesInput {
s.Dimension = &v
return s
}
// SetNextPageToken sets the NextPageToken field's value.
func (s *GetDimensionValuesInput) SetNextPageToken(v string) *GetDimensionValuesInput {
s.NextPageToken = &v
return s
}
// SetSearchString sets the SearchString field's value.
func (s *GetDimensionValuesInput) SetSearchString(v string) *GetDimensionValuesInput {
s.SearchString = &v
return s
}
// SetTimePeriod sets the TimePeriod field's value.
func (s *GetDimensionValuesInput) SetTimePeriod(v *DateInterval) *GetDimensionValuesInput {
s.TimePeriod = v
return s
}
type GetDimensionValuesOutput struct {
_ struct{} `type:"structure"`
// The filters that you used to filter your request. Some dimensions are available
// only for a specific context:
//
// If you set the context to CostAndUsage, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * InstanceType - The type of EC2 instance. An example is m4.xlarge.
//
// * LinkedAccount - The description in the attribute map that includes the
// full name of the member account. The value field contains the AWS ID of
// the member account
//
// * Operation - The action performed. Examples include RunInstance and CreateBucket.
//
// * PurchaseType - The reservation type of the purchase to which this usage
// is related. Examples include: On Demand Instances and Standard Reserved
// Instances
//
// * Service - The AWS service such as DynamoDB.
//
// * UsageType -The type of usage. An example is DataTransfer-In-Bytes. The
// response for the GetDimensionValues action includes a unit attribute,
// examples of which include GB and Hrs.
//
// * UsageTypeGroup - The grouping of common usage types. An example is EC2:
// CloudWatch – Alarms. The response for this action includes a unit attribute.
//
// * RecordType - The different types of charges such as RI fees, usage costs,
// tax refunds, and credits
//
// If you set the context to ReservedInstance, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * InstanceType - The type of EC2 instance. An example is m4.xlarge.
//
// * LinkedAccount - The description in the attribute map that includes the
// full name of the member account. The value field contains the AWS ID of
// the member account
//
// * Platform - The operating system. Examples are Windows or Linux.
//
// * Region - The AWS region.
//
// * Scope - The scope of a reserved instance (RI). Values are regional or
// a single availability zone.
//
// * Tenancy - The tenancy of a resource. Examples are shared or dedicated.
//
// DimensionValues is a required field
DimensionValues []*DimensionValuesWithAttributes `type:"list" required:"true"`
// The token for the next set of retrievable results. AWS provides the token
// when the response from a previous call has more results than the maximum
// page size.
NextPageToken *string `type:"string"`
// The number of results that AWS returned at one time.
//
// ReturnSize is a required field
ReturnSize *int64 `type:"integer" required:"true"`
// The total number of search results.
//
// TotalSize is a required field
TotalSize *int64 `type:"integer" required:"true"`
}
// String returns the string representation
func (s GetDimensionValuesOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetDimensionValuesOutput) GoString() string {
return s.String()
}
// SetDimensionValues sets the DimensionValues field's value.
func (s *GetDimensionValuesOutput) SetDimensionValues(v []*DimensionValuesWithAttributes) *GetDimensionValuesOutput {
s.DimensionValues = v
return s
}
// SetNextPageToken sets the NextPageToken field's value.
func (s *GetDimensionValuesOutput) SetNextPageToken(v string) *GetDimensionValuesOutput {
s.NextPageToken = &v
return s
}
// SetReturnSize sets the ReturnSize field's value.
func (s *GetDimensionValuesOutput) SetReturnSize(v int64) *GetDimensionValuesOutput {
s.ReturnSize = &v
return s
}
// SetTotalSize sets the TotalSize field's value.
func (s *GetDimensionValuesOutput) SetTotalSize(v int64) *GetDimensionValuesOutput {
s.TotalSize = &v
return s
}
type GetReservationUtilizationInput struct {
_ struct{} `type:"structure"`
// Filters utilization data by using different dimensions. GetReservationUtilization
// uses the same Expression object as the other operations, but only AND is
// supported among each dimension, and nesting is supported up to only one level
// deep. If there are multiple values for a dimension, they are OR'd together.
Filter *Expression `type:"structure"`
// Sets the AWS cost granularity to MONTHLY or DAILY. If both GroupBy and granularity
// are not set, GetReservationUtilization defaults to DAILY. If GroupBy is set,
// Granularity can't be set, and the response object doesn't include MONTHLY
// or DAILY granularity.
Granularity *string `type:"string" enum:"Granularity"`
// Groups only by SubscriptionId. Metadata is included.
GroupBy []*GroupDefinition `type:"list"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// Sets the start and end dates for retrieving reserve instance (RI) utilization.
// The start date is inclusive, but the end date is exclusive. For example,
// if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data
// is retrieved from 2017-01-01 up to and including 2017-04-30 but not including
// 2017-05-01.
//
// TimePeriod is a required field
TimePeriod *DateInterval `type:"structure" required:"true"`
}
// String returns the string representation
func (s GetReservationUtilizationInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetReservationUtilizationInput) GoString() string {
return s.String()
}