fog 1.24.0 → 1.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.md +184 -1
- data/CONTRIBUTORS.md +23 -0
- data/README.md +17 -9
- data/Rakefile +4 -0
- data/fog.gemspec +18 -6
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/auto_scaling.rb +12 -12
- data/lib/fog/aws/beanstalk.rb +12 -10
- data/lib/fog/aws/cdn.rb +0 -1
- data/lib/fog/aws/cloud_formation.rb +13 -11
- data/lib/fog/aws/cloud_watch.rb +14 -11
- data/lib/fog/aws/compute.rb +19 -19
- data/lib/fog/aws/core.rb +21 -0
- data/lib/fog/aws/dns.rb +0 -1
- data/lib/fog/aws/elasticache.rb +13 -9
- data/lib/fog/aws/elb.rb +23 -14
- data/lib/fog/aws/emr.rb +11 -9
- data/lib/fog/aws/iam.rb +14 -11
- data/lib/fog/aws/models/compute/security_group.rb +41 -0
- data/lib/fog/aws/models/elb/load_balancer.rb +31 -0
- data/lib/fog/aws/models/glacier/archive.rb +3 -1
- data/lib/fog/aws/models/iam/role.rb +1 -1
- data/lib/fog/aws/models/iam/roles.rb +1 -1
- data/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +68 -53
- data/lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb +7 -0
- data/lib/fog/aws/parsers/elb/describe_tags.rb +26 -0
- data/lib/fog/aws/parsers/elb/tag_list_parser.rb +57 -0
- data/lib/fog/aws/parsers/storage/get_bucket_website.rb +5 -1
- data/lib/fog/aws/rds.rb +13 -11
- data/lib/fog/aws/region_methods.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/put_item.rb +1 -1
- data/lib/fog/aws/requests/elb/add_tags.rb +46 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +4 -1
- data/lib/fog/aws/requests/elb/describe_load_balancer_attributes.rb +3 -0
- data/lib/fog/aws/requests/elb/describe_tags.rb +56 -0
- data/lib/fog/aws/requests/elb/modify_load_balancer_attributes.rb +9 -3
- data/lib/fog/aws/requests/elb/remove_tags.rb +46 -0
- data/lib/fog/aws/requests/storage/copy_object.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_object.rb +4 -3
- data/lib/fog/aws/requests/storage/post_object_hidden_fields.rb +23 -5
- data/lib/fog/aws/requests/storage/post_object_restore.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_website.rb +46 -18
- data/lib/fog/aws/ses.rb +1 -2
- data/lib/fog/aws/signaturev4.rb +62 -15
- data/lib/fog/aws/simpledb.rb +0 -1
- data/lib/fog/aws/sns.rb +12 -9
- data/lib/fog/aws/sqs.rb +14 -10
- data/lib/fog/aws/storage.rb +102 -78
- data/lib/fog/aws/sts.rb +10 -9
- data/lib/fog/bare_metal_cloud/compute.rb +0 -1
- data/lib/fog/bin.rb +1 -0
- data/lib/fog/bin/brightbox.rb +3 -1
- data/lib/fog/bin/rackspace.rb +4 -0
- data/lib/fog/bluebox/models/compute/server.rb +1 -0
- data/lib/fog/cloudstack/models/compute/server.rb +12 -1
- data/lib/fog/cloudstack/models/compute/snapshots.rb +3 -2
- data/lib/fog/cloudstack/models/compute/volume.rb +5 -0
- data/lib/fog/cloudstack/models/compute/volumes.rb +3 -2
- data/lib/fog/core/parser.rb +2 -112
- data/lib/fog/dnsmadeeasy/dns.rb +0 -1
- data/lib/fog/dynect/core.rb +0 -1
- data/lib/fog/dynect/dns.rb +11 -3
- data/lib/fog/ecloud/compute.rb +0 -1
- data/lib/fog/ecloud/core.rb +1 -1
- data/lib/fog/fogdocker/compute.rb +4 -1
- data/lib/fog/fogdocker/core.rb +1 -7
- data/lib/fog/fogdocker/errors.rb +9 -0
- data/lib/fog/fogdocker/models/compute/images.rb +4 -0
- data/lib/fog/fogdocker/models/compute/server.rb +18 -1
- data/lib/fog/fogdocker/requests/compute/container_action.rb +53 -3
- data/lib/fog/fogdocker/requests/compute/container_get.rb +31 -12
- data/lib/fog/fogdocker/requests/compute/image_search.rb +29 -0
- data/lib/fog/google/dns.rb +46 -12
- data/lib/fog/google/examples/dns/project.rb +8 -0
- data/lib/fog/google/examples/dns/zones.rb +43 -0
- data/lib/fog/google/models/compute/images.rb +2 -1
- data/lib/fog/google/models/dns/change.rb +40 -0
- data/lib/fog/google/models/dns/changes.rb +52 -0
- data/lib/fog/google/models/dns/project.rb +75 -0
- data/lib/fog/google/models/dns/projects.rb +25 -0
- data/lib/fog/google/models/dns/record.rb +112 -0
- data/lib/fog/google/models/dns/records.rb +52 -0
- data/lib/fog/google/models/dns/zone.rb +74 -0
- data/lib/fog/google/models/dns/zones.rb +34 -0
- data/lib/fog/google/models/storage/file.rb +1 -1
- data/lib/fog/google/models/storage/files.rb +1 -5
- data/lib/fog/google/requests/dns/create_change.rb +64 -0
- data/lib/fog/google/requests/dns/create_managed_zone.rb +64 -31
- data/lib/fog/google/requests/dns/delete_managed_zone.rb +20 -24
- data/lib/fog/google/requests/dns/get_change.rb +42 -0
- data/lib/fog/google/requests/dns/get_managed_zone.rb +22 -16
- data/lib/fog/google/requests/dns/get_project.rb +42 -0
- data/lib/fog/google/requests/dns/list_changes.rb +41 -0
- data/lib/fog/google/requests/dns/list_managed_zones.rb +15 -10
- data/lib/fog/google/requests/dns/list_resource_record_sets.rb +50 -0
- data/lib/fog/google/storage.rb +0 -1
- data/lib/fog/hp/storage.rb +1 -1
- data/lib/fog/internet_archive/storage.rb +0 -1
- data/lib/fog/libvirt/models/compute/server.rb +17 -7
- data/lib/fog/opennebula/models/compute/flavor.rb +46 -8
- data/lib/fog/opennebula/models/compute/flavors.rb +7 -0
- data/lib/fog/opennebula/models/compute/interface.rb +1 -1
- data/lib/fog/opennebula/models/compute/network.rb +1 -0
- data/lib/fog/opennebula/models/compute/networks.rb +5 -1
- data/lib/fog/opennebula/requests/compute/list_networks.rb +34 -25
- data/lib/fog/opennebula/requests/compute/template_pool.rb +47 -5
- data/lib/fog/openstack/compute.rb +2 -2
- data/lib/fog/openstack/docs/storage.md +18 -0
- data/lib/fog/openstack/identity.rb +1 -1
- data/lib/fog/openstack/image.rb +1 -1
- data/lib/fog/openstack/metering.rb +1 -1
- data/lib/fog/openstack/models/compute/server.rb +1 -0
- data/lib/fog/openstack/models/storage/directory.rb +8 -2
- data/lib/fog/openstack/network.rb +1 -1
- data/lib/fog/openstack/orchestration.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
- data/lib/fog/openstack/requests/storage/public_url.rb +28 -0
- data/lib/fog/openstack/requests/storage/put_container.rb +1 -0
- data/lib/fog/openstack/storage.rb +1 -0
- data/lib/fog/openstack/volume.rb +1 -1
- data/lib/fog/ovirt/compute.rb +1 -0
- data/lib/fog/ovirt/models/compute/server.rb +5 -0
- data/lib/fog/ovirt/requests/compute/update_volume.rb +39 -0
- data/lib/fog/rackspace.rb +1 -0
- data/lib/fog/rackspace/core.rb +1 -0
- data/lib/fog/rackspace/docs/networking.md +315 -0
- data/lib/fog/rackspace/mock_data.rb +1 -2
- data/lib/fog/rackspace/models/dns/zones.rb +2 -1
- data/lib/fog/rackspace/models/load_balancers/node.rb +7 -0
- data/lib/fog/rackspace/models/networking/network.rb +27 -0
- data/lib/fog/rackspace/models/networking/networks.rb +23 -0
- data/lib/fog/rackspace/models/networking/virtual_interface.rb +85 -0
- data/lib/fog/rackspace/models/networking/virtual_interfaces.rb +45 -0
- data/lib/fog/rackspace/models/queues/queue.rb +1 -1
- data/lib/fog/rackspace/networking.rb +192 -0
- data/lib/fog/rackspace/requests/load_balancers/create_node.rb +3 -0
- data/lib/fog/rackspace/requests/load_balancers/update_node.rb +3 -0
- data/lib/fog/rackspace/requests/networking/create_network.rb +36 -0
- data/lib/fog/rackspace/requests/networking/create_virtual_interface.rb +30 -0
- data/lib/fog/rackspace/requests/networking/delete_network.rb +21 -0
- data/lib/fog/rackspace/requests/networking/delete_virtual_interface.rb +23 -0
- data/lib/fog/rackspace/requests/networking/get_network.rb +21 -0
- data/lib/fog/rackspace/requests/networking/list_networks.rb +18 -0
- data/lib/fog/rackspace/requests/networking/list_virtual_interfaces.rb +22 -0
- data/lib/fog/vcloud/compute.rb +0 -1
- data/lib/fog/vcloud/core.rb +1 -0
- data/lib/fog/vcloud_director/compute.rb +1 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +38 -1
- data/lib/fog/vsphere/requests/compute/list_clusters.rb +31 -1
- data/lib/fog/vsphere/requests/compute/modify_vm_interface.rb +1 -1
- data/lib/fog/zerigo/dns.rb +0 -1
- data/lib/tasks/changelog_task.rb +1 -0
- data/tests/aws/models/elb/model_tests.rb +6 -0
- data/tests/aws/models/elb/tagging_tests.rb +15 -0
- data/tests/aws/models/iam/access_keys_tests.rb +1 -1
- data/tests/aws/models/iam/policies_tests.rb +2 -1
- data/tests/aws/models/iam/users_tests.rb +7 -4
- data/tests/aws/models/storage/url_tests.rb +5 -9
- data/tests/aws/requests/compute/tag_tests.rb +2 -0
- data/tests/aws/requests/elb/load_balancer_tests.rb +5 -1
- data/tests/aws/requests/storage/bucket_tests.rb +15 -1
- data/tests/aws/signaturev4_tests.rb +47 -0
- data/tests/bluebox/requests/compute/block_tests.rb +2 -1
- data/tests/compute/helper.rb +0 -10
- data/tests/compute/models/flavors_tests.rb +1 -1
- data/tests/fogdocker/compute_tests.rb +1 -1
- data/tests/fogdocker/models/compute/server_tests.rb +13 -3
- data/tests/fogdocker/requests/compute/container_action_tests.rb +19 -8
- data/tests/fogdocker/requests/compute/image_search_tests.rb +11 -0
- data/tests/google/models/dns/change_tests.rb +28 -0
- data/tests/google/models/dns/changes_tests.rb +36 -0
- data/tests/google/models/dns/projects_tests.rb +12 -0
- data/tests/google/models/dns/record_tests.rb +42 -0
- data/tests/google/models/dns/records_tests.rb +36 -0
- data/tests/google/models/dns/zone_tests.rb +28 -0
- data/tests/google/models/dns/zones_tests.rb +14 -0
- data/tests/google/requests/dns/change_tests.rb +86 -0
- data/tests/google/requests/dns/managed_zone_tests.rb +1 -1
- data/tests/google/requests/dns/project_tests.rb +29 -0
- data/tests/google/requests/dns/record_tests.rb +49 -0
- data/tests/helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +2 -2
- data/tests/opennebula/models/compute/flavor_tests.rb +29 -0
- data/tests/opennebula/models/compute/flavors_tests.rb +17 -0
- data/tests/opennebula/models/compute/network_tests.rb +2 -2
- data/tests/opennebula/models/compute/networks_tests.rb +2 -0
- data/tests/openstack/requests/storage/object_tests.rb +10 -0
- data/tests/ovirt/compute_tests.rb +1 -1
- data/tests/ovirt/requests/compute/update_volume_tests.rb +20 -0
- data/tests/rackspace/models/networking/network_tests.rb +10 -0
- data/tests/rackspace/models/networking/networks_tests.rb +10 -0
- data/tests/rackspace/models/networking/virtual_interface_tests.rb +33 -0
- data/tests/rackspace/models/networking/virtual_interfaces_tests.rb +24 -0
- data/tests/rackspace/models/queues/queue_tests.rb +9 -0
- data/tests/rackspace/networking_tests.rb +118 -0
- data/tests/rackspace/requests/networking/network_tests.rb +49 -0
- data/tests/rackspace/requests/networking/virtual_interface_tests.rb +49 -0
- data/tests/vsphere/requests/compute/list_clusters_tests.rb +11 -0
- metadata +228 -180
- data/lib/fog/bin/terremark.rb +0 -29
- data/lib/fog/bin/vmfusion.rb +0 -58
- data/lib/fog/bin/voxel.rb +0 -29
- data/lib/fog/terremark.rb +0 -11
- data/lib/fog/terremark/models/shared/address.rb +0 -25
- data/lib/fog/terremark/models/shared/addresses.rb +0 -45
- data/lib/fog/terremark/models/shared/image.rb +0 -19
- data/lib/fog/terremark/models/shared/images.rb +0 -41
- data/lib/fog/terremark/models/shared/internetservice.rb +0 -66
- data/lib/fog/terremark/models/shared/internetservices.rb +0 -39
- data/lib/fog/terremark/models/shared/network.rb +0 -31
- data/lib/fog/terremark/models/shared/networks.rb +0 -48
- data/lib/fog/terremark/models/shared/nodeservice.rb +0 -50
- data/lib/fog/terremark/models/shared/nodeservices.rb +0 -29
- data/lib/fog/terremark/models/shared/server.rb +0 -210
- data/lib/fog/terremark/models/shared/servers.rb +0 -50
- data/lib/fog/terremark/models/shared/task.rb +0 -46
- data/lib/fog/terremark/models/shared/tasks.rb +0 -54
- data/lib/fog/terremark/models/shared/vdc.rb +0 -40
- data/lib/fog/terremark/models/shared/vdcs.rb +0 -48
- data/lib/fog/terremark/parser.rb +0 -18
- data/lib/fog/terremark/parsers/shared/get_catalog.rb +0 -33
- data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +0 -32
- data/lib/fog/terremark/parsers/shared/get_internet_services.rb +0 -57
- data/lib/fog/terremark/parsers/shared/get_keys_list.rb +0 -39
- data/lib/fog/terremark/parsers/shared/get_network_ips.rb +0 -24
- data/lib/fog/terremark/parsers/shared/get_node_services.rb +0 -32
- data/lib/fog/terremark/parsers/shared/get_organization.rb +0 -50
- data/lib/fog/terremark/parsers/shared/get_organizations.rb +0 -31
- data/lib/fog/terremark/parsers/shared/get_public_ips.rb +0 -26
- data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +0 -35
- data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +0 -31
- data/lib/fog/terremark/parsers/shared/get_vdc.rb +0 -87
- data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +0 -26
- data/lib/fog/terremark/parsers/shared/internet_service.rb +0 -58
- data/lib/fog/terremark/parsers/shared/network.rb +0 -39
- data/lib/fog/terremark/parsers/shared/node_service.rb +0 -28
- data/lib/fog/terremark/parsers/shared/public_ip.rb +0 -22
- data/lib/fog/terremark/parsers/shared/task.rb +0 -25
- data/lib/fog/terremark/parsers/shared/vapp.rb +0 -61
- data/lib/fog/terremark/requests/shared/add_internet_service.rb +0 -54
- data/lib/fog/terremark/requests/shared/add_node_service.rb +0 -51
- data/lib/fog/terremark/requests/shared/configure_vapp.rb +0 -59
- data/lib/fog/terremark/requests/shared/create_internet_service.rb +0 -59
- data/lib/fog/terremark/requests/shared/delete_internet_service.rb +0 -21
- data/lib/fog/terremark/requests/shared/delete_node_service.rb +0 -21
- data/lib/fog/terremark/requests/shared/delete_public_ip.rb +0 -21
- data/lib/fog/terremark/requests/shared/delete_vapp.rb +0 -20
- data/lib/fog/terremark/requests/shared/deploy_vapp.rb +0 -33
- data/lib/fog/terremark/requests/shared/get_catalog.rb +0 -30
- data/lib/fog/terremark/requests/shared/get_catalog_item.rb +0 -33
- data/lib/fog/terremark/requests/shared/get_internet_services.rb +0 -34
- data/lib/fog/terremark/requests/shared/get_keys_list.rb +0 -34
- data/lib/fog/terremark/requests/shared/get_network.rb +0 -69
- data/lib/fog/terremark/requests/shared/get_network_ips.rb +0 -29
- data/lib/fog/terremark/requests/shared/get_node_services.rb +0 -29
- data/lib/fog/terremark/requests/shared/get_organization.rb +0 -82
- data/lib/fog/terremark/requests/shared/get_organizations.rb +0 -45
- data/lib/fog/terremark/requests/shared/get_public_ip.rb +0 -31
- data/lib/fog/terremark/requests/shared/get_public_ips.rb +0 -68
- data/lib/fog/terremark/requests/shared/get_task.rb +0 -37
- data/lib/fog/terremark/requests/shared/get_tasks_list.rb +0 -30
- data/lib/fog/terremark/requests/shared/get_vapp.rb +0 -40
- data/lib/fog/terremark/requests/shared/get_vapp_template.rb +0 -33
- data/lib/fog/terremark/requests/shared/get_vdc.rb +0 -121
- data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +0 -79
- data/lib/fog/terremark/requests/shared/power_off.rb +0 -33
- data/lib/fog/terremark/requests/shared/power_on.rb +0 -33
- data/lib/fog/terremark/requests/shared/power_reset.rb +0 -33
- data/lib/fog/terremark/requests/shared/power_shutdown.rb +0 -22
- data/lib/fog/terremark/shared.rb +0 -304
- data/lib/fog/terremark/vcloud.rb +0 -129
- data/lib/fog/vmfusion.rb +0 -1
- data/lib/fog/vmfusion/compute.rb +0 -28
- data/lib/fog/vmfusion/core.rb +0 -9
- data/lib/fog/vmfusion/models/compute/server.rb +0 -256
- data/lib/fog/vmfusion/models/compute/servers.rb +0 -36
- data/lib/fog/voxel.rb +0 -1
- data/lib/fog/voxel/compute.rb +0 -122
- data/lib/fog/voxel/core.rb +0 -16
- data/lib/fog/voxel/models/compute/image.rb +0 -13
- data/lib/fog/voxel/models/compute/images.rb +0 -27
- data/lib/fog/voxel/models/compute/server.rb +0 -73
- data/lib/fog/voxel/models/compute/servers.rb +0 -29
- data/lib/fog/voxel/parsers/compute/basic.rb +0 -27
- data/lib/fog/voxel/parsers/compute/devices_list.rb +0 -107
- data/lib/fog/voxel/parsers/compute/images_list.rb +0 -55
- data/lib/fog/voxel/parsers/compute/voxcloud_create.rb +0 -36
- data/lib/fog/voxel/parsers/compute/voxcloud_delete.rb +0 -27
- data/lib/fog/voxel/parsers/compute/voxcloud_status.rb +0 -42
- data/lib/fog/voxel/requests/compute/devices_list.rb +0 -22
- data/lib/fog/voxel/requests/compute/devices_power.rb +0 -20
- data/lib/fog/voxel/requests/compute/images_list.rb +0 -29
- data/lib/fog/voxel/requests/compute/voxcloud_create.rb +0 -20
- data/lib/fog/voxel/requests/compute/voxcloud_delete.rb +0 -18
- data/lib/fog/voxel/requests/compute/voxcloud_status.rb +0 -22
- data/lib/fog/xml.rb +0 -4
- data/lib/fog/xml/connection.rb +0 -24
- data/lib/fog/xml/sax_parser_connection.rb +0 -45
- data/tests/core/connection_tests.rb +0 -26
- data/tests/voxel/requests/compute/image_tests.rb +0 -52
- data/tests/voxel/requests/compute/server_tests.rb +0 -123
@@ -15,6 +15,8 @@ module Fog
|
|
15
15
|
@connection_draining = {}
|
16
16
|
when 'CrossZoneLoadBalancing'
|
17
17
|
@cross_zone_load_balancing = {}
|
18
|
+
when 'ConnectionSettings'
|
19
|
+
@connection_settings = {}
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
@@ -26,6 +28,8 @@ module Fog
|
|
26
28
|
elsif @connection_draining
|
27
29
|
@connection_draining['Enabled'] = value == 'true' ? true : false
|
28
30
|
end
|
31
|
+
when 'IdleTimeout'
|
32
|
+
@connection_settings['IdleTimeout'] = value.to_i
|
29
33
|
when 'Timeout'
|
30
34
|
if @connection_draining
|
31
35
|
@connection_draining['Timeout'] = value.to_i
|
@@ -36,6 +40,9 @@ module Fog
|
|
36
40
|
when 'CrossZoneLoadBalancing'
|
37
41
|
@response['DescribeLoadBalancerAttributesResult']['LoadBalancerAttributes']['CrossZoneLoadBalancing'] = @cross_zone_load_balancing
|
38
42
|
@cross_zone_load_balancing = nil
|
43
|
+
when 'ConnectionSettings'
|
44
|
+
@response['DescribeLoadBalancerAttributesResult']['LoadBalancerAttributes']['ConnectionSettings'] = @connection_settings
|
45
|
+
@connection_settings = nil
|
39
46
|
when 'RequestId'
|
40
47
|
@response['ResponseMetadata'][name] = value
|
41
48
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module Compute
|
4
|
+
module AWS
|
5
|
+
class DescribeTags < Fog::Parsers::Base
|
6
|
+
def reset
|
7
|
+
@tag = {}
|
8
|
+
@response = { 'tagSet' => [] }
|
9
|
+
end
|
10
|
+
|
11
|
+
def end_element(name)
|
12
|
+
case name
|
13
|
+
when 'resourceId', 'resourceType', 'key', 'value'
|
14
|
+
@tag[name] = value
|
15
|
+
when 'item'
|
16
|
+
@response['tagSet'] << @tag
|
17
|
+
@tag = {}
|
18
|
+
when 'requestId'
|
19
|
+
@response[name] = value
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module ELB
|
5
|
+
# parses an XML-formatted list of resource tags from AWS
|
6
|
+
class TagListParser < Fog::Parsers::Base
|
7
|
+
|
8
|
+
# each tag is modeled as a String pair (2-element Array)
|
9
|
+
def reset
|
10
|
+
@this_key = nil
|
11
|
+
@this_value = nil
|
12
|
+
@tags = Hash.new
|
13
|
+
@response = { 'DescribeTagsResult' => { 'LoadBalancers' => [] }, 'ResponseMetadata' => {} }
|
14
|
+
@in_tags = false
|
15
|
+
end
|
16
|
+
|
17
|
+
def start_element(name, attrs = [])
|
18
|
+
super
|
19
|
+
case name
|
20
|
+
when 'member'
|
21
|
+
unless @in_tags
|
22
|
+
@load_balancer_name = nil
|
23
|
+
@tags = {}
|
24
|
+
end
|
25
|
+
when 'Tags'
|
26
|
+
@in_tags = true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def end_element(name)
|
31
|
+
super
|
32
|
+
case name
|
33
|
+
when 'member'
|
34
|
+
if @in_tags
|
35
|
+
@tags[@this_key] = @this_value
|
36
|
+
@this_key, @this_value = nil, nil
|
37
|
+
else
|
38
|
+
@response['DescribeTagsResult']['LoadBalancers'] << { 'Tags' => @tags, 'LoadBalancerName' => @load_balancer_name }
|
39
|
+
end
|
40
|
+
when 'Key'
|
41
|
+
@this_key = value
|
42
|
+
when 'Value'
|
43
|
+
@this_value = value
|
44
|
+
when 'LoadBalancerName'
|
45
|
+
@load_balancer_name = value
|
46
|
+
when 'RequestId'
|
47
|
+
@response['ResponseMetadata'][name] = value
|
48
|
+
when 'Tags'
|
49
|
+
@in_tags = false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -2,9 +2,11 @@ module Fog
|
|
2
2
|
module Parsers
|
3
3
|
module Storage
|
4
4
|
module AWS
|
5
|
+
|
6
|
+
# http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETwebsite.html
|
5
7
|
class GetBucketWebsite < Fog::Parsers::Base
|
6
8
|
def reset
|
7
|
-
@response = { 'ErrorDocument' => {}, 'IndexDocument' => {} }
|
9
|
+
@response = { 'ErrorDocument' => {}, 'IndexDocument' => {}, 'RedirectAllRequestsTo' => {} }
|
8
10
|
end
|
9
11
|
|
10
12
|
def end_element(name)
|
@@ -13,6 +15,8 @@ module Fog
|
|
13
15
|
@response['ErrorDocument'][name] = value
|
14
16
|
when 'Suffix'
|
15
17
|
@response['IndexDocument'][name] = value
|
18
|
+
when 'HostName'
|
19
|
+
@response['RedirectAllRequestsTo'][name] = value
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
data/lib/fog/aws/rds.rb
CHANGED
@@ -115,7 +115,7 @@ module Fog
|
|
115
115
|
@use_iam_profile = options[:use_iam_profile]
|
116
116
|
@region = options[:region] || 'us-east-1'
|
117
117
|
|
118
|
-
unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region)
|
118
|
+
unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-central-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region)
|
119
119
|
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
120
120
|
end
|
121
121
|
end
|
@@ -157,7 +157,6 @@ module Fog
|
|
157
157
|
# * ELB object with connection to AWS.
|
158
158
|
def initialize(options={})
|
159
159
|
@use_iam_profile = options[:use_iam_profile]
|
160
|
-
setup_credentials(options)
|
161
160
|
@instrumentor = options[:instrumentor]
|
162
161
|
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.rds'
|
163
162
|
@connection_options = options[:connection_options] || {}
|
@@ -170,6 +169,8 @@ module Fog
|
|
170
169
|
@scheme = options[:scheme] || 'https'
|
171
170
|
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
|
172
171
|
@version = options[:version] || '2013-05-15'
|
172
|
+
|
173
|
+
setup_credentials(options)
|
173
174
|
end
|
174
175
|
|
175
176
|
def owner_id
|
@@ -188,7 +189,7 @@ module Fog
|
|
188
189
|
@aws_session_token = options[:aws_session_token]
|
189
190
|
@aws_credentials_expire_at = options[:aws_credentials_expire_at]
|
190
191
|
|
191
|
-
@
|
192
|
+
@signer = Fog::AWS::SignatureV4.new( @aws_access_key_id, @aws_secret_access_key,@region,'rds')
|
192
193
|
end
|
193
194
|
|
194
195
|
def request(params)
|
@@ -197,33 +198,34 @@ module Fog
|
|
197
198
|
idempotent = params.delete(:idempotent)
|
198
199
|
parser = params.delete(:parser)
|
199
200
|
|
200
|
-
body = Fog::AWS.
|
201
|
+
body, headers = Fog::AWS.signed_params_v4(
|
201
202
|
params,
|
203
|
+
{'Content-Type' => 'application/x-www-form-urlencoded' },
|
202
204
|
{
|
203
|
-
:aws_access_key_id => @aws_access_key_id,
|
204
205
|
:aws_session_token => @aws_session_token,
|
205
|
-
:
|
206
|
+
:signer => @signer,
|
206
207
|
:host => @host,
|
207
208
|
:path => @path,
|
208
209
|
:port => @port,
|
209
|
-
:version => @version
|
210
|
+
:version => @version,
|
211
|
+
:method => 'POST'
|
210
212
|
}
|
211
213
|
)
|
212
214
|
|
213
215
|
if @instrumentor
|
214
216
|
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
215
|
-
_request(body, idempotent, parser)
|
217
|
+
_request(body, headers, idempotent, parser)
|
216
218
|
end
|
217
219
|
else
|
218
|
-
_request(body, idempotent, parser)
|
220
|
+
_request(body, headers, idempotent, parser)
|
219
221
|
end
|
220
222
|
end
|
221
223
|
|
222
|
-
def _request(body, idempotent, parser)
|
224
|
+
def _request(body, headers, idempotent, parser)
|
223
225
|
@connection.request({
|
224
226
|
:body => body,
|
225
227
|
:expects => 200,
|
226
|
-
:headers =>
|
228
|
+
:headers => headers,
|
227
229
|
:idempotent => idempotent,
|
228
230
|
:method => 'POST',
|
229
231
|
:parser => parser
|
@@ -2,7 +2,7 @@ module Fog
|
|
2
2
|
module AWS
|
3
3
|
module RegionMethods
|
4
4
|
def validate_aws_region host, region
|
5
|
-
if host.end_with?('.amazonaws.com')
|
5
|
+
if host.end_with?('.amazonaws.com') && !['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1', 'us-gov-west-1', 'eu-central-1'].include?(region)
|
6
6
|
raise ArgumentError, "Unknown region: #{region.inspect}"
|
7
7
|
end
|
8
8
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class ELB
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# adds tags to a load balancer instance
|
7
|
+
# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_AddTags.html
|
8
|
+
# ==== Parameters
|
9
|
+
# * elb_id <~String> - name of the ELB instance to be tagged
|
10
|
+
# * tags <~Hash> A Hash of (String) key-value pairs
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
def add_tags(elb_id, tags)
|
15
|
+
keys = tags.keys.sort
|
16
|
+
values = keys.map {|key| tags[key]}
|
17
|
+
request({
|
18
|
+
'Action' => 'AddTags',
|
19
|
+
'LoadBalancerNames.member.1' => elb_id,
|
20
|
+
:parser => Fog::Parsers::AWS::ELB::Empty.new,
|
21
|
+
}.merge(Fog::AWS.indexed_param('Tags.member.%d.Key', keys)).
|
22
|
+
merge(Fog::AWS.indexed_param('Tags.member.%d.Value', values)))
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
class Mock
|
28
|
+
|
29
|
+
def add_tags(elb_id, tags)
|
30
|
+
response = Excon::Response.new
|
31
|
+
if server = self.data[:load_balancers][elb_id]
|
32
|
+
self.data[:tags][elb_id].merge! tags
|
33
|
+
response.status = 200
|
34
|
+
response.body = {
|
35
|
+
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id }
|
36
|
+
}
|
37
|
+
response
|
38
|
+
else
|
39
|
+
raise Fog::AWS::ELB::NotFound.new("Elastic load balancer #{elb_id} not found")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -146,6 +146,8 @@ module Fog
|
|
146
146
|
|
147
147
|
default_sg
|
148
148
|
end
|
149
|
+
self.data[:tags] ||= {}
|
150
|
+
self.data[:tags][lb_name] = {}
|
149
151
|
|
150
152
|
self.data[:load_balancers][lb_name] = {
|
151
153
|
'AvailabilityZones' => availability_zones,
|
@@ -172,7 +174,8 @@ module Fog
|
|
172
174
|
'ListenerDescriptions' => listeners,
|
173
175
|
'LoadBalancerAttributes' => {
|
174
176
|
'ConnectionDraining' => {'Enabled' => false, 'Timeout' => 300},
|
175
|
-
'CrossZoneLoadBalancing' => {'Enabled' => false}
|
177
|
+
'CrossZoneLoadBalancing' => {'Enabled' => false},
|
178
|
+
'ConnectionSettings' => {'IdleTimeout' => 60}
|
176
179
|
},
|
177
180
|
'LoadBalancerName' => lb_name,
|
178
181
|
'Policies' => {
|
@@ -21,6 +21,9 @@ module Fog
|
|
21
21
|
# * 'Timeout'<~Integer> - max time (in seconds) to keep existing conns open before deregistering instances.
|
22
22
|
# * 'CrossZoneLoadBalancing'<~Hash>
|
23
23
|
# * 'Enabled'<~Boolean> - whether crosszone load balancing is enabled
|
24
|
+
# * 'ConnectionSettings'<~Hash>
|
25
|
+
# * 'IdleTimeout'<~Integer> - time (in seconds) the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer.
|
26
|
+
|
24
27
|
def describe_load_balancer_attributes(lb_name)
|
25
28
|
request({
|
26
29
|
'Action' => 'DescribeLoadBalancerAttributes',
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class ELB
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/elb/tag_list_parser'
|
7
|
+
|
8
|
+
# returns a Hash of tags for a load balancer
|
9
|
+
# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_DescribeTags.html
|
10
|
+
# ==== Parameters
|
11
|
+
# * elb_id <~String> - name(s) of the ELB instance whose tags are to be retrieved (allows 1-20 of them)
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
def describe_tags(elb_ids)
|
16
|
+
request({
|
17
|
+
'Action' => 'DescribeTags',
|
18
|
+
:parser => Fog::Parsers::AWS::ELB::TagListParser.new
|
19
|
+
}.merge(Fog::AWS.indexed_param('LoadBalancerNames.member.%d', elb_ids))
|
20
|
+
)
|
21
|
+
end
|
22
|
+
# def describe_tags(filters = {})
|
23
|
+
# params = Fog::AWS.indexed_filters(filters)
|
24
|
+
# request({
|
25
|
+
# 'Action' => 'DescribeTags',
|
26
|
+
# :idempotent => true,
|
27
|
+
# :parser => Fog::Parsers::Compute::AWS::DescribeTags.new
|
28
|
+
# }.merge!(params))
|
29
|
+
# end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
class Mock
|
34
|
+
|
35
|
+
def describe_tags(elb_id)
|
36
|
+
response = Excon::Response.new
|
37
|
+
|
38
|
+
if server = self.data[:load_balancers][elb_id]
|
39
|
+
response.status = 200
|
40
|
+
##{"DescribeTagsResult"=>{"LoadBalancers"=>[{"Tags"=>{"Name"=>"2esakowski-test-opsworks-elb"}, "LoadBalancerName"=>"esakowski-test-opsworks"}]}}
|
41
|
+
response.body = {"DescribeTagsResult"=>{"LoadBalancers"=>[{"Tags"=>self.data[:tags][elb_id], "LoadBalancerName"=>elb_id}]}}
|
42
|
+
|
43
|
+
# response.body = {
|
44
|
+
# "DescribeTagsResult" =>
|
45
|
+
# {"TagDescriptions" => self.data[:tags][elb_id]}
|
46
|
+
# }
|
47
|
+
response
|
48
|
+
else
|
49
|
+
raise Fog::AWS::ELB::NotFound.new("Elastic load balancer #{elb_id} not found")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -6,8 +6,12 @@ module Fog
|
|
6
6
|
|
7
7
|
# Sets attributes of the load balancer
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# The following attributes can be set:
|
10
|
+
# * CrossZoneLoadBalancing (enable/disable)
|
11
|
+
# * ConnectionDraining (enable/disable and timeout)
|
12
|
+
# * Idle Connection Timeouts
|
13
|
+
#
|
14
|
+
# Still requires: AccessLog configuration
|
11
15
|
#
|
12
16
|
# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_ModifyLoadBalancerAttributes.html
|
13
17
|
# ==== Parameters
|
@@ -18,6 +22,8 @@ module Fog
|
|
18
22
|
# * 'Timeout'<~Integer> max time to keep existing conns open before deregistering instances
|
19
23
|
# * 'CrossZoneLoadBalancing'<~Hash>:
|
20
24
|
# * 'Enabled'<~Boolean> whether to enable cross zone load balancing
|
25
|
+
# * 'ConnectionSettings'<~Hash>:
|
26
|
+
# * 'IdleTimeout'<~Integer> time (in seconds) the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer.
|
21
27
|
#
|
22
28
|
# ==== Returns
|
23
29
|
# * response<~Excon::Response>:
|
@@ -38,7 +44,7 @@ module Fog
|
|
38
44
|
def modify_load_balancer_attributes(lb_name, attributes)
|
39
45
|
raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name]
|
40
46
|
|
41
|
-
if attributes['CrossZoneLoadBalancing'] || attributes['ConnectionDraining']
|
47
|
+
if attributes['CrossZoneLoadBalancing'] || attributes['ConnectionDraining'] || attributes['ConnectionSettings']
|
42
48
|
load_balancer['LoadBalancerAttributes'].merge! attributes
|
43
49
|
end
|
44
50
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class ELB
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# removes tags from an elastic load balancer instance
|
7
|
+
# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_RemoveTags.html
|
8
|
+
# ==== Parameters
|
9
|
+
# * elb_id <~String> - name of the ELB instance whose tags are to be retrieved
|
10
|
+
# * keys <~Array> A list of String keys for the tags to remove
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
def remove_tags(elb_id, keys)
|
15
|
+
request(
|
16
|
+
{ 'Action' => 'RemoveTags',
|
17
|
+
# Note: there is a discrepancy in the API docs in the ID parameter name between the write-up and the example.
|
18
|
+
# Who knows which way the fix will go, if any is ever made? In any case, this works.
|
19
|
+
'LoadBalancerNames.member.1' => elb_id,
|
20
|
+
:parser => Fog::Parsers::AWS::ELB::Empty.new,
|
21
|
+
}.merge(Fog::AWS.indexed_param('Tags.member.%d.Key', keys))
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
class Mock
|
28
|
+
|
29
|
+
def remove_tags(elb_id, keys)
|
30
|
+
response = Excon::Response.new
|
31
|
+
if server = self.data[:load_balancers][elb_id]
|
32
|
+
keys.each {|key| self.data[:tags][elb_id].delete key}
|
33
|
+
response.status = 200
|
34
|
+
response.body = {
|
35
|
+
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id }
|
36
|
+
}
|
37
|
+
response
|
38
|
+
else
|
39
|
+
raise Fog::AWS::ELB::NotFound.new("Elastic load balancer #{elb_id} not found")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -28,7 +28,7 @@ module Fog
|
|
28
28
|
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectCOPY.html
|
29
29
|
#
|
30
30
|
def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {})
|
31
|
-
headers = { 'x-amz-copy-source' => "/#{source_bucket_name}
|
31
|
+
headers = { 'x-amz-copy-source' => "/#{source_bucket_name}#{object_to_path(source_object_name)}" }.merge!(options)
|
32
32
|
request({
|
33
33
|
:expects => 200,
|
34
34
|
:headers => headers,
|