fog 0.2.30 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +8 -8
- data/README.rdoc +15 -6
- data/Rakefile +12 -19
- data/bin/fog +12 -10
- data/fog.gemspec +298 -286
- data/lib/fog.rb +22 -12
- data/lib/fog/attributes.rb +2 -6
- data/lib/fog/aws.rb +10 -5
- data/lib/fog/aws/bin.rb +29 -65
- data/lib/fog/aws/compute.rb +220 -0
- data/lib/fog/aws/ec2.rb +9 -216
- data/lib/fog/aws/elb.rb +9 -12
- data/lib/fog/aws/models/{ec2 → compute}/address.rb +3 -3
- data/lib/fog/aws/models/{ec2 → compute}/addresses.rb +3 -11
- data/lib/fog/aws/models/{ec2 → compute}/flavor.rb +2 -2
- data/lib/fog/aws/models/compute/flavors.rb +39 -0
- data/lib/fog/aws/models/compute/image.rb +44 -0
- data/lib/fog/aws/models/{ec2 → compute}/images.rb +3 -9
- data/lib/fog/aws/models/compute/key_pair.rb +44 -0
- data/lib/fog/aws/models/{ec2 → compute}/key_pairs.rb +3 -9
- data/lib/fog/aws/models/{ec2 → compute}/security_group.rb +28 -6
- data/lib/fog/aws/models/{ec2 → compute}/security_groups.rb +3 -9
- data/lib/fog/aws/models/{ec2 → compute}/server.rb +65 -38
- data/lib/fog/aws/models/compute/servers.rb +80 -0
- data/lib/fog/aws/models/{ec2 → compute}/snapshot.rb +7 -7
- data/lib/fog/aws/models/{ec2 → compute}/snapshots.rb +5 -13
- data/lib/fog/aws/models/{ec2 → compute}/volume.rb +8 -8
- data/lib/fog/aws/models/{ec2 → compute}/volumes.rb +3 -11
- data/lib/fog/aws/models/{s3 → storage}/directories.rb +3 -9
- data/lib/fog/aws/models/{s3 → storage}/directory.rb +5 -5
- data/lib/fog/aws/models/{s3 → storage}/file.rb +9 -9
- data/lib/fog/aws/models/{s3 → storage}/files.rb +13 -8
- data/lib/fog/aws/parsers/{ec2 → compute}/allocate_address.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/attach_volume.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/basic.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/create_image.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/create_key_pair.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/create_snapshot.rb +2 -2
- data/lib/fog/aws/parsers/{ec2 → compute}/create_volume.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/deregister_image.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_addresses.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_availability_zones.rb +2 -2
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_images.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_instances.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_key_pairs.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_regions.rb +2 -2
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_reserved_instances.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_security_groups.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_snapshots.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/describe_volumes.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/detach_volume.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/get_console_output.rb +2 -2
- data/lib/fog/aws/parsers/compute/import_key_pair.rb +20 -0
- data/lib/fog/aws/parsers/{ec2 → compute}/register_image.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/run_instances.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/start_stop_instances.rb +1 -1
- data/lib/fog/aws/parsers/{ec2 → compute}/terminate_instances.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/access_control_list.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/copy_object.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_bucket.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_bucket_location.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_bucket_logging.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_bucket_object_versions.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_bucket_versioning.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_request_payment.rb +1 -1
- data/lib/fog/aws/parsers/{s3 → storage}/get_service.rb +1 -1
- data/lib/fog/aws/requests/{ec2 → compute}/allocate_address.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/associate_address.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/attach_volume.rb +6 -6
- data/lib/fog/aws/requests/{ec2 → compute}/authorize_security_group_ingress.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/create_image.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/create_key_pair.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/create_security_group.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/create_snapshot.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/create_volume.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/delete_key_pair.rb +2 -2
- data/lib/fog/aws/requests/{ec2 → compute}/delete_security_group.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/delete_snapshot.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/delete_volume.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/deregister_image.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_addresses.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_availability_zones.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_images.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/describe_instances.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_key_pairs.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_regions.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_reserved_instances.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/describe_security_groups.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_snapshots.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/describe_volumes.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/detach_volume.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/disassociate_address.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/get_console_output.rb +4 -4
- data/lib/fog/aws/requests/compute/import_key_pair.rb +54 -0
- data/lib/fog/aws/requests/{ec2 → compute}/modify_image_attributes.rb +2 -2
- data/lib/fog/aws/requests/{ec2 → compute}/modify_snapshot_attribute.rb +2 -2
- data/lib/fog/aws/requests/{ec2 → compute}/reboot_instances.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/register_image.rb +4 -4
- data/lib/fog/aws/requests/{ec2 → compute}/release_address.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/revoke_security_group_ingress.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/run_instances.rb +4 -3
- data/lib/fog/aws/requests/{ec2 → compute}/start_instances.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/stop_instances.rb +3 -3
- data/lib/fog/aws/requests/{ec2 → compute}/terminate_instances.rb +4 -4
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/delete_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_instance_health.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +1 -1
- data/lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +1 -1
- data/lib/fog/aws/requests/simpledb/create_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/delete_attributes.rb +1 -1
- data/lib/fog/aws/requests/simpledb/delete_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/domain_metadata.rb +1 -1
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +1 -1
- data/lib/fog/aws/requests/simpledb/list_domains.rb +1 -1
- data/lib/fog/aws/requests/simpledb/put_attributes.rb +1 -1
- data/lib/fog/aws/requests/simpledb/select.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/copy_object.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/delete_bucket.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/delete_object.rb +2 -2
- data/lib/fog/aws/requests/{s3 → storage}/get_bucket.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_bucket_acl.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_bucket_location.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_bucket_logging.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_bucket_object_versions.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_bucket_versioning.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_object.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/get_object_acl.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_object_torrent.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/get_object_url.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/get_request_payment.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/get_service.rb +3 -3
- data/lib/fog/aws/requests/{s3 → storage}/head_object.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_bucket.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_bucket_acl.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_bucket_logging.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_bucket_versioning.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_object.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_object_url.rb +1 -1
- data/lib/fog/aws/requests/{s3 → storage}/put_request_payment.rb +1 -1
- data/lib/fog/aws/s3.rb +8 -205
- data/lib/fog/aws/simpledb.rb +10 -13
- data/lib/fog/aws/storage.rb +209 -0
- data/lib/fog/bin.rb +59 -50
- data/lib/fog/bluebox.rb +9 -78
- data/lib/fog/bluebox/bin.rb +10 -28
- data/lib/fog/bluebox/compute.rb +87 -0
- data/lib/fog/bluebox/models/compute/flavor.rb +45 -0
- data/lib/fog/bluebox/models/compute/flavors.rb +28 -0
- data/lib/fog/bluebox/models/compute/image.rb +19 -0
- data/lib/fog/bluebox/models/compute/images.rb +28 -0
- data/lib/fog/bluebox/models/compute/server.rb +81 -0
- data/lib/fog/bluebox/models/compute/servers.rb +29 -0
- data/lib/fog/bluebox/requests/compute/create_block.rb +41 -0
- data/lib/fog/bluebox/requests/compute/destroy_block.rb +34 -0
- data/lib/fog/bluebox/requests/compute/get_block.rb +34 -0
- data/lib/fog/bluebox/requests/compute/get_blocks.rb +36 -0
- data/lib/fog/bluebox/requests/compute/get_product.rb +34 -0
- data/lib/fog/bluebox/requests/compute/get_products.rb +33 -0
- data/lib/fog/bluebox/requests/compute/get_template.rb +34 -0
- data/lib/fog/bluebox/requests/compute/get_templates.rb +34 -0
- data/lib/fog/bluebox/requests/compute/reboot_block.rb +35 -0
- data/lib/fog/go_grid.rb +9 -88
- data/lib/fog/go_grid/bin.rb +17 -22
- data/lib/fog/go_grid/compute.rb +96 -0
- data/lib/fog/go_grid/requests/compute/common_lookup_list.rb +36 -0
- data/lib/fog/go_grid/requests/compute/grid_image_list.rb +39 -0
- data/lib/fog/go_grid/requests/compute/grid_ip_list.rb +38 -0
- data/lib/fog/go_grid/requests/compute/grid_loadbalancer_list.rb +36 -0
- data/lib/fog/go_grid/requests/compute/grid_server_add.rb +44 -0
- data/lib/fog/go_grid/requests/compute/grid_server_delete.rb +33 -0
- data/lib/fog/go_grid/requests/compute/grid_server_get.rb +33 -0
- data/lib/fog/go_grid/requests/compute/grid_server_list.rb +38 -0
- data/lib/fog/go_grid/requests/compute/grid_server_power.rb +34 -0
- data/lib/fog/linode.rb +10 -71
- data/lib/fog/linode/bin.rb +17 -22
- data/lib/fog/linode/compute.rb +79 -0
- data/lib/fog/linode/requests/compute/avail_datacenters.rb +31 -0
- data/lib/fog/linode/requests/compute/avail_distributions.rb +38 -0
- data/lib/fog/linode/requests/compute/avail_kernels.rb +36 -0
- data/lib/fog/linode/requests/compute/avail_linodeplans.rb +35 -0
- data/lib/fog/linode/requests/compute/avail_stackscripts.rb +37 -0
- data/lib/fog/linode/requests/compute/linode_create.rb +41 -0
- data/lib/fog/linode/requests/compute/linode_delete.rb +36 -0
- data/lib/fog/linode/requests/compute/linode_list.rb +38 -0
- data/lib/fog/linode/requests/compute/linode_reboot.rb +36 -0
- data/lib/fog/local.rb +10 -51
- data/lib/fog/local/bin.rb +17 -26
- data/lib/fog/local/models/storage/directories.rb +33 -0
- data/lib/fog/local/models/storage/directory.rb +52 -0
- data/lib/fog/local/models/storage/file.rb +60 -0
- data/lib/fog/local/models/storage/files.rb +73 -0
- data/lib/fog/local/storage.rb +58 -0
- data/lib/fog/model.rb +1 -1
- data/lib/fog/new_servers.rb +9 -80
- data/lib/fog/new_servers/bin.rb +17 -22
- data/lib/fog/new_servers/compute.rb +88 -0
- data/lib/fog/new_servers/requests/compute/add_server.rb +41 -0
- data/lib/fog/new_servers/requests/compute/cancel_server.rb +38 -0
- data/lib/fog/new_servers/requests/compute/get_server.rb +44 -0
- data/lib/fog/new_servers/requests/compute/list_images.rb +35 -0
- data/lib/fog/new_servers/requests/compute/list_plans.rb +38 -0
- data/lib/fog/new_servers/requests/compute/list_servers.rb +44 -0
- data/lib/fog/new_servers/requests/compute/reboot_server.rb +32 -0
- data/lib/fog/provider.rb +18 -0
- data/lib/fog/rackspace.rb +8 -3
- data/lib/fog/rackspace/bin.rb +26 -41
- data/lib/fog/rackspace/compute.rb +107 -0
- data/lib/fog/rackspace/files.rb +9 -130
- data/lib/fog/rackspace/models/{servers → compute}/flavor.rb +1 -1
- data/lib/fog/rackspace/models/{servers → compute}/flavors.rb +4 -10
- data/lib/fog/rackspace/models/{servers → compute}/image.rb +4 -4
- data/lib/fog/rackspace/models/{servers → compute}/images.rb +4 -12
- data/lib/fog/rackspace/models/{servers → compute}/server.rb +20 -16
- data/lib/fog/rackspace/models/{servers → compute}/servers.rb +5 -11
- data/lib/fog/rackspace/models/{files → storage}/directories.rb +4 -10
- data/lib/fog/rackspace/models/{files → storage}/directory.rb +4 -4
- data/lib/fog/rackspace/models/{files → storage}/file.rb +6 -6
- data/lib/fog/rackspace/models/{files → storage}/files.rb +11 -15
- data/lib/fog/rackspace/requests/{servers → compute}/create_image.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/create_server.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/delete_image.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/delete_server.rb +2 -2
- data/lib/fog/rackspace/requests/{servers → compute}/get_flavor_details.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/get_image_details.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/get_server_details.rb +2 -2
- data/lib/fog/rackspace/requests/{servers → compute}/list_addresses.rb +2 -2
- data/lib/fog/rackspace/requests/{servers → compute}/list_flavors.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/list_flavors_detail.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/list_images.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/list_images_detail.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/list_private_addresses.rb +2 -2
- data/lib/fog/rackspace/requests/{servers → compute}/list_public_addresses.rb +2 -2
- data/lib/fog/rackspace/requests/{servers → compute}/list_servers.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/list_servers_detail.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/reboot_server.rb +1 -1
- data/lib/fog/rackspace/requests/{servers → compute}/update_server.rb +2 -2
- data/lib/fog/rackspace/requests/{files → storage}/delete_container.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/delete_object.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/get_container.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/get_containers.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/get_object.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/head_container.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/head_containers.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/head_object.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/put_container.rb +1 -1
- data/lib/fog/rackspace/requests/{files → storage}/put_object.rb +1 -1
- data/lib/fog/rackspace/servers.rb +9 -104
- data/lib/fog/rackspace/storage.rb +151 -0
- data/lib/fog/service.rb +111 -59
- data/lib/fog/slicehost.rb +9 -83
- data/lib/fog/slicehost/bin.rb +17 -34
- data/lib/fog/slicehost/compute.rb +91 -0
- data/lib/fog/slicehost/models/compute/flavor.rb +45 -0
- data/lib/fog/slicehost/models/compute/flavors.rb +28 -0
- data/lib/fog/slicehost/models/compute/image.rb +17 -0
- data/lib/fog/slicehost/models/compute/images.rb +27 -0
- data/lib/fog/slicehost/models/compute/server.rb +64 -0
- data/lib/fog/slicehost/models/compute/servers.rb +31 -0
- data/lib/fog/slicehost/parsers/compute/create_slice.rb +31 -0
- data/lib/fog/slicehost/parsers/compute/get_backups.rb +32 -0
- data/lib/fog/slicehost/parsers/compute/get_flavor.rb +26 -0
- data/lib/fog/slicehost/parsers/compute/get_flavors.rb +30 -0
- data/lib/fog/slicehost/parsers/compute/get_image.rb +26 -0
- data/lib/fog/slicehost/parsers/compute/get_images.rb +30 -0
- data/lib/fog/slicehost/parsers/compute/get_slice.rb +31 -0
- data/lib/fog/slicehost/parsers/compute/get_slices.rb +35 -0
- data/lib/fog/slicehost/requests/compute/create_slice.rb +49 -0
- data/lib/fog/slicehost/requests/compute/delete_slice.rb +45 -0
- data/lib/fog/slicehost/requests/compute/get_backups.rb +37 -0
- data/lib/fog/slicehost/requests/compute/get_flavor.rb +40 -0
- data/lib/fog/slicehost/requests/compute/get_flavors.rb +37 -0
- data/lib/fog/slicehost/requests/compute/get_image.rb +38 -0
- data/lib/fog/slicehost/requests/compute/get_images.rb +35 -0
- data/lib/fog/slicehost/requests/compute/get_slice.rb +46 -0
- data/lib/fog/slicehost/requests/compute/get_slices.rb +43 -0
- data/lib/fog/slicehost/requests/compute/reboot_slice.rb +44 -0
- data/lib/fog/ssh.rb +16 -7
- data/lib/fog/terremark/bin.rb +25 -33
- data/lib/fog/terremark/models/shared/address.rb +1 -1
- data/lib/fog/terremark/models/shared/task.rb +6 -6
- data/lib/fog/vcloud.rb +60 -36
- data/lib/fog/vcloud/bin.rb +2 -2
- data/lib/fog/vcloud/collection.rb +1 -1
- data/lib/fog/vcloud/generators.rb +1 -1
- data/lib/fog/vcloud/model.rb +1 -1
- data/lib/fog/vcloud/models/vdc.rb +1 -1
- data/lib/fog/vcloud/models/vdcs.rb +3 -9
- data/lib/fog/vcloud/requests/get_network.rb +1 -1
- data/lib/fog/vcloud/requests/get_organization.rb +1 -1
- data/lib/fog/vcloud/requests/get_vdc.rb +1 -1
- data/lib/fog/vcloud/requests/get_versions.rb +1 -1
- data/lib/fog/vcloud/requests/login.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud.rb +19 -14
- data/lib/fog/vcloud/terremark/ecloud/models/catalog.rb +2 -2
- data/lib/fog/vcloud/terremark/ecloud/models/catalog_item.rb +3 -3
- data/lib/fog/vcloud/terremark/ecloud/models/firewall_acl.rb +3 -3
- data/lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb +4 -2
- data/lib/fog/vcloud/terremark/ecloud/models/internet_service.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +4 -8
- data/lib/fog/vcloud/terremark/ecloud/models/ip.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +4 -2
- data/lib/fog/vcloud/terremark/ecloud/models/network.rb +2 -2
- data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +4 -8
- data/lib/fog/vcloud/terremark/ecloud/models/node.rb +3 -3
- data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +4 -2
- data/lib/fog/vcloud/terremark/ecloud/models/public_ip.rb +3 -3
- data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +4 -14
- data/lib/fog/vcloud/terremark/ecloud/models/server.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +4 -2
- data/lib/fog/vcloud/terremark/ecloud/models/task.rb +3 -3
- data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +4 -2
- data/lib/fog/vcloud/terremark/ecloud/models/vdc.rb +2 -2
- data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +25 -15
- data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/clone_vapp.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acl.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acls.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_node.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_task.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_task_list.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp_template.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/power_off.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/power_on.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/power_reset.rb +4 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/power_shutdown.rb +4 -4
- data/lib/fog/vcloud/terremark/vcloud.rb +9 -5
- data/lib/fog/vcloud/terremark/vcloud/requests/get_vdc.rb +4 -4
- data/spec/aws/models/{ec2 → compute}/address_spec.rb +12 -12
- data/spec/aws/models/compute/addresses_spec.rb +70 -0
- data/spec/aws/models/{ec2 → compute}/flavors_spec.rb +2 -2
- data/spec/aws/models/{ec2 → compute}/key_pair_spec.rb +12 -12
- data/spec/aws/models/compute/key_pairs_spec.rb +71 -0
- data/spec/aws/models/{ec2 → compute}/security_group_spec.rb +12 -12
- data/spec/aws/models/compute/security_groups_spec.rb +71 -0
- data/spec/aws/models/{ec2 → compute}/server_spec.rb +9 -9
- data/spec/aws/models/{ec2 → compute}/servers_spec.rb +2 -2
- data/spec/aws/models/{ec2 → compute}/snapshot_spec.rb +7 -7
- data/spec/aws/models/{ec2 → compute}/snapshots_spec.rb +12 -12
- data/spec/aws/models/{ec2 → compute}/volume_spec.rb +16 -16
- data/spec/aws/models/compute/volumes_spec.rb +71 -0
- data/spec/aws/models/storage/directories_spec.rb +49 -0
- data/spec/aws/models/{s3 → storage}/directory_spec.rb +13 -13
- data/spec/aws/models/{s3 → storage}/file_spec.rb +6 -6
- data/spec/aws/models/{s3 → storage}/files_spec.rb +6 -6
- data/spec/aws/requests/{ec2 → compute}/describe_images_spec.rb +4 -4
- data/spec/aws/requests/s3/copy_object_spec.rb +12 -12
- data/spec/aws/requests/s3/delete_bucket_spec.rb +9 -9
- data/spec/aws/requests/s3/delete_object_spec.rb +9 -9
- data/spec/aws/requests/s3/get_bucket_location_spec.rb +5 -5
- data/spec/aws/requests/s3/get_bucket_spec.rb +13 -13
- data/spec/aws/requests/s3/get_object_spec.rb +10 -10
- data/spec/aws/requests/s3/get_request_payment_spec.rb +5 -5
- data/spec/aws/requests/s3/get_service_spec.rb +6 -6
- data/spec/aws/requests/s3/head_object_spec.rb +6 -6
- data/spec/aws/requests/s3/put_bucket_spec.rb +4 -4
- data/spec/aws/requests/s3/put_object_spec.rb +12 -12
- data/spec/aws/requests/s3/put_request_payment_spec.rb +5 -5
- data/spec/{rackspace/models/servers → bluebox/models/compute}/flavors_spec.rb +3 -3
- data/spec/bluebox/models/{server_spec.rb → compute/server_spec.rb} +4 -4
- data/spec/bluebox/models/{servers_spec.rb → compute/servers_spec.rb} +4 -4
- data/spec/rackspace/models/compute/flavors_spec.rb +14 -0
- data/spec/rackspace/models/{servers → compute}/server_spec.rb +4 -4
- data/spec/rackspace/models/compute/servers_spec.rb +22 -0
- data/spec/rackspace/requests/{files → storage}/delete_container_spec.rb +5 -5
- data/spec/rackspace/requests/storage/delete_object_spec.rb +37 -0
- data/spec/rackspace/requests/{files → storage}/get_container_spec.rb +9 -9
- data/spec/rackspace/requests/{files → storage}/get_containers_spec.rb +4 -4
- data/spec/rackspace/requests/storage/get_object_spec.rb +21 -0
- data/spec/rackspace/requests/storage/head_container_spec.rb +30 -0
- data/spec/rackspace/requests/storage/head_containers_spec.rb +19 -0
- data/spec/rackspace/requests/storage/head_object_spec.rb +21 -0
- data/spec/rackspace/requests/{files → storage}/put_container_spec.rb +3 -3
- data/spec/rackspace/requests/storage/put_object_spec.rb +20 -0
- data/spec/slicehost/models/compute/flavors_spec.rb +14 -0
- data/spec/slicehost/models/{server_spec.rb → compute/server_spec.rb} +8 -8
- data/spec/{rackspace/models/servers → slicehost/models/compute}/servers_spec.rb +4 -4
- data/spec/spec_helper.rb +14 -14
- data/spec/vcloud/models/vdc_spec.rb +1 -1
- data/spec/vcloud/spec_helper.rb +7 -7
- data/spec/vcloud/terremark/ecloud/models/internet_service_spec.rb +1 -1
- data/tests/aws/helper.rb +8 -8
- data/tests/aws/models/storage/directory_tests.rb +8 -0
- data/tests/aws/requests/compute/address_tests.rb +80 -0
- data/tests/aws/requests/{ec2 → compute}/availability_zone_tests.rb +5 -5
- data/tests/aws/requests/{ec2 → compute}/instance_tests.rb +17 -17
- data/tests/aws/requests/{ec2 → compute}/key_pair_tests.rb +12 -12
- data/tests/aws/requests/{ec2 → compute}/region_tests.rb +5 -5
- data/tests/aws/requests/{ec2 → compute}/security_group_tests.rb +31 -31
- data/tests/aws/requests/{ec2 → compute}/snapshot_tests.rb +12 -12
- data/tests/aws/requests/{ec2 → compute}/volume_tests.rb +23 -23
- data/tests/bluebox/helper.rb +13 -9
- data/tests/bluebox/requests/{block_tests.rb → compute/block_tests.rb} +16 -17
- data/tests/bluebox/requests/compute/product_tests.rb +25 -0
- data/tests/bluebox/requests/{template_tests.rb → compute/template_tests.rb} +5 -5
- data/tests/linode/helper.rb +12 -8
- data/tests/linode/requests/{datacenter_tests.rb → compute/datacenter_tests.rb} +3 -3
- data/tests/linode/requests/{distribution_tests.rb → compute/distribution_tests.rb} +4 -4
- data/tests/linode/requests/{linode_tests.rb → compute/linode_tests.rb} +13 -13
- data/tests/linode/requests/{linodeplans_tests.rb → compute/linodeplans_tests.rb} +4 -4
- data/tests/rackspace/helper.rb +5 -13
- data/tests/rackspace/requests/compute/address_tests.rb +40 -0
- data/tests/rackspace/requests/compute/flavor_tests.rb +34 -0
- data/tests/rackspace/requests/compute/image_tests.rb +62 -0
- data/tests/rackspace/requests/{servers → compute}/server_tests.rb +20 -20
- data/tests/slicehost/helper.rb +3 -3
- data/tests/slicehost/requests/{backup_tests.rb → compute/backup_tests.rb} +2 -2
- data/tests/slicehost/requests/{flavor_tests.rb → compute/flavor_tests.rb} +4 -4
- data/tests/slicehost/requests/{image_tests.rb → compute/image_tests.rb} +4 -4
- data/tests/slicehost/requests/{slice_tests.rb → compute/slice_tests.rb} +12 -12
- metadata +304 -290
- data/lib/fog/aws/models/ec2/flavors.rb +0 -43
- data/lib/fog/aws/models/ec2/image.rb +0 -44
- data/lib/fog/aws/models/ec2/key_pair.rb +0 -34
- data/lib/fog/aws/models/ec2/servers.rb +0 -49
- data/lib/fog/bluebox/models/flavor.rb +0 -43
- data/lib/fog/bluebox/models/flavors.rb +0 -32
- data/lib/fog/bluebox/models/image.rb +0 -17
- data/lib/fog/bluebox/models/images.rb +0 -34
- data/lib/fog/bluebox/models/server.rb +0 -79
- data/lib/fog/bluebox/models/servers.rb +0 -33
- data/lib/fog/bluebox/requests/create_block.rb +0 -39
- data/lib/fog/bluebox/requests/destroy_block.rb +0 -32
- data/lib/fog/bluebox/requests/get_block.rb +0 -32
- data/lib/fog/bluebox/requests/get_blocks.rb +0 -34
- data/lib/fog/bluebox/requests/get_product.rb +0 -32
- data/lib/fog/bluebox/requests/get_products.rb +0 -31
- data/lib/fog/bluebox/requests/get_template.rb +0 -32
- data/lib/fog/bluebox/requests/get_templates.rb +0 -32
- data/lib/fog/bluebox/requests/reboot_block.rb +0 -33
- data/lib/fog/go_grid/requests/common_lookup_list.rb +0 -34
- data/lib/fog/go_grid/requests/grid_image_list.rb +0 -37
- data/lib/fog/go_grid/requests/grid_ip_list.rb +0 -36
- data/lib/fog/go_grid/requests/grid_loadbalancer_list.rb +0 -34
- data/lib/fog/go_grid/requests/grid_server_add.rb +0 -42
- data/lib/fog/go_grid/requests/grid_server_delete.rb +0 -31
- data/lib/fog/go_grid/requests/grid_server_get.rb +0 -31
- data/lib/fog/go_grid/requests/grid_server_list.rb +0 -36
- data/lib/fog/go_grid/requests/grid_server_power.rb +0 -32
- data/lib/fog/linode/requests/avail_datacenters.rb +0 -29
- data/lib/fog/linode/requests/avail_distributions.rb +0 -36
- data/lib/fog/linode/requests/avail_kernels.rb +0 -34
- data/lib/fog/linode/requests/avail_linodeplans.rb +0 -33
- data/lib/fog/linode/requests/avail_stackscripts.rb +0 -35
- data/lib/fog/linode/requests/linode_create.rb +0 -39
- data/lib/fog/linode/requests/linode_delete.rb +0 -34
- data/lib/fog/linode/requests/linode_list.rb +0 -36
- data/lib/fog/linode/requests/linode_reboot.rb +0 -34
- data/lib/fog/local/models/directories.rb +0 -37
- data/lib/fog/local/models/directory.rb +0 -50
- data/lib/fog/local/models/file.rb +0 -58
- data/lib/fog/local/models/files.rb +0 -74
- data/lib/fog/new_servers/requests/add_server.rb +0 -39
- data/lib/fog/new_servers/requests/cancel_server.rb +0 -36
- data/lib/fog/new_servers/requests/get_server.rb +0 -42
- data/lib/fog/new_servers/requests/list_images.rb +0 -33
- data/lib/fog/new_servers/requests/list_plans.rb +0 -36
- data/lib/fog/new_servers/requests/list_servers.rb +0 -43
- data/lib/fog/new_servers/requests/reboot_server.rb +0 -30
- data/lib/fog/slicehost/models/flavor.rb +0 -43
- data/lib/fog/slicehost/models/flavors.rb +0 -31
- data/lib/fog/slicehost/models/image.rb +0 -15
- data/lib/fog/slicehost/models/images.rb +0 -33
- data/lib/fog/slicehost/models/server.rb +0 -62
- data/lib/fog/slicehost/models/servers.rb +0 -35
- data/lib/fog/slicehost/parsers/create_slice.rb +0 -29
- data/lib/fog/slicehost/parsers/get_backups.rb +0 -30
- data/lib/fog/slicehost/parsers/get_flavor.rb +0 -24
- data/lib/fog/slicehost/parsers/get_flavors.rb +0 -28
- data/lib/fog/slicehost/parsers/get_image.rb +0 -24
- data/lib/fog/slicehost/parsers/get_images.rb +0 -28
- data/lib/fog/slicehost/parsers/get_slice.rb +0 -29
- data/lib/fog/slicehost/parsers/get_slices.rb +0 -33
- data/lib/fog/slicehost/requests/create_slice.rb +0 -47
- data/lib/fog/slicehost/requests/delete_slice.rb +0 -43
- data/lib/fog/slicehost/requests/get_backups.rb +0 -35
- data/lib/fog/slicehost/requests/get_flavor.rb +0 -38
- data/lib/fog/slicehost/requests/get_flavors.rb +0 -35
- data/lib/fog/slicehost/requests/get_image.rb +0 -36
- data/lib/fog/slicehost/requests/get_images.rb +0 -33
- data/lib/fog/slicehost/requests/get_slice.rb +0 -44
- data/lib/fog/slicehost/requests/get_slices.rb +0 -41
- data/lib/fog/slicehost/requests/reboot_slice.rb +0 -42
- data/lib/fog/vcloud/extension.rb +0 -37
- data/spec/aws/models/ec2/addresses_spec.rb +0 -70
- data/spec/aws/models/ec2/key_pairs_spec.rb +0 -71
- data/spec/aws/models/ec2/security_groups_spec.rb +0 -71
- data/spec/aws/models/ec2/volumes_spec.rb +0 -71
- data/spec/aws/models/s3/directories_spec.rb +0 -49
- data/spec/bluebox/models/flavors_spec.rb +0 -14
- data/spec/rackspace/requests/files/delete_object_spec.rb +0 -37
- data/spec/rackspace/requests/files/get_object_spec.rb +0 -21
- data/spec/rackspace/requests/files/head_container_spec.rb +0 -30
- data/spec/rackspace/requests/files/head_containers_spec.rb +0 -19
- data/spec/rackspace/requests/files/head_object_spec.rb +0 -21
- data/spec/rackspace/requests/files/put_object_spec.rb +0 -20
- data/spec/slicehost/models/flavors_spec.rb +0 -14
- data/spec/slicehost/models/servers_spec.rb +0 -22
- data/tests/aws/models/s3/directory_tests.rb +0 -8
- data/tests/aws/requests/ec2/address_tests.rb +0 -80
- data/tests/bluebox/requests/product_tests.rb +0 -25
- data/tests/rackspace/requests/servers/address_tests.rb +0 -40
- data/tests/rackspace/requests/servers/flavor_tests.rb +0 -34
- data/tests/rackspace/requests/servers/image_tests.rb +0 -59
data/lib/fog/aws/simpledb.rb
CHANGED
@@ -1,23 +1,21 @@
|
|
1
1
|
module Fog
|
2
2
|
module AWS
|
3
|
-
|
4
|
-
extend Fog::Service
|
3
|
+
class SimpleDB < Fog::Service
|
5
4
|
|
6
5
|
requires :aws_access_key_id, :aws_secret_access_key
|
7
6
|
|
8
7
|
request_path 'fog/aws/requests/simpledb'
|
9
|
-
request
|
10
|
-
request
|
11
|
-
request
|
12
|
-
request
|
13
|
-
request
|
14
|
-
request
|
15
|
-
request
|
16
|
-
request
|
17
|
-
request
|
8
|
+
request :batch_put_attributes
|
9
|
+
request :create_domain
|
10
|
+
request :delete_attributes
|
11
|
+
request :delete_domain
|
12
|
+
request :domain_metadata
|
13
|
+
request :get_attributes
|
14
|
+
request :list_domains
|
15
|
+
request :put_attributes
|
16
|
+
request :select
|
18
17
|
|
19
18
|
class Mock
|
20
|
-
include Collections
|
21
19
|
|
22
20
|
def self.data
|
23
21
|
@data ||= Hash.new do |hash, key|
|
@@ -41,7 +39,6 @@ module Fog
|
|
41
39
|
end
|
42
40
|
|
43
41
|
class Real
|
44
|
-
include Collections
|
45
42
|
|
46
43
|
# Initialize connection to SimpleDB
|
47
44
|
#
|
@@ -0,0 +1,209 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class Storage < Fog::Service
|
4
|
+
|
5
|
+
requires :aws_access_key_id, :aws_secret_access_key
|
6
|
+
|
7
|
+
model_path 'fog/aws/models/storage'
|
8
|
+
collection :directories
|
9
|
+
model :directory
|
10
|
+
collection :files
|
11
|
+
model :file
|
12
|
+
|
13
|
+
request_path 'fog/aws/requests/storage'
|
14
|
+
request :copy_object
|
15
|
+
request :delete_bucket
|
16
|
+
request :delete_object
|
17
|
+
request :get_bucket
|
18
|
+
request :get_bucket_acl
|
19
|
+
request :get_bucket_location
|
20
|
+
request :get_bucket_logging
|
21
|
+
request :get_bucket_object_versions
|
22
|
+
request :get_bucket_versioning
|
23
|
+
request :get_object
|
24
|
+
request :get_object_acl
|
25
|
+
request :get_object_torrent
|
26
|
+
request :get_object_url
|
27
|
+
request :get_request_payment
|
28
|
+
request :get_service
|
29
|
+
request :head_object
|
30
|
+
request :put_bucket
|
31
|
+
request :put_bucket_acl
|
32
|
+
request :put_bucket_logging
|
33
|
+
request :put_bucket_versioning
|
34
|
+
request :put_object
|
35
|
+
request :put_object_url
|
36
|
+
request :put_request_payment
|
37
|
+
|
38
|
+
module Utils
|
39
|
+
|
40
|
+
def parse_data(data)
|
41
|
+
metadata = {
|
42
|
+
:body => nil,
|
43
|
+
:headers => {}
|
44
|
+
}
|
45
|
+
|
46
|
+
if data.is_a?(String)
|
47
|
+
metadata[:body] = data
|
48
|
+
metadata[:headers]['Content-Length'] = metadata[:body].size.to_s
|
49
|
+
else
|
50
|
+
filename = ::File.basename(data.path)
|
51
|
+
unless (mime_types = MIME::Types.of(filename)).empty?
|
52
|
+
metadata[:headers]['Content-Type'] = mime_types.first.content_type
|
53
|
+
end
|
54
|
+
metadata[:body] = data
|
55
|
+
metadata[:headers]['Content-Length'] = ::File.size(data.path).to_s
|
56
|
+
end
|
57
|
+
# metadata[:headers]['Content-MD5'] = Base64.encode64(Digest::MD5.digest(metadata[:body])).strip
|
58
|
+
metadata
|
59
|
+
end
|
60
|
+
|
61
|
+
def url(params, expires)
|
62
|
+
params[:headers]['Date'] = expires.to_i
|
63
|
+
query = [params[:query]].compact
|
64
|
+
query << "AWSAccessKeyId=#{@aws_access_key_id}"
|
65
|
+
query << "Signature=#{CGI.escape(signature(params))}"
|
66
|
+
query << "Expires=#{params[:headers]['Date']}"
|
67
|
+
"http://#{params[:host]}/#{params[:path]}?#{query.join('&')}"
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
class Mock
|
73
|
+
include Utils
|
74
|
+
|
75
|
+
def self.data
|
76
|
+
@data ||= Hash.new do |hash, key|
|
77
|
+
hash[key] = {
|
78
|
+
:buckets => {}
|
79
|
+
}
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.reset_data(keys=data.keys)
|
84
|
+
for key in [*keys]
|
85
|
+
data.delete(key)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def initialize(options={})
|
90
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
91
|
+
@data = self.class.data[@aws_access_key_id]
|
92
|
+
end
|
93
|
+
|
94
|
+
def signature(params)
|
95
|
+
"foo"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
class Real
|
100
|
+
include Utils
|
101
|
+
extend Fog::Deprecation
|
102
|
+
deprecate(:reset, :reload)
|
103
|
+
|
104
|
+
# Initialize connection to S3
|
105
|
+
#
|
106
|
+
# ==== Notes
|
107
|
+
# options parameter must include values for :aws_access_key_id and
|
108
|
+
# :aws_secret_access_key in order to create a connection
|
109
|
+
#
|
110
|
+
# ==== Examples
|
111
|
+
# s3 = S3.new(
|
112
|
+
# :aws_access_key_id => your_aws_access_key_id,
|
113
|
+
# :aws_secret_access_key => your_aws_secret_access_key
|
114
|
+
# )
|
115
|
+
#
|
116
|
+
# ==== Parameters
|
117
|
+
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
118
|
+
#
|
119
|
+
# ==== Returns
|
120
|
+
# * S3 object with connection to aws.
|
121
|
+
def initialize(options={})
|
122
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
123
|
+
@aws_secret_access_key = options[:aws_secret_access_key]
|
124
|
+
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)
|
125
|
+
options[:region] ||= 'us-east-1'
|
126
|
+
@host = options[:host] || case options[:region]
|
127
|
+
when 'us-east-1'
|
128
|
+
's3.amazonaws.com'
|
129
|
+
when 'ap-southeast-1'
|
130
|
+
's3-ap-southeast-1.amazonaws.com'
|
131
|
+
when 'us-west-1'
|
132
|
+
's3-us-west-1.amazonaws.com'
|
133
|
+
else
|
134
|
+
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
135
|
+
end
|
136
|
+
@port = options[:port] || 443
|
137
|
+
@scheme = options[:scheme] || 'https'
|
138
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent] || true)
|
139
|
+
end
|
140
|
+
|
141
|
+
def reload
|
142
|
+
@connection.reset
|
143
|
+
end
|
144
|
+
|
145
|
+
private
|
146
|
+
|
147
|
+
def request(params, &block)
|
148
|
+
params[:headers]['Date'] = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S +0000")
|
149
|
+
params[:headers]['Authorization'] = "AWS #{@aws_access_key_id}:#{signature(params)}"
|
150
|
+
|
151
|
+
response = @connection.request(params, &block)
|
152
|
+
|
153
|
+
response
|
154
|
+
end
|
155
|
+
|
156
|
+
def signature(params)
|
157
|
+
string_to_sign =
|
158
|
+
<<-DATA
|
159
|
+
#{params[:method]}
|
160
|
+
#{params[:headers]['Content-MD5']}
|
161
|
+
#{params[:headers]['Content-Type']}
|
162
|
+
#{params[:headers]['Date']}
|
163
|
+
DATA
|
164
|
+
|
165
|
+
amz_headers, canonical_amz_headers = {}, ''
|
166
|
+
for key, value in params[:headers]
|
167
|
+
if key[0..5] == 'x-amz-'
|
168
|
+
amz_headers[key] = value
|
169
|
+
end
|
170
|
+
end
|
171
|
+
amz_headers = amz_headers.sort {|x, y| x[0] <=> y[0]}
|
172
|
+
for key, value in amz_headers
|
173
|
+
canonical_amz_headers << "#{key}:#{value}\n"
|
174
|
+
end
|
175
|
+
string_to_sign << "#{canonical_amz_headers}"
|
176
|
+
|
177
|
+
subdomain = params[:host].split(".#{@host}").first
|
178
|
+
unless subdomain =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
|
179
|
+
Formatador.display_line("[yellow][WARN] fog: the specified s3 bucket name(#{subdomain}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html[/]")
|
180
|
+
params[:host] = params[:host].split("#{subdomain}.")[-1]
|
181
|
+
if params[:path]
|
182
|
+
params[:path] = "#{subdomain}/#{params[:path]}"
|
183
|
+
else
|
184
|
+
params[:path] = "#{subdomain}"
|
185
|
+
end
|
186
|
+
subdomain = nil
|
187
|
+
end
|
188
|
+
|
189
|
+
canonical_resource = "/"
|
190
|
+
unless subdomain.nil? || subdomain == @host
|
191
|
+
canonical_resource << "#{CGI.escape(subdomain).downcase}/"
|
192
|
+
end
|
193
|
+
canonical_resource << "#{params[:path]}"
|
194
|
+
canonical_resource << '?'
|
195
|
+
for key in (params[:query] || {}).keys
|
196
|
+
if ['acl', 'location', 'logging', 'requestPayment', 'torrent', 'versions', 'versioning'].include?(key)
|
197
|
+
canonical_resource << "#{key}&"
|
198
|
+
end
|
199
|
+
end
|
200
|
+
canonical_resource.chop!
|
201
|
+
string_to_sign << "#{canonical_resource}"
|
202
|
+
|
203
|
+
signed_string = @hmac.sign(string_to_sign)
|
204
|
+
signature = Base64.encode64(signed_string).chomp!
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
data/lib/fog/bin.rb
CHANGED
@@ -1,68 +1,77 @@
|
|
1
1
|
require 'fog/credentials'
|
2
2
|
|
3
|
-
require 'fog/aws/bin'
|
4
|
-
require 'fog/go_grid/bin'
|
5
|
-
require 'fog/linode/bin'
|
6
|
-
require 'fog/local/bin'
|
7
|
-
require 'fog/new_servers/bin'
|
8
|
-
require 'fog/rackspace/bin'
|
9
|
-
require 'fog/slicehost/bin'
|
10
|
-
require 'fog/terremark/bin'
|
11
|
-
require 'fog/vcloud/bin'
|
12
|
-
require 'fog/bluebox/bin'
|
13
|
-
|
14
3
|
module Fog
|
15
4
|
class << self
|
16
5
|
|
17
|
-
def
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
6
|
+
def providers
|
7
|
+
[
|
8
|
+
::AWS,
|
9
|
+
::Bluebox,
|
10
|
+
::GoGrid,
|
11
|
+
::Linode,
|
12
|
+
::Local,
|
13
|
+
::NewServers,
|
14
|
+
::Rackspace,
|
15
|
+
::Slicehost,
|
16
|
+
::Terremark
|
17
|
+
].select {|provider| provider.available?}
|
25
18
|
end
|
26
19
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
directories[service] = service.directories
|
32
|
-
end
|
33
|
-
end
|
34
|
-
directories
|
20
|
+
def modules
|
21
|
+
[
|
22
|
+
::Vcloud
|
23
|
+
].select {|_module_| _module_.initialized?}
|
35
24
|
end
|
36
25
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
26
|
+
end
|
27
|
+
|
28
|
+
class Bin
|
29
|
+
class << self
|
30
|
+
|
31
|
+
def available?
|
32
|
+
availability = true
|
33
|
+
for service in services
|
34
|
+
begin
|
35
|
+
service = eval(self[service].class.to_s.split('::')[0...-1].join('::'))
|
36
|
+
availability &&= service.requirements.all? {|requirement| Fog.credentials.include?(requirement)}
|
37
|
+
rescue
|
38
|
+
availability = false
|
39
|
+
end
|
42
40
|
end
|
43
|
-
end
|
44
|
-
flavors
|
45
|
-
end
|
46
41
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
if availability
|
43
|
+
for service in services
|
44
|
+
for collection in self[service].collections
|
45
|
+
unless self.respond_to?(collection)
|
46
|
+
self.class_eval <<-EOS, __FILE__, __LINE__
|
47
|
+
def self.#{collection}
|
48
|
+
self[:#{service}].#{collection}
|
49
|
+
end
|
50
|
+
EOS
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
52
54
|
end
|
55
|
+
|
56
|
+
availability
|
53
57
|
end
|
54
|
-
images
|
55
|
-
end
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
services.each do |service|
|
60
|
-
if service.respond_to?(:servers)
|
61
|
-
servers[service] = service.servers
|
62
|
-
end
|
59
|
+
def collections
|
60
|
+
services.map {|service| self[service].collections}.flatten.sort_by {|service| service.to_s}
|
63
61
|
end
|
64
|
-
servers
|
65
|
-
end
|
66
62
|
|
63
|
+
end
|
67
64
|
end
|
65
|
+
|
68
66
|
end
|
67
|
+
|
68
|
+
require 'fog/aws/bin'
|
69
|
+
require 'fog/bluebox/bin'
|
70
|
+
require 'fog/go_grid/bin'
|
71
|
+
require 'fog/linode/bin'
|
72
|
+
require 'fog/local/bin'
|
73
|
+
require 'fog/new_servers/bin'
|
74
|
+
require 'fog/rackspace/bin'
|
75
|
+
require 'fog/slicehost/bin'
|
76
|
+
require 'fog/terremark/bin'
|
77
|
+
require 'fog/vcloud/bin'
|
data/lib/fog/bluebox.rb
CHANGED
@@ -1,87 +1,18 @@
|
|
1
1
|
module Fog
|
2
2
|
module Bluebox
|
3
|
-
extend Fog::Service
|
4
3
|
|
5
|
-
|
4
|
+
extend Fog::Provider
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
model 'flavors'
|
10
|
-
model 'images'
|
11
|
-
model 'server'
|
12
|
-
model 'servers'
|
13
|
-
|
14
|
-
request_path 'fog/bluebox/requests'
|
15
|
-
request 'create_block'
|
16
|
-
request 'destroy_block'
|
17
|
-
request 'get_block'
|
18
|
-
request 'get_blocks'
|
19
|
-
request 'get_product'
|
20
|
-
request 'get_products'
|
21
|
-
request 'get_template'
|
22
|
-
request 'get_templates'
|
23
|
-
request 'reboot_block'
|
24
|
-
|
25
|
-
class Mock
|
26
|
-
include Collections
|
27
|
-
|
28
|
-
def self.data
|
29
|
-
@data ||= Hash.new do |hash, key|
|
30
|
-
hash[key] = {}
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.reset_data(keys=data.keys)
|
35
|
-
for key in [*keys]
|
36
|
-
data.delete(key)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def initialize(options={})
|
41
|
-
@bluebox_api_key = options[:bluebox_api_key]
|
42
|
-
@data = self.class.data[@bluebox_api_key]
|
43
|
-
end
|
6
|
+
service_path 'fog/bluebox'
|
7
|
+
service :compute
|
44
8
|
|
9
|
+
def self.new(attributes = {})
|
10
|
+
location = caller.first
|
11
|
+
warning = "[yellow][WARN] Fog::Bluebox#new is deprecated, use Fog::Bluebox::Compute#new instead[/]"
|
12
|
+
warning << " [light_black](" << location << ")[/] "
|
13
|
+
Formatador.display_line(warning)
|
14
|
+
Fog::Bluebox::Compute.new(attributes)
|
45
15
|
end
|
46
16
|
|
47
|
-
class Real
|
48
|
-
include Collections
|
49
|
-
|
50
|
-
def initialize(options={})
|
51
|
-
@bluebox_api_key = options[:bluebox_api_key]
|
52
|
-
@bluebox_customer_id = options[:bluebox_customer_id]
|
53
|
-
@host = options[:bluebox_host] || "boxpanel.blueboxgrp.com"
|
54
|
-
@port = options[:bluebox_port] || 443
|
55
|
-
@scheme = options[:bluebox_scheme] || 'https'
|
56
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
57
|
-
end
|
58
|
-
|
59
|
-
def reload
|
60
|
-
@connection.reset
|
61
|
-
end
|
62
|
-
|
63
|
-
def request(params)
|
64
|
-
params[:headers] ||= {}
|
65
|
-
params[:headers].merge!({
|
66
|
-
'Authorization' => "Basic #{Base64.encode64([@bluebox_customer_id, @bluebox_api_key].join(':')).delete("\r\n")}"
|
67
|
-
})
|
68
|
-
|
69
|
-
begin
|
70
|
-
response = @connection.request(params.merge!({:host => @host}))
|
71
|
-
rescue Excon::Errors::Error => error
|
72
|
-
raise case error
|
73
|
-
when Excon::Errors::NotFound
|
74
|
-
Fog::Bluebox::NotFound.slurp(error)
|
75
|
-
else
|
76
|
-
error
|
77
|
-
end
|
78
|
-
end
|
79
|
-
unless response.body.empty?
|
80
|
-
response.body = JSON.parse(response.body)
|
81
|
-
end
|
82
|
-
response
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
86
17
|
end
|
87
18
|
end
|