1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package pi
4
5import (
6	"fmt"
7	"time"
8
9	"github.com/aws/aws-sdk-go/aws"
10	"github.com/aws/aws-sdk-go/aws/awsutil"
11	"github.com/aws/aws-sdk-go/aws/request"
12	"github.com/aws/aws-sdk-go/private/protocol"
13)
14
15const opDescribeDimensionKeys = "DescribeDimensionKeys"
16
17// DescribeDimensionKeysRequest generates a "aws/request.Request" representing the
18// client's request for the DescribeDimensionKeys operation. The "output" return
19// value will be populated with the request's response once the request completes
20// successfully.
21//
22// Use "Send" method on the returned Request to send the API call to the service.
23// the "output" return value is not valid until after Send returns without error.
24//
25// See DescribeDimensionKeys for more information on using the DescribeDimensionKeys
26// API call, and error handling.
27//
28// This method is useful when you want to inject custom logic or configuration
29// into the SDK's request lifecycle. Such as custom headers, or retry logic.
30//
31//
32//    // Example sending a request using the DescribeDimensionKeysRequest method.
33//    req, resp := client.DescribeDimensionKeysRequest(params)
34//
35//    err := req.Send()
36//    if err == nil { // resp is now filled
37//        fmt.Println(resp)
38//    }
39//
40// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/DescribeDimensionKeys
41func (c *PI) DescribeDimensionKeysRequest(input *DescribeDimensionKeysInput) (req *request.Request, output *DescribeDimensionKeysOutput) {
42	op := &request.Operation{
43		Name:       opDescribeDimensionKeys,
44		HTTPMethod: "POST",
45		HTTPPath:   "/",
46	}
47
48	if input == nil {
49		input = &DescribeDimensionKeysInput{}
50	}
51
52	output = &DescribeDimensionKeysOutput{}
53	req = c.newRequest(op, input, output)
54	return
55}
56
57// DescribeDimensionKeys API operation for AWS Performance Insights.
58//
59// For a specific time period, retrieve the top N dimension keys for a metric.
60//
61// Each response element returns a maximum of 500 bytes. For larger elements,
62// such as SQL statements, only the first 500 bytes are returned.
63//
64// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
65// with awserr.Error's Code and Message methods to get detailed information about
66// the error.
67//
68// See the AWS API reference guide for AWS Performance Insights's
69// API operation DescribeDimensionKeys for usage and error information.
70//
71// Returned Error Types:
72//   * InvalidArgumentException
73//   One of the arguments provided is invalid for this request.
74//
75//   * InternalServiceError
76//   The request failed due to an unknown error.
77//
78//   * NotAuthorizedException
79//   The user is not authorized to perform this request.
80//
81// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/DescribeDimensionKeys
82func (c *PI) DescribeDimensionKeys(input *DescribeDimensionKeysInput) (*DescribeDimensionKeysOutput, error) {
83	req, out := c.DescribeDimensionKeysRequest(input)
84	return out, req.Send()
85}
86
87// DescribeDimensionKeysWithContext is the same as DescribeDimensionKeys with the addition of
88// the ability to pass a context and additional request options.
89//
90// See DescribeDimensionKeys for details on how to use this API operation.
91//
92// The context must be non-nil and will be used for request cancellation. If
93// the context is nil a panic will occur. In the future the SDK may create
94// sub-contexts for http.Requests. See https://golang.org/pkg/context/
95// for more information on using Contexts.
96func (c *PI) DescribeDimensionKeysWithContext(ctx aws.Context, input *DescribeDimensionKeysInput, opts ...request.Option) (*DescribeDimensionKeysOutput, error) {
97	req, out := c.DescribeDimensionKeysRequest(input)
98	req.SetContext(ctx)
99	req.ApplyOptions(opts...)
100	return out, req.Send()
101}
102
103const opGetResourceMetrics = "GetResourceMetrics"
104
105// GetResourceMetricsRequest generates a "aws/request.Request" representing the
106// client's request for the GetResourceMetrics operation. The "output" return
107// value will be populated with the request's response once the request completes
108// successfully.
109//
110// Use "Send" method on the returned Request to send the API call to the service.
111// the "output" return value is not valid until after Send returns without error.
112//
113// See GetResourceMetrics for more information on using the GetResourceMetrics
114// API call, and error handling.
115//
116// This method is useful when you want to inject custom logic or configuration
117// into the SDK's request lifecycle. Such as custom headers, or retry logic.
118//
119//
120//    // Example sending a request using the GetResourceMetricsRequest method.
121//    req, resp := client.GetResourceMetricsRequest(params)
122//
123//    err := req.Send()
124//    if err == nil { // resp is now filled
125//        fmt.Println(resp)
126//    }
127//
128// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetResourceMetrics
129func (c *PI) GetResourceMetricsRequest(input *GetResourceMetricsInput) (req *request.Request, output *GetResourceMetricsOutput) {
130	op := &request.Operation{
131		Name:       opGetResourceMetrics,
132		HTTPMethod: "POST",
133		HTTPPath:   "/",
134	}
135
136	if input == nil {
137		input = &GetResourceMetricsInput{}
138	}
139
140	output = &GetResourceMetricsOutput{}
141	req = c.newRequest(op, input, output)
142	return
143}
144
145// GetResourceMetrics API operation for AWS Performance Insights.
146//
147// Retrieve Performance Insights metrics for a set of data sources, over a time
148// period. You can provide specific dimension groups and dimensions, and provide
149// aggregation and filtering criteria for each group.
150//
151// Each response element returns a maximum of 500 bytes. For larger elements,
152// such as SQL statements, only the first 500 bytes are returned.
153//
154// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
155// with awserr.Error's Code and Message methods to get detailed information about
156// the error.
157//
158// See the AWS API reference guide for AWS Performance Insights's
159// API operation GetResourceMetrics for usage and error information.
160//
161// Returned Error Types:
162//   * InvalidArgumentException
163//   One of the arguments provided is invalid for this request.
164//
165//   * InternalServiceError
166//   The request failed due to an unknown error.
167//
168//   * NotAuthorizedException
169//   The user is not authorized to perform this request.
170//
171// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetResourceMetrics
172func (c *PI) GetResourceMetrics(input *GetResourceMetricsInput) (*GetResourceMetricsOutput, error) {
173	req, out := c.GetResourceMetricsRequest(input)
174	return out, req.Send()
175}
176
177// GetResourceMetricsWithContext is the same as GetResourceMetrics with the addition of
178// the ability to pass a context and additional request options.
179//
180// See GetResourceMetrics for details on how to use this API operation.
181//
182// The context must be non-nil and will be used for request cancellation. If
183// the context is nil a panic will occur. In the future the SDK may create
184// sub-contexts for http.Requests. See https://golang.org/pkg/context/
185// for more information on using Contexts.
186func (c *PI) GetResourceMetricsWithContext(ctx aws.Context, input *GetResourceMetricsInput, opts ...request.Option) (*GetResourceMetricsOutput, error) {
187	req, out := c.GetResourceMetricsRequest(input)
188	req.SetContext(ctx)
189	req.ApplyOptions(opts...)
190	return out, req.Send()
191}
192
193// A timestamp, and a single numerical value, which together represent a measurement
194// at a particular point in time.
195type DataPoint struct {
196	_ struct{} `type:"structure"`
197
198	// The time, in epoch format, associated with a particular Value.
199	//
200	// Timestamp is a required field
201	Timestamp *time.Time `type:"timestamp" required:"true"`
202
203	// The actual value associated with a particular Timestamp.
204	//
205	// Value is a required field
206	Value *float64 `type:"double" required:"true"`
207}
208
209// String returns the string representation
210func (s DataPoint) String() string {
211	return awsutil.Prettify(s)
212}
213
214// GoString returns the string representation
215func (s DataPoint) GoString() string {
216	return s.String()
217}
218
219// SetTimestamp sets the Timestamp field's value.
220func (s *DataPoint) SetTimestamp(v time.Time) *DataPoint {
221	s.Timestamp = &v
222	return s
223}
224
225// SetValue sets the Value field's value.
226func (s *DataPoint) SetValue(v float64) *DataPoint {
227	s.Value = &v
228	return s
229}
230
231type DescribeDimensionKeysInput struct {
232	_ struct{} `type:"structure"`
233
234	// The date and time specifying the end of the requested time series data. The
235	// value specified is exclusive, which means that data points less than (but
236	// not equal to) EndTime are returned.
237	//
238	// The value for EndTime must be later than the value for StartTime.
239	//
240	// EndTime is a required field
241	EndTime *time.Time `type:"timestamp" required:"true"`
242
243	// One or more filters to apply in the request. Restrictions:
244	//
245	//    * Any number of filters by the same dimension, as specified in the GroupBy
246	//    or Partition parameters.
247	//
248	//    * A single filter for any other dimension in this dimension group.
249	Filter map[string]*string `type:"map"`
250
251	// A specification for how to aggregate the data points from a query result.
252	// You must specify a valid dimension group. Performance Insights returns all
253	// dimensions within this group, unless you provide the names of specific dimensions
254	// within this group. You can also request that Performance Insights return
255	// a limited number of values for a dimension.
256	//
257	// GroupBy is a required field
258	GroupBy *DimensionGroup `type:"structure" required:"true"`
259
260	// An immutable, AWS Region-unique identifier for a data source. Performance
261	// Insights gathers metrics from this data source.
262	//
263	// To use an Amazon RDS instance as a data source, you specify its DbiResourceId
264	// value. For example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A
265	//
266	// Identifier is a required field
267	Identifier *string `type:"string" required:"true"`
268
269	// The maximum number of items to return in the response. If more items exist
270	// than the specified MaxRecords value, a pagination token is included in the
271	// response so that the remaining results can be retrieved.
272	MaxResults *int64 `type:"integer"`
273
274	// The name of a Performance Insights metric to be measured.
275	//
276	// Valid values for Metric are:
277	//
278	//    * db.load.avg - a scaled representation of the number of active sessions
279	//    for the database engine.
280	//
281	//    * db.sampledload.avg - the raw number of active sessions for the database
282	//    engine.
283	//
284	// If the number of active sessions is less than an internal Performance Insights
285	// threshold, db.load.avg and db.sampledload.avg are the same value. If the
286	// number of active sessions is greater than the internal threshold, Performance
287	// Insights samples the active sessions, with db.load.avg showing the scaled
288	// values, db.sampledload.avg showing the raw values, and db.sampledload.avg
289	// less than db.load.avg. For most use cases, you can query db.load.avg only.
290	//
291	// Metric is a required field
292	Metric *string `type:"string" required:"true"`
293
294	// An optional pagination token provided by a previous request. If this parameter
295	// is specified, the response includes only records beyond the token, up to
296	// the value specified by MaxRecords.
297	NextToken *string `type:"string"`
298
299	// For each dimension specified in GroupBy, specify a secondary dimension to
300	// further subdivide the partition keys in the response.
301	PartitionBy *DimensionGroup `type:"structure"`
302
303	// The granularity, in seconds, of the data points returned from Performance
304	// Insights. A period can be as short as one second, or as long as one day (86400
305	// seconds). Valid values are:
306	//
307	//    * 1 (one second)
308	//
309	//    * 60 (one minute)
310	//
311	//    * 300 (five minutes)
312	//
313	//    * 3600 (one hour)
314	//
315	//    * 86400 (twenty-four hours)
316	//
317	// If you don't specify PeriodInSeconds, then Performance Insights chooses a
318	// value for you, with a goal of returning roughly 100-200 data points in the
319	// response.
320	PeriodInSeconds *int64 `type:"integer"`
321
322	// The AWS service for which Performance Insights will return metrics. The only
323	// valid value for ServiceType is RDS.
324	//
325	// ServiceType is a required field
326	ServiceType *string `type:"string" required:"true" enum:"ServiceType"`
327
328	// The date and time specifying the beginning of the requested time series data.
329	// You must specify a StartTime within the past 7 days. The value specified
330	// is inclusive, which means that data points equal to or greater than StartTime
331	// are returned.
332	//
333	// The value for StartTime must be earlier than the value for EndTime.
334	//
335	// StartTime is a required field
336	StartTime *time.Time `type:"timestamp" required:"true"`
337}
338
339// String returns the string representation
340func (s DescribeDimensionKeysInput) String() string {
341	return awsutil.Prettify(s)
342}
343
344// GoString returns the string representation
345func (s DescribeDimensionKeysInput) GoString() string {
346	return s.String()
347}
348
349// Validate inspects the fields of the type to determine if they are valid.
350func (s *DescribeDimensionKeysInput) Validate() error {
351	invalidParams := request.ErrInvalidParams{Context: "DescribeDimensionKeysInput"}
352	if s.EndTime == nil {
353		invalidParams.Add(request.NewErrParamRequired("EndTime"))
354	}
355	if s.GroupBy == nil {
356		invalidParams.Add(request.NewErrParamRequired("GroupBy"))
357	}
358	if s.Identifier == nil {
359		invalidParams.Add(request.NewErrParamRequired("Identifier"))
360	}
361	if s.Metric == nil {
362		invalidParams.Add(request.NewErrParamRequired("Metric"))
363	}
364	if s.ServiceType == nil {
365		invalidParams.Add(request.NewErrParamRequired("ServiceType"))
366	}
367	if s.StartTime == nil {
368		invalidParams.Add(request.NewErrParamRequired("StartTime"))
369	}
370	if s.GroupBy != nil {
371		if err := s.GroupBy.Validate(); err != nil {
372			invalidParams.AddNested("GroupBy", err.(request.ErrInvalidParams))
373		}
374	}
375	if s.PartitionBy != nil {
376		if err := s.PartitionBy.Validate(); err != nil {
377			invalidParams.AddNested("PartitionBy", err.(request.ErrInvalidParams))
378		}
379	}
380
381	if invalidParams.Len() > 0 {
382		return invalidParams
383	}
384	return nil
385}
386
387// SetEndTime sets the EndTime field's value.
388func (s *DescribeDimensionKeysInput) SetEndTime(v time.Time) *DescribeDimensionKeysInput {
389	s.EndTime = &v
390	return s
391}
392
393// SetFilter sets the Filter field's value.
394func (s *DescribeDimensionKeysInput) SetFilter(v map[string]*string) *DescribeDimensionKeysInput {
395	s.Filter = v
396	return s
397}
398
399// SetGroupBy sets the GroupBy field's value.
400func (s *DescribeDimensionKeysInput) SetGroupBy(v *DimensionGroup) *DescribeDimensionKeysInput {
401	s.GroupBy = v
402	return s
403}
404
405// SetIdentifier sets the Identifier field's value.
406func (s *DescribeDimensionKeysInput) SetIdentifier(v string) *DescribeDimensionKeysInput {
407	s.Identifier = &v
408	return s
409}
410
411// SetMaxResults sets the MaxResults field's value.
412func (s *DescribeDimensionKeysInput) SetMaxResults(v int64) *DescribeDimensionKeysInput {
413	s.MaxResults = &v
414	return s
415}
416
417// SetMetric sets the Metric field's value.
418func (s *DescribeDimensionKeysInput) SetMetric(v string) *DescribeDimensionKeysInput {
419	s.Metric = &v
420	return s
421}
422
423// SetNextToken sets the NextToken field's value.
424func (s *DescribeDimensionKeysInput) SetNextToken(v string) *DescribeDimensionKeysInput {
425	s.NextToken = &v
426	return s
427}
428
429// SetPartitionBy sets the PartitionBy field's value.
430func (s *DescribeDimensionKeysInput) SetPartitionBy(v *DimensionGroup) *DescribeDimensionKeysInput {
431	s.PartitionBy = v
432	return s
433}
434
435// SetPeriodInSeconds sets the PeriodInSeconds field's value.
436func (s *DescribeDimensionKeysInput) SetPeriodInSeconds(v int64) *DescribeDimensionKeysInput {
437	s.PeriodInSeconds = &v
438	return s
439}
440
441// SetServiceType sets the ServiceType field's value.
442func (s *DescribeDimensionKeysInput) SetServiceType(v string) *DescribeDimensionKeysInput {
443	s.ServiceType = &v
444	return s
445}
446
447// SetStartTime sets the StartTime field's value.
448func (s *DescribeDimensionKeysInput) SetStartTime(v time.Time) *DescribeDimensionKeysInput {
449	s.StartTime = &v
450	return s
451}
452
453type DescribeDimensionKeysOutput struct {
454	_ struct{} `type:"structure"`
455
456	// The end time for the returned dimension keys, after alignment to a granular
457	// boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater
458	// than or equal to the value of the user-specified Endtime.
459	AlignedEndTime *time.Time `type:"timestamp"`
460
461	// The start time for the returned dimension keys, after alignment to a granular
462	// boundary (as specified by PeriodInSeconds). AlignedStartTime will be less
463	// than or equal to the value of the user-specified StartTime.
464	AlignedStartTime *time.Time `type:"timestamp"`
465
466	// The dimension keys that were requested.
467	Keys []*DimensionKeyDescription `type:"list"`
468
469	// An optional pagination token provided by a previous request. If this parameter
470	// is specified, the response includes only records beyond the token, up to
471	// the value specified by MaxRecords.
472	NextToken *string `type:"string"`
473
474	// If PartitionBy was present in the request, PartitionKeys contains the breakdown
475	// of dimension keys by the specified partitions.
476	PartitionKeys []*ResponsePartitionKey `type:"list"`
477}
478
479// String returns the string representation
480func (s DescribeDimensionKeysOutput) String() string {
481	return awsutil.Prettify(s)
482}
483
484// GoString returns the string representation
485func (s DescribeDimensionKeysOutput) GoString() string {
486	return s.String()
487}
488
489// SetAlignedEndTime sets the AlignedEndTime field's value.
490func (s *DescribeDimensionKeysOutput) SetAlignedEndTime(v time.Time) *DescribeDimensionKeysOutput {
491	s.AlignedEndTime = &v
492	return s
493}
494
495// SetAlignedStartTime sets the AlignedStartTime field's value.
496func (s *DescribeDimensionKeysOutput) SetAlignedStartTime(v time.Time) *DescribeDimensionKeysOutput {
497	s.AlignedStartTime = &v
498	return s
499}
500
501// SetKeys sets the Keys field's value.
502func (s *DescribeDimensionKeysOutput) SetKeys(v []*DimensionKeyDescription) *DescribeDimensionKeysOutput {
503	s.Keys = v
504	return s
505}
506
507// SetNextToken sets the NextToken field's value.
508func (s *DescribeDimensionKeysOutput) SetNextToken(v string) *DescribeDimensionKeysOutput {
509	s.NextToken = &v
510	return s
511}
512
513// SetPartitionKeys sets the PartitionKeys field's value.
514func (s *DescribeDimensionKeysOutput) SetPartitionKeys(v []*ResponsePartitionKey) *DescribeDimensionKeysOutput {
515	s.PartitionKeys = v
516	return s
517}
518
519// A logical grouping of Performance Insights metrics for a related subject
520// area. For example, the db.sql dimension group consists of the following dimensions:
521// db.sql.id, db.sql.db_id, db.sql.statement, and db.sql.tokenized_id.
522//
523// Each response element returns a maximum of 500 bytes. For larger elements,
524// such as SQL statements, only the first 500 bytes are returned.
525type DimensionGroup struct {
526	_ struct{} `type:"structure"`
527
528	// A list of specific dimensions from a dimension group. If this parameter is
529	// not present, then it signifies that all of the dimensions in the group were
530	// requested, or are present in the response.
531	//
532	// Valid values for elements in the Dimensions array are:
533	//
534	//    * db.application.name - The name of the application that is connected
535	//    to the database (only Aurora PostgreSQL and RDS PostgreSQL)
536	//
537	//    * db.host.id - The host ID of the connected client (all engines)
538	//
539	//    * db.host.name - The host name of the connected client (all engines)
540	//
541	//    * db.name - The name of the database to which the client is connected
542	//    (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and
543	//    MariaDB)
544	//
545	//    * db.session_type.name - The type of the current session (only Aurora
546	//    PostgreSQL and RDS PostgreSQL)
547	//
548	//    * db.sql.id - The SQL ID generated by Performance Insights (all engines)
549	//
550	//    * db.sql.db_id - The SQL ID generated by the database (all engines)
551	//
552	//    * db.sql.statement - The SQL text that is being executed (all engines)
553	//
554	//    * db.sql.tokenized_id
555	//
556	//    * db.sql_tokenized.id - The SQL digest ID generated by Performance Insights
557	//    (all engines)
558	//
559	//    * db.sql_tokenized.db_id - SQL digest ID generated by the database (all
560	//    engines)
561	//
562	//    * db.sql_tokenized.statement - The SQL digest text (all engines)
563	//
564	//    * db.user.id - The ID of the user logged in to the database (all engines)
565	//
566	//    * db.user.name - The name of the user logged in to the database (all engines)
567	//
568	//    * db.wait_event.name - The event for which the backend is waiting (all
569	//    engines)
570	//
571	//    * db.wait_event.type - The type of event for which the backend is waiting
572	//    (all engines)
573	//
574	//    * db.wait_event_type.name - The name of the event type for which the backend
575	//    is waiting (all engines)
576	Dimensions []*string `min:"1" type:"list"`
577
578	// The name of the dimension group. Valid values are:
579	//
580	//    * db - The name of the database to which the client is connected (only
581	//    Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)
582	//
583	//    * db.application - The name of the application that is connected to the
584	//    database (only Aurora PostgreSQL and RDS PostgreSQL)
585	//
586	//    * db.host - The host name of the connected client (all engines)
587	//
588	//    * db.session_type - The type of the current session (only Aurora PostgreSQL
589	//    and RDS PostgreSQL)
590	//
591	//    * db.sql - The SQL that is currently executing (all engines)
592	//
593	//    * db.sql_tokenized - The SQL digest (all engines)
594	//
595	//    * db.wait_event - The event for which the database backend is waiting
596	//    (all engines)
597	//
598	//    * db.wait_event_type - The type of event for which the database backend
599	//    is waiting (all engines)
600	//
601	//    * db.user - The user logged in to the database (all engines)
602	//
603	// Group is a required field
604	Group *string `type:"string" required:"true"`
605
606	// The maximum number of items to fetch for this dimension group.
607	Limit *int64 `min:"1" type:"integer"`
608}
609
610// String returns the string representation
611func (s DimensionGroup) String() string {
612	return awsutil.Prettify(s)
613}
614
615// GoString returns the string representation
616func (s DimensionGroup) GoString() string {
617	return s.String()
618}
619
620// Validate inspects the fields of the type to determine if they are valid.
621func (s *DimensionGroup) Validate() error {
622	invalidParams := request.ErrInvalidParams{Context: "DimensionGroup"}
623	if s.Dimensions != nil && len(s.Dimensions) < 1 {
624		invalidParams.Add(request.NewErrParamMinLen("Dimensions", 1))
625	}
626	if s.Group == nil {
627		invalidParams.Add(request.NewErrParamRequired("Group"))
628	}
629	if s.Limit != nil && *s.Limit < 1 {
630		invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
631	}
632
633	if invalidParams.Len() > 0 {
634		return invalidParams
635	}
636	return nil
637}
638
639// SetDimensions sets the Dimensions field's value.
640func (s *DimensionGroup) SetDimensions(v []*string) *DimensionGroup {
641	s.Dimensions = v
642	return s
643}
644
645// SetGroup sets the Group field's value.
646func (s *DimensionGroup) SetGroup(v string) *DimensionGroup {
647	s.Group = &v
648	return s
649}
650
651// SetLimit sets the Limit field's value.
652func (s *DimensionGroup) SetLimit(v int64) *DimensionGroup {
653	s.Limit = &v
654	return s
655}
656
657// An array of descriptions and aggregated values for each dimension within
658// a dimension group.
659type DimensionKeyDescription struct {
660	_ struct{} `type:"structure"`
661
662	// A map of name-value pairs for the dimensions in the group.
663	Dimensions map[string]*string `type:"map"`
664
665	// If PartitionBy was specified, PartitionKeys contains the dimensions that
666	// were.
667	Partitions []*float64 `type:"list"`
668
669	// The aggregated metric value for the dimension(s), over the requested time
670	// range.
671	Total *float64 `type:"double"`
672}
673
674// String returns the string representation
675func (s DimensionKeyDescription) String() string {
676	return awsutil.Prettify(s)
677}
678
679// GoString returns the string representation
680func (s DimensionKeyDescription) GoString() string {
681	return s.String()
682}
683
684// SetDimensions sets the Dimensions field's value.
685func (s *DimensionKeyDescription) SetDimensions(v map[string]*string) *DimensionKeyDescription {
686	s.Dimensions = v
687	return s
688}
689
690// SetPartitions sets the Partitions field's value.
691func (s *DimensionKeyDescription) SetPartitions(v []*float64) *DimensionKeyDescription {
692	s.Partitions = v
693	return s
694}
695
696// SetTotal sets the Total field's value.
697func (s *DimensionKeyDescription) SetTotal(v float64) *DimensionKeyDescription {
698	s.Total = &v
699	return s
700}
701
702type GetResourceMetricsInput struct {
703	_ struct{} `type:"structure"`
704
705	// The date and time specifying the end of the requested time series data. The
706	// value specified is exclusive - data points less than (but not equal to) EndTime
707	// will be returned.
708	//
709	// The value for EndTime must be later than the value for StartTime.
710	//
711	// EndTime is a required field
712	EndTime *time.Time `type:"timestamp" required:"true"`
713
714	// An immutable, AWS Region-unique identifier for a data source. Performance
715	// Insights gathers metrics from this data source.
716	//
717	// To use a DB instance as a data source, specify its DbiResourceId value. For
718	// example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A.
719	//
720	// Identifier is a required field
721	Identifier *string `type:"string" required:"true"`
722
723	// The maximum number of items to return in the response. If more items exist
724	// than the specified MaxRecords value, a pagination token is included in the
725	// response so that the remaining results can be retrieved.
726	MaxResults *int64 `type:"integer"`
727
728	// An array of one or more queries to perform. Each query must specify a Performance
729	// Insights metric, and can optionally specify aggregation and filtering criteria.
730	//
731	// MetricQueries is a required field
732	MetricQueries []*MetricQuery `min:"1" type:"list" required:"true"`
733
734	// An optional pagination token provided by a previous request. If this parameter
735	// is specified, the response includes only records beyond the token, up to
736	// the value specified by MaxRecords.
737	NextToken *string `type:"string"`
738
739	// The granularity, in seconds, of the data points returned from Performance
740	// Insights. A period can be as short as one second, or as long as one day (86400
741	// seconds). Valid values are:
742	//
743	//    * 1 (one second)
744	//
745	//    * 60 (one minute)
746	//
747	//    * 300 (five minutes)
748	//
749	//    * 3600 (one hour)
750	//
751	//    * 86400 (twenty-four hours)
752	//
753	// If you don't specify PeriodInSeconds, then Performance Insights will choose
754	// a value for you, with a goal of returning roughly 100-200 data points in
755	// the response.
756	PeriodInSeconds *int64 `type:"integer"`
757
758	// The AWS service for which Performance Insights returns metrics. The only
759	// valid value for ServiceType is RDS.
760	//
761	// ServiceType is a required field
762	ServiceType *string `type:"string" required:"true" enum:"ServiceType"`
763
764	// The date and time specifying the beginning of the requested time series data.
765	// You can't specify a StartTime that's earlier than 7 days ago. The value specified
766	// is inclusive - data points equal to or greater than StartTime will be returned.
767	//
768	// The value for StartTime must be earlier than the value for EndTime.
769	//
770	// StartTime is a required field
771	StartTime *time.Time `type:"timestamp" required:"true"`
772}
773
774// String returns the string representation
775func (s GetResourceMetricsInput) String() string {
776	return awsutil.Prettify(s)
777}
778
779// GoString returns the string representation
780func (s GetResourceMetricsInput) GoString() string {
781	return s.String()
782}
783
784// Validate inspects the fields of the type to determine if they are valid.
785func (s *GetResourceMetricsInput) Validate() error {
786	invalidParams := request.ErrInvalidParams{Context: "GetResourceMetricsInput"}
787	if s.EndTime == nil {
788		invalidParams.Add(request.NewErrParamRequired("EndTime"))
789	}
790	if s.Identifier == nil {
791		invalidParams.Add(request.NewErrParamRequired("Identifier"))
792	}
793	if s.MetricQueries == nil {
794		invalidParams.Add(request.NewErrParamRequired("MetricQueries"))
795	}
796	if s.MetricQueries != nil && len(s.MetricQueries) < 1 {
797		invalidParams.Add(request.NewErrParamMinLen("MetricQueries", 1))
798	}
799	if s.ServiceType == nil {
800		invalidParams.Add(request.NewErrParamRequired("ServiceType"))
801	}
802	if s.StartTime == nil {
803		invalidParams.Add(request.NewErrParamRequired("StartTime"))
804	}
805	if s.MetricQueries != nil {
806		for i, v := range s.MetricQueries {
807			if v == nil {
808				continue
809			}
810			if err := v.Validate(); err != nil {
811				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricQueries", i), err.(request.ErrInvalidParams))
812			}
813		}
814	}
815
816	if invalidParams.Len() > 0 {
817		return invalidParams
818	}
819	return nil
820}
821
822// SetEndTime sets the EndTime field's value.
823func (s *GetResourceMetricsInput) SetEndTime(v time.Time) *GetResourceMetricsInput {
824	s.EndTime = &v
825	return s
826}
827
828// SetIdentifier sets the Identifier field's value.
829func (s *GetResourceMetricsInput) SetIdentifier(v string) *GetResourceMetricsInput {
830	s.Identifier = &v
831	return s
832}
833
834// SetMaxResults sets the MaxResults field's value.
835func (s *GetResourceMetricsInput) SetMaxResults(v int64) *GetResourceMetricsInput {
836	s.MaxResults = &v
837	return s
838}
839
840// SetMetricQueries sets the MetricQueries field's value.
841func (s *GetResourceMetricsInput) SetMetricQueries(v []*MetricQuery) *GetResourceMetricsInput {
842	s.MetricQueries = v
843	return s
844}
845
846// SetNextToken sets the NextToken field's value.
847func (s *GetResourceMetricsInput) SetNextToken(v string) *GetResourceMetricsInput {
848	s.NextToken = &v
849	return s
850}
851
852// SetPeriodInSeconds sets the PeriodInSeconds field's value.
853func (s *GetResourceMetricsInput) SetPeriodInSeconds(v int64) *GetResourceMetricsInput {
854	s.PeriodInSeconds = &v
855	return s
856}
857
858// SetServiceType sets the ServiceType field's value.
859func (s *GetResourceMetricsInput) SetServiceType(v string) *GetResourceMetricsInput {
860	s.ServiceType = &v
861	return s
862}
863
864// SetStartTime sets the StartTime field's value.
865func (s *GetResourceMetricsInput) SetStartTime(v time.Time) *GetResourceMetricsInput {
866	s.StartTime = &v
867	return s
868}
869
870type GetResourceMetricsOutput struct {
871	_ struct{} `type:"structure"`
872
873	// The end time for the returned metrics, after alignment to a granular boundary
874	// (as specified by PeriodInSeconds). AlignedEndTime will be greater than or
875	// equal to the value of the user-specified Endtime.
876	AlignedEndTime *time.Time `type:"timestamp"`
877
878	// The start time for the returned metrics, after alignment to a granular boundary
879	// (as specified by PeriodInSeconds). AlignedStartTime will be less than or
880	// equal to the value of the user-specified StartTime.
881	AlignedStartTime *time.Time `type:"timestamp"`
882
883	// An immutable, AWS Region-unique identifier for a data source. Performance
884	// Insights gathers metrics from this data source.
885	//
886	// To use a DB instance as a data source, you specify its DbiResourceId value
887	// - for example: db-FAIHNTYBKTGAUSUZQYPDS2GW4A
888	Identifier *string `type:"string"`
889
890	// An array of metric results,, where each array element contains all of the
891	// data points for a particular dimension.
892	MetricList []*MetricKeyDataPoints `type:"list"`
893
894	// An optional pagination token provided by a previous request. If this parameter
895	// is specified, the response includes only records beyond the token, up to
896	// the value specified by MaxRecords.
897	NextToken *string `type:"string"`
898}
899
900// String returns the string representation
901func (s GetResourceMetricsOutput) String() string {
902	return awsutil.Prettify(s)
903}
904
905// GoString returns the string representation
906func (s GetResourceMetricsOutput) GoString() string {
907	return s.String()
908}
909
910// SetAlignedEndTime sets the AlignedEndTime field's value.
911func (s *GetResourceMetricsOutput) SetAlignedEndTime(v time.Time) *GetResourceMetricsOutput {
912	s.AlignedEndTime = &v
913	return s
914}
915
916// SetAlignedStartTime sets the AlignedStartTime field's value.
917func (s *GetResourceMetricsOutput) SetAlignedStartTime(v time.Time) *GetResourceMetricsOutput {
918	s.AlignedStartTime = &v
919	return s
920}
921
922// SetIdentifier sets the Identifier field's value.
923func (s *GetResourceMetricsOutput) SetIdentifier(v string) *GetResourceMetricsOutput {
924	s.Identifier = &v
925	return s
926}
927
928// SetMetricList sets the MetricList field's value.
929func (s *GetResourceMetricsOutput) SetMetricList(v []*MetricKeyDataPoints) *GetResourceMetricsOutput {
930	s.MetricList = v
931	return s
932}
933
934// SetNextToken sets the NextToken field's value.
935func (s *GetResourceMetricsOutput) SetNextToken(v string) *GetResourceMetricsOutput {
936	s.NextToken = &v
937	return s
938}
939
940// The request failed due to an unknown error.
941type InternalServiceError struct {
942	_            struct{}                  `type:"structure"`
943	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
944
945	Message_ *string `locationName:"Message" type:"string"`
946}
947
948// String returns the string representation
949func (s InternalServiceError) String() string {
950	return awsutil.Prettify(s)
951}
952
953// GoString returns the string representation
954func (s InternalServiceError) GoString() string {
955	return s.String()
956}
957
958func newErrorInternalServiceError(v protocol.ResponseMetadata) error {
959	return &InternalServiceError{
960		RespMetadata: v,
961	}
962}
963
964// Code returns the exception type name.
965func (s *InternalServiceError) Code() string {
966	return "InternalServiceError"
967}
968
969// Message returns the exception's message.
970func (s *InternalServiceError) Message() string {
971	if s.Message_ != nil {
972		return *s.Message_
973	}
974	return ""
975}
976
977// OrigErr always returns nil, satisfies awserr.Error interface.
978func (s *InternalServiceError) OrigErr() error {
979	return nil
980}
981
982func (s *InternalServiceError) Error() string {
983	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
984}
985
986// Status code returns the HTTP status code for the request's response error.
987func (s *InternalServiceError) StatusCode() int {
988	return s.RespMetadata.StatusCode
989}
990
991// RequestID returns the service's response RequestID for request.
992func (s *InternalServiceError) RequestID() string {
993	return s.RespMetadata.RequestID
994}
995
996// One of the arguments provided is invalid for this request.
997type InvalidArgumentException struct {
998	_            struct{}                  `type:"structure"`
999	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1000
1001	Message_ *string `locationName:"Message" type:"string"`
1002}
1003
1004// String returns the string representation
1005func (s InvalidArgumentException) String() string {
1006	return awsutil.Prettify(s)
1007}
1008
1009// GoString returns the string representation
1010func (s InvalidArgumentException) GoString() string {
1011	return s.String()
1012}
1013
1014func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error {
1015	return &InvalidArgumentException{
1016		RespMetadata: v,
1017	}
1018}
1019
1020// Code returns the exception type name.
1021func (s *InvalidArgumentException) Code() string {
1022	return "InvalidArgumentException"
1023}
1024
1025// Message returns the exception's message.
1026func (s *InvalidArgumentException) Message() string {
1027	if s.Message_ != nil {
1028		return *s.Message_
1029	}
1030	return ""
1031}
1032
1033// OrigErr always returns nil, satisfies awserr.Error interface.
1034func (s *InvalidArgumentException) OrigErr() error {
1035	return nil
1036}
1037
1038func (s *InvalidArgumentException) Error() string {
1039	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
1040}
1041
1042// Status code returns the HTTP status code for the request's response error.
1043func (s *InvalidArgumentException) StatusCode() int {
1044	return s.RespMetadata.StatusCode
1045}
1046
1047// RequestID returns the service's response RequestID for request.
1048func (s *InvalidArgumentException) RequestID() string {
1049	return s.RespMetadata.RequestID
1050}
1051
1052// A time-ordered series of data points, corresponding to a dimension of a Performance
1053// Insights metric.
1054type MetricKeyDataPoints struct {
1055	_ struct{} `type:"structure"`
1056
1057	// An array of timestamp-value pairs, representing measurements over a period
1058	// of time.
1059	DataPoints []*DataPoint `type:"list"`
1060
1061	// The dimension(s) to which the data points apply.
1062	Key *ResponseResourceMetricKey `type:"structure"`
1063}
1064
1065// String returns the string representation
1066func (s MetricKeyDataPoints) String() string {
1067	return awsutil.Prettify(s)
1068}
1069
1070// GoString returns the string representation
1071func (s MetricKeyDataPoints) GoString() string {
1072	return s.String()
1073}
1074
1075// SetDataPoints sets the DataPoints field's value.
1076func (s *MetricKeyDataPoints) SetDataPoints(v []*DataPoint) *MetricKeyDataPoints {
1077	s.DataPoints = v
1078	return s
1079}
1080
1081// SetKey sets the Key field's value.
1082func (s *MetricKeyDataPoints) SetKey(v *ResponseResourceMetricKey) *MetricKeyDataPoints {
1083	s.Key = v
1084	return s
1085}
1086
1087// A single query to be processed. You must provide the metric to query. If
1088// no other parameters are specified, Performance Insights returns all of the
1089// data points for that metric. You can optionally request that the data points
1090// be aggregated by dimension group ( GroupBy), and return only those data points
1091// that match your criteria (Filter).
1092type MetricQuery struct {
1093	_ struct{} `type:"structure"`
1094
1095	// One or more filters to apply in the request. Restrictions:
1096	//
1097	//    * Any number of filters by the same dimension, as specified in the GroupBy
1098	//    parameter.
1099	//
1100	//    * A single filter for any other dimension in this dimension group.
1101	Filter map[string]*string `type:"map"`
1102
1103	// A specification for how to aggregate the data points from a query result.
1104	// You must specify a valid dimension group. Performance Insights will return
1105	// all of the dimensions within that group, unless you provide the names of
1106	// specific dimensions within that group. You can also request that Performance
1107	// Insights return a limited number of values for a dimension.
1108	GroupBy *DimensionGroup `type:"structure"`
1109
1110	// The name of a Performance Insights metric to be measured.
1111	//
1112	// Valid values for Metric are:
1113	//
1114	//    * db.load.avg - a scaled representation of the number of active sessions
1115	//    for the database engine.
1116	//
1117	//    * db.sampledload.avg - the raw number of active sessions for the database
1118	//    engine.
1119	//
1120	// If the number of active sessions is less than an internal Performance Insights
1121	// threshold, db.load.avg and db.sampledload.avg are the same value. If the
1122	// number of active sessions is greater than the internal threshold, Performance
1123	// Insights samples the active sessions, with db.load.avg showing the scaled
1124	// values, db.sampledload.avg showing the raw values, and db.sampledload.avg
1125	// less than db.load.avg. For most use cases, you can query db.load.avg only.
1126	//
1127	// Metric is a required field
1128	Metric *string `type:"string" required:"true"`
1129}
1130
1131// String returns the string representation
1132func (s MetricQuery) String() string {
1133	return awsutil.Prettify(s)
1134}
1135
1136// GoString returns the string representation
1137func (s MetricQuery) GoString() string {
1138	return s.String()
1139}
1140
1141// Validate inspects the fields of the type to determine if they are valid.
1142func (s *MetricQuery) Validate() error {
1143	invalidParams := request.ErrInvalidParams{Context: "MetricQuery"}
1144	if s.Metric == nil {
1145		invalidParams.Add(request.NewErrParamRequired("Metric"))
1146	}
1147	if s.GroupBy != nil {
1148		if err := s.GroupBy.Validate(); err != nil {
1149			invalidParams.AddNested("GroupBy", err.(request.ErrInvalidParams))
1150		}
1151	}
1152
1153	if invalidParams.Len() > 0 {
1154		return invalidParams
1155	}
1156	return nil
1157}
1158
1159// SetFilter sets the Filter field's value.
1160func (s *MetricQuery) SetFilter(v map[string]*string) *MetricQuery {
1161	s.Filter = v
1162	return s
1163}
1164
1165// SetGroupBy sets the GroupBy field's value.
1166func (s *MetricQuery) SetGroupBy(v *DimensionGroup) *MetricQuery {
1167	s.GroupBy = v
1168	return s
1169}
1170
1171// SetMetric sets the Metric field's value.
1172func (s *MetricQuery) SetMetric(v string) *MetricQuery {
1173	s.Metric = &v
1174	return s
1175}
1176
1177// The user is not authorized to perform this request.
1178type NotAuthorizedException struct {
1179	_            struct{}                  `type:"structure"`
1180	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1181
1182	Message_ *string `locationName:"Message" type:"string"`
1183}
1184
1185// String returns the string representation
1186func (s NotAuthorizedException) String() string {
1187	return awsutil.Prettify(s)
1188}
1189
1190// GoString returns the string representation
1191func (s NotAuthorizedException) GoString() string {
1192	return s.String()
1193}
1194
1195func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error {
1196	return &NotAuthorizedException{
1197		RespMetadata: v,
1198	}
1199}
1200
1201// Code returns the exception type name.
1202func (s *NotAuthorizedException) Code() string {
1203	return "NotAuthorizedException"
1204}
1205
1206// Message returns the exception's message.
1207func (s *NotAuthorizedException) Message() string {
1208	if s.Message_ != nil {
1209		return *s.Message_
1210	}
1211	return ""
1212}
1213
1214// OrigErr always returns nil, satisfies awserr.Error interface.
1215func (s *NotAuthorizedException) OrigErr() error {
1216	return nil
1217}
1218
1219func (s *NotAuthorizedException) Error() string {
1220	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
1221}
1222
1223// Status code returns the HTTP status code for the request's response error.
1224func (s *NotAuthorizedException) StatusCode() int {
1225	return s.RespMetadata.StatusCode
1226}
1227
1228// RequestID returns the service's response RequestID for request.
1229func (s *NotAuthorizedException) RequestID() string {
1230	return s.RespMetadata.RequestID
1231}
1232
1233// If PartitionBy was specified in a DescribeDimensionKeys request, the dimensions
1234// are returned in an array. Each element in the array specifies one dimension.
1235type ResponsePartitionKey struct {
1236	_ struct{} `type:"structure"`
1237
1238	// A dimension map that contains the dimension(s) for this partition.
1239	//
1240	// Dimensions is a required field
1241	Dimensions map[string]*string `type:"map" required:"true"`
1242}
1243
1244// String returns the string representation
1245func (s ResponsePartitionKey) String() string {
1246	return awsutil.Prettify(s)
1247}
1248
1249// GoString returns the string representation
1250func (s ResponsePartitionKey) GoString() string {
1251	return s.String()
1252}
1253
1254// SetDimensions sets the Dimensions field's value.
1255func (s *ResponsePartitionKey) SetDimensions(v map[string]*string) *ResponsePartitionKey {
1256	s.Dimensions = v
1257	return s
1258}
1259
1260// An object describing a Performance Insights metric and one or more dimensions
1261// for that metric.
1262type ResponseResourceMetricKey struct {
1263	_ struct{} `type:"structure"`
1264
1265	// The valid dimensions for the metric.
1266	Dimensions map[string]*string `type:"map"`
1267
1268	// The name of a Performance Insights metric to be measured.
1269	//
1270	// Valid values for Metric are:
1271	//
1272	//    * db.load.avg - a scaled representation of the number of active sessions
1273	//    for the database engine.
1274	//
1275	//    * db.sampledload.avg - the raw number of active sessions for the database
1276	//    engine.
1277	//
1278	// If the number of active sessions is less than an internal Performance Insights
1279	// threshold, db.load.avg and db.sampledload.avg are the same value. If the
1280	// number of active sessions is greater than the internal threshold, Performance
1281	// Insights samples the active sessions, with db.load.avg showing the scaled
1282	// values, db.sampledload.avg showing the raw values, and db.sampledload.avg
1283	// less than db.load.avg. For most use cases, you can query db.load.avg only.
1284	//
1285	// Metric is a required field
1286	Metric *string `type:"string" required:"true"`
1287}
1288
1289// String returns the string representation
1290func (s ResponseResourceMetricKey) String() string {
1291	return awsutil.Prettify(s)
1292}
1293
1294// GoString returns the string representation
1295func (s ResponseResourceMetricKey) GoString() string {
1296	return s.String()
1297}
1298
1299// SetDimensions sets the Dimensions field's value.
1300func (s *ResponseResourceMetricKey) SetDimensions(v map[string]*string) *ResponseResourceMetricKey {
1301	s.Dimensions = v
1302	return s
1303}
1304
1305// SetMetric sets the Metric field's value.
1306func (s *ResponseResourceMetricKey) SetMetric(v string) *ResponseResourceMetricKey {
1307	s.Metric = &v
1308	return s
1309}
1310
1311const (
1312	// ServiceTypeRds is a ServiceType enum value
1313	ServiceTypeRds = "RDS"
1314)
1315
1316// ServiceType_Values returns all elements of the ServiceType enum
1317func ServiceType_Values() []string {
1318	return []string{
1319		ServiceTypeRds,
1320	}
1321}
1322