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.rb
CHANGED
@@ -8,6 +8,7 @@ require 'json'
|
|
8
8
|
require 'mime/types'
|
9
9
|
require 'net/ssh'
|
10
10
|
require 'nokogiri'
|
11
|
+
require 'tempfile'
|
11
12
|
require 'time'
|
12
13
|
|
13
14
|
__DIR__ = File.dirname(__FILE__)
|
@@ -24,24 +25,14 @@ require 'fog/errors'
|
|
24
25
|
require 'fog/hmac'
|
25
26
|
require 'fog/model'
|
26
27
|
require 'fog/parser'
|
28
|
+
require 'fog/provider'
|
27
29
|
require 'fog/service'
|
28
30
|
require 'fog/ssh'
|
29
31
|
|
30
|
-
require 'fog/aws'
|
31
|
-
require 'fog/bluebox'
|
32
|
-
require 'fog/go_grid'
|
33
|
-
require 'fog/linode'
|
34
|
-
require 'fog/local'
|
35
|
-
require 'fog/new_servers'
|
36
|
-
require 'fog/rackspace'
|
37
|
-
require 'fog/slicehost'
|
38
|
-
require 'fog/terremark'
|
39
|
-
require 'fog/vcloud'
|
40
|
-
|
41
32
|
module Fog
|
42
33
|
|
43
34
|
unless const_defined?(:VERSION)
|
44
|
-
VERSION = '0.
|
35
|
+
VERSION = '0.3.0'
|
45
36
|
end
|
46
37
|
|
47
38
|
module Mock
|
@@ -61,6 +52,14 @@ module Fog
|
|
61
52
|
|
62
53
|
end
|
63
54
|
|
55
|
+
def self.bin
|
56
|
+
@bin ||= false
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.bin=(new_bin)
|
60
|
+
@bin = new_bin
|
61
|
+
end
|
62
|
+
|
64
63
|
def self.mock!
|
65
64
|
@mocking = true
|
66
65
|
end
|
@@ -84,3 +83,14 @@ module Fog
|
|
84
83
|
end
|
85
84
|
|
86
85
|
end
|
86
|
+
|
87
|
+
require 'fog/aws'
|
88
|
+
require 'fog/bluebox'
|
89
|
+
require 'fog/go_grid'
|
90
|
+
require 'fog/linode'
|
91
|
+
require 'fog/local'
|
92
|
+
require 'fog/new_servers'
|
93
|
+
require 'fog/rackspace'
|
94
|
+
require 'fog/slicehost'
|
95
|
+
require 'fog/terremark'
|
96
|
+
require 'fog/vcloud'
|
data/lib/fog/attributes.rb
CHANGED
@@ -15,10 +15,6 @@ module Fog
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def attribute(name, options = {})
|
18
|
-
# FIXME: handle legacy where options would have been one or more aliases
|
19
|
-
if !options.is_a?(Hash)
|
20
|
-
options = {:aliases => options}
|
21
|
-
end
|
22
18
|
class_eval <<-EOS, __FILE__, __LINE__
|
23
19
|
attr_reader :#{name}
|
24
20
|
EOS
|
@@ -100,9 +96,9 @@ module Fog
|
|
100
96
|
end
|
101
97
|
end
|
102
98
|
|
103
|
-
def identity(name,
|
99
|
+
def identity(name, options = {})
|
104
100
|
@identity = name
|
105
|
-
self.attribute(name,
|
101
|
+
self.attribute(name, options)
|
106
102
|
end
|
107
103
|
|
108
104
|
def ignore_attributes(*args)
|
data/lib/fog/aws.rb
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
require 'fog/aws/ec2.rb'
|
2
|
-
require 'fog/aws/elb.rb'
|
3
|
-
require 'fog/aws/s3'
|
4
|
-
require 'fog/aws/simpledb'
|
5
|
-
|
6
1
|
module Fog
|
7
2
|
module AWS
|
8
3
|
|
4
|
+
extend Fog::Provider
|
5
|
+
|
6
|
+
service_path 'fog/aws'
|
7
|
+
service 'compute'
|
8
|
+
service 'ec2'
|
9
|
+
service 'elb'
|
10
|
+
service 's3'
|
11
|
+
service 'simpledb'
|
12
|
+
service 'storage'
|
13
|
+
|
9
14
|
def self.indexed_param(key, values, offset = 0)
|
10
15
|
params = {}
|
11
16
|
unless key.include?('%d')
|
data/lib/fog/aws/bin.rb
CHANGED
@@ -1,73 +1,37 @@
|
|
1
|
-
|
1
|
+
class AWS < Fog::Bin
|
2
2
|
class << self
|
3
|
-
credential = (ARGV.first && :"#{ARGV.first}") || :default
|
4
|
-
if Fog.credentials[:aws_access_key_id] && Fog.credentials[:aws_secret_access_key]
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
4
|
+
def [](service)
|
5
|
+
@@connections ||= Hash.new do |hash, key|
|
6
|
+
hash[key] = case key
|
7
|
+
when :compute
|
8
|
+
Fog::AWS::Compute.new
|
9
|
+
when :ec2
|
10
|
+
location = caller.first
|
11
|
+
warning = "[yellow][WARN] AWS[:ec2] is deprecated, use AWS[:compute] instead[/]"
|
12
|
+
warning << " [light_black](" << location << ")[/] "
|
13
|
+
Formatador.display_line(warning)
|
14
|
+
Fog::AWS::Compute.new
|
15
|
+
when :elb
|
16
|
+
Fog::AWS::ELB.new
|
17
|
+
when :simpledb
|
18
|
+
Fog::AWS::SimpleDB.new
|
19
|
+
when :s3
|
20
|
+
location = caller.first
|
21
|
+
warning = "[yellow][WARN] AWS[:s3] is deprecated, use AWS[:storage] instead[/]"
|
22
|
+
warning << " [light_black](" << location << ")[/] "
|
23
|
+
Formatador.display_line(warning)
|
24
|
+
Fog::AWS::Storage.new
|
25
|
+
when :storage
|
26
|
+
Fog::AWS::Storage.new
|
25
27
|
end
|
26
|
-
@@connections[service]
|
27
|
-
end
|
28
|
-
|
29
|
-
def addresses
|
30
|
-
self[:ec2].addresses
|
31
|
-
end
|
32
|
-
|
33
|
-
def directories
|
34
|
-
self[:s3].directories
|
35
|
-
end
|
36
|
-
|
37
|
-
def flavors
|
38
|
-
self[:ec2].flavors
|
39
|
-
end
|
40
|
-
|
41
|
-
def images
|
42
|
-
self[:ec2].images
|
43
|
-
end
|
44
|
-
|
45
|
-
def servers
|
46
|
-
self[:ec2].servers
|
47
|
-
end
|
48
|
-
|
49
|
-
def key_pairs
|
50
|
-
self[:ec2].key_pairs
|
51
|
-
end
|
52
|
-
|
53
|
-
def security_groups
|
54
|
-
self[:ec2].security_groups
|
55
|
-
end
|
56
|
-
|
57
|
-
def snapshots
|
58
|
-
self[:ec2].snapshots
|
59
|
-
end
|
60
|
-
|
61
|
-
def volumes
|
62
|
-
self[:ec2].volumes
|
63
|
-
end
|
64
|
-
|
65
|
-
else
|
66
|
-
|
67
|
-
def initialized?
|
68
|
-
false
|
69
28
|
end
|
29
|
+
@@connections[service]
|
30
|
+
end
|
70
31
|
|
32
|
+
def services
|
33
|
+
[:compute, :elb, :simpledb, :storage]
|
71
34
|
end
|
35
|
+
|
72
36
|
end
|
73
37
|
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class Compute < Fog::Service
|
4
|
+
|
5
|
+
requires :aws_access_key_id, :aws_secret_access_key
|
6
|
+
|
7
|
+
model_path 'fog/aws/models/compute'
|
8
|
+
model :address
|
9
|
+
collection :addresses
|
10
|
+
model :flavor
|
11
|
+
collection :flavors
|
12
|
+
model :image
|
13
|
+
collection :images
|
14
|
+
model :key_pair
|
15
|
+
collection :key_pairs
|
16
|
+
model :security_group
|
17
|
+
collection :security_groups
|
18
|
+
model :server
|
19
|
+
collection :servers
|
20
|
+
model :snapshot
|
21
|
+
collection :snapshots
|
22
|
+
model :volume
|
23
|
+
collection :volumes
|
24
|
+
|
25
|
+
require 'fog/aws/parsers/compute/basic'
|
26
|
+
|
27
|
+
request_path 'fog/aws/requests/compute'
|
28
|
+
request :allocate_address
|
29
|
+
request :associate_address
|
30
|
+
request :attach_volume
|
31
|
+
request :authorize_security_group_ingress
|
32
|
+
request :create_key_pair
|
33
|
+
request :create_security_group
|
34
|
+
request :create_snapshot
|
35
|
+
request :create_image
|
36
|
+
request :create_volume
|
37
|
+
request :delete_key_pair
|
38
|
+
request :delete_security_group
|
39
|
+
request :delete_snapshot
|
40
|
+
request :delete_volume
|
41
|
+
request :deregister_image
|
42
|
+
request :describe_addresses
|
43
|
+
request :describe_availability_zones
|
44
|
+
request :describe_images
|
45
|
+
request :describe_instances
|
46
|
+
request :describe_reserved_instances
|
47
|
+
request :describe_key_pairs
|
48
|
+
request :describe_regions
|
49
|
+
request :describe_security_groups
|
50
|
+
request :describe_snapshots
|
51
|
+
request :describe_volumes
|
52
|
+
request :detach_volume
|
53
|
+
request :disassociate_address
|
54
|
+
request :get_console_output
|
55
|
+
request :import_key_pair
|
56
|
+
request :modify_image_attributes
|
57
|
+
request :modify_snapshot_attribute
|
58
|
+
request :reboot_instances
|
59
|
+
request :release_address
|
60
|
+
request :register_image
|
61
|
+
request :revoke_security_group_ingress
|
62
|
+
request :run_instances
|
63
|
+
request :terminate_instances
|
64
|
+
request :start_instances
|
65
|
+
request :stop_instances
|
66
|
+
|
67
|
+
class Mock
|
68
|
+
|
69
|
+
def self.data
|
70
|
+
@data ||= Hash.new do |hash, key|
|
71
|
+
owner_id = Fog::AWS::Mock.owner_id
|
72
|
+
hash[key] = {
|
73
|
+
:deleted_at => {},
|
74
|
+
:addresses => {},
|
75
|
+
:instances => {},
|
76
|
+
:key_pairs => {},
|
77
|
+
:limits => { :addresses => 5 },
|
78
|
+
:owner_id => owner_id,
|
79
|
+
:security_groups => {
|
80
|
+
'default' => {
|
81
|
+
'groupDescription' => 'default group',
|
82
|
+
'groupName' => 'default',
|
83
|
+
'ipPermissions' => [
|
84
|
+
{
|
85
|
+
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
86
|
+
'fromPort' => -1,
|
87
|
+
'toPort' => -1,
|
88
|
+
'ipProtocol' => 'icmp',
|
89
|
+
'ipRanges' => []
|
90
|
+
},
|
91
|
+
{
|
92
|
+
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
93
|
+
'fromPort' => 0,
|
94
|
+
'toPort' => 65535,
|
95
|
+
'ipProtocol' => 'tcp',
|
96
|
+
'ipRanges' => []
|
97
|
+
},
|
98
|
+
{
|
99
|
+
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
100
|
+
'fromPort' => 0,
|
101
|
+
'toPort' => 65535,
|
102
|
+
'ipProtocol' => 'udp',
|
103
|
+
'ipRanges' => []
|
104
|
+
}
|
105
|
+
],
|
106
|
+
'ownerId' => owner_id
|
107
|
+
}
|
108
|
+
},
|
109
|
+
:snapshots => {},
|
110
|
+
:volumes => {}
|
111
|
+
}
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def self.reset_data(keys=data.keys)
|
116
|
+
for key in [*keys]
|
117
|
+
data.delete(key)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def initialize(options={})
|
122
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
123
|
+
@data = self.class.data[@aws_access_key_id]
|
124
|
+
@owner_id = @data[:owner_id]
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
class Real
|
130
|
+
|
131
|
+
# Initialize connection to EC2
|
132
|
+
#
|
133
|
+
# ==== Notes
|
134
|
+
# options parameter must include values for :aws_access_key_id and
|
135
|
+
# :aws_secret_access_key in order to create a connection
|
136
|
+
#
|
137
|
+
# ==== Examples
|
138
|
+
# sdb = SimpleDB.new(
|
139
|
+
# :aws_access_key_id => your_aws_access_key_id,
|
140
|
+
# :aws_secret_access_key => your_aws_secret_access_key
|
141
|
+
# )
|
142
|
+
#
|
143
|
+
# ==== Parameters
|
144
|
+
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
145
|
+
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1']
|
146
|
+
#
|
147
|
+
# ==== Returns
|
148
|
+
# * EC2 object with connection to aws.
|
149
|
+
def initialize(options={})
|
150
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
151
|
+
@aws_secret_access_key = options[:aws_secret_access_key]
|
152
|
+
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
153
|
+
options[:region] ||= 'us-east-1'
|
154
|
+
@host = options[:host] || case options[:region]
|
155
|
+
when 'ap-southeast-1'
|
156
|
+
'ec2.ap-southeast-1.amazonaws.com'
|
157
|
+
when 'eu-west-1'
|
158
|
+
'ec2.eu-west-1.amazonaws.com'
|
159
|
+
when 'us-east-1'
|
160
|
+
'ec2.us-east-1.amazonaws.com'
|
161
|
+
when 'us-west-1'
|
162
|
+
'ec2.us-west-1.amazonaws.com'
|
163
|
+
else
|
164
|
+
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
165
|
+
end
|
166
|
+
@port = options[:port] || 443
|
167
|
+
@scheme = options[:scheme] || 'https'
|
168
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
169
|
+
end
|
170
|
+
|
171
|
+
def reload
|
172
|
+
@connection.reset
|
173
|
+
end
|
174
|
+
|
175
|
+
private
|
176
|
+
|
177
|
+
def request(params)
|
178
|
+
idempotent = params.delete(:idempotent)
|
179
|
+
parser = params.delete(:parser)
|
180
|
+
|
181
|
+
body = AWS.signed_params(
|
182
|
+
params,
|
183
|
+
{
|
184
|
+
:aws_access_key_id => @aws_access_key_id,
|
185
|
+
:hmac => @hmac,
|
186
|
+
:host => @host,
|
187
|
+
:version => '2010-08-31'
|
188
|
+
}
|
189
|
+
)
|
190
|
+
|
191
|
+
begin
|
192
|
+
response = @connection.request({
|
193
|
+
:body => body,
|
194
|
+
:expects => 200,
|
195
|
+
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
196
|
+
:idempotent => idempotent,
|
197
|
+
:host => @host,
|
198
|
+
:method => 'POST',
|
199
|
+
:parser => parser
|
200
|
+
})
|
201
|
+
rescue Excon::Errors::Error => error
|
202
|
+
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
203
|
+
raise case match[1].split('.').last
|
204
|
+
when 'NotFound'
|
205
|
+
Fog::AWS::Compute::NotFound.slurp(error, match[2])
|
206
|
+
else
|
207
|
+
Fog::AWS::Compute::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
208
|
+
end
|
209
|
+
else
|
210
|
+
raise error
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
response
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
data/lib/fog/aws/ec2.rb
CHANGED
@@ -1,222 +1,15 @@
|
|
1
|
-
|
1
|
+
module Fog
|
2
2
|
module AWS
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
model 'flavor'
|
12
|
-
model 'flavors'
|
13
|
-
model 'image'
|
14
|
-
model 'images'
|
15
|
-
model 'key_pair'
|
16
|
-
model 'key_pairs'
|
17
|
-
model 'security_group'
|
18
|
-
model 'security_groups'
|
19
|
-
model 'server'
|
20
|
-
model 'servers'
|
21
|
-
model 'snapshot'
|
22
|
-
model 'snapshots'
|
23
|
-
model 'volume'
|
24
|
-
model 'volumes'
|
25
|
-
|
26
|
-
require 'fog/aws/parsers/ec2/basic'
|
27
|
-
|
28
|
-
request_path 'fog/aws/requests/ec2'
|
29
|
-
request 'allocate_address'
|
30
|
-
request 'associate_address'
|
31
|
-
request 'attach_volume'
|
32
|
-
request 'authorize_security_group_ingress'
|
33
|
-
request 'create_key_pair'
|
34
|
-
request 'create_security_group'
|
35
|
-
request 'create_snapshot'
|
36
|
-
request 'create_image'
|
37
|
-
request 'create_volume'
|
38
|
-
request 'delete_key_pair'
|
39
|
-
request 'delete_security_group'
|
40
|
-
request 'delete_snapshot'
|
41
|
-
request 'delete_volume'
|
42
|
-
request 'deregister_image'
|
43
|
-
request 'describe_addresses'
|
44
|
-
request 'describe_availability_zones'
|
45
|
-
request 'describe_images'
|
46
|
-
request 'describe_instances'
|
47
|
-
request 'describe_reserved_instances'
|
48
|
-
request 'describe_key_pairs'
|
49
|
-
request 'describe_regions'
|
50
|
-
request 'describe_security_groups'
|
51
|
-
request 'describe_snapshots'
|
52
|
-
request 'describe_volumes'
|
53
|
-
request 'detach_volume'
|
54
|
-
request 'disassociate_address'
|
55
|
-
request 'get_console_output'
|
56
|
-
request 'modify_image_attributes'
|
57
|
-
request 'modify_snapshot_attribute'
|
58
|
-
request 'reboot_instances'
|
59
|
-
request 'release_address'
|
60
|
-
request 'register_image'
|
61
|
-
request 'revoke_security_group_ingress'
|
62
|
-
request 'run_instances'
|
63
|
-
request 'terminate_instances'
|
64
|
-
request 'start_instances'
|
65
|
-
request 'stop_instances'
|
66
|
-
|
67
|
-
class Mock
|
68
|
-
include Collections
|
69
|
-
|
70
|
-
def self.data
|
71
|
-
@data ||= Hash.new do |hash, key|
|
72
|
-
owner_id = Fog::AWS::Mock.owner_id
|
73
|
-
hash[key] = {
|
74
|
-
:deleted_at => {},
|
75
|
-
:addresses => {},
|
76
|
-
:instances => {},
|
77
|
-
:key_pairs => {},
|
78
|
-
:limits => { :addresses => 5 },
|
79
|
-
:owner_id => owner_id,
|
80
|
-
:security_groups => {
|
81
|
-
'default' => {
|
82
|
-
'groupDescription' => 'default group',
|
83
|
-
'groupName' => 'default',
|
84
|
-
'ipPermissions' => [
|
85
|
-
{
|
86
|
-
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
87
|
-
'fromPort' => -1,
|
88
|
-
'toPort' => -1,
|
89
|
-
'ipProtocol' => 'icmp',
|
90
|
-
'ipRanges' => []
|
91
|
-
},
|
92
|
-
{
|
93
|
-
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
94
|
-
'fromPort' => 0,
|
95
|
-
'toPort' => 65535,
|
96
|
-
'ipProtocol' => 'tcp',
|
97
|
-
'ipRanges' => []
|
98
|
-
},
|
99
|
-
{
|
100
|
-
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
101
|
-
'fromPort' => 0,
|
102
|
-
'toPort' => 65535,
|
103
|
-
'ipProtocol' => 'udp',
|
104
|
-
'ipRanges' => []
|
105
|
-
}
|
106
|
-
],
|
107
|
-
'ownerId' => owner_id
|
108
|
-
}
|
109
|
-
},
|
110
|
-
:snapshots => {},
|
111
|
-
:volumes => {}
|
112
|
-
}
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
def self.reset_data(keys=data.keys)
|
117
|
-
for key in [*keys]
|
118
|
-
data.delete(key)
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
def initialize(options={})
|
123
|
-
@aws_access_key_id = options[:aws_access_key_id]
|
124
|
-
@data = self.class.data[@aws_access_key_id]
|
125
|
-
@owner_id = @data[:owner_id]
|
126
|
-
end
|
127
|
-
|
3
|
+
class EC2
|
4
|
+
|
5
|
+
def self.new(attributes = {})
|
6
|
+
location = caller.first
|
7
|
+
warning = "[yellow][WARN] Fog::AWS::EC2#new is deprecated, use Fog::AWS::Compute#new instead[/]"
|
8
|
+
warning << " [light_black](" << location << ")[/] "
|
9
|
+
Formatador.display_line(warning)
|
10
|
+
Fog::AWS::Compute.new(attributes)
|
128
11
|
end
|
129
12
|
|
130
|
-
class Real
|
131
|
-
include Collections
|
132
|
-
|
133
|
-
# Initialize connection to EC2
|
134
|
-
#
|
135
|
-
# ==== Notes
|
136
|
-
# options parameter must include values for :aws_access_key_id and
|
137
|
-
# :aws_secret_access_key in order to create a connection
|
138
|
-
#
|
139
|
-
# ==== Examples
|
140
|
-
# sdb = SimpleDB.new(
|
141
|
-
# :aws_access_key_id => your_aws_access_key_id,
|
142
|
-
# :aws_secret_access_key => your_aws_secret_access_key
|
143
|
-
# )
|
144
|
-
#
|
145
|
-
# ==== Parameters
|
146
|
-
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
147
|
-
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1']
|
148
|
-
#
|
149
|
-
# ==== Returns
|
150
|
-
# * EC2 object with connection to aws.
|
151
|
-
def initialize(options={})
|
152
|
-
@aws_access_key_id = options[:aws_access_key_id]
|
153
|
-
@aws_secret_access_key = options[:aws_secret_access_key]
|
154
|
-
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
155
|
-
options[:region] ||= 'us-east-1'
|
156
|
-
@host = options[:host] || case options[:region]
|
157
|
-
when 'ap-southeast-1'
|
158
|
-
'ec2.ap-southeast-1.amazonaws.com'
|
159
|
-
when 'eu-west-1'
|
160
|
-
'ec2.eu-west-1.amazonaws.com'
|
161
|
-
when 'us-east-1'
|
162
|
-
'ec2.us-east-1.amazonaws.com'
|
163
|
-
when 'us-west-1'
|
164
|
-
'ec2.us-west-1.amazonaws.com'
|
165
|
-
else
|
166
|
-
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
167
|
-
end
|
168
|
-
@port = options[:port] || 443
|
169
|
-
@scheme = options[:scheme] || 'https'
|
170
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
171
|
-
end
|
172
|
-
|
173
|
-
def reload
|
174
|
-
@connection.reset
|
175
|
-
end
|
176
|
-
|
177
|
-
private
|
178
|
-
|
179
|
-
def request(params)
|
180
|
-
idempotent = params.delete(:idempotent)
|
181
|
-
parser = params.delete(:parser)
|
182
|
-
|
183
|
-
body = AWS.signed_params(
|
184
|
-
params,
|
185
|
-
{
|
186
|
-
:aws_access_key_id => @aws_access_key_id,
|
187
|
-
:hmac => @hmac,
|
188
|
-
:host => @host,
|
189
|
-
:version => '2009-11-30'
|
190
|
-
}
|
191
|
-
)
|
192
|
-
|
193
|
-
begin
|
194
|
-
response = @connection.request({
|
195
|
-
:body => body,
|
196
|
-
:expects => 200,
|
197
|
-
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
198
|
-
:idempotent => idempotent,
|
199
|
-
:host => @host,
|
200
|
-
:method => 'POST',
|
201
|
-
:parser => parser
|
202
|
-
})
|
203
|
-
rescue Excon::Errors::Error => error
|
204
|
-
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
205
|
-
raise case match[1].split('.').last
|
206
|
-
when 'NotFound'
|
207
|
-
Fog::AWS::EC2::NotFound.slurp(error, match[2])
|
208
|
-
else
|
209
|
-
Fog::AWS::EC2::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
210
|
-
end
|
211
|
-
else
|
212
|
-
raise error
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
|
-
response
|
217
|
-
end
|
218
|
-
|
219
|
-
end
|
220
13
|
end
|
221
14
|
end
|
222
15
|
end
|