forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
3141 lines (2587 loc) · 104 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 cloudwatchlogs provides a client for Amazon CloudWatch Logs.
package cloudwatchlogs
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opCancelExportTask = "CancelExportTask"
// CancelExportTaskRequest generates a request for the CancelExportTask operation.
func (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) {
op := &request.Operation{
Name: opCancelExportTask,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CancelExportTaskInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &CancelExportTaskOutput{}
req.Data = output
return
}
// Cancels an export task if it is in PENDING or RUNNING state.
func (c *CloudWatchLogs) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) {
req, out := c.CancelExportTaskRequest(input)
err := req.Send()
return out, err
}
const opCreateExportTask = "CreateExportTask"
// CreateExportTaskRequest generates a request for the CreateExportTask operation.
func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) (req *request.Request, output *CreateExportTaskOutput) {
op := &request.Operation{
Name: opCreateExportTask,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateExportTaskInput{}
}
req = c.newRequest(op, input, output)
output = &CreateExportTaskOutput{}
req.Data = output
return
}
// Creates an ExportTask which allows you to efficiently export data from a
// Log Group to your Amazon S3 bucket.
//
// This is an asynchronous call. If all the required information is provided,
// this API will initiate an export task and respond with the task Id. Once
// started, DescribeExportTasks can be used to get the status of an export task.
// You can only have one active (RUNNING or PENDING) export task at a time,
// per account.
//
// You can export logs from multiple log groups or multiple time ranges to
// the same Amazon S3 bucket. To separate out log data for each export task,
// you can specify a prefix that will be used as the Amazon S3 key prefix for
// all exported objects.
func (c *CloudWatchLogs) CreateExportTask(input *CreateExportTaskInput) (*CreateExportTaskOutput, error) {
req, out := c.CreateExportTaskRequest(input)
err := req.Send()
return out, err
}
const opCreateLogGroup = "CreateLogGroup"
// CreateLogGroupRequest generates a request for the CreateLogGroup operation.
func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *request.Request, output *CreateLogGroupOutput) {
op := &request.Operation{
Name: opCreateLogGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateLogGroupInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &CreateLogGroupOutput{}
req.Data = output
return
}
// Creates a new log group with the specified name. The name of the log group
// must be unique within a region for an AWS account. You can create up to 500
// log groups per account.
//
// You must use the following guidelines when naming a log group: Log group
// names can be between 1 and 512 characters long. Allowed characters are a-z,
// A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
func (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error) {
req, out := c.CreateLogGroupRequest(input)
err := req.Send()
return out, err
}
const opCreateLogStream = "CreateLogStream"
// CreateLogStreamRequest generates a request for the CreateLogStream operation.
func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *request.Request, output *CreateLogStreamOutput) {
op := &request.Operation{
Name: opCreateLogStream,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateLogStreamInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &CreateLogStreamOutput{}
req.Data = output
return
}
// Creates a new log stream in the specified log group. The name of the log
// stream must be unique within the log group. There is no limit on the number
// of log streams that can exist in a log group.
//
// You must use the following guidelines when naming a log stream: Log stream
// names can be between 1 and 512 characters long. The ':' colon character is
// not allowed.
func (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error) {
req, out := c.CreateLogStreamRequest(input)
err := req.Send()
return out, err
}
const opDeleteDestination = "DeleteDestination"
// DeleteDestinationRequest generates a request for the DeleteDestination operation.
func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) (req *request.Request, output *DeleteDestinationOutput) {
op := &request.Operation{
Name: opDeleteDestination,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteDestinationInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteDestinationOutput{}
req.Data = output
return
}
// Deletes the destination with the specified name and eventually disables all
// the subscription filters that publish to it. This will not delete the physical
// resource encapsulated by the destination.
func (c *CloudWatchLogs) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error) {
req, out := c.DeleteDestinationRequest(input)
err := req.Send()
return out, err
}
const opDeleteLogGroup = "DeleteLogGroup"
// DeleteLogGroupRequest generates a request for the DeleteLogGroup operation.
func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *request.Request, output *DeleteLogGroupOutput) {
op := &request.Operation{
Name: opDeleteLogGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteLogGroupInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteLogGroupOutput{}
req.Data = output
return
}
// Deletes the log group with the specified name and permanently deletes all
// the archived log events associated with it.
func (c *CloudWatchLogs) DeleteLogGroup(input *DeleteLogGroupInput) (*DeleteLogGroupOutput, error) {
req, out := c.DeleteLogGroupRequest(input)
err := req.Send()
return out, err
}
const opDeleteLogStream = "DeleteLogStream"
// DeleteLogStreamRequest generates a request for the DeleteLogStream operation.
func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *request.Request, output *DeleteLogStreamOutput) {
op := &request.Operation{
Name: opDeleteLogStream,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteLogStreamInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteLogStreamOutput{}
req.Data = output
return
}
// Deletes a log stream and permanently deletes all the archived log events
// associated with it.
func (c *CloudWatchLogs) DeleteLogStream(input *DeleteLogStreamInput) (*DeleteLogStreamOutput, error) {
req, out := c.DeleteLogStreamRequest(input)
err := req.Send()
return out, err
}
const opDeleteMetricFilter = "DeleteMetricFilter"
// DeleteMetricFilterRequest generates a request for the DeleteMetricFilter operation.
func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *request.Request, output *DeleteMetricFilterOutput) {
op := &request.Operation{
Name: opDeleteMetricFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteMetricFilterInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteMetricFilterOutput{}
req.Data = output
return
}
// Deletes a metric filter associated with the specified log group.
func (c *CloudWatchLogs) DeleteMetricFilter(input *DeleteMetricFilterInput) (*DeleteMetricFilterOutput, error) {
req, out := c.DeleteMetricFilterRequest(input)
err := req.Send()
return out, err
}
const opDeleteRetentionPolicy = "DeleteRetentionPolicy"
// DeleteRetentionPolicyRequest generates a request for the DeleteRetentionPolicy operation.
func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *request.Request, output *DeleteRetentionPolicyOutput) {
op := &request.Operation{
Name: opDeleteRetentionPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteRetentionPolicyInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteRetentionPolicyOutput{}
req.Data = output
return
}
// Deletes the retention policy of the specified log group. Log events would
// not expire if they belong to log groups without a retention policy.
func (c *CloudWatchLogs) DeleteRetentionPolicy(input *DeleteRetentionPolicyInput) (*DeleteRetentionPolicyOutput, error) {
req, out := c.DeleteRetentionPolicyRequest(input)
err := req.Send()
return out, err
}
const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter"
// DeleteSubscriptionFilterRequest generates a request for the DeleteSubscriptionFilter operation.
func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *request.Request, output *DeleteSubscriptionFilterOutput) {
op := &request.Operation{
Name: opDeleteSubscriptionFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteSubscriptionFilterInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &DeleteSubscriptionFilterOutput{}
req.Data = output
return
}
// Deletes a subscription filter associated with the specified log group.
func (c *CloudWatchLogs) DeleteSubscriptionFilter(input *DeleteSubscriptionFilterInput) (*DeleteSubscriptionFilterOutput, error) {
req, out := c.DeleteSubscriptionFilterRequest(input)
err := req.Send()
return out, err
}
const opDescribeDestinations = "DescribeDestinations"
// DescribeDestinationsRequest generates a request for the DescribeDestinations operation.
func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinationsInput) (req *request.Request, output *DescribeDestinationsOutput) {
op := &request.Operation{
Name: opDescribeDestinations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeDestinationsInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeDestinationsOutput{}
req.Data = output
return
}
// Returns all the destinations that are associated with the AWS account making
// the request. The list returned in the response is ASCII-sorted by destination
// name.
//
// By default, this operation returns up to 50 destinations. If there are
// more destinations to list, the response would contain a nextToken value in
// the response body. You can also limit the number of destinations returned
// in the response by specifying the limit parameter in the request.
func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error) {
req, out := c.DescribeDestinationsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsInput, fn func(p *DescribeDestinationsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeDestinationsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeDestinationsOutput), lastPage)
})
}
const opDescribeExportTasks = "DescribeExportTasks"
// DescribeExportTasksRequest generates a request for the DescribeExportTasks operation.
func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) {
op := &request.Operation{
Name: opDescribeExportTasks,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeExportTasksInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeExportTasksOutput{}
req.Data = output
return
}
// Returns all the export tasks that are associated with the AWS account making
// the request. The export tasks can be filtered based on TaskId or TaskStatus.
//
// By default, this operation returns up to 50 export tasks that satisfy the
// specified filters. If there are more export tasks to list, the response would
// contain a nextToken value in the response body. You can also limit the number
// of export tasks returned in the response by specifying the limit parameter
// in the request.
func (c *CloudWatchLogs) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) {
req, out := c.DescribeExportTasksRequest(input)
err := req.Send()
return out, err
}
const opDescribeLogGroups = "DescribeLogGroups"
// DescribeLogGroupsRequest generates a request for the DescribeLogGroups operation.
func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *request.Request, output *DescribeLogGroupsOutput) {
op := &request.Operation{
Name: opDescribeLogGroups,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeLogGroupsInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeLogGroupsOutput{}
req.Data = output
return
}
// Returns all the log groups that are associated with the AWS account making
// the request. The list returned in the response is ASCII-sorted by log group
// name.
//
// By default, this operation returns up to 50 log groups. If there are more
// log groups to list, the response would contain a nextToken value in the response
// body. You can also limit the number of log groups returned in the response
// by specifying the limit parameter in the request.
func (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*DescribeLogGroupsOutput, error) {
req, out := c.DescribeLogGroupsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(p *DescribeLogGroupsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeLogGroupsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeLogGroupsOutput), lastPage)
})
}
const opDescribeLogStreams = "DescribeLogStreams"
// DescribeLogStreamsRequest generates a request for the DescribeLogStreams operation.
func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) (req *request.Request, output *DescribeLogStreamsOutput) {
op := &request.Operation{
Name: opDescribeLogStreams,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeLogStreamsInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeLogStreamsOutput{}
req.Data = output
return
}
// Returns all the log streams that are associated with the specified log group.
// The list returned in the response is ASCII-sorted by log stream name.
//
// By default, this operation returns up to 50 log streams. If there are more
// log streams to list, the response would contain a nextToken value in the
// response body. You can also limit the number of log streams returned in the
// response by specifying the limit parameter in the request. This operation
// has a limit of five transactions per second, after which transactions are
// throttled.
func (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*DescribeLogStreamsOutput, error) {
req, out := c.DescribeLogStreamsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(p *DescribeLogStreamsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeLogStreamsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeLogStreamsOutput), lastPage)
})
}
const opDescribeMetricFilters = "DescribeMetricFilters"
// DescribeMetricFiltersRequest generates a request for the DescribeMetricFilters operation.
func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFiltersInput) (req *request.Request, output *DescribeMetricFiltersOutput) {
op := &request.Operation{
Name: opDescribeMetricFilters,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeMetricFiltersInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeMetricFiltersOutput{}
req.Data = output
return
}
// Returns all the metrics filters associated with the specified log group.
// The list returned in the response is ASCII-sorted by filter name.
//
// By default, this operation returns up to 50 metric filters. If there are
// more metric filters to list, the response would contain a nextToken value
// in the response body. You can also limit the number of metric filters returned
// in the response by specifying the limit parameter in the request.
func (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput) (*DescribeMetricFiltersOutput, error) {
req, out := c.DescribeMetricFiltersRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(p *DescribeMetricFiltersOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeMetricFiltersRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeMetricFiltersOutput), lastPage)
})
}
const opDescribeSubscriptionFilters = "DescribeSubscriptionFilters"
// DescribeSubscriptionFiltersRequest generates a request for the DescribeSubscriptionFilters operation.
func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubscriptionFiltersInput) (req *request.Request, output *DescribeSubscriptionFiltersOutput) {
op := &request.Operation{
Name: opDescribeSubscriptionFilters,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeSubscriptionFiltersInput{}
}
req = c.newRequest(op, input, output)
output = &DescribeSubscriptionFiltersOutput{}
req.Data = output
return
}
// Returns all the subscription filters associated with the specified log group.
// The list returned in the response is ASCII-sorted by filter name.
//
// By default, this operation returns up to 50 subscription filters. If there
// are more subscription filters to list, the response would contain a nextToken
// value in the response body. You can also limit the number of subscription
// filters returned in the response by specifying the limit parameter in the
// request.
func (c *CloudWatchLogs) DescribeSubscriptionFilters(input *DescribeSubscriptionFiltersInput) (*DescribeSubscriptionFiltersOutput, error) {
req, out := c.DescribeSubscriptionFiltersRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscriptionFiltersInput, fn func(p *DescribeSubscriptionFiltersOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeSubscriptionFiltersRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeSubscriptionFiltersOutput), lastPage)
})
}
const opFilterLogEvents = "FilterLogEvents"
// FilterLogEventsRequest generates a request for the FilterLogEvents operation.
func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *request.Request, output *FilterLogEventsOutput) {
op := &request.Operation{
Name: opFilterLogEvents,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &FilterLogEventsInput{}
}
req = c.newRequest(op, input, output)
output = &FilterLogEventsOutput{}
req.Data = output
return
}
// Retrieves log events, optionally filtered by a filter pattern from the specified
// log group. You can provide an optional time range to filter the results on
// the event timestamp. You can limit the streams searched to an explicit list
// of logStreamNames.
//
// By default, this operation returns as much matching log events as can fit
// in a response size of 1MB, up to 10,000 log events, or all the events found
// within a time-bounded scan window. If the response includes a nextToken,
// then there is more data to search, and the search can be resumed with a new
// request providing the nextToken. The response will contain a list of searchedLogStreams
// that contains information about which streams were searched in the request
// and whether they have been searched completely or require further pagination.
// The limit parameter in the request. can be used to specify the maximum number
// of events to return in a page.
func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error) {
req, out := c.FilterLogEventsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn func(p *FilterLogEventsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.FilterLogEventsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*FilterLogEventsOutput), lastPage)
})
}
const opGetLogEvents = "GetLogEvents"
// GetLogEventsRequest generates a request for the GetLogEvents operation.
func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *request.Request, output *GetLogEventsOutput) {
op := &request.Operation{
Name: opGetLogEvents,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextForwardToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
if input == nil {
input = &GetLogEventsInput{}
}
req = c.newRequest(op, input, output)
output = &GetLogEventsOutput{}
req.Data = output
return
}
// Retrieves log events from the specified log stream. You can provide an optional
// time range to filter the results on the event timestamp.
//
// By default, this operation returns as much log events as can fit in a response
// size of 1MB, up to 10,000 log events. The response will always include a
// nextForwardToken and a nextBackwardToken in the response body. You can use
// any of these tokens in subsequent GetLogEvents requests to paginate through
// events in either forward or backward direction. You can also limit the number
// of log events returned in the response by specifying the limit parameter
// in the request.
func (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOutput, error) {
req, out := c.GetLogEventsRequest(input)
err := req.Send()
return out, err
}
func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(p *GetLogEventsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.GetLogEventsRequest(input)
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*GetLogEventsOutput), lastPage)
})
}
const opPutDestination = "PutDestination"
// PutDestinationRequest generates a request for the PutDestination operation.
func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req *request.Request, output *PutDestinationOutput) {
op := &request.Operation{
Name: opPutDestination,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutDestinationInput{}
}
req = c.newRequest(op, input, output)
output = &PutDestinationOutput{}
req.Data = output
return
}
// Creates or updates a Destination. A destination encapsulates a physical resource
// (such as a Kinesis stream) and allows you to subscribe to a real-time stream
// of log events of a different account, ingested through PutLogEvents requests.
// Currently, the only supported physical resource is a Amazon Kinesis stream
// belonging to the same account as the destination.
//
// A destination controls what is written to its Amazon Kinesis stream through
// an access policy. By default, PutDestination does not set any access policy
// with the destination, which means a cross-account user will not be able to
// call PutSubscriptionFilter against this destination. To enable that, the
// destination owner must call PutDestinationPolicy after PutDestination.
func (c *CloudWatchLogs) PutDestination(input *PutDestinationInput) (*PutDestinationOutput, error) {
req, out := c.PutDestinationRequest(input)
err := req.Send()
return out, err
}
const opPutDestinationPolicy = "PutDestinationPolicy"
// PutDestinationPolicyRequest generates a request for the PutDestinationPolicy operation.
func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicyInput) (req *request.Request, output *PutDestinationPolicyOutput) {
op := &request.Operation{
Name: opPutDestinationPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutDestinationPolicyInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &PutDestinationPolicyOutput{}
req.Data = output
return
}
// Creates or updates an access policy associated with an existing Destination.
// An access policy is an IAM policy document (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html)
// that is used to authorize claims to register a subscription filter against
// a given destination.
func (c *CloudWatchLogs) PutDestinationPolicy(input *PutDestinationPolicyInput) (*PutDestinationPolicyOutput, error) {
req, out := c.PutDestinationPolicyRequest(input)
err := req.Send()
return out, err
}
const opPutLogEvents = "PutLogEvents"
// PutLogEventsRequest generates a request for the PutLogEvents operation.
func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *request.Request, output *PutLogEventsOutput) {
op := &request.Operation{
Name: opPutLogEvents,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutLogEventsInput{}
}
req = c.newRequest(op, input, output)
output = &PutLogEventsOutput{}
req.Data = output
return
}
// Uploads a batch of log events to the specified log stream.
//
// Every PutLogEvents request must include the sequenceToken obtained from
// the response of the previous request. An upload in a newly created log stream
// does not require a sequenceToken.
//
// The batch of events must satisfy the following constraints: The maximum
// batch size is 1,048,576 bytes, and this size is calculated as the sum of
// all event messages in UTF-8, plus 26 bytes for each log event. None of the
// log events in the batch can be more than 2 hours in the future. None of the
// log events in the batch can be older than 14 days or the retention period
// of the log group. The log events in the batch must be in chronological ordered
// by their timestamp. The maximum number of log events in a batch is 10,000.
// A batch of log events in a single PutLogEvents request cannot span more than
// 24 hours. Otherwise, the PutLogEvents operation will fail.
func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) {
req, out := c.PutLogEventsRequest(input)
err := req.Send()
return out, err
}
const opPutMetricFilter = "PutMetricFilter"
// PutMetricFilterRequest generates a request for the PutMetricFilter operation.
func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (req *request.Request, output *PutMetricFilterOutput) {
op := &request.Operation{
Name: opPutMetricFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutMetricFilterInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &PutMetricFilterOutput{}
req.Data = output
return
}
// Creates or updates a metric filter and associates it with the specified log
// group. Metric filters allow you to configure rules to extract metric data
// from log events ingested through PutLogEvents requests.
//
// The maximum number of metric filters that can be associated with a log
// group is 100.
func (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error) {
req, out := c.PutMetricFilterRequest(input)
err := req.Send()
return out, err
}
const opPutRetentionPolicy = "PutRetentionPolicy"
// PutRetentionPolicyRequest generates a request for the PutRetentionPolicy operation.
func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *request.Request, output *PutRetentionPolicyOutput) {
op := &request.Operation{
Name: opPutRetentionPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutRetentionPolicyInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &PutRetentionPolicyOutput{}
req.Data = output
return
}
// Sets the retention of the specified log group. A retention policy allows
// you to configure the number of days you want to retain log events in the
// specified log group.
func (c *CloudWatchLogs) PutRetentionPolicy(input *PutRetentionPolicyInput) (*PutRetentionPolicyOutput, error) {
req, out := c.PutRetentionPolicyRequest(input)
err := req.Send()
return out, err
}
const opPutSubscriptionFilter = "PutSubscriptionFilter"
// PutSubscriptionFilterRequest generates a request for the PutSubscriptionFilter operation.
func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *request.Request, output *PutSubscriptionFilterOutput) {
op := &request.Operation{
Name: opPutSubscriptionFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutSubscriptionFilterInput{}
}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output = &PutSubscriptionFilterOutput{}
req.Data = output
return
}
// Creates or updates a subscription filter and associates it with the specified
// log group. Subscription filters allow you to subscribe to a real-time stream
// of log events ingested through PutLogEvents requests and have them delivered
// to a specific destination. Currently, the supported destinations are: An
// Amazon Kinesis stream belonging to the same account as the subscription filter,
// for same-account delivery. A logical destination (used via an ARN of Destination)
// belonging to a different account, for cross-account delivery. An Amazon
// Kinesis Firehose stream belonging to the same account as the subscription
// filter, for same-account delivery. An AWS Lambda function belonging to
// the same account as the subscription filter, for same-account delivery.
//
//
// Currently there can only be one subscription filter associated with a log
// group.
func (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error) {
req, out := c.PutSubscriptionFilterRequest(input)
err := req.Send()
return out, err
}
const opTestMetricFilter = "TestMetricFilter"
// TestMetricFilterRequest generates a request for the TestMetricFilter operation.
func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *request.Request, output *TestMetricFilterOutput) {
op := &request.Operation{
Name: opTestMetricFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &TestMetricFilterInput{}
}
req = c.newRequest(op, input, output)
output = &TestMetricFilterOutput{}
req.Data = output
return
}
// Tests the filter pattern of a metric filter against a sample of log event
// messages. You can use this operation to validate the correctness of a metric
// filter pattern.
func (c *CloudWatchLogs) TestMetricFilter(input *TestMetricFilterInput) (*TestMetricFilterOutput, error) {
req, out := c.TestMetricFilterRequest(input)
err := req.Send()
return out, err
}
type CancelExportTaskInput struct {
_ struct{} `type:"structure"`
// Id of the export task to cancel.
TaskId *string `locationName:"taskId" min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s CancelExportTaskInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CancelExportTaskInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CancelExportTaskInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CancelExportTaskInput"}
if s.TaskId == nil {
invalidParams.Add(request.NewErrParamRequired("TaskId"))
}
if s.TaskId != nil && len(*s.TaskId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TaskId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CancelExportTaskOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s CancelExportTaskOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CancelExportTaskOutput) GoString() string {
return s.String()