fog-aws 3.5.2 → 3.6.2

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +16 -3
  4. data/LICENSE.md +1 -1
  5. data/README.md +39 -6
  6. data/bin/console +14 -0
  7. data/bin/setup +8 -0
  8. data/fog-aws.gemspec +2 -2
  9. data/lib/fog/aws.rb +4 -0
  10. data/lib/fog/aws/elasticache.rb +4 -2
  11. data/lib/fog/aws/elb.rb +1 -1
  12. data/lib/fog/aws/elbv2.rb +72 -0
  13. data/lib/fog/aws/models/compute/flavors.rb +1544 -122
  14. data/lib/fog/aws/models/compute/snapshot.rb +7 -6
  15. data/lib/fog/aws/models/compute/vpc.rb +7 -1
  16. data/lib/fog/aws/models/storage/directory.rb +0 -1
  17. data/lib/fog/aws/models/storage/file.rb +3 -0
  18. data/lib/fog/aws/parsers/compute/create_snapshot.rb +1 -1
  19. data/lib/fog/aws/parsers/compute/create_subnet.rb +33 -6
  20. data/lib/fog/aws/parsers/compute/describe_subnets.rb +33 -6
  21. data/lib/fog/aws/parsers/dns/create_hosted_zone.rb +1 -1
  22. data/lib/fog/aws/parsers/dns/get_hosted_zone.rb +3 -3
  23. data/lib/fog/aws/parsers/dns/list_hosted_zones.rb +3 -1
  24. data/lib/fog/aws/parsers/elbv2/create_load_balancer.rb +88 -0
  25. data/lib/fog/aws/parsers/elbv2/describe_listeners.rb +110 -0
  26. data/lib/fog/aws/parsers/elbv2/describe_load_balancers.rb +88 -0
  27. data/lib/fog/aws/parsers/elbv2/describe_tags.rb +53 -0
  28. data/lib/fog/aws/parsers/elbv2/empty.rb +10 -0
  29. data/lib/fog/aws/parsers/storage/get_object_tagging.rb +33 -0
  30. data/lib/fog/aws/parsers/sts/assume_role_with_web_identity.rb +1 -1
  31. data/lib/fog/aws/requests/compute/create_vpc.rb +2 -2
  32. data/lib/fog/aws/requests/elbv2/add_tags.rb +45 -0
  33. data/lib/fog/aws/requests/elbv2/create_load_balancer.rb +160 -0
  34. data/lib/fog/aws/requests/elbv2/describe_listeners.rb +38 -0
  35. data/lib/fog/aws/requests/elbv2/describe_load_balancers.rb +100 -0
  36. data/lib/fog/aws/requests/elbv2/describe_tags.rb +50 -0
  37. data/lib/fog/aws/requests/elbv2/remove_tags.rb +45 -0
  38. data/lib/fog/aws/requests/storage/get_object_tagging.rb +41 -0
  39. data/lib/fog/aws/requests/storage/put_object_tagging.rb +42 -0
  40. data/lib/fog/aws/requests/sts/assume_role_with_web_identity.rb +7 -6
  41. data/lib/fog/aws/storage.rb +2 -0
  42. data/lib/fog/aws/version.rb +1 -1
  43. data/tests/parsers/elbv2/create_load_balancer_tests.rb +48 -0
  44. data/tests/parsers/elbv2/describe_listeners_tests.rb +76 -0
  45. data/tests/parsers/elbv2/describe_load_balancers_tests.rb +54 -0
  46. data/tests/parsers/elbv2/describe_tags_tests.rb +35 -0
  47. data/tests/requests/compute/vpc_tests.rb +6 -0
  48. data/tests/requests/elbv2/helper.rb +66 -0
  49. data/tests/requests/elbv2/load_balancer_tests.rb +50 -0
  50. metadata +35 -10
@@ -0,0 +1,66 @@
1
+ class AWS
2
+ module ELBV2
3
+ module Formats
4
+ BASIC = {
5
+ 'ResponseMetadata' => {'RequestId' => String}
6
+ }
7
+
8
+ LOAD_BALANCER = {
9
+ "AvailabilityZones" => [{
10
+ "SubnetId" => String, "ZoneName" => String,
11
+ "LoadBalancerAddresses" => [Fog::Nullable::Hash]
12
+ }],
13
+ "LoadBalancerArn" => String,
14
+ "DNSName" => String,
15
+ "CreatedTime" => Time,
16
+ "LoadBalancerName" => String,
17
+ "VpcId" => String,
18
+ "CanonicalHostedZoneId" => String,
19
+ "Scheme" => String,
20
+ "Type" => String,
21
+ "State" => {"Code" => String},
22
+ "SecurityGroups" => [Fog::Nullable::String]
23
+ }
24
+
25
+ DESCRIBE_LOAD_BALANCERS = BASIC.merge({
26
+ 'DescribeLoadBalancersResult' => {'LoadBalancers' => [LOAD_BALANCER], 'NextMarker' => Fog::Nullable::String}
27
+ })
28
+
29
+ CREATE_LOAD_BALANCER = BASIC.merge({
30
+ 'CreateLoadBalancerResult' => {'LoadBalancers' => [LOAD_BALANCER]}
31
+ })
32
+
33
+ LISTENER_DEFAULT_ACTIONS = [{
34
+ "Type" => String,
35
+ "Order" => String,
36
+ "TargetGroupArn" => String,
37
+ "RedirectConfig" => Fog::Nullable::Hash,
38
+ "ForwardConfig" => Fog::Nullable::Hash,
39
+ "FixedResponseConfig" => Fog::Nullable::Hash
40
+ }]
41
+
42
+ LISTENER = {
43
+ "LoadBalancerArn" => String,
44
+ "Protocol" => String,
45
+ "Port" => String,
46
+ "ListenerArn" => String,
47
+ "SslPolicy" => String,
48
+ "DefaultActions" => LISTENER_DEFAULT_ACTIONS,
49
+ "Certificates" => [{"CertificateArn" => String}]
50
+ }
51
+
52
+ DESCRIBE_LISTENERS = BASIC.merge({
53
+ 'DescribeListenersResult' => {'Listeners' => [LISTENER], 'NextMarker' => Fog::Nullable::String}
54
+ })
55
+
56
+ TAG_DESCRIPTIONS = [{
57
+ "Tags" => Hash,
58
+ "ResourceArn" => String
59
+ }]
60
+
61
+ DESCRIBE_TAGS = BASIC.merge({
62
+ 'DescribeTagsResult' => {'TagDescriptions' => TAG_DESCRIPTIONS}
63
+ })
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,50 @@
1
+ Shindo.tests('AWS::ELBV2 | load_balancer_tests', ['aws', 'elb']) do
2
+ @load_balancer_id = 'fog-test-elb'
3
+ @key_name = 'fog-test'
4
+ vpc = Fog::Compute[:aws].create_vpc('10.255.254.64/28').body['vpcSet'].first
5
+ @subnet_id = Fog::Compute[:aws].create_subnet(vpc['vpcId'], vpc['cidrBlock']).body['subnet']['subnetId']
6
+ @tags = { 'test1' => 'Value1', 'test2' => 'Value2' }
7
+
8
+ tests('success') do
9
+ tests('#create_load_balancer').formats(AWS::ELBV2::Formats::CREATE_LOAD_BALANCER) do
10
+ options = {
11
+ subnets: [@subnet_id]
12
+ }
13
+ load_balancer = Fog::AWS[:elbv2].create_load_balancer(@load_balancer_id, options).body
14
+ @load_balancer_arn = load_balancer['CreateLoadBalancerResult']['LoadBalancers'].first['LoadBalancerArn']
15
+ load_balancer
16
+ end
17
+
18
+ tests('#describe_load_balancers').formats(AWS::ELBV2::Formats::DESCRIBE_LOAD_BALANCERS) do
19
+ Fog::AWS[:elbv2].describe_load_balancers.body
20
+ end
21
+
22
+ tests('#describe_load_balancers with bad name') do
23
+ raises(Fog::AWS::ELBV2::NotFound) { Fog::AWS[:elbv2].describe_load_balancers('LoadBalancerNames' => 'none-such-lb') }
24
+ end
25
+
26
+ tests("#add_tags('#{@load_balancer_arn}', #{@tags})").formats(AWS::ELBV2::Formats::BASIC) do
27
+ Fog::AWS[:elbv2].add_tags(@load_balancer_arn, @tags).body
28
+ end
29
+
30
+ tests('#describe_tags').formats(AWS::ELBV2::Formats::DESCRIBE_TAGS) do
31
+ Fog::AWS[:elbv2].describe_tags(@load_balancer_arn).body
32
+ end
33
+
34
+ tests('#describe_tags with at least one wrong arn') do
35
+ raises(Fog::AWS::ELBV2::NotFound) { Fog::AWS[:elbv2].describe_tags([@load_balancer_arn, 'wrong_arn']) }
36
+ end
37
+
38
+ tests("#describe_tags(#{@load_balancer_arn})").returns(@tags) do
39
+ Fog::AWS[:elbv2].describe_tags(@load_balancer_arn).body['DescribeTagsResult']['TagDescriptions'].first['Tags']
40
+ end
41
+
42
+ tests("#remove_tags('#{@load_balancer_arn}', #{@tags.keys})").formats(AWS::ELBV2::Formats::BASIC) do
43
+ Fog::AWS[:elbv2].remove_tags(@load_balancer_arn, @tags.keys).body
44
+ end
45
+
46
+ tests("#describe_tags(#{@load_balancer_arn})").returns({}) do
47
+ Fog::AWS[:elbv2].describe_tags(@load_balancer_arn).body['DescribeTagsResult']['TagDescriptions'].first['Tags']
48
+ end
49
+ end
50
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-16 00:00:00.000000000 Z
12
+ date: 2020-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -43,30 +43,30 @@ dependencies:
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '10.0'
48
+ version: 12.3.3
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '10.0'
55
+ version: 12.3.3
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rubyzip
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 1.2.1
62
+ version: 1.3.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 1.2.1
69
+ version: 1.3.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: shindo
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,9 @@ description: |-
143
143
  email:
144
144
  - me@joshualane.com
145
145
  - geemus@gmail.com
146
- executables: []
146
+ executables:
147
+ - console
148
+ - setup
147
149
  extensions: []
148
150
  extra_rdoc_files: []
149
151
  files:
@@ -156,6 +158,8 @@ files:
156
158
  - LICENSE.md
157
159
  - README.md
158
160
  - Rakefile
161
+ - bin/console
162
+ - bin/setup
159
163
  - fog-aws.gemspec
160
164
  - gemfiles/Gemfile-edge
161
165
  - gemfiles/Gemfile-ruby-2.0
@@ -176,6 +180,7 @@ files:
176
180
  - lib/fog/aws/elasticache.rb
177
181
  - lib/fog/aws/elb.rb
178
182
  - lib/fog/aws/elb/policy_types.rb
183
+ - lib/fog/aws/elbv2.rb
179
184
  - lib/fog/aws/emr.rb
180
185
  - lib/fog/aws/errors.rb
181
186
  - lib/fog/aws/federation.rb
@@ -570,6 +575,11 @@ files:
570
575
  - lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb
571
576
  - lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb
572
577
  - lib/fog/aws/parsers/elb/tag_list_parser.rb
578
+ - lib/fog/aws/parsers/elbv2/create_load_balancer.rb
579
+ - lib/fog/aws/parsers/elbv2/describe_listeners.rb
580
+ - lib/fog/aws/parsers/elbv2/describe_load_balancers.rb
581
+ - lib/fog/aws/parsers/elbv2/describe_tags.rb
582
+ - lib/fog/aws/parsers/elbv2/empty.rb
573
583
  - lib/fog/aws/parsers/emr/add_instance_groups.rb
574
584
  - lib/fog/aws/parsers/emr/add_job_flow_steps.rb
575
585
  - lib/fog/aws/parsers/emr/describe_job_flows.rb
@@ -740,6 +750,7 @@ files:
740
750
  - lib/fog/aws/parsers/storage/get_bucket_tagging.rb
741
751
  - lib/fog/aws/parsers/storage/get_bucket_versioning.rb
742
752
  - lib/fog/aws/parsers/storage/get_bucket_website.rb
753
+ - lib/fog/aws/parsers/storage/get_object_tagging.rb
743
754
  - lib/fog/aws/parsers/storage/get_request_payment.rb
744
755
  - lib/fog/aws/parsers/storage/get_service.rb
745
756
  - lib/fog/aws/parsers/storage/initiate_multipart_upload.rb
@@ -1106,6 +1117,12 @@ files:
1106
1117
  - lib/fog/aws/requests/elb/set_load_balancer_listener_ssl_certificate.rb
1107
1118
  - lib/fog/aws/requests/elb/set_load_balancer_policies_for_backend_server.rb
1108
1119
  - lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb
1120
+ - lib/fog/aws/requests/elbv2/add_tags.rb
1121
+ - lib/fog/aws/requests/elbv2/create_load_balancer.rb
1122
+ - lib/fog/aws/requests/elbv2/describe_listeners.rb
1123
+ - lib/fog/aws/requests/elbv2/describe_load_balancers.rb
1124
+ - lib/fog/aws/requests/elbv2/describe_tags.rb
1125
+ - lib/fog/aws/requests/elbv2/remove_tags.rb
1109
1126
  - lib/fog/aws/requests/emr/add_instance_groups.rb
1110
1127
  - lib/fog/aws/requests/emr/add_job_flow_steps.rb
1111
1128
  - lib/fog/aws/requests/emr/describe_job_flows.rb
@@ -1396,6 +1413,7 @@ files:
1396
1413
  - lib/fog/aws/requests/storage/get_object_acl.rb
1397
1414
  - lib/fog/aws/requests/storage/get_object_http_url.rb
1398
1415
  - lib/fog/aws/requests/storage/get_object_https_url.rb
1416
+ - lib/fog/aws/requests/storage/get_object_tagging.rb
1399
1417
  - lib/fog/aws/requests/storage/get_object_torrent.rb
1400
1418
  - lib/fog/aws/requests/storage/get_object_url.rb
1401
1419
  - lib/fog/aws/requests/storage/get_request_payment.rb
@@ -1420,6 +1438,7 @@ files:
1420
1438
  - lib/fog/aws/requests/storage/put_bucket_website.rb
1421
1439
  - lib/fog/aws/requests/storage/put_object.rb
1422
1440
  - lib/fog/aws/requests/storage/put_object_acl.rb
1441
+ - lib/fog/aws/requests/storage/put_object_tagging.rb
1423
1442
  - lib/fog/aws/requests/storage/put_object_url.rb
1424
1443
  - lib/fog/aws/requests/storage/put_request_payment.rb
1425
1444
  - lib/fog/aws/requests/storage/shared_mock_methods.rb
@@ -1554,6 +1573,10 @@ files:
1554
1573
  - tests/models/support/trusted_advisor_tests.rb
1555
1574
  - tests/parsers/compute/describe_images_tests.rb
1556
1575
  - tests/parsers/elb/describe_load_balancers.rb
1576
+ - tests/parsers/elbv2/create_load_balancer_tests.rb
1577
+ - tests/parsers/elbv2/describe_listeners_tests.rb
1578
+ - tests/parsers/elbv2/describe_load_balancers_tests.rb
1579
+ - tests/parsers/elbv2/describe_tags_tests.rb
1557
1580
  - tests/requests/auto_scaling/auto_scaling_tests.rb
1558
1581
  - tests/requests/auto_scaling/describe_types_tests.rb
1559
1582
  - tests/requests/auto_scaling/helper.rb
@@ -1620,6 +1643,8 @@ files:
1620
1643
  - tests/requests/elb/listener_tests.rb
1621
1644
  - tests/requests/elb/load_balancer_tests.rb
1622
1645
  - tests/requests/elb/policy_tests.rb
1646
+ - tests/requests/elbv2/helper.rb
1647
+ - tests/requests/elbv2/load_balancer_tests.rb
1623
1648
  - tests/requests/emr/helper.rb
1624
1649
  - tests/requests/emr/instance_group_tests.rb
1625
1650
  - tests/requests/emr/job_flow_tests.rb
@@ -1718,7 +1743,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1718
1743
  - !ruby/object:Gem::Version
1719
1744
  version: '0'
1720
1745
  requirements: []
1721
- rubygems_version: 3.0.4
1746
+ rubygems_version: 3.0.3
1722
1747
  signing_key:
1723
1748
  specification_version: 4
1724
1749
  summary: Module for the 'fog' gem to support Amazon Web Services.