/
api_types.go
265 lines (225 loc) · 7.35 KB
/
api_types.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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package pi
import (
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
var _ aws.Config
var _ = awsutil.Prettify
// A timestamp, and a single numerical value, which together represent a measurement
// at a particular point in time.
type DataPoint struct {
_ struct{} `type:"structure"`
// The time, in epoch format, associated with a particular Value.
//
// Timestamp is a required field
Timestamp *time.Time `type:"timestamp" required:"true"`
// The actual value associated with a particular Timestamp.
//
// Value is a required field
Value *float64 `type:"double" required:"true"`
}
// String returns the string representation
func (s DataPoint) String() string {
return awsutil.Prettify(s)
}
// A logical grouping of Performance Insights metrics for a related subject
// area. For example, the db.sql dimension group consists of the following dimensions:
// db.sql.id, db.sql.db_id, db.sql.statement, and db.sql.tokenized_id.
type DimensionGroup struct {
_ struct{} `type:"structure"`
// A list of specific dimensions from a dimension group. If this parameter is
// not present, then it signifies that all of the dimensions in the group were
// requested, or are present in the response.
//
// Valid values for elements in the Dimensions array are:
//
// * db.user.id
//
// * db.user.name
//
// * db.host.id
//
// * db.host.name
//
// * db.sql.id
//
// * db.sql.db_id
//
// * db.sql.statement
//
// * db.sql.tokenized_id
//
// * db.sql_tokenized.id
//
// * db.sql_tokenized.db_id
//
// * db.sql_tokenized.statement
//
// * db.wait_event.name
//
// * db.wait_event.type
//
// * db.wait_event_type.name
Dimensions []string `min:"1" type:"list"`
// The name of the dimension group. Valid values are:
//
// * db.user
//
// * db.host
//
// * db.sql
//
// * db.sql_tokenized
//
// * db.wait_event
//
// * db.wait_event_type
//
// Group is a required field
Group *string `type:"string" required:"true"`
// The maximum number of items to fetch for this dimension group.
Limit *int64 `min:"1" type:"integer"`
}
// String returns the string representation
func (s DimensionGroup) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DimensionGroup) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DimensionGroup"}
if s.Dimensions != nil && len(s.Dimensions) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Dimensions", 1))
}
if s.Group == nil {
invalidParams.Add(aws.NewErrParamRequired("Group"))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(aws.NewErrParamMinValue("Limit", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// An array of descriptions and aggregated values for each dimension within
// a dimension group.
type DimensionKeyDescription struct {
_ struct{} `type:"structure"`
// A map of name-value pairs for the dimensions in the group.
Dimensions map[string]string `type:"map"`
// If PartitionBy was specified, PartitionKeys contains the dimensions that
// were.
Partitions []float64 `type:"list"`
// The aggregated metric value for the dimension(s), over the requested time
// range.
Total *float64 `type:"double"`
}
// String returns the string representation
func (s DimensionKeyDescription) String() string {
return awsutil.Prettify(s)
}
// A time-ordered series of data points, correpsonding to a dimension of a Performance
// Insights metric.
type MetricKeyDataPoints struct {
_ struct{} `type:"structure"`
// An array of timestamp-value pairs, representing measurements over a period
// of time.
DataPoints []DataPoint `type:"list"`
// The dimension(s) to which the data points apply.
Key *ResponseResourceMetricKey `type:"structure"`
}
// String returns the string representation
func (s MetricKeyDataPoints) String() string {
return awsutil.Prettify(s)
}
// A single query to be processed. You must provide the metric to query. If
// no other parameters are specified, Performance Insights returns all of the
// data points for that metric. You can optionally request that the data points
// be aggregated by dimension group ( GroupBy), and return only those data points
// that match your criteria (Filter).
type MetricQuery struct {
_ struct{} `type:"structure"`
// One or more filters to apply in the request. Restrictions:
//
// * Any number of filters by the same dimension, as specified in the GroupBy
// parameter.
//
// * A single filter for any other dimension in this dimension group.
Filter map[string]string `type:"map"`
// A specification for how to aggregate the data points from a query result.
// You must specify a valid dimension group. Performance Insights will return
// all of the dimensions within that group, unless you provide the names of
// specific dimensions within that group. You can also request that Performance
// Insights return a limited number of values for a dimension.
GroupBy *DimensionGroup `type:"structure"`
// The name of a Performance Insights metric to be measured.
//
// Valid values for Metric are:
//
// * db.load.avg - a scaled representation of the number of active sessions
// for the database engine.
//
// * db.sampledload.avg - the raw number of active sessions for the database
// engine.
//
// Metric is a required field
Metric *string `type:"string" required:"true"`
}
// String returns the string representation
func (s MetricQuery) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MetricQuery) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "MetricQuery"}
if s.Metric == nil {
invalidParams.Add(aws.NewErrParamRequired("Metric"))
}
if s.GroupBy != nil {
if err := s.GroupBy.Validate(); err != nil {
invalidParams.AddNested("GroupBy", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// If PartitionBy was specified in a DescribeDimensionKeys request, the dimensions
// are returned in an array. Each element in the array specifies one dimension.
type ResponsePartitionKey struct {
_ struct{} `type:"structure"`
// A dimension map that contains the dimension(s) for this partition.
//
// Dimensions is a required field
Dimensions map[string]string `type:"map" required:"true"`
}
// String returns the string representation
func (s ResponsePartitionKey) String() string {
return awsutil.Prettify(s)
}
// An object describing a Performance Insights metric and one or more dimensions
// for that metric.
type ResponseResourceMetricKey struct {
_ struct{} `type:"structure"`
// The valid dimensions for the metric.
Dimensions map[string]string `type:"map"`
// The name of a Performance Insights metric to be measured.
//
// Valid values for Metric are:
//
// * db.load.avg - a scaled representation of the number of active sessions
// for the database engine.
//
// * db.sampledload.avg - the raw number of active sessions for the database
// engine.
//
// Metric is a required field
Metric *string `type:"string" required:"true"`
}
// String returns the string representation
func (s ResponseResourceMetricKey) String() string {
return awsutil.Prettify(s)
}