aws-sdk-shield 1.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 69a73cbb3b900a10c58ef45ad40040dd276d2fb8
4
+ data.tar.gz: 368ab934dc62f7d0cb88b9be6fdb436bc8b4220d
5
+ SHA512:
6
+ metadata.gz: e701a903aa19a13f1067e6be85d0f5189e7a07252c524f256604a5909d65039047972bc61165cdf5463817e841811ee49fe9cd7070eb277f150cf286c26d5af3
7
+ data.tar.gz: 0dfe6958f201ab84cadd63fc0eb44fa4bf474dc10c35623991456bb00e018a729b1042f27c971c1a962ef5168444b623d680153e89269b4a2ae86049295debdf
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
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-shield/types'
12
+ require_relative 'aws-sdk-shield/client_api'
13
+ require_relative 'aws-sdk-shield/client'
14
+ require_relative 'aws-sdk-shield/errors'
15
+ require_relative 'aws-sdk-shield/resource'
16
+ require_relative 'aws-sdk-shield/customizations'
17
+
18
+ # This module provides support for AWS Shield. This module is available in the
19
+ # `aws-sdk-shield` 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 Shield all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::Shield::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::Shield
44
+
45
+ GEM_VERSION = '1.0.0.rc2'
46
+
47
+ end
@@ -0,0 +1,422 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
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/signature_v4.rb'
22
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
23
+
24
+ Aws::Plugins::GlobalConfiguration.add_identifier(:shield)
25
+
26
+ module Aws
27
+ module Shield
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :shield
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::SignatureV4)
50
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
51
+
52
+ # @option options [required, Aws::CredentialProvider] :credentials
53
+ # Your AWS credentials. This can be an instance of any one of the
54
+ # following classes:
55
+ #
56
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
57
+ # credentials.
58
+ #
59
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
60
+ # from an EC2 IMDS on an EC2 instance.
61
+ #
62
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
63
+ # shared file, such as `~/.aws/config`.
64
+ #
65
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
66
+ #
67
+ # When `:credentials` are not configured directly, the following
68
+ # locations will be searched for credentials:
69
+ #
70
+ # * `Aws.config[:credentials]`
71
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
72
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
73
+ # * `~/.aws/credentials`
74
+ # * `~/.aws/config`
75
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
76
+ # very aggressive. Construct and pass an instance of
77
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
78
+ # timeouts.
79
+ # @option options [required, String] :region
80
+ # The AWS region to connect to. The configured `:region` is
81
+ # used to determine the service `:endpoint`. When not passed,
82
+ # a default `:region` is search for in the following locations:
83
+ #
84
+ # * `Aws.config[:region]`
85
+ # * `ENV['AWS_REGION']`
86
+ # * `ENV['AMAZON_REGION']`
87
+ # * `ENV['AWS_DEFAULT_REGION']`
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ # @option options [String] :access_key_id
91
+ # @option options [Boolean] :convert_params (true)
92
+ # When `true`, an attempt is made to coerce request parameters into
93
+ # the required types.
94
+ # @option options [String] :endpoint
95
+ # The client endpoint is normally constructed from the `:region`
96
+ # option. You should only configure an `:endpoint` when connecting
97
+ # to test endpoints. This should be avalid HTTP(S) URI.
98
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
99
+ # The log formatter.
100
+ # @option options [Symbol] :log_level (:info)
101
+ # The log level to send messages to the `:logger` at.
102
+ # @option options [Logger] :logger
103
+ # The Logger instance to send log messages to. If this option
104
+ # is not set, logging will be disabled.
105
+ # @option options [String] :profile ("default")
106
+ # Used when loading credentials from the shared credentials file
107
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
108
+ # @option options [Integer] :retry_limit (3)
109
+ # The maximum number of times to retry failed requests. Only
110
+ # ~ 500 level server errors and certain ~ 400 level client errors
111
+ # are retried. Generally, these are throttling errors, data
112
+ # checksum errors, networking errors, timeout errors and auth
113
+ # errors from expired credentials.
114
+ # @option options [String] :secret_access_key
115
+ # @option options [String] :session_token
116
+ # @option options [Boolean] :simple_json (false)
117
+ # Disables request parameter conversion, validation, and formatting.
118
+ # Also disable response data type conversions. This option is useful
119
+ # when you want to ensure the highest level of performance by
120
+ # avoiding overhead of walking request parameters and response data
121
+ # structures.
122
+ #
123
+ # When `:simple_json` is enabled, the request parameters hash must
124
+ # be formatted exactly as the DynamoDB API expects.
125
+ # @option options [Boolean] :stub_responses (false)
126
+ # Causes the client to return stubbed responses. By default
127
+ # fake responses are generated and returned. You can specify
128
+ # the response data to return or errors to raise by calling
129
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
130
+ #
131
+ # ** Please note ** When response stubbing is enabled, no HTTP
132
+ # requests are made, and retries are disabled.
133
+ # @option options [Boolean] :validate_params (true)
134
+ # When `true`, request parameters are validated before
135
+ # sending the request.
136
+ def initialize(*args)
137
+ super
138
+ end
139
+
140
+ # @!group API Operations
141
+
142
+ # Enables AWS Shield Advanced for a specific AWS resource. The resource
143
+ # can be an Amazon CloudFront distribution, Elastic Load Balancing load
144
+ # balancer, or an Amazon Route 53 hosted zone.
145
+ # @option params [required, String] :name
146
+ # Friendly name for the `Protection` you are creating.
147
+ # @option params [required, String] :resource_arn
148
+ # The ARN (Amazon Resource Name) of the resource to be protected.
149
+ # @return [Types::CreateProtectionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
150
+ #
151
+ # * {Types::CreateProtectionResponse#protection_id #ProtectionId} => String
152
+ #
153
+ # @example Request syntax with placeholder values
154
+ # resp = client.create_protection({
155
+ # name: "ProtectionName", # required
156
+ # resource_arn: "ResourceArn", # required
157
+ # })
158
+ #
159
+ # @example Response structure
160
+ # resp.protection_id #=> String
161
+ # @overload create_protection(params = {})
162
+ # @param [Hash] params ({})
163
+ def create_protection(params = {}, options = {})
164
+ req = build_request(:create_protection, params)
165
+ req.send_request(options)
166
+ end
167
+
168
+ # Activates AWS Shield Advanced for an account.
169
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
170
+ #
171
+ # @example Request syntax with placeholder values
172
+ # resp = client.create_subscription()
173
+ # @overload create_subscription(params = {})
174
+ # @param [Hash] params ({})
175
+ def create_subscription(params = {}, options = {})
176
+ req = build_request(:create_subscription, params)
177
+ req.send_request(options)
178
+ end
179
+
180
+ # Deletes an AWS Shield Advanced Protection.
181
+ # @option params [required, String] :protection_id
182
+ # The unique identifier (ID) for the Protection object to be deleted.
183
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
184
+ #
185
+ # @example Request syntax with placeholder values
186
+ # resp = client.delete_protection({
187
+ # protection_id: "ProtectionId", # required
188
+ # })
189
+ # @overload delete_protection(params = {})
190
+ # @param [Hash] params ({})
191
+ def delete_protection(params = {}, options = {})
192
+ req = build_request(:delete_protection, params)
193
+ req.send_request(options)
194
+ end
195
+
196
+ # Removes AWS Shield Advanced from an account.
197
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
198
+ #
199
+ # @example Request syntax with placeholder values
200
+ # resp = client.delete_subscription()
201
+ # @overload delete_subscription(params = {})
202
+ # @param [Hash] params ({})
203
+ def delete_subscription(params = {}, options = {})
204
+ req = build_request(:delete_subscription, params)
205
+ req.send_request(options)
206
+ end
207
+
208
+ # Describes the details of a DDoS attack.
209
+ # @option params [required, String] :attack_id
210
+ # The unique identifier (ID) for the attack that to be described.
211
+ # @return [Types::DescribeAttackResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
212
+ #
213
+ # * {Types::DescribeAttackResponse#attack #Attack} => Types::AttackDetail
214
+ #
215
+ # @example Request syntax with placeholder values
216
+ # resp = client.describe_attack({
217
+ # attack_id: "AttackId", # required
218
+ # })
219
+ #
220
+ # @example Response structure
221
+ # resp.attack.attack_id #=> String
222
+ # resp.attack.resource_arn #=> String
223
+ # resp.attack.sub_resources #=> Array
224
+ # resp.attack.sub_resources[0].type #=> String, one of "IP", "URL"
225
+ # resp.attack.sub_resources[0].id #=> String
226
+ # resp.attack.sub_resources[0].attack_vectors #=> Array
227
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_type #=> String
228
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters #=> Array
229
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters[0].name #=> String
230
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters[0].max #=> Float
231
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters[0].average #=> Float
232
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters[0].sum #=> Float
233
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters[0].n #=> Integer
234
+ # resp.attack.sub_resources[0].attack_vectors[0].vector_counters[0].unit #=> String
235
+ # resp.attack.sub_resources[0].counters #=> Array
236
+ # resp.attack.sub_resources[0].counters[0].name #=> String
237
+ # resp.attack.sub_resources[0].counters[0].max #=> Float
238
+ # resp.attack.sub_resources[0].counters[0].average #=> Float
239
+ # resp.attack.sub_resources[0].counters[0].sum #=> Float
240
+ # resp.attack.sub_resources[0].counters[0].n #=> Integer
241
+ # resp.attack.sub_resources[0].counters[0].unit #=> String
242
+ # resp.attack.start_time #=> Time
243
+ # resp.attack.end_time #=> Time
244
+ # resp.attack.attack_counters #=> Array
245
+ # resp.attack.attack_counters[0].name #=> String
246
+ # resp.attack.attack_counters[0].max #=> Float
247
+ # resp.attack.attack_counters[0].average #=> Float
248
+ # resp.attack.attack_counters[0].sum #=> Float
249
+ # resp.attack.attack_counters[0].n #=> Integer
250
+ # resp.attack.attack_counters[0].unit #=> String
251
+ # resp.attack.mitigations #=> Array
252
+ # resp.attack.mitigations[0].mitigation_name #=> String
253
+ # @overload describe_attack(params = {})
254
+ # @param [Hash] params ({})
255
+ def describe_attack(params = {}, options = {})
256
+ req = build_request(:describe_attack, params)
257
+ req.send_request(options)
258
+ end
259
+
260
+ # Lists the details of a Protection object.
261
+ # @option params [required, String] :protection_id
262
+ # The unique identifier (ID) for the Protection object that is
263
+ # described.
264
+ # @return [Types::DescribeProtectionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
265
+ #
266
+ # * {Types::DescribeProtectionResponse#protection #Protection} => Types::Protection
267
+ #
268
+ # @example Request syntax with placeholder values
269
+ # resp = client.describe_protection({
270
+ # protection_id: "ProtectionId", # required
271
+ # })
272
+ #
273
+ # @example Response structure
274
+ # resp.protection.id #=> String
275
+ # resp.protection.name #=> String
276
+ # resp.protection.resource_arn #=> String
277
+ # @overload describe_protection(params = {})
278
+ # @param [Hash] params ({})
279
+ def describe_protection(params = {}, options = {})
280
+ req = build_request(:describe_protection, params)
281
+ req.send_request(options)
282
+ end
283
+
284
+ # Provides details about the AWS Shield Advanced subscription for an
285
+ # account.
286
+ # @return [Types::DescribeSubscriptionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
287
+ #
288
+ # * {Types::DescribeSubscriptionResponse#subscription #Subscription} => Types::Subscription
289
+ #
290
+ # @example Request syntax with placeholder values
291
+ # resp = client.describe_subscription()
292
+ #
293
+ # @example Response structure
294
+ # resp.subscription.start_time #=> Time
295
+ # resp.subscription.time_commitment_in_seconds #=> Integer
296
+ # @overload describe_subscription(params = {})
297
+ # @param [Hash] params ({})
298
+ def describe_subscription(params = {}, options = {})
299
+ req = build_request(:describe_subscription, params)
300
+ req.send_request(options)
301
+ end
302
+
303
+ # Returns all ongoing DDoS attacks or all DDoS attacks during a
304
+ # specified time period.
305
+ # @option params [Array<String>] :resource_arns
306
+ # The ARN (Amazon Resource Name) of the resource that was attacked. If
307
+ # this is left blank, all applicable resources for this account will be
308
+ # included.
309
+ # @option params [Types::TimeRange] :start_time
310
+ # The time period for the attacks.
311
+ # @option params [Types::TimeRange] :end_time
312
+ # The end of the time period for the attacks.
313
+ # @option params [String] :next_token
314
+ # The `ListAttacksRequest.NextMarker` value from a previous call to
315
+ # `ListAttacksRequest`. Pass null if this is the first call.
316
+ # @option params [Integer] :max_results
317
+ # The maximum number of AttackSummary objects to be returned. If this is
318
+ # left blank, the first 20 results will be returned.
319
+ # @return [Types::ListAttacksResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
320
+ #
321
+ # * {Types::ListAttacksResponse#attack_summaries #AttackSummaries} => Array&lt;Types::AttackSummary&gt;
322
+ # * {Types::ListAttacksResponse#next_token #NextToken} => String
323
+ #
324
+ # @example Request syntax with placeholder values
325
+ # resp = client.list_attacks({
326
+ # resource_arns: ["ResourceArn"],
327
+ # start_time: {
328
+ # from_inclusive: Time.now,
329
+ # to_exclusive: Time.now,
330
+ # },
331
+ # end_time: {
332
+ # from_inclusive: Time.now,
333
+ # to_exclusive: Time.now,
334
+ # },
335
+ # next_token: "Token",
336
+ # max_results: 1,
337
+ # })
338
+ #
339
+ # @example Response structure
340
+ # resp.attack_summaries #=> Array
341
+ # resp.attack_summaries[0].attack_id #=> String
342
+ # resp.attack_summaries[0].resource_arn #=> String
343
+ # resp.attack_summaries[0].start_time #=> Time
344
+ # resp.attack_summaries[0].end_time #=> Time
345
+ # resp.attack_summaries[0].attack_vectors #=> Array
346
+ # resp.attack_summaries[0].attack_vectors[0].vector_type #=> String
347
+ # resp.next_token #=> String
348
+ # @overload list_attacks(params = {})
349
+ # @param [Hash] params ({})
350
+ def list_attacks(params = {}, options = {})
351
+ req = build_request(:list_attacks, params)
352
+ req.send_request(options)
353
+ end
354
+
355
+ # Lists all Protection objects for the account.
356
+ # @option params [String] :next_token
357
+ # The `ListProtectionsRequest.NextToken` value from a previous call to
358
+ # `ListProtections`. Pass null if this is the first call.
359
+ # @option params [Integer] :max_results
360
+ # The maximum number of Protection objects to be returned. If this is
361
+ # left blank the first 20 results will be returned.
362
+ # @return [Types::ListProtectionsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
363
+ #
364
+ # * {Types::ListProtectionsResponse#protections #Protections} => Array&lt;Types::Protection&gt;
365
+ # * {Types::ListProtectionsResponse#next_token #NextToken} => String
366
+ #
367
+ # @example Request syntax with placeholder values
368
+ # resp = client.list_protections({
369
+ # next_token: "Token",
370
+ # max_results: 1,
371
+ # })
372
+ #
373
+ # @example Response structure
374
+ # resp.protections #=> Array
375
+ # resp.protections[0].id #=> String
376
+ # resp.protections[0].name #=> String
377
+ # resp.protections[0].resource_arn #=> String
378
+ # resp.next_token #=> String
379
+ # @overload list_protections(params = {})
380
+ # @param [Hash] params ({})
381
+ def list_protections(params = {}, options = {})
382
+ req = build_request(:list_protections, params)
383
+ req.send_request(options)
384
+ end
385
+
386
+ # @!endgroup
387
+
388
+ # @param params ({})
389
+ # @api private
390
+ def build_request(operation_name, params = {})
391
+ handlers = @handlers.for(operation_name)
392
+ context = Seahorse::Client::RequestContext.new(
393
+ operation_name: operation_name,
394
+ operation: config.api.operation(operation_name),
395
+ client: self,
396
+ params: params,
397
+ config: config)
398
+ context[:gem_name] = 'aws-sdk-shield'
399
+ context[:gem_version] = '1.0.0.rc2'
400
+ Seahorse::Client::Request.new(handlers, context)
401
+ end
402
+
403
+ # @api private
404
+ # @deprecated
405
+ def waiter_names
406
+ []
407
+ end
408
+
409
+ class << self
410
+
411
+ # @api private
412
+ attr_reader :identifier
413
+
414
+ # @api private
415
+ def errors_module
416
+ Errors
417
+ end
418
+
419
+ end
420
+ end
421
+ end
422
+ end