forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
1931 lines (1525 loc) · 61.8 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 (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
)
const opCreateLogGroup = "CreateLogGroup"
// CreateLogGroupRequest generates a request for the CreateLogGroup operation.
func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *aws.Request, output *CreateLogGroupOutput) {
op := &aws.Operation{
Name: opCreateLogGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateLogGroupInput{}
}
req = c.newRequest(op, 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
}
const opCreateLogStream = "CreateLogStream"
// CreateLogStreamRequest generates a request for the CreateLogStream operation.
func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *aws.Request, output *CreateLogStreamOutput) {
op := &aws.Operation{
Name: opCreateLogStream,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateLogStreamInput{}
}
req = c.newRequest(op, 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
}
const opDeleteLogGroup = "DeleteLogGroup"
// DeleteLogGroupRequest generates a request for the DeleteLogGroup operation.
func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *aws.Request, output *DeleteLogGroupOutput) {
op := &aws.Operation{
Name: opDeleteLogGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteLogGroupInput{}
}
req = c.newRequest(op, 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
}
const opDeleteLogStream = "DeleteLogStream"
// DeleteLogStreamRequest generates a request for the DeleteLogStream operation.
func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *aws.Request, output *DeleteLogStreamOutput) {
op := &aws.Operation{
Name: opDeleteLogStream,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteLogStreamInput{}
}
req = c.newRequest(op, 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
}
const opDeleteMetricFilter = "DeleteMetricFilter"
// DeleteMetricFilterRequest generates a request for the DeleteMetricFilter operation.
func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *aws.Request, output *DeleteMetricFilterOutput) {
op := &aws.Operation{
Name: opDeleteMetricFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteMetricFilterInput{}
}
req = c.newRequest(op, 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
}
const opDeleteRetentionPolicy = "DeleteRetentionPolicy"
// DeleteRetentionPolicyRequest generates a request for the DeleteRetentionPolicy operation.
func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *aws.Request, output *DeleteRetentionPolicyOutput) {
op := &aws.Operation{
Name: opDeleteRetentionPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteRetentionPolicyInput{}
}
req = c.newRequest(op, 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
}
const opDeleteSubscriptionFilter = "DeleteSubscriptionFilter"
// DeleteSubscriptionFilterRequest generates a request for the DeleteSubscriptionFilter operation.
func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *aws.Request, output *DeleteSubscriptionFilterOutput) {
op := &aws.Operation{
Name: opDeleteSubscriptionFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteSubscriptionFilterInput{}
}
req = c.newRequest(op, 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
}
const opDescribeLogGroups = "DescribeLogGroups"
// DescribeLogGroupsRequest generates a request for the DescribeLogGroups operation.
func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *aws.Request, output *DescribeLogGroupsOutput) {
op := &aws.Operation{
Name: opDescribeLogGroups,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.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)
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 *aws.Request, output *DescribeLogStreamsOutput) {
op := &aws.Operation{
Name: opDescribeLogStreams,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.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)
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 *aws.Request, output *DescribeMetricFiltersOutput) {
op := &aws.Operation{
Name: opDescribeMetricFilters,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.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)
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 *aws.Request, output *DescribeSubscriptionFiltersOutput) {
op := &aws.Operation{
Name: opDescribeSubscriptionFilters,
HTTPMethod: "POST",
HTTPPath: "/",
}
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
}
const opFilterLogEvents = "FilterLogEvents"
// FilterLogEventsRequest generates a request for the FilterLogEvents operation.
func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *aws.Request, output *FilterLogEventsOutput) {
op := &aws.Operation{
Name: opFilterLogEvents,
HTTPMethod: "POST",
HTTPPath: "/",
}
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
}
const opGetLogEvents = "GetLogEvents"
// GetLogEventsRequest generates a request for the GetLogEvents operation.
func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *aws.Request, output *GetLogEventsOutput) {
op := &aws.Operation{
Name: opGetLogEvents,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.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)
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*GetLogEventsOutput), lastPage)
})
}
const opPutLogEvents = "PutLogEvents"
// PutLogEventsRequest generates a request for the PutLogEvents operation.
func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *aws.Request, output *PutLogEventsOutput) {
op := &aws.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.
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 *aws.Request, output *PutMetricFilterOutput) {
op := &aws.Operation{
Name: opPutMetricFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutMetricFilterInput{}
}
req = c.newRequest(op, 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
}
const opPutRetentionPolicy = "PutRetentionPolicy"
// PutRetentionPolicyRequest generates a request for the PutRetentionPolicy operation.
func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *aws.Request, output *PutRetentionPolicyOutput) {
op := &aws.Operation{
Name: opPutRetentionPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutRetentionPolicyInput{}
}
req = c.newRequest(op, 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
}
const opPutSubscriptionFilter = "PutSubscriptionFilter"
// PutSubscriptionFilterRequest generates a request for the PutSubscriptionFilter operation.
func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *aws.Request, output *PutSubscriptionFilterOutput) {
op := &aws.Operation{
Name: opPutSubscriptionFilter,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutSubscriptionFilterInput{}
}
req = c.newRequest(op, 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
}
const opTestMetricFilter = "TestMetricFilter"
// TestMetricFilterRequest generates a request for the TestMetricFilter operation.
func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *aws.Request, output *TestMetricFilterOutput) {
op := &aws.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 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"`
}
// String returns the string representation
func (s CreateLogGroupInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s CreateLogGroupInput) GoString() string {
return s.String()
}
type CreateLogGroupOutput struct {
metadataCreateLogGroupOutput `json:"-" xml:"-"`
}
type metadataCreateLogGroupOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s CreateLogGroupOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s CreateLogGroupOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s CreateLogStreamInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s CreateLogStreamInput) GoString() string {
return s.String()
}
type CreateLogStreamOutput struct {
metadataCreateLogStreamOutput `json:"-" xml:"-"`
}
type metadataCreateLogStreamOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s CreateLogStreamOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s CreateLogStreamOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DeleteLogGroupInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteLogGroupInput) GoString() string {
return s.String()
}
type DeleteLogGroupOutput struct {
metadataDeleteLogGroupOutput `json:"-" xml:"-"`
}
type metadataDeleteLogGroupOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s DeleteLogGroupOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteLogGroupOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DeleteLogStreamInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteLogStreamInput) GoString() string {
return s.String()
}
type DeleteLogStreamOutput struct {
metadataDeleteLogStreamOutput `json:"-" xml:"-"`
}
type metadataDeleteLogStreamOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s DeleteLogStreamOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteLogStreamOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DeleteMetricFilterInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteMetricFilterInput) GoString() string {
return s.String()
}
type DeleteMetricFilterOutput struct {
metadataDeleteMetricFilterOutput `json:"-" xml:"-"`
}
type metadataDeleteMetricFilterOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s DeleteMetricFilterOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteMetricFilterOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DeleteRetentionPolicyInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteRetentionPolicyInput) GoString() string {
return s.String()
}
type DeleteRetentionPolicyOutput struct {
metadataDeleteRetentionPolicyOutput `json:"-" xml:"-"`
}
type metadataDeleteRetentionPolicyOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s DeleteRetentionPolicyOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteRetentionPolicyOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DeleteSubscriptionFilterInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteSubscriptionFilterInput) GoString() string {
return s.String()
}
type DeleteSubscriptionFilterOutput struct {
metadataDeleteSubscriptionFilterOutput `json:"-" xml:"-"`
}
type metadataDeleteSubscriptionFilterOutput struct {
SDKShapeTraits bool `type:"structure"`
}
// String returns the string representation
func (s DeleteSubscriptionFilterOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DeleteSubscriptionFilterOutput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DescribeLogGroupsInput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DescribeLogGroupsInput) GoString() string {
return s.String()
}
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"`
}
// String returns the string representation
func (s DescribeLogGroupsOutput) String() string {
return awsutil.StringValue(s)
}
// GoString returns the string representation
func (s DescribeLogGroupsOutput) GoString() string {
return s.String()
}
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"`