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/voxel.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'fog/voxel/compute'
|
data/lib/fog/voxel/compute.rb
DELETED
@@ -1,122 +0,0 @@
|
|
1
|
-
require 'fog/voxel/core'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class Voxel < Fog::Service
|
6
|
-
requires :voxel_api_key, :voxel_api_secret
|
7
|
-
recognizes :host, :port, :scheme, :persistent
|
8
|
-
|
9
|
-
model_path 'fog/voxel/models/compute'
|
10
|
-
model :image
|
11
|
-
collection :images
|
12
|
-
model :server
|
13
|
-
collection :servers
|
14
|
-
|
15
|
-
request_path 'fog/voxel/requests/compute'
|
16
|
-
request :images_list
|
17
|
-
request :devices_list
|
18
|
-
request :devices_power
|
19
|
-
request :voxcloud_create
|
20
|
-
request :voxcloud_status
|
21
|
-
request :voxcloud_delete
|
22
|
-
|
23
|
-
class Mock
|
24
|
-
include Collections
|
25
|
-
|
26
|
-
def self.data
|
27
|
-
@data ||= Hash.new do |hash, key|
|
28
|
-
hash[key] = {
|
29
|
-
:last_modified => { :servers => {}, :statuses => {}, :images => {} },
|
30
|
-
:servers => [],
|
31
|
-
:statuses => {},
|
32
|
-
:images => [
|
33
|
-
{'id' => 1, 'name' => "CentOS 4, 32-bit, base install"},
|
34
|
-
{'id' => 2, 'name' => "CentOS 4, 64-bit, base install"},
|
35
|
-
{'id' => 3, 'name' => "CentOS 5, 32-bit, base install"},
|
36
|
-
{'id' => 4, 'name' => "CentOS 5, 64-bit, base install"},
|
37
|
-
{'id' => 7, 'name' => "Fedora 10, 32-bit, base install"},
|
38
|
-
{'id' => 8, 'name' => "Fedora 10, 64-bit, base install"},
|
39
|
-
{'id' => 10, 'name' => "OpenSUSE 11, 64-bit, base install"},
|
40
|
-
{'id' => 11, 'name' => "Debian 5.0 \"lenny\", 32-bit, base install"},
|
41
|
-
{'id' => 12, 'name' => "Debian 5.0 \"lenny\", 64-bit, base install"},
|
42
|
-
{'id' => 13, 'name' => "Ubuntu 8.04 \"Hardy\", 32-bit, base install"},
|
43
|
-
{'id' => 14, 'name' => "Ubuntu 8.04 \"Hardy\", 64-bit, base install"},
|
44
|
-
{'id' => 15, 'name' => "Voxel Server Environment (VSE), 32-bit, base install"},
|
45
|
-
{'id' => 16, 'name' => "Voxel Server Environment (VSE), 64-bit, base install"},
|
46
|
-
{'id' => 32, 'name' => "Pantheon Official Mercury Stack for Drupal (based on VSE/64)"},
|
47
|
-
{'id' => 55, 'name' => "Ubuntu 10.04 \"Lucid\", 64-bit, base install"} ]
|
48
|
-
}
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.reset
|
53
|
-
@data = nil
|
54
|
-
end
|
55
|
-
|
56
|
-
def initialize(options={})
|
57
|
-
@voxel_api_key = options[:voxel_api_key]
|
58
|
-
end
|
59
|
-
|
60
|
-
def data
|
61
|
-
self.class.data[@voxel_api_key]
|
62
|
-
end
|
63
|
-
|
64
|
-
def reset_data
|
65
|
-
self.class.data.delete(@voxel_api_key)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
class Real
|
70
|
-
include Collections
|
71
|
-
|
72
|
-
def initialize(options = {})
|
73
|
-
require 'time'
|
74
|
-
require 'digest/md5'
|
75
|
-
|
76
|
-
@voxel_api_key = options[:voxel_api_key]
|
77
|
-
@voxel_api_secret = options[:voxel_api_secret]
|
78
|
-
|
79
|
-
@connection_options = options[:connection_options] || {}
|
80
|
-
@host = options[:host] || "api.voxel.net"
|
81
|
-
@port = options[:port] || 443
|
82
|
-
@scheme = options[:scheme] || 'https'
|
83
|
-
@persistent = options[:persistent] || false
|
84
|
-
|
85
|
-
@connection_options[:ssl_verify_peer] = false
|
86
|
-
|
87
|
-
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
88
|
-
end
|
89
|
-
|
90
|
-
def request(method_name, options = {})
|
91
|
-
begin
|
92
|
-
parser = options.delete(:parser)
|
93
|
-
options.merge!({ :method => method_name, :timestamp => Time.now.xmlschema, :key => @voxel_api_key })
|
94
|
-
options[:api_sig] = create_signature(@voxel_api_secret, options)
|
95
|
-
data = @connection.request(
|
96
|
-
:method => "POST",
|
97
|
-
:query => options,
|
98
|
-
:parser => parser,
|
99
|
-
:path => "/version/1.0/"
|
100
|
-
)
|
101
|
-
unless data.body['stat'] == 'ok'
|
102
|
-
raise Fog::Compute::Voxel::Error, "#{data.body['err']['msg']}"
|
103
|
-
end
|
104
|
-
data
|
105
|
-
rescue Excon::Errors::HTTPStatusError => error
|
106
|
-
raise case error
|
107
|
-
when Excon::Errors::NotFound
|
108
|
-
Fog::Compute::Voxel::NotFound.slurp(error)
|
109
|
-
else
|
110
|
-
error
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
def create_signature(secret, options)
|
116
|
-
to_sign = options.keys.map { |k| k.to_s }.sort.map { |k| "#{k}#{options[k.to_sym]}" }.join("")
|
117
|
-
Digest::MD5.hexdigest( secret + to_sign )
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
data/lib/fog/voxel/core.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'fog/core'
|
2
|
-
require 'fog/xml'
|
3
|
-
require 'digest/md5'
|
4
|
-
|
5
|
-
module Fog
|
6
|
-
module Voxel
|
7
|
-
extend Fog::Provider
|
8
|
-
|
9
|
-
service(:compute, 'Compute')
|
10
|
-
|
11
|
-
def self.create_signature(secret, options)
|
12
|
-
to_sign = options.keys.map { |k| k.to_s }.sort.map { |k| "#{k}#{options[k.to_sym]}" }.join("")
|
13
|
-
Digest::MD7.hexdigest( secret + to_sign )
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/voxel/models/compute/image'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class Voxel
|
7
|
-
class Images < Fog::Collection
|
8
|
-
model Fog::Compute::Voxel::Image
|
9
|
-
|
10
|
-
def all
|
11
|
-
data = service.images_list.body['images']
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get(image_id)
|
16
|
-
data = service.images_list(image_id).body['images']
|
17
|
-
|
18
|
-
if data.empty?
|
19
|
-
nil
|
20
|
-
else
|
21
|
-
new(data.first)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'fog/compute/models/server'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class Voxel
|
6
|
-
class Server < Fog::Compute::Server
|
7
|
-
identity :id
|
8
|
-
|
9
|
-
attribute :name
|
10
|
-
attribute :processing_cores
|
11
|
-
attribute :image_id
|
12
|
-
attribute :facility
|
13
|
-
attribute :disk_size
|
14
|
-
attribute :ip_assignments, :aliases => 'ipassignments'
|
15
|
-
|
16
|
-
def initialize(attributes={})
|
17
|
-
self.image_id ||= '55' # Ubuntu 10.04 LTS 64bit
|
18
|
-
super
|
19
|
-
end
|
20
|
-
|
21
|
-
def destroy
|
22
|
-
requires :id
|
23
|
-
service.voxcloud_delete(id)
|
24
|
-
true
|
25
|
-
end
|
26
|
-
|
27
|
-
def image
|
28
|
-
requires :image_id
|
29
|
-
service.images.get(image_id)
|
30
|
-
end
|
31
|
-
|
32
|
-
def ready?
|
33
|
-
self.state == 'SUCCEEDED'
|
34
|
-
end
|
35
|
-
|
36
|
-
def private_ip_address
|
37
|
-
ip_assignments.select {|ip_assignment| ip_assignment['type'] == 'internal'}.first
|
38
|
-
end
|
39
|
-
|
40
|
-
def public_ip_address
|
41
|
-
ip_assignments.select {|ip_assignment| ip_assignment['type'] == 'external'}.first
|
42
|
-
end
|
43
|
-
|
44
|
-
def reboot
|
45
|
-
requires :id
|
46
|
-
service.devices_power(id, :reboot)
|
47
|
-
true
|
48
|
-
end
|
49
|
-
|
50
|
-
def state
|
51
|
-
@state ||= service.voxcloud_status(id).body['devices'].first['status']
|
52
|
-
end
|
53
|
-
|
54
|
-
def save
|
55
|
-
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
|
56
|
-
requires :name, :image_id, :processing_cores, :facility, :disk_size
|
57
|
-
|
58
|
-
data = service.voxcloud_create({
|
59
|
-
:disk_size => disk_size,
|
60
|
-
:facility => facility,
|
61
|
-
:hostname => name,
|
62
|
-
:image_id => image_id,
|
63
|
-
:processing_cores => processing_cores
|
64
|
-
}).body
|
65
|
-
|
66
|
-
merge_attributes(data['device'])
|
67
|
-
|
68
|
-
true
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/voxel/models/compute/server'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class Voxel
|
7
|
-
class Servers < Fog::Collection
|
8
|
-
model Fog::Compute::Voxel::Server
|
9
|
-
|
10
|
-
def all
|
11
|
-
data = service.devices_list.body['devices'].select {|device| device['type']['id'] == '3'}
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get(device_id)
|
16
|
-
if device_id && server = service.devices_list(device_id).body['devices']
|
17
|
-
new(server.first)
|
18
|
-
end
|
19
|
-
rescue Fog::Service::Error => error
|
20
|
-
if error.message == "The device_id passed in can't be matched to a valid device."
|
21
|
-
nil
|
22
|
-
else
|
23
|
-
raise error
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module Compute
|
4
|
-
module Voxel
|
5
|
-
class Basic < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@response = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def start_element(name, attrs = [])
|
11
|
-
super
|
12
|
-
|
13
|
-
case name
|
14
|
-
when 'err'
|
15
|
-
@response['err'] = {
|
16
|
-
'code' => attr_value('code', attrs),
|
17
|
-
'msg' => attr_value('msg', attrs)
|
18
|
-
}
|
19
|
-
when 'rsp'
|
20
|
-
@response['stat'] = attr_value('stat', attrs)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,107 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module Compute
|
4
|
-
module Voxel
|
5
|
-
class DevicesList < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@device = {}
|
8
|
-
@response = { 'devices' => [] }
|
9
|
-
@in_storage = false
|
10
|
-
end
|
11
|
-
|
12
|
-
def start_element(name, attrs = [])
|
13
|
-
super
|
14
|
-
|
15
|
-
case name
|
16
|
-
when 'accessmethod'
|
17
|
-
@access_method = { 'type' => attr_value('type', attrs) }
|
18
|
-
when 'accessmethods'
|
19
|
-
@device['access_methods'] = []
|
20
|
-
when 'device'
|
21
|
-
@device = {
|
22
|
-
'id' => attr_value('id', attrs),
|
23
|
-
'label' => attr_value('label', attrs),
|
24
|
-
'status' => attr_value('status', attrs)
|
25
|
-
}
|
26
|
-
when 'err'
|
27
|
-
@response['err'] = {
|
28
|
-
'code' => attr_value('code', attrs),
|
29
|
-
'msg' => attr_value('msg', attrs)
|
30
|
-
}
|
31
|
-
when 'cage', 'facility', 'rack', 'row', 'zone'
|
32
|
-
@device['location'][name] = { 'id' => attr_value('id', attrs) }
|
33
|
-
if code = attr_value('code', attrs)
|
34
|
-
@device['location'][name]['code'] = code
|
35
|
-
end
|
36
|
-
when 'drive'
|
37
|
-
@drive = { 'position' => attr_value('position', attrs) }
|
38
|
-
when 'ipassignment'
|
39
|
-
type = attr_value('type', attrs)
|
40
|
-
@device['ipassignments'] = []
|
41
|
-
@device['ipassignments'] << {
|
42
|
-
'id' => attr_value('id', attrs),
|
43
|
-
'type' => attr_value('type', attrs),
|
44
|
-
'description' => attr_value('description', attrs),
|
45
|
-
}
|
46
|
-
when 'ipassignments'
|
47
|
-
@device['ipassignments'] = {}
|
48
|
-
when 'location'
|
49
|
-
@device['location'] = {}
|
50
|
-
when 'memory'
|
51
|
-
@device['memory'] = { 'size' => attr_value('size', attrs).to_i }
|
52
|
-
when 'model', 'type'
|
53
|
-
@device[name] = { 'id' => attr_value('id', attrs) }
|
54
|
-
when 'operating_system'
|
55
|
-
@device['operating_system'] = {}
|
56
|
-
when 'power_consumption'
|
57
|
-
@device[name] = attr_value('unit', attrs)
|
58
|
-
when 'processor'
|
59
|
-
@device['processor'] = {}
|
60
|
-
when 'rsp'
|
61
|
-
@response['stat'] = attr_value('stat', attrs)
|
62
|
-
when 'storage'
|
63
|
-
@device['drives'] = []
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def end_element(name)
|
68
|
-
case name
|
69
|
-
when 'access_method'
|
70
|
-
@device['access_methods'] << @access_method
|
71
|
-
when 'architecture'
|
72
|
-
@device['operating_system'][name] = value.to_i
|
73
|
-
when 'cage', 'facility', 'rack', 'row', 'zone'
|
74
|
-
@device['location'][name]['value'] = value
|
75
|
-
when 'cores'
|
76
|
-
@device['processor'][name] = value.to_i
|
77
|
-
when 'description'
|
78
|
-
@device[name] = value
|
79
|
-
when 'device'
|
80
|
-
@response['devices'] << @device
|
81
|
-
@device = {}
|
82
|
-
when 'drive'
|
83
|
-
@device['drives'] << @drive
|
84
|
-
@drive = {}
|
85
|
-
when 'cores'
|
86
|
-
@device['processing_cores'] = value.to_i
|
87
|
-
when 'ipassignment'
|
88
|
-
@device['ipassignments'].last['value'] = value
|
89
|
-
when 'model', 'type'
|
90
|
-
@device[name]['value'] = value
|
91
|
-
when 'name'
|
92
|
-
@device['operating_system'][name] = value
|
93
|
-
when 'position'
|
94
|
-
@device['location'][name] = value
|
95
|
-
when 'power_consumption'
|
96
|
-
@device[name] = [value, @device[name]].join(' ')
|
97
|
-
when 'size'
|
98
|
-
@drive[name] = value.to_i
|
99
|
-
when 'host', 'password', 'protocol', 'username'
|
100
|
-
@access_method[name] = value
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module Compute
|
4
|
-
module Voxel
|
5
|
-
class ImagesList < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@image = {}
|
8
|
-
@response = { 'images' => [] }
|
9
|
-
end
|
10
|
-
|
11
|
-
def start_element(name, attrs = [])
|
12
|
-
super
|
13
|
-
|
14
|
-
case name
|
15
|
-
when 'err'
|
16
|
-
@response['err'] = {
|
17
|
-
'code' => attr_value('code', attrs),
|
18
|
-
'msg' => attr_value('msg', attrs)
|
19
|
-
}
|
20
|
-
when 'size'
|
21
|
-
@image['filesystem']['units'] = attr_value('units', attrs)
|
22
|
-
when 'image'
|
23
|
-
@image = {
|
24
|
-
'id' => attr_value('id', attrs).to_i,
|
25
|
-
'summary' => attr_value('summary', attrs)
|
26
|
-
}
|
27
|
-
when 'filesystem', 'operating_system'
|
28
|
-
@image[name] = {}
|
29
|
-
when 'rsp'
|
30
|
-
@response['stat'] = attr_value('stat', attrs)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def end_element(name)
|
35
|
-
case name
|
36
|
-
when 'architecture'
|
37
|
-
@image['operating_system'][name] = value.to_i
|
38
|
-
when 'admin_username', 'family', 'product_family', 'product_version', 'version'
|
39
|
-
@image['operating_system'][name] = value
|
40
|
-
when 'description'
|
41
|
-
@image[name] = value
|
42
|
-
when 'image'
|
43
|
-
@response['images'] << @image
|
44
|
-
@image = {}
|
45
|
-
when 'size'
|
46
|
-
@image['filesystem'][name] = value.to_i
|
47
|
-
when 'type'
|
48
|
-
@image['filesystem'][name] = value
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|