forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
1554 lines (1222 loc) · 52.2 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 (
"sync"
"github.com/aws/aws-sdk-go/aws"
)
var oprw sync.Mutex
// CreateLogGroupRequest generates a request for the CreateLogGroup operation.
func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *aws.Request, output *CreateLogGroupOutput) {
oprw.Lock()
defer oprw.Unlock()
if opCreateLogGroup == nil {
opCreateLogGroup = &aws.Operation{
Name: "CreateLogGroup",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &CreateLogGroupInput{}
}
req = c.newRequest(opCreateLogGroup, input, output)
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
}
var opCreateLogGroup *aws.Operation
// CreateLogStreamRequest generates a request for the CreateLogStream operation.
func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *aws.Request, output *CreateLogStreamOutput) {
oprw.Lock()
defer oprw.Unlock()
if opCreateLogStream == nil {
opCreateLogStream = &aws.Operation{
Name: "CreateLogStream",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &CreateLogStreamInput{}
}
req = c.newRequest(opCreateLogStream, input, output)
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
}
var opCreateLogStream *aws.Operation
// DeleteLogGroupRequest generates a request for the DeleteLogGroup operation.
func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *aws.Request, output *DeleteLogGroupOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDeleteLogGroup == nil {
opDeleteLogGroup = &aws.Operation{
Name: "DeleteLogGroup",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &DeleteLogGroupInput{}
}
req = c.newRequest(opDeleteLogGroup, input, output)
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
}
var opDeleteLogGroup *aws.Operation
// DeleteLogStreamRequest generates a request for the DeleteLogStream operation.
func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *aws.Request, output *DeleteLogStreamOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDeleteLogStream == nil {
opDeleteLogStream = &aws.Operation{
Name: "DeleteLogStream",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &DeleteLogStreamInput{}
}
req = c.newRequest(opDeleteLogStream, input, output)
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
}
var opDeleteLogStream *aws.Operation
// DeleteMetricFilterRequest generates a request for the DeleteMetricFilter operation.
func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *aws.Request, output *DeleteMetricFilterOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDeleteMetricFilter == nil {
opDeleteMetricFilter = &aws.Operation{
Name: "DeleteMetricFilter",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &DeleteMetricFilterInput{}
}
req = c.newRequest(opDeleteMetricFilter, input, output)
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
}
var opDeleteMetricFilter *aws.Operation
// DeleteRetentionPolicyRequest generates a request for the DeleteRetentionPolicy operation.
func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *aws.Request, output *DeleteRetentionPolicyOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDeleteRetentionPolicy == nil {
opDeleteRetentionPolicy = &aws.Operation{
Name: "DeleteRetentionPolicy",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &DeleteRetentionPolicyInput{}
}
req = c.newRequest(opDeleteRetentionPolicy, input, output)
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
}
var opDeleteRetentionPolicy *aws.Operation
// DeleteSubscriptionFilterRequest generates a request for the DeleteSubscriptionFilter operation.
func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *aws.Request, output *DeleteSubscriptionFilterOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDeleteSubscriptionFilter == nil {
opDeleteSubscriptionFilter = &aws.Operation{
Name: "DeleteSubscriptionFilter",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &DeleteSubscriptionFilterInput{}
}
req = c.newRequest(opDeleteSubscriptionFilter, input, output)
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
}
var opDeleteSubscriptionFilter *aws.Operation
// DescribeLogGroupsRequest generates a request for the DescribeLogGroups operation.
func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *aws.Request, output *DescribeLogGroupsOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDescribeLogGroups == nil {
opDescribeLogGroups = &aws.Operation{
Name: "DescribeLogGroups",
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
}
if input == nil {
input = &DescribeLogGroupsInput{}
}
req = c.newRequest(opDescribeLogGroups, 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)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeLogGroupsOutput), lastPage)
})
}
var opDescribeLogGroups *aws.Operation
// DescribeLogStreamsRequest generates a request for the DescribeLogStreams operation.
func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) (req *aws.Request, output *DescribeLogStreamsOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDescribeLogStreams == nil {
opDescribeLogStreams = &aws.Operation{
Name: "DescribeLogStreams",
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
}
if input == nil {
input = &DescribeLogStreamsInput{}
}
req = c.newRequest(opDescribeLogStreams, 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)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeLogStreamsOutput), lastPage)
})
}
var opDescribeLogStreams *aws.Operation
// DescribeMetricFiltersRequest generates a request for the DescribeMetricFilters operation.
func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFiltersInput) (req *aws.Request, output *DescribeMetricFiltersOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDescribeMetricFilters == nil {
opDescribeMetricFilters = &aws.Operation{
Name: "DescribeMetricFilters",
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
}
if input == nil {
input = &DescribeMetricFiltersInput{}
}
req = c.newRequest(opDescribeMetricFilters, 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)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeMetricFiltersOutput), lastPage)
})
}
var opDescribeMetricFilters *aws.Operation
// DescribeSubscriptionFiltersRequest generates a request for the DescribeSubscriptionFilters operation.
func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubscriptionFiltersInput) (req *aws.Request, output *DescribeSubscriptionFiltersOutput) {
oprw.Lock()
defer oprw.Unlock()
if opDescribeSubscriptionFilters == nil {
opDescribeSubscriptionFilters = &aws.Operation{
Name: "DescribeSubscriptionFilters",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &DescribeSubscriptionFiltersInput{}
}
req = c.newRequest(opDescribeSubscriptionFilters, 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
}
var opDescribeSubscriptionFilters *aws.Operation
// FilterLogEventsRequest generates a request for the FilterLogEvents operation.
func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *aws.Request, output *FilterLogEventsOutput) {
oprw.Lock()
defer oprw.Unlock()
if opFilterLogEvents == nil {
opFilterLogEvents = &aws.Operation{
Name: "FilterLogEvents",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &FilterLogEventsInput{}
}
req = c.newRequest(opFilterLogEvents, 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
}
var opFilterLogEvents *aws.Operation
// GetLogEventsRequest generates a request for the GetLogEvents operation.
func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *aws.Request, output *GetLogEventsOutput) {
oprw.Lock()
defer oprw.Unlock()
if opGetLogEvents == nil {
opGetLogEvents = &aws.Operation{
Name: "GetLogEvents",
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextForwardToken"},
LimitToken: "limit",
TruncationToken: "",
},
}
}
if input == nil {
input = &GetLogEventsInput{}
}
req = c.newRequest(opGetLogEvents, 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)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*GetLogEventsOutput), lastPage)
})
}
var opGetLogEvents *aws.Operation
// PutLogEventsRequest generates a request for the PutLogEvents operation.
func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *aws.Request, output *PutLogEventsOutput) {
oprw.Lock()
defer oprw.Unlock()
if opPutLogEvents == nil {
opPutLogEvents = &aws.Operation{
Name: "PutLogEvents",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &PutLogEventsInput{}
}
req = c.newRequest(opPutLogEvents, 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.
func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) {
req, out := c.PutLogEventsRequest(input)
err := req.Send()
return out, err
}
var opPutLogEvents *aws.Operation
// PutMetricFilterRequest generates a request for the PutMetricFilter operation.
func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (req *aws.Request, output *PutMetricFilterOutput) {
oprw.Lock()
defer oprw.Unlock()
if opPutMetricFilter == nil {
opPutMetricFilter = &aws.Operation{
Name: "PutMetricFilter",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &PutMetricFilterInput{}
}
req = c.newRequest(opPutMetricFilter, input, output)
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
}
var opPutMetricFilter *aws.Operation
// PutRetentionPolicyRequest generates a request for the PutRetentionPolicy operation.
func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *aws.Request, output *PutRetentionPolicyOutput) {
oprw.Lock()
defer oprw.Unlock()
if opPutRetentionPolicy == nil {
opPutRetentionPolicy = &aws.Operation{
Name: "PutRetentionPolicy",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &PutRetentionPolicyInput{}
}
req = c.newRequest(opPutRetentionPolicy, input, output)
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
}
var opPutRetentionPolicy *aws.Operation
// PutSubscriptionFilterRequest generates a request for the PutSubscriptionFilter operation.
func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *aws.Request, output *PutSubscriptionFilterOutput) {
oprw.Lock()
defer oprw.Unlock()
if opPutSubscriptionFilter == nil {
opPutSubscriptionFilter = &aws.Operation{
Name: "PutSubscriptionFilter",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &PutSubscriptionFilterInput{}
}
req = c.newRequest(opPutSubscriptionFilter, input, output)
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 only supported destination is an
// Amazon Kinesis stream belonging to the same account as the subscription filter.
//
// 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
}
var opPutSubscriptionFilter *aws.Operation
// TestMetricFilterRequest generates a request for the TestMetricFilter operation.
func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *aws.Request, output *TestMetricFilterOutput) {
oprw.Lock()
defer oprw.Unlock()
if opTestMetricFilter == nil {
opTestMetricFilter = &aws.Operation{
Name: "TestMetricFilter",
HTTPMethod: "POST",
HTTPPath: "/",
}
}
if input == nil {
input = &TestMetricFilterInput{}
}
req = c.newRequest(opTestMetricFilter, 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
}
var opTestMetricFilter *aws.Operation
type CreateLogGroupInput struct {
// The name of the log group to create.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
metadataCreateLogGroupInput `json:"-" xml:"-"`
}
type metadataCreateLogGroupInput struct {
SDKShapeTraits bool `type:"structure"`
}
type CreateLogGroupOutput struct {
metadataCreateLogGroupOutput `json:"-" xml:"-"`
}
type metadataCreateLogGroupOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type CreateLogStreamInput struct {
// The name of the log group under which the log stream is to be created.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
// The name of the log stream to create.
LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`
metadataCreateLogStreamInput `json:"-" xml:"-"`
}
type metadataCreateLogStreamInput struct {
SDKShapeTraits bool `type:"structure"`
}
type CreateLogStreamOutput struct {
metadataCreateLogStreamOutput `json:"-" xml:"-"`
}
type metadataCreateLogStreamOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteLogGroupInput struct {
// The name of the log group to delete.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
metadataDeleteLogGroupInput `json:"-" xml:"-"`
}
type metadataDeleteLogGroupInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteLogGroupOutput struct {
metadataDeleteLogGroupOutput `json:"-" xml:"-"`
}
type metadataDeleteLogGroupOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteLogStreamInput struct {
// The name of the log group under which the log stream to delete belongs.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
// The name of the log stream to delete.
LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`
metadataDeleteLogStreamInput `json:"-" xml:"-"`
}
type metadataDeleteLogStreamInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteLogStreamOutput struct {
metadataDeleteLogStreamOutput `json:"-" xml:"-"`
}
type metadataDeleteLogStreamOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteMetricFilterInput struct {
// The name of the metric filter to delete.
FilterName *string `locationName:"filterName" type:"string" required:"true"`
// The name of the log group that is associated with the metric filter to delete.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
metadataDeleteMetricFilterInput `json:"-" xml:"-"`
}
type metadataDeleteMetricFilterInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteMetricFilterOutput struct {
metadataDeleteMetricFilterOutput `json:"-" xml:"-"`
}
type metadataDeleteMetricFilterOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteRetentionPolicyInput struct {
// The name of the log group that is associated with the retention policy to
// delete.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
metadataDeleteRetentionPolicyInput `json:"-" xml:"-"`
}
type metadataDeleteRetentionPolicyInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteRetentionPolicyOutput struct {
metadataDeleteRetentionPolicyOutput `json:"-" xml:"-"`
}
type metadataDeleteRetentionPolicyOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteSubscriptionFilterInput struct {
// The name of the subscription filter to delete.
FilterName *string `locationName:"filterName" type:"string" required:"true"`
// The name of the log group that is associated with the subscription filter
// to delete.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
metadataDeleteSubscriptionFilterInput `json:"-" xml:"-"`
}
type metadataDeleteSubscriptionFilterInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DeleteSubscriptionFilterOutput struct {
metadataDeleteSubscriptionFilterOutput `json:"-" xml:"-"`
}
type metadataDeleteSubscriptionFilterOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DescribeLogGroupsInput struct {
// The maximum number of items returned in the response. If you don't specify
// a value, the request would return up to 50 items.
Limit *int64 `locationName:"limit" type:"integer"`
// Will only return log groups that match the provided logGroupNamePrefix. If
// you don't specify a value, no prefix filter is applied.
LogGroupNamePrefix *string `locationName:"logGroupNamePrefix" type:"string"`
// A string token used for pagination that points to the next page of results.
// It must be a value obtained from the response of the previous DescribeLogGroups
// request.
NextToken *string `locationName:"nextToken" type:"string"`
metadataDescribeLogGroupsInput `json:"-" xml:"-"`
}
type metadataDescribeLogGroupsInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DescribeLogGroupsOutput struct {
// A list of log groups.
LogGroups []*LogGroup `locationName:"logGroups" type:"list"`
// A string token used for pagination that points to the next page of results.
// It must be a value obtained from the response of the previous request. The
// token expires after 24 hours.
NextToken *string `locationName:"nextToken" type:"string"`
metadataDescribeLogGroupsOutput `json:"-" xml:"-"`
}
type metadataDescribeLogGroupsOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DescribeLogStreamsInput struct {
// If set to true, results are returned in descending order. If you don't specify
// a value or set it to false, results are returned in ascending order.
Descending *bool `locationName:"descending" type:"boolean"`
// The maximum number of items returned in the response. If you don't specify
// a value, the request would return up to 50 items.
Limit *int64 `locationName:"limit" type:"integer"`
// The log group name for which log streams are to be listed.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
// Will only return log streams that match the provided logStreamNamePrefix.
// If you don't specify a value, no prefix filter is applied.
LogStreamNamePrefix *string `locationName:"logStreamNamePrefix" type:"string"`
// A string token used for pagination that points to the next page of results.
// It must be a value obtained from the response of the previous DescribeLogStreams
// request.
NextToken *string `locationName:"nextToken" type:"string"`
// Specifies what to order the returned log streams by. Valid arguments are
// 'LogStreamName' or 'LastEventTime'. If you don't specify a value, results
// are ordered by LogStreamName. If 'LastEventTime' is chosen, the request cannot
// also contain a logStreamNamePrefix.
OrderBy *string `locationName:"orderBy" type:"string"`
metadataDescribeLogStreamsInput `json:"-" xml:"-"`
}
type metadataDescribeLogStreamsInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DescribeLogStreamsOutput struct {
// A list of log streams.
LogStreams []*LogStream `locationName:"logStreams" type:"list"`
// A string token used for pagination that points to the next page of results.
// It must be a value obtained from the response of the previous request. The
// token expires after 24 hours.
NextToken *string `locationName:"nextToken" type:"string"`
metadataDescribeLogStreamsOutput `json:"-" xml:"-"`
}
type metadataDescribeLogStreamsOutput struct {
SDKShapeTraits bool `type:"structure"`
}
type DescribeMetricFiltersInput struct {
// Will only return metric filters that match the provided filterNamePrefix.
// If you don't specify a value, no prefix filter is applied.
FilterNamePrefix *string `locationName:"filterNamePrefix" type:"string"`
// The maximum number of items returned in the response. If you don't specify
// a value, the request would return up to 50 items.
Limit *int64 `locationName:"limit" type:"integer"`
// The log group name for which metric filters are to be listed.
LogGroupName *string `locationName:"logGroupName" type:"string" required:"true"`
// A string token used for pagination that points to the next page of results.
// It must be a value obtained from the response of the previous DescribeMetricFilters
// request.
NextToken *string `locationName:"nextToken" type:"string"`
metadataDescribeMetricFiltersInput `json:"-" xml:"-"`
}
type metadataDescribeMetricFiltersInput struct {
SDKShapeTraits bool `type:"structure"`
}
type DescribeMetricFiltersOutput struct {
MetricFilters []*MetricFilter `locationName:"metricFilters" type:"list"`
// A string token used for pagination that points to the next page of results.
// It must be a value obtained from the response of the previous request. The
// token expires after 24 hours.
NextToken *string `locationName:"nextToken" type:"string"`