aws-sdk-pi 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1fec3609c4c34668ff11db4ce9745806dc729d9f
4
+ data.tar.gz: ad62b316c71c86eace2d855b058532bcb9598a1e
5
+ SHA512:
6
+ metadata.gz: 272c8d240d6826b91528138c1393d88b4701a6b73288ec0ed80530885abede3a51b91a1e86836878e5810f4e03a084af9dbd19bf1e1c0909f0179f03769e3844
7
+ data.tar.gz: 032ca8f4dab11e4f55ca8289ce792e87af05f2b5fa5966a91bc54ad45726914fb835f12134474a46353689c86660dd596a6082cd4994fd572ada5ee008b7cb5e
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-pi/types'
12
+ require_relative 'aws-sdk-pi/client_api'
13
+ require_relative 'aws-sdk-pi/client'
14
+ require_relative 'aws-sdk-pi/errors'
15
+ require_relative 'aws-sdk-pi/resource'
16
+ require_relative 'aws-sdk-pi/customizations'
17
+
18
+ # This module provides support for AWS Performance Insights. This module is available in the
19
+ # `aws-sdk-pi` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWS Performance Insights all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::PI::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::PI
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,465 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
22
+ require 'aws-sdk-core/plugins/signature_v4.rb'
23
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
24
+
25
+ Aws::Plugins::GlobalConfiguration.add_identifier(:pi)
26
+
27
+ module Aws::PI
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :pi
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::JsonvalueConverter)
50
+ add_plugin(Aws::Plugins::SignatureV4)
51
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
52
+
53
+ # @option options [required, Aws::CredentialProvider] :credentials
54
+ # Your AWS credentials. This can be an instance of any one of the
55
+ # following classes:
56
+ #
57
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
58
+ # credentials.
59
+ #
60
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
61
+ # from an EC2 IMDS on an EC2 instance.
62
+ #
63
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
64
+ # shared file, such as `~/.aws/config`.
65
+ #
66
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
67
+ #
68
+ # When `:credentials` are not configured directly, the following
69
+ # locations will be searched for credentials:
70
+ #
71
+ # * `Aws.config[:credentials]`
72
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
73
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
74
+ # * `~/.aws/credentials`
75
+ # * `~/.aws/config`
76
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
77
+ # very aggressive. Construct and pass an instance of
78
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
79
+ # timeouts.
80
+ #
81
+ # @option options [required, String] :region
82
+ # The AWS region to connect to. The configured `:region` is
83
+ # used to determine the service `:endpoint`. When not passed,
84
+ # a default `:region` is search for in the following locations:
85
+ #
86
+ # * `Aws.config[:region]`
87
+ # * `ENV['AWS_REGION']`
88
+ # * `ENV['AMAZON_REGION']`
89
+ # * `ENV['AWS_DEFAULT_REGION']`
90
+ # * `~/.aws/credentials`
91
+ # * `~/.aws/config`
92
+ #
93
+ # @option options [String] :access_key_id
94
+ #
95
+ # @option options [Boolean] :convert_params (true)
96
+ # When `true`, an attempt is made to coerce request parameters into
97
+ # the required types.
98
+ #
99
+ # @option options [String] :endpoint
100
+ # The client endpoint is normally constructed from the `:region`
101
+ # option. You should only configure an `:endpoint` when connecting
102
+ # to test endpoints. This should be avalid HTTP(S) URI.
103
+ #
104
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
105
+ # The log formatter.
106
+ #
107
+ # @option options [Symbol] :log_level (:info)
108
+ # The log level to send messages to the `:logger` at.
109
+ #
110
+ # @option options [Logger] :logger
111
+ # The Logger instance to send log messages to. If this option
112
+ # is not set, logging will be disabled.
113
+ #
114
+ # @option options [String] :profile ("default")
115
+ # Used when loading credentials from the shared credentials file
116
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
117
+ #
118
+ # @option options [Integer] :retry_limit (3)
119
+ # The maximum number of times to retry failed requests. Only
120
+ # ~ 500 level server errors and certain ~ 400 level client errors
121
+ # are retried. Generally, these are throttling errors, data
122
+ # checksum errors, networking errors, timeout errors and auth
123
+ # errors from expired credentials.
124
+ #
125
+ # @option options [String] :secret_access_key
126
+ #
127
+ # @option options [String] :session_token
128
+ #
129
+ # @option options [Boolean] :simple_json (false)
130
+ # Disables request parameter conversion, validation, and formatting.
131
+ # Also disable response data type conversions. This option is useful
132
+ # when you want to ensure the highest level of performance by
133
+ # avoiding overhead of walking request parameters and response data
134
+ # structures.
135
+ #
136
+ # When `:simple_json` is enabled, the request parameters hash must
137
+ # be formatted exactly as the DynamoDB API expects.
138
+ #
139
+ # @option options [Boolean] :stub_responses (false)
140
+ # Causes the client to return stubbed responses. By default
141
+ # fake responses are generated and returned. You can specify
142
+ # the response data to return or errors to raise by calling
143
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
144
+ #
145
+ # ** Please note ** When response stubbing is enabled, no HTTP
146
+ # requests are made, and retries are disabled.
147
+ #
148
+ # @option options [Boolean] :validate_params (true)
149
+ # When `true`, request parameters are validated before
150
+ # sending the request.
151
+ #
152
+ def initialize(*args)
153
+ super
154
+ end
155
+
156
+ # @!group API Operations
157
+
158
+ # For a specific time period, retrieve the top `N` dimension keys for a
159
+ # metric.
160
+ #
161
+ # @option params [required, String] :service_type
162
+ # The AWS service for which Performance Insights will return metrics.
163
+ # The only valid value for *ServiceType* is: `RDS`
164
+ #
165
+ # @option params [required, String] :identifier
166
+ # An immutable, AWS Region-unique identifier for a data source.
167
+ # Performance Insights gathers metrics from this data source.
168
+ #
169
+ # To use an Amazon RDS instance as a data source, you specify its
170
+ # `DbiResourceId` value - for example: `db-FAIHNTYBKTGAUSUZQYPDS2GW4A`
171
+ #
172
+ # @option params [required, Time,DateTime,Date,Integer,String] :start_time
173
+ # The date and time specifying the beginning of the requested time
174
+ # series data. You can't specify a `StartTime` that's earlier than 7
175
+ # days ago. The value specified is *inclusive* - data points equal to or
176
+ # greater than `StartTime` will be returned.
177
+ #
178
+ # The value for `StartTime` must be earlier than the value for
179
+ # `EndTime`.
180
+ #
181
+ # @option params [required, Time,DateTime,Date,Integer,String] :end_time
182
+ # The date and time specifying the end of the requested time series
183
+ # data. The value specified is *exclusive* - data points less than (but
184
+ # not equal to) `EndTime` will be returned.
185
+ #
186
+ # The value for `EndTime` must be later than the value for `StartTime`.
187
+ #
188
+ # @option params [required, String] :metric
189
+ # The name of a Performance Insights metric to be measured.
190
+ #
191
+ # Valid values for `Metric` are:
192
+ #
193
+ # * `db.load.avg` - a scaled representation of the number of active
194
+ # sessions for the database engine.
195
+ #
196
+ # * `db.sampledload.avg` - the raw number of active sessions for the
197
+ # database engine.
198
+ #
199
+ # @option params [Integer] :period_in_seconds
200
+ # The granularity, in seconds, of the data points returned from
201
+ # Performance Insights. A period can be as short as one second, or as
202
+ # long as one day (86400 seconds). Valid values are:
203
+ #
204
+ # * `1` (one second)
205
+ #
206
+ # * `60` (one minute)
207
+ #
208
+ # * `300` (five minutes)
209
+ #
210
+ # * `3600` (one hour)
211
+ #
212
+ # * `86400` (twenty-four hours)
213
+ #
214
+ # If you don't specify `PeriodInSeconds`, then Performance Insights
215
+ # will choose a value for you, with a goal of returning roughly 100-200
216
+ # data points in the response.
217
+ #
218
+ # @option params [required, Types::DimensionGroup] :group_by
219
+ # A specification for how to aggregate the data points from a query
220
+ # result. You must specify a valid dimension group. Performance Insights
221
+ # will return all of the dimensions within that group, unless you
222
+ # provide the names of specific dimensions within that group. You can
223
+ # also request that Performance Insights return a limited number of
224
+ # values for a dimension.
225
+ #
226
+ # @option params [Types::DimensionGroup] :partition_by
227
+ # For each dimension specified in `GroupBy`, specify a secondary
228
+ # dimension to further subdivide the partition keys in the response.
229
+ #
230
+ # @option params [Hash<String,String>] :filter
231
+ # One or more filters to apply in the request. Restrictions:
232
+ #
233
+ # * Any number of filters by the same dimension, as specified in the
234
+ # `GroupBy` or `Partition` parameters.
235
+ #
236
+ # * A single filter for any other dimension in this dimension group.
237
+ #
238
+ # @option params [Integer] :max_results
239
+ # The maximum number of items to return in the response. If more items
240
+ # exist than the specified `MaxRecords` value, a pagination token is
241
+ # included in the response so that the remaining results can be
242
+ # retrieved.
243
+ #
244
+ # @option params [String] :next_token
245
+ # An optional pagination token provided by a previous request. If this
246
+ # parameter is specified, the response includes only records beyond the
247
+ # token, up to the value specified by `MaxRecords`.
248
+ #
249
+ # @return [Types::DescribeDimensionKeysResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
250
+ #
251
+ # * {Types::DescribeDimensionKeysResponse#aligned_start_time #aligned_start_time} => Time
252
+ # * {Types::DescribeDimensionKeysResponse#aligned_end_time #aligned_end_time} => Time
253
+ # * {Types::DescribeDimensionKeysResponse#partition_keys #partition_keys} => Array&lt;Types::ResponsePartitionKey&gt;
254
+ # * {Types::DescribeDimensionKeysResponse#keys #keys} => Array&lt;Types::DimensionKeyDescription&gt;
255
+ # * {Types::DescribeDimensionKeysResponse#next_token #next_token} => String
256
+ #
257
+ # @example Request syntax with placeholder values
258
+ #
259
+ # resp = client.describe_dimension_keys({
260
+ # service_type: "RDS", # required, accepts RDS
261
+ # identifier: "String", # required
262
+ # start_time: Time.now, # required
263
+ # end_time: Time.now, # required
264
+ # metric: "String", # required
265
+ # period_in_seconds: 1,
266
+ # group_by: { # required
267
+ # group: "String", # required
268
+ # dimensions: ["String"],
269
+ # limit: 1,
270
+ # },
271
+ # partition_by: {
272
+ # group: "String", # required
273
+ # dimensions: ["String"],
274
+ # limit: 1,
275
+ # },
276
+ # filter: {
277
+ # "String" => "String",
278
+ # },
279
+ # max_results: 1,
280
+ # next_token: "String",
281
+ # })
282
+ #
283
+ # @example Response structure
284
+ #
285
+ # resp.aligned_start_time #=> Time
286
+ # resp.aligned_end_time #=> Time
287
+ # resp.partition_keys #=> Array
288
+ # resp.partition_keys[0].dimensions #=> Hash
289
+ # resp.partition_keys[0].dimensions["String"] #=> String
290
+ # resp.keys #=> Array
291
+ # resp.keys[0].dimensions #=> Hash
292
+ # resp.keys[0].dimensions["String"] #=> String
293
+ # resp.keys[0].total #=> Float
294
+ # resp.keys[0].partitions #=> Array
295
+ # resp.keys[0].partitions[0] #=> Float
296
+ # resp.next_token #=> String
297
+ #
298
+ # @see http://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/DescribeDimensionKeys AWS API Documentation
299
+ #
300
+ # @overload describe_dimension_keys(params = {})
301
+ # @param [Hash] params ({})
302
+ def describe_dimension_keys(params = {}, options = {})
303
+ req = build_request(:describe_dimension_keys, params)
304
+ req.send_request(options)
305
+ end
306
+
307
+ # Retrieve Performance Insights metrics for a set of data sources, over
308
+ # a time period. You can provide specific dimension groups and
309
+ # dimensions, and provide aggregation and filtering criteria for each
310
+ # group.
311
+ #
312
+ # @option params [required, String] :service_type
313
+ # The AWS service for which Performance Insights will return metrics.
314
+ # The only valid value for *ServiceType* is: `RDS`
315
+ #
316
+ # @option params [required, String] :identifier
317
+ # An immutable, AWS Region-unique identifier for a data source.
318
+ # Performance Insights gathers metrics from this data source.
319
+ #
320
+ # To use an Amazon RDS instance as a data source, you specify its
321
+ # `DbiResourceId` value - for example: `db-FAIHNTYBKTGAUSUZQYPDS2GW4A`
322
+ #
323
+ # @option params [required, Array<Types::MetricQuery>] :metric_queries
324
+ # An array of one or more queries to perform. Each query must specify a
325
+ # Performance Insights metric, and can optionally specify aggregation
326
+ # and filtering criteria.
327
+ #
328
+ # @option params [required, Time,DateTime,Date,Integer,String] :start_time
329
+ # The date and time specifying the beginning of the requested time
330
+ # series data. You can't specify a `StartTime` that's earlier than 7
331
+ # days ago. The value specified is *inclusive* - data points equal to or
332
+ # greater than `StartTime` will be returned.
333
+ #
334
+ # The value for `StartTime` must be earlier than the value for
335
+ # `EndTime`.
336
+ #
337
+ # @option params [required, Time,DateTime,Date,Integer,String] :end_time
338
+ # The date and time specifiying the end of the requested time series
339
+ # data. The value specified is *exclusive* - data points less than (but
340
+ # not equal to) `EndTime` will be returned.
341
+ #
342
+ # The value for `EndTime` must be later than the value for `StartTime`.
343
+ #
344
+ # @option params [Integer] :period_in_seconds
345
+ # The granularity, in seconds, of the data points returned from
346
+ # Performance Insights. A period can be as short as one second, or as
347
+ # long as one day (86400 seconds). Valid values are:
348
+ #
349
+ # * `1` (one second)
350
+ #
351
+ # * `60` (one minute)
352
+ #
353
+ # * `300` (five minutes)
354
+ #
355
+ # * `3600` (one hour)
356
+ #
357
+ # * `86400` (twenty-four hours)
358
+ #
359
+ # If you don't specify `PeriodInSeconds`, then Performance Insights
360
+ # will choose a value for you, with a goal of returning roughly 100-200
361
+ # data points in the response.
362
+ #
363
+ # @option params [Integer] :max_results
364
+ # The maximum number of items to return in the response. If more items
365
+ # exist than the specified `MaxRecords` value, a pagination token is
366
+ # included in the response so that the remaining results can be
367
+ # retrieved.
368
+ #
369
+ # @option params [String] :next_token
370
+ # An optional pagination token provided by a previous request. If this
371
+ # parameter is specified, the response includes only records beyond the
372
+ # token, up to the value specified by `MaxRecords`.
373
+ #
374
+ # @return [Types::GetResourceMetricsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
375
+ #
376
+ # * {Types::GetResourceMetricsResponse#aligned_start_time #aligned_start_time} => Time
377
+ # * {Types::GetResourceMetricsResponse#aligned_end_time #aligned_end_time} => Time
378
+ # * {Types::GetResourceMetricsResponse#identifier #identifier} => String
379
+ # * {Types::GetResourceMetricsResponse#metric_list #metric_list} => Array&lt;Types::MetricKeyDataPoints&gt;
380
+ # * {Types::GetResourceMetricsResponse#next_token #next_token} => String
381
+ #
382
+ # @example Request syntax with placeholder values
383
+ #
384
+ # resp = client.get_resource_metrics({
385
+ # service_type: "RDS", # required, accepts RDS
386
+ # identifier: "String", # required
387
+ # metric_queries: [ # required
388
+ # {
389
+ # metric: "String", # required
390
+ # group_by: {
391
+ # group: "String", # required
392
+ # dimensions: ["String"],
393
+ # limit: 1,
394
+ # },
395
+ # filter: {
396
+ # "String" => "String",
397
+ # },
398
+ # },
399
+ # ],
400
+ # start_time: Time.now, # required
401
+ # end_time: Time.now, # required
402
+ # period_in_seconds: 1,
403
+ # max_results: 1,
404
+ # next_token: "String",
405
+ # })
406
+ #
407
+ # @example Response structure
408
+ #
409
+ # resp.aligned_start_time #=> Time
410
+ # resp.aligned_end_time #=> Time
411
+ # resp.identifier #=> String
412
+ # resp.metric_list #=> Array
413
+ # resp.metric_list[0].key.metric #=> String
414
+ # resp.metric_list[0].key.dimensions #=> Hash
415
+ # resp.metric_list[0].key.dimensions["String"] #=> String
416
+ # resp.metric_list[0].data_points #=> Array
417
+ # resp.metric_list[0].data_points[0].timestamp #=> Time
418
+ # resp.metric_list[0].data_points[0].value #=> Float
419
+ # resp.next_token #=> String
420
+ #
421
+ # @see http://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetResourceMetrics AWS API Documentation
422
+ #
423
+ # @overload get_resource_metrics(params = {})
424
+ # @param [Hash] params ({})
425
+ def get_resource_metrics(params = {}, options = {})
426
+ req = build_request(:get_resource_metrics, params)
427
+ req.send_request(options)
428
+ end
429
+
430
+ # @!endgroup
431
+
432
+ # @param params ({})
433
+ # @api private
434
+ def build_request(operation_name, params = {})
435
+ handlers = @handlers.for(operation_name)
436
+ context = Seahorse::Client::RequestContext.new(
437
+ operation_name: operation_name,
438
+ operation: config.api.operation(operation_name),
439
+ client: self,
440
+ params: params,
441
+ config: config)
442
+ context[:gem_name] = 'aws-sdk-pi'
443
+ context[:gem_version] = '1.0.0'
444
+ Seahorse::Client::Request.new(handlers, context)
445
+ end
446
+
447
+ # @api private
448
+ # @deprecated
449
+ def waiter_names
450
+ []
451
+ end
452
+
453
+ class << self
454
+
455
+ # @api private
456
+ attr_reader :identifier
457
+
458
+ # @api private
459
+ def errors_module
460
+ Errors
461
+ end
462
+
463
+ end
464
+ end
465
+ end