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
data/lib/fog/aws/elb.rb
CHANGED
@@ -44,6 +44,9 @@ module Fog
|
|
44
44
|
request :detach_load_balancer_from_subnets
|
45
45
|
request :apply_security_groups_to_load_balancer
|
46
46
|
request :set_load_balancer_policies_for_backend_server
|
47
|
+
request :add_tags
|
48
|
+
request :describe_tags
|
49
|
+
request :remove_tags
|
47
50
|
|
48
51
|
model_path 'fog/aws/models/elb'
|
49
52
|
model :load_balancer
|
@@ -81,11 +84,11 @@ module Fog
|
|
81
84
|
|
82
85
|
def initialize(options={})
|
83
86
|
@use_iam_profile = options[:use_iam_profile]
|
84
|
-
setup_credentials(options)
|
85
87
|
|
86
88
|
@region = options[:region] || 'us-east-1'
|
89
|
+
setup_credentials(options)
|
87
90
|
|
88
|
-
unless ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region)
|
91
|
+
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)
|
89
92
|
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
90
93
|
end
|
91
94
|
end
|
@@ -93,6 +96,9 @@ module Fog
|
|
93
96
|
def setup_credentials(options)
|
94
97
|
@aws_access_key_id = options[:aws_access_key_id]
|
95
98
|
@aws_secret_access_key = options[:aws_secret_access_key]
|
99
|
+
|
100
|
+
@signer = Fog::AWS::SignatureV4.new( @aws_access_key_id, @aws_secret_access_key,@region,'elasticloadbalancing')
|
101
|
+
|
96
102
|
end
|
97
103
|
|
98
104
|
def data
|
@@ -125,21 +131,23 @@ module Fog
|
|
125
131
|
# ==== Returns
|
126
132
|
# * ELB object with connection to AWS.
|
127
133
|
def initialize(options={})
|
128
|
-
require 'fog/core/parser'
|
129
134
|
|
130
135
|
@use_iam_profile = options[:use_iam_profile]
|
131
|
-
setup_credentials(options)
|
132
136
|
@connection_options = options[:connection_options] || {}
|
133
137
|
@instrumentor = options[:instrumentor]
|
134
138
|
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.elb'
|
135
139
|
|
136
140
|
options[:region] ||= 'us-east-1'
|
137
|
-
@
|
141
|
+
@region = options[:region]
|
142
|
+
@host = options[:host] || "elasticloadbalancing.#{@region}.amazonaws.com"
|
138
143
|
@path = options[:path] || '/'
|
139
144
|
@persistent = options[:persistent] || false
|
140
145
|
@port = options[:port] || 443
|
141
146
|
@scheme = options[:scheme] || 'https'
|
142
147
|
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
|
148
|
+
|
149
|
+
setup_credentials(options)
|
150
|
+
|
143
151
|
end
|
144
152
|
|
145
153
|
def reload
|
@@ -154,7 +162,7 @@ module Fog
|
|
154
162
|
@aws_session_token = options[:aws_session_token]
|
155
163
|
@aws_credentials_expire_at = options[:aws_credentials_expire_at]
|
156
164
|
|
157
|
-
@
|
165
|
+
@signer = Fog::AWS::SignatureV4.new( @aws_access_key_id, @aws_secret_access_key,@region,'elasticloadbalancing')
|
158
166
|
end
|
159
167
|
|
160
168
|
def request(params)
|
@@ -163,33 +171,34 @@ module Fog
|
|
163
171
|
idempotent = params.delete(:idempotent)
|
164
172
|
parser = params.delete(:parser)
|
165
173
|
|
166
|
-
body = Fog::AWS.
|
174
|
+
body, headers = Fog::AWS.signed_params_v4(
|
167
175
|
params,
|
176
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded' },
|
168
177
|
{
|
169
|
-
:aws_access_key_id => @aws_access_key_id,
|
170
178
|
:aws_session_token => @aws_session_token,
|
171
|
-
:
|
179
|
+
:signer => @signer,
|
172
180
|
:host => @host,
|
173
181
|
:path => @path,
|
174
182
|
:port => @port,
|
175
|
-
:version => '2012-06-01'
|
183
|
+
:version => '2012-06-01',
|
184
|
+
:method => 'POST'
|
176
185
|
}
|
177
186
|
)
|
178
187
|
|
179
188
|
if @instrumentor
|
180
189
|
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
181
|
-
_request(body, idempotent, parser)
|
190
|
+
_request(body, headers, idempotent, parser)
|
182
191
|
end
|
183
192
|
else
|
184
|
-
_request(body, idempotent, parser)
|
193
|
+
_request(body, headers, idempotent, parser)
|
185
194
|
end
|
186
195
|
end
|
187
196
|
|
188
|
-
def _request(body, idempotent, parser)
|
197
|
+
def _request(body, headers, idempotent, parser)
|
189
198
|
@connection.request({
|
190
199
|
:body => body,
|
191
200
|
:expects => 200,
|
192
|
-
:headers =>
|
201
|
+
:headers => headers,
|
193
202
|
:idempotent => idempotent,
|
194
203
|
:method => 'POST',
|
195
204
|
:parser => parser
|
data/lib/fog/aws/emr.rb
CHANGED
@@ -62,7 +62,6 @@ module Fog
|
|
62
62
|
# * EMR object with connection to AWS.
|
63
63
|
def initialize(options={})
|
64
64
|
@use_iam_profile = options[:use_iam_profile]
|
65
|
-
setup_credentials(options)
|
66
65
|
@connection_options = options[:connection_options] || {}
|
67
66
|
@instrumentor = options[:instrumentor]
|
68
67
|
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.emr'
|
@@ -74,7 +73,9 @@ module Fog
|
|
74
73
|
@port = options[:port] || 443
|
75
74
|
@scheme = options[:scheme] || 'https'
|
76
75
|
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
|
76
|
+
|
77
77
|
@region = options[:region]
|
78
|
+
setup_credentials(options)
|
78
79
|
end
|
79
80
|
|
80
81
|
def reload
|
@@ -89,7 +90,7 @@ module Fog
|
|
89
90
|
@aws_session_token = options[:aws_session_token]
|
90
91
|
@aws_credentials_expire_at = options[:aws_credentials_expire_at]
|
91
92
|
|
92
|
-
@
|
93
|
+
@signer = Fog::AWS::SignatureV4.new( @aws_access_key_id, @aws_secret_access_key, @region, 'elasticmapreduce')
|
93
94
|
end
|
94
95
|
|
95
96
|
def request(params)
|
@@ -98,12 +99,13 @@ module Fog
|
|
98
99
|
idempotent = params.delete(:idempotent)
|
99
100
|
parser = params.delete(:parser)
|
100
101
|
|
101
|
-
body = Fog::AWS.
|
102
|
+
body, headers = Fog::AWS.signed_params_v4(
|
102
103
|
params,
|
104
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded' },
|
103
105
|
{
|
104
|
-
:
|
106
|
+
:signer => @signer,
|
105
107
|
:aws_session_token => @aws_session_token,
|
106
|
-
:
|
108
|
+
:method => 'POST',
|
107
109
|
:host => @host,
|
108
110
|
:path => @path,
|
109
111
|
:port => @port,
|
@@ -113,18 +115,18 @@ module Fog
|
|
113
115
|
|
114
116
|
if @instrumentor
|
115
117
|
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
116
|
-
_request(body, idempotent, parser)
|
118
|
+
_request(body, headers, idempotent, parser)
|
117
119
|
end
|
118
120
|
else
|
119
|
-
_request(body, idempotent, parser)
|
121
|
+
_request(body, headers, idempotent, parser)
|
120
122
|
end
|
121
123
|
end
|
122
124
|
|
123
|
-
def _request(body, idempotent, parser)
|
125
|
+
def _request(body, headers, idempotent, parser)
|
124
126
|
@connection.request({
|
125
127
|
:body => body,
|
126
128
|
:expects => 200,
|
127
|
-
:headers =>
|
129
|
+
:headers => headers,
|
128
130
|
:idempotent => idempotent,
|
129
131
|
:method => 'POST',
|
130
132
|
:parser => parser
|
data/lib/fog/aws/iam.rb
CHANGED
@@ -173,10 +173,8 @@ module Fog
|
|
173
173
|
# ==== Returns
|
174
174
|
# * IAM object with connection to AWS.
|
175
175
|
def initialize(options={})
|
176
|
-
require 'fog/core/parser'
|
177
176
|
|
178
177
|
@use_iam_profile = options[:use_iam_profile]
|
179
|
-
setup_credentials(options)
|
180
178
|
@connection_options = options[:connection_options] || {}
|
181
179
|
@instrumentor = options[:instrumentor]
|
182
180
|
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.iam'
|
@@ -186,6 +184,9 @@ module Fog
|
|
186
184
|
@port = options[:port] || 443
|
187
185
|
@scheme = options[:scheme] || 'https'
|
188
186
|
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
|
187
|
+
|
188
|
+
setup_credentials(options)
|
189
|
+
|
189
190
|
end
|
190
191
|
|
191
192
|
def reload
|
@@ -200,7 +201,8 @@ module Fog
|
|
200
201
|
@aws_session_token = options[:aws_session_token]
|
201
202
|
@aws_credentials_expire_at = options[:aws_credentials_expire_at]
|
202
203
|
|
203
|
-
|
204
|
+
#global services that have no region are signed with the us-east-1 region
|
205
|
+
@signer = Fog::AWS::SignatureV4.new( @aws_access_key_id, @aws_secret_access_key,'us-east-1','iam')
|
204
206
|
end
|
205
207
|
|
206
208
|
def request(params)
|
@@ -208,34 +210,35 @@ module Fog
|
|
208
210
|
idempotent = params.delete(:idempotent)
|
209
211
|
parser = params.delete(:parser)
|
210
212
|
|
211
|
-
body = Fog::AWS.
|
213
|
+
body, headers = Fog::AWS.signed_params_v4(
|
212
214
|
params,
|
215
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded' },
|
213
216
|
{
|
214
|
-
:
|
217
|
+
:signer => @signer,
|
215
218
|
:aws_session_token => @aws_session_token,
|
216
|
-
:hmac => @hmac,
|
217
219
|
:host => @host,
|
218
220
|
:path => @path,
|
219
221
|
:port => @port,
|
220
|
-
:version => '2010-05-08'
|
222
|
+
:version => '2010-05-08',
|
223
|
+
:method => 'POST'
|
221
224
|
}
|
222
225
|
)
|
223
226
|
|
224
227
|
if @instrumentor
|
225
228
|
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
226
|
-
_request(body, idempotent, parser)
|
229
|
+
_request(body, headers, idempotent, parser)
|
227
230
|
end
|
228
231
|
else
|
229
|
-
_request(body, idempotent, parser)
|
232
|
+
_request(body, headers, idempotent, parser)
|
230
233
|
end
|
231
234
|
end
|
232
235
|
|
233
|
-
def _request(body, idempotent, parser)
|
236
|
+
def _request(body, headers, idempotent, parser)
|
234
237
|
@connection.request({
|
235
238
|
:body => body,
|
236
239
|
:expects => 200,
|
237
240
|
:idempotent => idempotent,
|
238
|
-
:headers =>
|
241
|
+
:headers => headers,
|
239
242
|
:method => 'POST',
|
240
243
|
:parser => parser
|
241
244
|
})
|
@@ -11,6 +11,7 @@ module Fog
|
|
11
11
|
attribute :ip_permissions_egress, :aliases => 'ipPermissionsEgress'
|
12
12
|
attribute :owner_id, :aliases => 'ownerId'
|
13
13
|
attribute :vpc_id, :aliases => 'vpcId'
|
14
|
+
attribute :tags, :aliases => 'tagSet'
|
14
15
|
|
15
16
|
# Authorize access by another security group
|
16
17
|
#
|
@@ -220,6 +221,36 @@ module Fog
|
|
220
221
|
)
|
221
222
|
end
|
222
223
|
|
224
|
+
# Reload a security group
|
225
|
+
#
|
226
|
+
# >> g = AWS.security_groups.get(:name => "some_name")
|
227
|
+
# >> g.reload
|
228
|
+
#
|
229
|
+
# == Returns:
|
230
|
+
#
|
231
|
+
# Up to date model or an exception
|
232
|
+
|
233
|
+
def reload
|
234
|
+
if group_id.nil?
|
235
|
+
super
|
236
|
+
service.delete_security_group(name)
|
237
|
+
else
|
238
|
+
requires :group_id
|
239
|
+
|
240
|
+
data = begin
|
241
|
+
collection.get_by_id(group_id)
|
242
|
+
rescue Excon::Errors::SocketError
|
243
|
+
nil
|
244
|
+
end
|
245
|
+
|
246
|
+
return unless data
|
247
|
+
|
248
|
+
merge_attributes(data.attributes)
|
249
|
+
self
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
|
223
254
|
# Create a security group
|
224
255
|
#
|
225
256
|
# >> g = AWS.security_groups.new(:name => "some_name", :description => "something")
|
@@ -236,6 +267,16 @@ module Fog
|
|
236
267
|
data = service.create_security_group(name, description, vpc_id).body
|
237
268
|
new_attributes = data.reject {|key,value| key == 'requestId'}
|
238
269
|
merge_attributes(new_attributes)
|
270
|
+
|
271
|
+
if tags = self.tags
|
272
|
+
# expect eventual consistency
|
273
|
+
Fog.wait_for { self.reload rescue nil }
|
274
|
+
service.create_tags(
|
275
|
+
self.group_id,
|
276
|
+
tags
|
277
|
+
)
|
278
|
+
end
|
279
|
+
|
239
280
|
true
|
240
281
|
end
|
241
282
|
|
@@ -16,6 +16,7 @@ module Fog
|
|
16
16
|
attribute :security_groups, :aliases => 'SecurityGroups'
|
17
17
|
attribute :scheme, :aliases => 'Scheme'
|
18
18
|
attribute :vpc_id, :aliases => 'VPCId'
|
19
|
+
attribute :tags, :aliases => 'tagSet'
|
19
20
|
|
20
21
|
def initialize(attributes={})
|
21
22
|
if attributes[:subnet_ids] ||= attributes['Subnets']
|
@@ -60,6 +61,17 @@ module Fog
|
|
60
61
|
service.modify_load_balancer_attributes(id, 'CrossZoneLoadBalancing' => {'Enabled' => value})
|
61
62
|
end
|
62
63
|
|
64
|
+
def connection_settings_idle_timeout
|
65
|
+
requires :id
|
66
|
+
service.describe_load_balancer_attributes(id).body['DescribeLoadBalancerAttributesResult']['LoadBalancerAttributes']['ConnectionSettings']['IdleTimeout']
|
67
|
+
end
|
68
|
+
|
69
|
+
def set_connection_settings_idle_timeout(timeout=60)
|
70
|
+
requires :id
|
71
|
+
attrs = {'IdleTimeout' => timeout}
|
72
|
+
service.modify_load_balancer_attributes(id,'ConnectionSettings' => attrs)
|
73
|
+
end
|
74
|
+
|
63
75
|
def register_instances(instances)
|
64
76
|
requires :id
|
65
77
|
data = service.register_instances_with_load_balancer(instances, id).body['RegisterInstancesWithLoadBalancerResult']
|
@@ -174,6 +186,25 @@ module Fog
|
|
174
186
|
true
|
175
187
|
end
|
176
188
|
|
189
|
+
def tags
|
190
|
+
requires :id
|
191
|
+
service.describe_tags(id).
|
192
|
+
body['DescribeTagsResult']["LoadBalancers"][0]["Tags"]
|
193
|
+
|
194
|
+
end
|
195
|
+
def add_tags(new_tags)
|
196
|
+
requires :id
|
197
|
+
service.add_tags(id, new_tags)
|
198
|
+
tags
|
199
|
+
end
|
200
|
+
|
201
|
+
def remove_tags(tag_keys)
|
202
|
+
requires :id
|
203
|
+
service.remove_tags(id, tag_keys)
|
204
|
+
tags
|
205
|
+
end
|
206
|
+
|
207
|
+
|
177
208
|
def save
|
178
209
|
requires :id
|
179
210
|
requires :listeners
|
@@ -44,7 +44,9 @@ module Fog
|
|
44
44
|
|
45
45
|
hash = Fog::AWS::Glacier::TreeHash.new
|
46
46
|
|
47
|
-
|
47
|
+
if body.respond_to?(:rewind)
|
48
|
+
body.rewind rescue nil
|
49
|
+
end
|
48
50
|
offset = 0
|
49
51
|
while (chunk = body.read(multipart_chunk_size)) do
|
50
52
|
part_hash = hash.add_part(chunk)
|
@@ -17,7 +17,7 @@ module Fog
|
|
17
17
|
requires :rolename
|
18
18
|
requires :assume_role_policy_document
|
19
19
|
|
20
|
-
data = service.create_role(rolename, assume_role_policy_document).body["Role"]
|
20
|
+
data = service.create_role(rolename, assume_role_policy_document, path).body["Role"]
|
21
21
|
merge_attributes(data)
|
22
22
|
true
|
23
23
|
end
|
@@ -20,7 +20,7 @@ module Fog
|
|
20
20
|
role = nil
|
21
21
|
begin
|
22
22
|
role = service.roles.new( service.get_role( identity ).data[:body]["Role"] )
|
23
|
-
rescue Excon::Errors::NotFound # ignore not found error
|
23
|
+
rescue Excon::Errors::NotFound, Fog::AWS::IAM::NotFound # ignore not found error
|
24
24
|
end
|
25
25
|
role
|
26
26
|
end
|
@@ -8,8 +8,9 @@ module Fog
|
|
8
8
|
@ip_permission = { 'groups' => [], 'ipRanges' => []}
|
9
9
|
@ip_permission_egress = { 'groups' => [], 'ipRanges' => []}
|
10
10
|
@ip_range = {}
|
11
|
-
@security_group = { 'ipPermissions' => [], 'ipPermissionsEgress' => [] }
|
11
|
+
@security_group = { 'ipPermissions' => [], 'ipPermissionsEgress' => [], 'tagSet' => {} }
|
12
12
|
@response = { 'securityGroupInfo' => [] }
|
13
|
+
@tag = {}
|
13
14
|
end
|
14
15
|
|
15
16
|
def start_element(name, attrs = [])
|
@@ -23,70 +24,84 @@ module Fog
|
|
23
24
|
@in_ip_permissions_egress = true
|
24
25
|
when 'ipRanges'
|
25
26
|
@in_ip_ranges = true
|
27
|
+
when 'tagSet'
|
28
|
+
@in_tag_set = true
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
29
32
|
def end_element(name)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
when 'groups'
|
40
|
-
@in_groups = false
|
41
|
-
when 'groupDescription', 'ownerId', 'vpcId'
|
42
|
-
@security_group[name] = value
|
43
|
-
when 'groupId','groupName'
|
44
|
-
if @in_groups
|
45
|
-
@group[name] = value
|
46
|
-
else
|
47
|
-
@security_group[name] = value
|
48
|
-
end
|
49
|
-
when 'ipPermissions'
|
50
|
-
@in_ip_permissions = false
|
51
|
-
when 'ipPermissionsEgress'
|
52
|
-
@in_ip_permissions_egress = false
|
53
|
-
when 'ipProtocol'
|
54
|
-
if @in_ip_permissions_egress
|
55
|
-
@ip_permission_egress[name] = value
|
56
|
-
else
|
57
|
-
@ip_permission[name] = value
|
33
|
+
if @in_tag_set
|
34
|
+
case name
|
35
|
+
when 'item'
|
36
|
+
@security_group['tagSet'][@tag['key']] = @tag['value']
|
37
|
+
@tag = {}
|
38
|
+
when 'key', 'value'
|
39
|
+
@tag[name] = value
|
40
|
+
when 'tagSet'
|
41
|
+
@in_tag_set = false
|
58
42
|
end
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
43
|
+
else
|
44
|
+
case name
|
45
|
+
when 'cidrIp'
|
46
|
+
@ip_range[name] = value
|
47
|
+
when 'fromPort', 'toPort'
|
63
48
|
if @in_ip_permissions_egress
|
64
|
-
@ip_permission_egress[
|
49
|
+
@ip_permission_egress[name] = value.to_i
|
50
|
+
else
|
51
|
+
@ip_permission[name] = value.to_i
|
52
|
+
end
|
53
|
+
when 'groups'
|
54
|
+
@in_groups = false
|
55
|
+
when 'groupDescription', 'ownerId', 'vpcId'
|
56
|
+
@security_group[name] = value
|
57
|
+
when 'groupId','groupName'
|
58
|
+
if @in_groups
|
59
|
+
@group[name] = value
|
65
60
|
else
|
66
|
-
@
|
61
|
+
@security_group[name] = value
|
67
62
|
end
|
68
|
-
|
69
|
-
|
63
|
+
when 'ipPermissions'
|
64
|
+
@in_ip_permissions = false
|
65
|
+
when 'ipPermissionsEgress'
|
66
|
+
@in_ip_permissions_egress = false
|
67
|
+
when 'ipProtocol'
|
70
68
|
if @in_ip_permissions_egress
|
71
|
-
@ip_permission_egress[
|
69
|
+
@ip_permission_egress[name] = value
|
72
70
|
else
|
73
|
-
@ip_permission[
|
71
|
+
@ip_permission[name] = value
|
74
72
|
end
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
@
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
73
|
+
when 'ipRanges'
|
74
|
+
@in_ip_ranges = false
|
75
|
+
when 'item'
|
76
|
+
if @in_groups
|
77
|
+
if @in_ip_permissions_egress
|
78
|
+
@ip_permission_egress['groups'] << @group
|
79
|
+
else
|
80
|
+
@ip_permission['groups'] << @group
|
81
|
+
end
|
82
|
+
@group = {}
|
83
|
+
elsif @in_ip_ranges
|
84
|
+
if @in_ip_permissions_egress
|
85
|
+
@ip_permission_egress['ipRanges'] << @ip_range
|
86
|
+
else
|
87
|
+
@ip_permission['ipRanges'] << @ip_range
|
88
|
+
end
|
89
|
+
@ip_range = {}
|
90
|
+
elsif @in_ip_permissions
|
91
|
+
@security_group['ipPermissions'] << @ip_permission
|
92
|
+
@ip_permission = { 'groups' => [], 'ipRanges' => []}
|
93
|
+
elsif @in_ip_permissions_egress
|
94
|
+
@security_group['ipPermissionsEgress'] << @ip_permission_egress
|
95
|
+
@ip_permission_egress = { 'groups' => [], 'ipRanges' => []}
|
96
|
+
else
|
97
|
+
@response['securityGroupInfo'] << @security_group
|
98
|
+
@security_group = { 'ipPermissions' => [], 'ipPermissionsEgress' => [], 'tagSet' => {} }
|
99
|
+
end
|
100
|
+
when 'requestId'
|
101
|
+
@response[name] = value
|
102
|
+
when 'userId'
|
103
|
+
@group[name] = value
|
85
104
|
end
|
86
|
-
when 'requestId'
|
87
|
-
@response[name] = value
|
88
|
-
when 'userId'
|
89
|
-
@group[name] = value
|
90
105
|
end
|
91
106
|
end
|
92
107
|
end
|