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/sts.rb
CHANGED
@@ -72,7 +72,6 @@ module Fog
|
|
72
72
|
# ==== Returns
|
73
73
|
# * STS object with connection to AWS.
|
74
74
|
def initialize(options={})
|
75
|
-
require 'fog/core/parser'
|
76
75
|
|
77
76
|
@use_iam_profile = options[:use_iam_profile]
|
78
77
|
setup_credentials(options)
|
@@ -99,19 +98,21 @@ module Fog
|
|
99
98
|
@aws_secret_access_key = options[:aws_secret_access_key]
|
100
99
|
@aws_session_token = options[:aws_session_token]
|
101
100
|
@aws_credentials_expire_at = options[:aws_credentials_expire_at]
|
102
|
-
|
101
|
+
|
102
|
+
@signer = Fog::AWS::SignatureV4.new(@aws_access_key_id, @aws_secret_access_key, 'us-east-1', 'sts')
|
103
103
|
end
|
104
104
|
|
105
105
|
def request(params)
|
106
106
|
idempotent = params.delete(:idempotent)
|
107
107
|
parser = params.delete(:parser)
|
108
108
|
|
109
|
-
body = Fog::AWS.
|
109
|
+
body, headers = Fog::AWS.signed_params_v4(
|
110
110
|
params,
|
111
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded' },
|
111
112
|
{
|
112
|
-
:
|
113
|
+
:method => 'POST',
|
113
114
|
:aws_session_token => @aws_session_token,
|
114
|
-
:
|
115
|
+
:signer => @signer,
|
115
116
|
:host => @host,
|
116
117
|
:path => @path,
|
117
118
|
:port => @port,
|
@@ -121,19 +122,19 @@ module Fog
|
|
121
122
|
|
122
123
|
if @instrumentor
|
123
124
|
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
124
|
-
_request(body, idempotent, parser)
|
125
|
+
_request(body, headers, idempotent, parser)
|
125
126
|
end
|
126
127
|
else
|
127
|
-
_request(body, idempotent, parser)
|
128
|
+
_request(body, headers, idempotent, parser)
|
128
129
|
end
|
129
130
|
end
|
130
131
|
|
131
|
-
def _request(body, idempotent, parser)
|
132
|
+
def _request(body, headers, idempotent, parser)
|
132
133
|
@connection.request({
|
133
134
|
:body => body,
|
134
135
|
:expects => 200,
|
135
136
|
:idempotent => idempotent,
|
136
|
-
:headers =>
|
137
|
+
:headers => headers,
|
137
138
|
:method => 'POST',
|
138
139
|
:parser => parser
|
139
140
|
})
|
data/lib/fog/bin.rb
CHANGED
data/lib/fog/bin/brightbox.rb
CHANGED
@@ -4,8 +4,10 @@ class Brightbox < Fog::Bin
|
|
4
4
|
case key
|
5
5
|
when :compute
|
6
6
|
Fog::Compute::Brightbox
|
7
|
+
when :storage
|
8
|
+
Fog::Storage::Brightbox
|
7
9
|
else
|
8
|
-
raise ArgumentError, "
|
10
|
+
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
data/lib/fog/bin/rackspace.rb
CHANGED
@@ -26,6 +26,8 @@ class Rackspace < Fog::Bin
|
|
26
26
|
Fog::Rackspace::Monitoring
|
27
27
|
when :queues
|
28
28
|
Fog::Rackspace::Queues
|
29
|
+
when :networking
|
30
|
+
Fog::Rackspace::Networking
|
29
31
|
else
|
30
32
|
raise ArgumentError, "Unrecognized service: #{key}"
|
31
33
|
end
|
@@ -63,6 +65,8 @@ class Rackspace < Fog::Bin
|
|
63
65
|
Fog::Rackspace::Monitoring.new
|
64
66
|
when :queues
|
65
67
|
Fog::Rackspace::Queues.new
|
68
|
+
when :networking
|
69
|
+
Fog::Rackspace::Networking.new
|
66
70
|
else
|
67
71
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
68
72
|
end
|
@@ -50,7 +50,18 @@ module Fog
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def ip_addresses
|
53
|
-
addresses.map
|
53
|
+
addresses.map(&:ip_address)
|
54
|
+
end
|
55
|
+
|
56
|
+
def volumes
|
57
|
+
requires :id
|
58
|
+
service.volumes.all('virtualmachineid' => id)
|
59
|
+
end
|
60
|
+
|
61
|
+
def reset_password
|
62
|
+
requires :id
|
63
|
+
data = service.reset_password_for_virtual_machine(id)
|
64
|
+
service.jobs.new(data['resetpasswordforvirtualmachineresponse'])
|
54
65
|
end
|
55
66
|
|
56
67
|
def public_ip_addresses
|
@@ -7,8 +7,9 @@ module Fog
|
|
7
7
|
class Snapshots < Fog::Collection
|
8
8
|
model Fog::Compute::Cloudstack::Snapshot
|
9
9
|
|
10
|
-
def all
|
11
|
-
|
10
|
+
def all(attributes = {})
|
11
|
+
response = service.list_snapshots(attributes)
|
12
|
+
data = response["listsnapshotsresponse"]["snapshot"] || []
|
12
13
|
load(data)
|
13
14
|
end
|
14
15
|
|
@@ -7,8 +7,9 @@ module Fog
|
|
7
7
|
class Volumes < Fog::Collection
|
8
8
|
model Fog::Compute::Cloudstack::Volume
|
9
9
|
|
10
|
-
def all
|
11
|
-
|
10
|
+
def all(attributes = {})
|
11
|
+
response = service.list_volumes(attributes)
|
12
|
+
data = response["listvolumesresponse"]["volume"] || []
|
12
13
|
load(data)
|
13
14
|
end
|
14
15
|
|
data/lib/fog/core/parser.rb
CHANGED
@@ -1,112 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Parsers
|
5
|
-
class Base < Nokogiri::XML::SAX::Document
|
6
|
-
attr_reader :response
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
reset
|
10
|
-
end
|
11
|
-
|
12
|
-
def attr_value(name, attrs)
|
13
|
-
(entry = attrs.find {|a, v| a == name }) && entry.last
|
14
|
-
end
|
15
|
-
|
16
|
-
def reset
|
17
|
-
@response = {}
|
18
|
-
end
|
19
|
-
|
20
|
-
def characters(string)
|
21
|
-
@value ||= ''
|
22
|
-
@value << string
|
23
|
-
end
|
24
|
-
|
25
|
-
# ###############################################################################
|
26
|
-
# This is a workaround. Original implementation from Nokogiri is overwritten with
|
27
|
-
# one that does not join namespace prefix with local name.
|
28
|
-
def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = []
|
29
|
-
start_element name, attrs
|
30
|
-
end
|
31
|
-
|
32
|
-
def end_element_namespace name, prefix = nil, uri = nil
|
33
|
-
end_element name
|
34
|
-
end
|
35
|
-
|
36
|
-
# ###############################################################################
|
37
|
-
|
38
|
-
def start_element(name, attrs = [])
|
39
|
-
@value = nil
|
40
|
-
end
|
41
|
-
|
42
|
-
def value
|
43
|
-
@value && @value.dup
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
module Fog
|
50
|
-
class ToHashDocument < Nokogiri::XML::SAX::Document
|
51
|
-
def initialize
|
52
|
-
@stack = []
|
53
|
-
end
|
54
|
-
|
55
|
-
def characters(string)
|
56
|
-
@value ||= ''
|
57
|
-
@value << string.strip
|
58
|
-
end
|
59
|
-
|
60
|
-
def end_element(name)
|
61
|
-
last = @stack.pop
|
62
|
-
if last.empty? && @value.empty?
|
63
|
-
@stack.last[name.to_sym] = ''
|
64
|
-
elsif last == {:i_nil=>"true"}
|
65
|
-
@stack.last[name.to_sym] = nil
|
66
|
-
elsif !@value.empty?
|
67
|
-
@stack.last[name.to_sym] = @value
|
68
|
-
end
|
69
|
-
@value = ''
|
70
|
-
end
|
71
|
-
|
72
|
-
def body
|
73
|
-
@stack.first
|
74
|
-
end
|
75
|
-
|
76
|
-
def response
|
77
|
-
body
|
78
|
-
end
|
79
|
-
|
80
|
-
def start_element(name, attributes = [])
|
81
|
-
@value = ''
|
82
|
-
parsed_attributes = {}
|
83
|
-
until attributes.empty?
|
84
|
-
if attributes.first.is_a?(Array)
|
85
|
-
key, value = attributes.shift
|
86
|
-
else
|
87
|
-
key, value = attributes.shift, attributes.shift
|
88
|
-
end
|
89
|
-
parsed_attributes[key.gsub(':','_').to_sym] = value
|
90
|
-
end
|
91
|
-
if @stack.last.is_a?(Array)
|
92
|
-
@stack.last << {name.to_sym => parsed_attributes}
|
93
|
-
else
|
94
|
-
data = if @stack.empty?
|
95
|
-
@stack.push(parsed_attributes)
|
96
|
-
parsed_attributes
|
97
|
-
elsif @stack.last[name.to_sym]
|
98
|
-
unless @stack.last[name.to_sym].is_a?(Array)
|
99
|
-
@stack.last[name.to_sym] = [@stack.last[name.to_sym]]
|
100
|
-
end
|
101
|
-
@stack.last[name.to_sym] << parsed_attributes
|
102
|
-
@stack.last[name.to_sym].last
|
103
|
-
else
|
104
|
-
@stack.last[name.to_sym] = {}
|
105
|
-
@stack.last[name.to_sym].merge!(parsed_attributes)
|
106
|
-
@stack.last[name.to_sym]
|
107
|
-
end
|
108
|
-
@stack.push(data)
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
1
|
+
Fog::Logger.deprecation("fog/core/parser is deprecated use fog/xml instead [light_black](#{caller.first})[/]")
|
2
|
+
require 'fog/xml'
|
data/lib/fog/dnsmadeeasy/dns.rb
CHANGED
data/lib/fog/dynect/core.rb
CHANGED
data/lib/fog/dynect/dns.rb
CHANGED
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
module DNS
|
5
5
|
class Dynect < Fog::Service
|
6
6
|
requires :dynect_customer, :dynect_username, :dynect_password
|
7
|
-
recognizes :timeout, :persistent
|
7
|
+
recognizes :timeout, :persistent, :job_poll_timeout
|
8
8
|
recognizes :provider # remove post deprecation
|
9
9
|
|
10
10
|
model_path 'fog/dynect/models/dns'
|
@@ -102,8 +102,16 @@ module Fog
|
|
102
102
|
raise Error, response.body['msgs'].first['INFO']
|
103
103
|
end
|
104
104
|
|
105
|
-
if
|
106
|
-
|
105
|
+
if params[:path] !~ %r{^/REST/Job/}
|
106
|
+
if response.status == 307
|
107
|
+
response = poll_job(response, params[:expects], @job_poll_timeout)
|
108
|
+
|
109
|
+
# Dynect intermittently returns 200 with an incomplete status. When this
|
110
|
+
# happens, the job should still be polled.
|
111
|
+
elsif response.status == 200 && response.body['status'].eql?('incomplete')
|
112
|
+
response.headers['Location'] = "/REST/Job/#{ response.body['job_id'] }"
|
113
|
+
response = poll_job(response, params[:expects], @job_poll_timeout)
|
114
|
+
end
|
107
115
|
end
|
108
116
|
|
109
117
|
response
|
data/lib/fog/ecloud/compute.rb
CHANGED
data/lib/fog/ecloud/core.rb
CHANGED
@@ -25,6 +25,7 @@ module Fog
|
|
25
25
|
request :image_create
|
26
26
|
request :image_delete
|
27
27
|
request :image_get
|
28
|
+
request :image_search
|
28
29
|
|
29
30
|
class Mock
|
30
31
|
def initialize(options={})
|
@@ -40,7 +41,9 @@ module Fog
|
|
40
41
|
url = options[:docker_url]
|
41
42
|
|
42
43
|
Docker.url = url
|
43
|
-
Docker.authenticate!('username' => username, 'password' => password, 'email' => email) unless username.
|
44
|
+
Docker.authenticate!('username' => username, 'password' => password, 'email' => email) unless username.nil? || username.empty?
|
45
|
+
rescue Docker::Error::AuthenticationError => e
|
46
|
+
raise Fog::Errors::Fogdocker::AuthenticationError.new(e.message)
|
44
47
|
end
|
45
48
|
|
46
49
|
def downcase_hash_keys(hash, k = [])
|
data/lib/fog/fogdocker/core.rb
CHANGED
@@ -1,15 +1,9 @@
|
|
1
1
|
require 'fog/core'
|
2
|
+
require 'fog/fogdocker/errors'
|
2
3
|
|
3
4
|
module Fog
|
4
5
|
module Fogdocker
|
5
6
|
extend Fog::Provider
|
6
|
-
|
7
|
-
module Errors
|
8
|
-
class ServiceError < Fog::Errors::Error; end
|
9
|
-
class SecurityError < ServiceError; end
|
10
|
-
class NotFound < ServiceError; end
|
11
|
-
end
|
12
|
-
|
13
7
|
service(:compute, 'Compute')
|
14
8
|
end
|
15
9
|
end
|
@@ -14,15 +14,24 @@ module Fog
|
|
14
14
|
attribute :path
|
15
15
|
attribute :args
|
16
16
|
attribute :hostname
|
17
|
+
attribute :links, :aliases => 'hostconfig_links'
|
18
|
+
attribute :privileged, :aliases => 'hostconfig_privileged'
|
19
|
+
attribute :port_bindings, :aliases => 'hostconfig_port_bindings'
|
17
20
|
attribute :ipaddress, :aliases => 'network_settings_ipaddress'
|
18
21
|
attribute :bridge, :aliases => 'network_settings_bridge'
|
19
22
|
attribute :state_running
|
20
23
|
attribute :state_pid
|
21
|
-
attribute :
|
24
|
+
attribute :state_exit_code
|
25
|
+
attribute :cores, :aliases => 'config_cpu_sets'
|
26
|
+
attribute :cpu_shares, :aliases => 'config_cpu_shares'
|
22
27
|
attribute :memory, :aliases => 'config_memory'
|
23
28
|
attribute :hostname, :aliases => 'config_hostname'
|
24
29
|
attribute :cmd, :aliases => 'config_cmd'
|
25
30
|
attribute :entrypoint, :aliases => 'config_entrypoint'
|
31
|
+
attribute :tty, :aliases => 'config_tty'
|
32
|
+
attribute :attach_stdin, :aliases => 'config_attach_stdin'
|
33
|
+
attribute :attach_stdout, :aliases => 'config_attach_stdout'
|
34
|
+
attribute :attach_stderr, :aliases => 'config_attach_stderr'
|
26
35
|
attribute :host
|
27
36
|
attribute :image
|
28
37
|
attribute :exposed_ports, :aliases => 'config_exposed_ports'
|
@@ -115,6 +124,14 @@ module Fog
|
|
115
124
|
service.container_delete(:id => id)
|
116
125
|
end
|
117
126
|
|
127
|
+
def logs(options = { :stdout => 1, :stderr => 1 })
|
128
|
+
service.container_action(:id =>id, :action => :logs, :options => options)
|
129
|
+
end
|
130
|
+
|
131
|
+
def top(options = {})
|
132
|
+
service.container_action(:id =>id, :action => :top)
|
133
|
+
end
|
134
|
+
|
118
135
|
def save
|
119
136
|
if persisted?
|
120
137
|
service.container_update(attributes)
|