-
Notifications
You must be signed in to change notification settings - Fork 597
/
api_op_DescribeLogStreams.go
113 lines (95 loc) · 4.04 KB
/
api_op_DescribeLogStreams.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
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/smithy-go/transport/http"
)
// Lists the log streams for the specified log group. You can list all the log
// streams or filter the results by prefix. You can also control how the results
// are ordered. This operation has a limit of five transactions per second, after
// which transactions are throttled.
func (c *Client) DescribeLogStreams(ctx context.Context, params *DescribeLogStreamsInput, optFns ...func(*Options)) (*DescribeLogStreamsOutput, error) {
if params == nil {
params = &DescribeLogStreamsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLogStreams", params, optFns, addOperationDescribeLogStreamsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLogStreamsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLogStreamsInput struct {
// The name of the log group.
//
// This member is required.
LogGroupName *string
// If the value is true, results are returned in descending order. If the value is
// to false, results are returned in ascending order. The default value is false.
Descending *bool
// The maximum number of items returned. If you don't specify a value, the default
// is up to 50 items.
Limit *int32
// The prefix to match. If orderBy is LastEventTime,you cannot specify this
// parameter.
LogStreamNamePrefix *string
// The token for the next set of items to return. (You received this token from a
// previous call.)
NextToken *string
// If the value is LogStreamName, the results are ordered by log stream name. If
// the value is LastEventTime, the results are ordered by the event time. The
// default value is LogStreamName. If you order the results by event time, you
// cannot specify the logStreamNamePrefix parameter. lastEventTimestamp represents
// the time of the most recent log event in the log stream in CloudWatch Logs. This
// number is expressed as the number of milliseconds after Jan 1, 1970 00:00:00
// UTC. lastEventTimeStamp updates on an eventual consistency basis. It typically
// updates in less than an hour from ingestion, but may take longer in some rare
// situations.
OrderBy types.OrderBy
}
type DescribeLogStreamsOutput struct {
// The log streams.
LogStreams []*types.LogStream
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationDescribeLogStreamsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeLogStreams{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeLogStreams{}, middleware.After)
if err != nil {
return err
}
awsmiddleware.AddRequestInvocationIDMiddleware(stack)
smithyhttp.AddContentLengthMiddleware(stack)
addResolveEndpointMiddleware(stack, options)
v4.AddComputePayloadSHA256Middleware(stack)
addRetryMiddlewares(stack, options)
addHTTPSignerV4Middleware(stack, options)
awsmiddleware.AddAttemptClockSkewMiddleware(stack)
addClientUserAgent(stack)
smithyhttp.AddErrorCloseResponseBodyMiddleware(stack)
smithyhttp.AddCloseResponseBodyMiddleware(stack)
addOpDescribeLogStreamsValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLogStreams(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opDescribeLogStreams(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "logs",
OperationName: "DescribeLogStreams",
}
}