fog 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/benchs/load_times.rb +31 -0
- data/changelog.txt +320 -0
- data/fog.gemspec +3 -3
- data/lib/fog.rb +42 -15
- data/lib/fog/aws/auto_scaling.rb +1 -1
- data/lib/fog/aws/beanstalk.rb +1 -1
- data/lib/fog/aws/cloud_formation.rb +1 -1
- data/lib/fog/aws/compute.rb +1 -1
- data/lib/fog/aws/elasticache.rb +1 -1
- data/lib/fog/aws/elb.rb +1 -1
- data/lib/fog/aws/iam.rb +1 -1
- data/lib/fog/aws/models/beanstalk/environment.rb +6 -2
- data/lib/fog/aws/models/cdn/distributions.rb +2 -1
- data/lib/fog/aws/models/cdn/distributions_helper.rb +2 -1
- data/lib/fog/aws/models/cdn/streaming_distributions.rb +2 -1
- data/lib/fog/aws/models/compute/server.rb +1 -1
- data/lib/fog/aws/models/storage/directory.rb +1 -1
- data/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/fog/aws/parsers/beanstalk/describe_environment_resources.rb +11 -0
- data/lib/fog/aws/rds.rb +1 -1
- data/lib/fog/aws/requests/cdn/delete_distribution.rb +5 -7
- data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +5 -7
- data/lib/fog/aws/requests/cdn/get_distribution.rb +28 -31
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +29 -33
- data/lib/fog/aws/requests/cdn/get_invalidation.rb +15 -13
- data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +15 -17
- data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +23 -26
- data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +29 -33
- data/lib/fog/aws/requests/cdn/post_distribution.rb +40 -42
- data/lib/fog/aws/requests/cdn/post_invalidation.rb +14 -18
- data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +28 -30
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +41 -43
- data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +31 -33
- data/lib/fog/aws/requests/cloud_formation/create_stack.rb +16 -20
- data/lib/fog/aws/requests/cloud_formation/delete_stack.rb +5 -8
- data/lib/fog/aws/requests/cloud_formation/describe_stack_events.rb +19 -22
- data/lib/fog/aws/requests/cloud_formation/describe_stack_resources.rb +18 -21
- data/lib/fog/aws/requests/cloud_formation/describe_stacks.rb +18 -21
- data/lib/fog/aws/requests/cloud_formation/get_template.rb +7 -10
- data/lib/fog/aws/requests/cloud_formation/update_stack.rb +12 -16
- data/lib/fog/aws/requests/cloud_formation/validate_template.rb +9 -12
- data/lib/fog/aws/requests/compute/associate_address.rb +13 -7
- data/lib/fog/aws/requests/compute/describe_reserved_instances_offerings.rb +16 -2
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -2
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +10 -0
- data/lib/fog/aws/requests/iam/update_server_certificate.rb +27 -0
- data/lib/fog/aws/requests/storage/get_object.rb +6 -2
- data/lib/fog/aws/storage.rb +6 -4
- data/lib/fog/aws/sts.rb +1 -1
- data/lib/fog/bin.rb +2 -0
- data/lib/fog/bin/digitalocean.rb +31 -0
- data/lib/fog/bin/riakcs.rb +27 -0
- data/lib/fog/cloudstack/compute.rb +3 -0
- data/lib/fog/cloudstack/models/compute/snapshot.rb +46 -0
- data/lib/fog/cloudstack/models/compute/snapshots.rb +25 -0
- data/lib/fog/cloudstack/requests/compute/create_snapshot.rb +24 -0
- data/lib/fog/compute.rb +3 -0
- data/lib/fog/compute/models/server.rb +6 -7
- data/lib/fog/core.rb +10 -5
- data/lib/fog/core/errors.rb +2 -0
- data/lib/fog/core/scp.rb +3 -3
- data/lib/fog/core/ssh.rb +1 -1
- data/lib/fog/digitalocean.rb +9 -0
- data/lib/fog/digitalocean/CHANGELOG.md +6 -0
- data/lib/fog/digitalocean/compute.rb +107 -0
- data/lib/fog/digitalocean/examples/getting_started.md +106 -0
- data/lib/fog/digitalocean/models/compute/flavor.rb +14 -0
- data/lib/fog/digitalocean/models/compute/flavors.rb +25 -0
- data/lib/fog/digitalocean/models/compute/image.rb +15 -0
- data/lib/fog/digitalocean/models/compute/images.rb +25 -0
- data/lib/fog/digitalocean/models/compute/region.rb +14 -0
- data/lib/fog/digitalocean/models/compute/regions.rb +25 -0
- data/lib/fog/digitalocean/models/compute/server.rb +150 -0
- data/lib/fog/digitalocean/models/compute/servers.rb +27 -0
- data/lib/fog/digitalocean/models/compute/ssh_key.rb +28 -0
- data/lib/fog/digitalocean/models/compute/ssh_keys.rb +27 -0
- data/lib/fog/digitalocean/requests/compute/create_server.rb +68 -0
- data/lib/fog/digitalocean/requests/compute/create_ssh_key.rb +38 -0
- data/lib/fog/digitalocean/requests/compute/destroy_server.rb +34 -0
- data/lib/fog/digitalocean/requests/compute/destroy_ssh_key.rb +37 -0
- data/lib/fog/digitalocean/requests/compute/get_server_details.rb +35 -0
- data/lib/fog/digitalocean/requests/compute/get_ssh_key.rb +39 -0
- data/lib/fog/digitalocean/requests/compute/list_flavors.rb +38 -0
- data/lib/fog/digitalocean/requests/compute/list_images.rb +49 -0
- data/lib/fog/digitalocean/requests/compute/list_regions.rb +34 -0
- data/lib/fog/digitalocean/requests/compute/list_servers.rb +31 -0
- data/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb +31 -0
- data/lib/fog/digitalocean/requests/compute/power_cycle_server.rb +33 -0
- data/lib/fog/digitalocean/requests/compute/power_off_server.rb +33 -0
- data/lib/fog/digitalocean/requests/compute/power_on_server.rb +33 -0
- data/lib/fog/digitalocean/requests/compute/reboot_server.rb +33 -0
- data/lib/fog/digitalocean/requests/compute/shutdown_server.rb +36 -0
- data/lib/fog/dreamhost/CHANGELOG.md +8 -0
- data/lib/fog/glesys/models/compute/server.rb +3 -3
- data/lib/fog/google/storage.rb +1 -1
- data/lib/fog/hp.rb +1 -1
- data/lib/fog/hp/CHANGELOG.hp +12 -2
- data/lib/fog/hp/block_storage.rb +1 -0
- data/lib/fog/hp/cdn.rb +1 -0
- data/lib/fog/hp/compute.rb +1 -0
- data/lib/fog/hp/models/compute/server.rb +14 -8
- data/lib/fog/hp/models/storage/directories.rb +1 -1
- data/lib/fog/hp/models/storage/directory.rb +28 -3
- data/lib/fog/hp/models/storage/files.rb +1 -1
- data/lib/fog/hp/requests/compute/create_server.rb +4 -14
- data/lib/fog/hp/storage.rb +2 -0
- data/lib/fog/internet_archive.rb +3 -1
- data/lib/fog/internet_archive/models/storage/directory.rb +25 -42
- data/lib/fog/internet_archive/models/storage/file.rb +45 -64
- data/lib/fog/internet_archive/models/storage/ia_attributes.rb +39 -0
- data/lib/fog/internet_archive/requests/storage/delete_multiple_objects.rb +4 -78
- data/lib/fog/internet_archive/requests/storage/delete_object.rb +2 -70
- data/lib/fog/internet_archive/requests/storage/get_object.rb +1 -22
- data/lib/fog/internet_archive/requests/storage/get_object_acl.rb +0 -4
- data/lib/fog/internet_archive/requests/storage/get_service.rb +1 -2
- data/lib/fog/internet_archive/requests/storage/head_object.rb +0 -4
- data/lib/fog/internet_archive/requests/storage/post_object_hidden_fields.rb +1 -1
- data/lib/fog/internet_archive/requests/storage/put_object.rb +2 -17
- data/lib/fog/internet_archive/requests/storage/put_object_acl.rb +0 -5
- data/lib/fog/internet_archive/storage.rb +6 -18
- data/lib/fog/joyent.rb +2 -0
- data/lib/fog/libvirt/requests/compute/get_node_info.rb +1 -1
- data/lib/fog/openstack/CHANGELOG.md +47 -0
- data/lib/fog/openstack/examples/identity/basics.rb +69 -0
- data/lib/fog/openstack/examples/image/upload-test-image.rb +77 -0
- data/lib/fog/openstack/examples/network/network_subnets_routers.rb +63 -0
- data/lib/fog/openstack/examples/storage/set-account-quota.rb +66 -0
- data/lib/fog/openstack/image.rb +4 -0
- data/lib/fog/openstack/models/compute/server.rb +4 -2
- data/lib/fog/openstack/models/network/floating_ip.rb +2 -2
- data/lib/fog/openstack/models/network/floating_ips.rb +1 -1
- data/lib/fog/openstack/models/network/router.rb +56 -0
- data/lib/fog/openstack/models/network/routers.rb +34 -0
- data/lib/fog/openstack/network.rb +15 -2
- data/lib/fog/openstack/requests/compute/create_server.rb +11 -0
- data/lib/fog/openstack/requests/compute/rebuild_server.rb +9 -1
- data/lib/fog/openstack/requests/network/add_router_interface.rb +48 -0
- data/lib/fog/openstack/requests/network/create_network.rb +57 -2
- data/lib/fog/openstack/requests/network/create_router.rb +57 -0
- data/lib/fog/openstack/requests/network/delete_router.rb +30 -0
- data/lib/fog/openstack/requests/network/get_router.rb +32 -0
- data/lib/fog/openstack/requests/network/list_routers.rb +27 -0
- data/lib/fog/openstack/requests/network/remove_router_interface.rb +36 -0
- data/lib/fog/openstack/requests/network/update_router.rb +85 -0
- data/lib/fog/openstack/storage.rb +57 -0
- data/lib/fog/ovirt/compute.rb +4 -0
- data/lib/fog/ovirt/models/compute/quota.rb +21 -0
- data/lib/fog/ovirt/models/compute/quotas.rb +24 -0
- data/lib/fog/ovirt/models/compute/server.rb +2 -1
- data/lib/fog/ovirt/models/compute/volume.rb +1 -0
- data/lib/fog/ovirt/requests/compute/get_quota.rb +19 -0
- data/lib/fog/ovirt/requests/compute/list_quotas.rb +21 -0
- data/lib/fog/ovirt/requests/compute/mock_files/quotas.xml +7 -0
- data/lib/fog/rackspace.rb +11 -0
- data/lib/fog/rackspace/block_storage.rb +73 -20
- data/lib/fog/rackspace/cdn.rb +57 -19
- data/lib/fog/rackspace/compute.rb +53 -28
- data/lib/fog/rackspace/compute_v2.rb +99 -22
- data/lib/fog/rackspace/databases.rb +74 -18
- data/lib/fog/rackspace/dns.rb +55 -22
- data/lib/fog/rackspace/docs/block_storage.md +417 -0
- data/lib/fog/rackspace/docs/compute_v2.md +114 -55
- data/lib/fog/rackspace/docs/getting_started.md +20 -10
- data/lib/fog/rackspace/docs/storage.md +496 -0
- data/lib/fog/rackspace/examples/README.md +1 -1
- data/lib/fog/rackspace/examples/block_storage/create_snapshot.rb +118 -0
- data/lib/fog/rackspace/examples/block_storage/create_volume.rb +58 -0
- data/lib/fog/rackspace/examples/block_storage/delete_volume.rb +53 -0
- data/lib/fog/rackspace/examples/compute_v2/create_image.rb +2 -2
- data/lib/fog/rackspace/examples/compute_v2/create_server.rb +1 -1
- data/lib/fog/rackspace/examples/compute_v2/delete_image.rb +2 -2
- data/lib/fog/rackspace/examples/compute_v2/delete_server.rb +2 -2
- data/lib/fog/rackspace/examples/compute_v2/detach_volume.rb +4 -4
- data/lib/fog/rackspace/examples/compute_v2/resize_server.rb +2 -2
- data/lib/fog/rackspace/examples/compute_v2/server_attachments.rb +3 -3
- data/lib/fog/rackspace/examples/compute_v2/server_metadata.rb +2 -2
- data/lib/fog/rackspace/examples/storage/create_cdn_directory.rb +44 -0
- data/lib/fog/rackspace/examples/storage/create_private_directory.rb +46 -0
- data/lib/fog/rackspace/examples/storage/delete_directory.rb +62 -0
- data/lib/fog/rackspace/examples/storage/delete_file.rb +70 -0
- data/lib/fog/rackspace/examples/storage/download_file.rb +75 -0
- data/lib/fog/rackspace/examples/storage/lorem.txt +1 -0
- data/lib/fog/rackspace/examples/storage/storage_metadata.rb +82 -0
- data/lib/fog/rackspace/examples/storage/upload_file.rb +45 -0
- data/lib/fog/rackspace/identity.rb +10 -3
- data/lib/fog/rackspace/load_balancers.rb +76 -18
- data/lib/fog/rackspace/models/block_storage/snapshot.rb +42 -0
- data/lib/fog/rackspace/models/block_storage/snapshots.rb +15 -0
- data/lib/fog/rackspace/models/block_storage/volume.rb +65 -0
- data/lib/fog/rackspace/models/block_storage/volume_type.rb +6 -0
- data/lib/fog/rackspace/models/block_storage/volume_types.rb +15 -0
- data/lib/fog/rackspace/models/block_storage/volumes.rb +15 -0
- data/lib/fog/rackspace/models/compute_v2/attachment.rb +8 -0
- data/lib/fog/rackspace/models/compute_v2/attachments.rb +9 -1
- data/lib/fog/rackspace/models/compute_v2/flavors.rb +9 -1
- data/lib/fog/rackspace/models/compute_v2/image.rb +10 -2
- data/lib/fog/rackspace/models/compute_v2/images.rb +9 -1
- data/lib/fog/rackspace/models/compute_v2/meta_parent.rb +1 -1
- data/lib/fog/rackspace/models/compute_v2/metadata.rb +17 -5
- data/lib/fog/rackspace/models/compute_v2/metadatum.rb +8 -0
- data/lib/fog/rackspace/models/compute_v2/server.rb +72 -13
- data/lib/fog/rackspace/models/compute_v2/servers.rb +16 -2
- data/lib/fog/rackspace/models/dns/zones.rb +5 -9
- data/lib/fog/rackspace/models/identity/service_catalog.rb +83 -0
- data/lib/fog/rackspace/models/storage/account.rb +26 -0
- data/lib/fog/rackspace/models/storage/directories.rb +23 -3
- data/lib/fog/rackspace/models/storage/directory.rb +89 -5
- data/lib/fog/rackspace/models/storage/file.rb +112 -2
- data/lib/fog/rackspace/models/storage/files.rb +78 -0
- data/lib/fog/rackspace/models/storage/metadata.rb +28 -5
- data/lib/fog/rackspace/requests/block_storage/create_snapshot.rb +24 -0
- data/lib/fog/rackspace/requests/block_storage/create_volume.rb +29 -0
- data/lib/fog/rackspace/requests/block_storage/delete_snapshot.rb +10 -0
- data/lib/fog/rackspace/requests/block_storage/delete_volume.rb +11 -0
- data/lib/fog/rackspace/requests/block_storage/get_snapshot.rb +20 -0
- data/lib/fog/rackspace/requests/block_storage/get_volume.rb +24 -0
- data/lib/fog/rackspace/requests/block_storage/get_volume_type.rb +14 -0
- data/lib/fog/rackspace/requests/block_storage/list_snapshots.rb +17 -0
- data/lib/fog/rackspace/requests/block_storage/list_volume_types.rb +13 -0
- data/lib/fog/rackspace/requests/block_storage/list_volumes.rb +21 -0
- data/lib/fog/rackspace/requests/cdn/delete_object.rb +5 -1
- data/lib/fog/rackspace/requests/cdn/get_containers.rb +5 -0
- data/lib/fog/rackspace/requests/cdn/head_container.rb +5 -0
- data/lib/fog/rackspace/requests/cdn/post_container.rb +6 -1
- data/lib/fog/rackspace/requests/cdn/put_container.rb +6 -1
- data/lib/fog/rackspace/requests/compute_v2/attach_volume.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/change_server_password.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/confirm_resize_server.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/create_image.rb +9 -4
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +9 -5
- data/lib/fog/rackspace/requests/compute_v2/delete_attachment.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_image.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_metadata_item.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/get_attachment.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/get_flavor.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/get_image.rb +5 -1
- data/lib/fog/rackspace/requests/compute_v2/get_metadata_item.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/get_server.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_addresses.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_addresses_by_network.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_attachments.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_flavors.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_images.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_metadata.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/reboot_server.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/rebuild_server.rb +8 -4
- data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +6 -1
- data/lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb +8 -3
- data/lib/fog/rackspace/requests/compute_v2/set_metadata.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/set_metadata_item.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/update_metadata.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/update_server.rb +4 -0
- data/lib/fog/rackspace/requests/storage/copy_object.rb +4 -0
- data/lib/fog/rackspace/requests/storage/delete_container.rb +4 -1
- data/lib/fog/rackspace/requests/storage/delete_object.rb +4 -1
- data/lib/fog/rackspace/requests/storage/get_container.rb +4 -0
- data/lib/fog/rackspace/requests/storage/get_containers.rb +4 -0
- data/lib/fog/rackspace/requests/storage/get_object.rb +4 -1
- data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +7 -4
- data/lib/fog/rackspace/requests/storage/head_container.rb +4 -0
- data/lib/fog/rackspace/requests/storage/head_containers.rb +4 -0
- data/lib/fog/rackspace/requests/storage/head_object.rb +4 -1
- data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +4 -1
- data/lib/fog/rackspace/requests/storage/put_container.rb +4 -1
- data/lib/fog/rackspace/requests/storage/put_object.rb +4 -1
- data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +4 -1
- data/lib/fog/rackspace/service.rb +78 -0
- data/lib/fog/rackspace/storage.rb +62 -22
- data/lib/fog/riakcs.rb +122 -0
- data/lib/fog/riakcs/provisioning.rb +100 -0
- data/lib/fog/riakcs/requests/provisioning/create_user.rb +77 -0
- data/lib/fog/riakcs/requests/provisioning/disable_user.rb +23 -0
- data/lib/fog/riakcs/requests/provisioning/enable_user.rb +23 -0
- data/lib/fog/riakcs/requests/provisioning/get_user.rb +41 -0
- data/lib/fog/riakcs/requests/provisioning/list_users.rb +43 -0
- data/lib/fog/riakcs/requests/provisioning/regrant_secret.rb +23 -0
- data/lib/fog/riakcs/requests/provisioning/update_user.rb +23 -0
- data/lib/fog/riakcs/requests/usage/get_usage.rb +68 -0
- data/lib/fog/riakcs/usage.rb +66 -0
- data/lib/fog/vcloud/compute.rb +1 -1
- data/lib/fog/vcloud/models/compute/catalog_item.rb +8 -0
- data/lib/fog/vcloud/models/compute/server.rb +1 -0
- data/lib/fog/vcloud/requests/compute/configure_vm_network.rb +1 -2
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +1 -1
- data/lib/fog/vsphere/models/compute/servers.rb +9 -9
- data/lib/fog/xenserver.rb +2 -0
- data/lib/fog/xenserver/CHANGELOG.md +7 -1
- data/lib/fog/xenserver/compute.rb +6 -0
- data/lib/fog/xenserver/examples/networks-and-vlans.rb +45 -0
- data/lib/fog/xenserver/models/compute/network.rb +33 -0
- data/lib/fog/xenserver/models/compute/vlan.rb +80 -0
- data/lib/fog/xenserver/models/compute/vlans.rb +39 -0
- data/lib/fog/xenserver/requests/compute/create_network.rb +42 -0
- data/lib/fog/xenserver/requests/compute/create_vlan.rb +35 -0
- data/lib/fog/xenserver/requests/compute/destroy_network.rb +33 -0
- data/lib/fog/xenserver/requests/compute/destroy_vlan.rb +32 -0
- data/lib/fog/zerigo/models/dns/records.rb +15 -12
- data/lib/tasks/changelog_task.rb +1 -0
- data/tests/aws/requests/compute/address_tests.rb +4 -0
- data/tests/aws/requests/iam/server_certificate_tests.rb +32 -0
- data/tests/cloudstack/compute/models/snapshot_tests.rb +34 -0
- data/tests/digitalocean/helper.rb +44 -0
- data/tests/digitalocean/models/compute/flavor_tests.rb +30 -0
- data/tests/digitalocean/models/compute/image_tests.rb +31 -0
- data/tests/digitalocean/models/compute/region_tests.rb +30 -0
- data/tests/digitalocean/models/compute/server_tests.rb +84 -0
- data/tests/digitalocean/models/compute/servers_tests.rb +35 -0
- data/tests/digitalocean/models/compute/ssh_key_tests.rb +40 -0
- data/tests/digitalocean/models/compute/ssh_keys_tests.rb +28 -0
- data/tests/digitalocean/requests/compute/create_server_tests.rb +28 -0
- data/tests/digitalocean/requests/compute/create_ssh_key_tests.rb +22 -0
- data/tests/digitalocean/requests/compute/destroy_server_tests.rb +15 -0
- data/tests/digitalocean/requests/compute/destroy_ssh_key_tests.rb +23 -0
- data/tests/digitalocean/requests/compute/get_server_details_tests.rb +13 -0
- data/tests/digitalocean/requests/compute/get_ssh_key_tests.rb +22 -0
- data/tests/digitalocean/requests/compute/list_flavors_tests.rb +23 -0
- data/tests/digitalocean/requests/compute/list_images_tests.rb +24 -0
- data/tests/digitalocean/requests/compute/list_regions_tests.rb +23 -0
- data/tests/digitalocean/requests/compute/list_servers_tests.rb +26 -0
- data/tests/digitalocean/requests/compute/list_ssh_keys_tests.rb +21 -0
- data/tests/digitalocean/requests/compute/power_cycle_server_tests.rb +20 -0
- data/tests/digitalocean/requests/compute/power_state_tests.rb +25 -0
- data/tests/digitalocean/requests/compute/reboot_server_tests.rb +14 -0
- data/tests/helpers/collection_helper.rb +36 -1
- data/tests/helpers/mock_helper.rb +2 -0
- data/tests/internet_archive/models/storage/directory_tests.rb +24 -32
- data/tests/internet_archive/models/storage/file_tests.rb +16 -35
- data/tests/internet_archive/models/storage/files_tests.rb +33 -31
- data/tests/internet_archive/models/storage/url_tests.rb +1 -1
- data/tests/internet_archive/requests/storage/bucket_tests.rb +34 -38
- data/tests/internet_archive/requests/storage/multipart_upload_tests.rb +1 -1
- data/tests/openstack/models/network/network_tests.rb +17 -0
- data/tests/openstack/models/network/router_tests.rb +38 -0
- data/tests/openstack/models/network/routers_tests.rb +21 -0
- data/tests/openstack/requests/network/network_tests.rb +61 -10
- data/tests/openstack/requests/network/router_tests.rb +75 -0
- data/tests/openstack/storage_tests.rb +19 -0
- data/tests/ovirt/requests/compute/list_quotas_tests.rb +12 -0
- data/tests/rackspace/block_storage_tests.rb +101 -0
- data/tests/rackspace/cdn_tests.rb +144 -52
- data/tests/rackspace/compute_tests.rb +88 -0
- data/tests/rackspace/compute_v2_tests.rb +101 -0
- data/tests/rackspace/databases_tests.rb +98 -0
- data/tests/rackspace/dns_tests.rb +82 -0
- data/tests/rackspace/load_balancer_tests.rb +99 -0
- data/tests/rackspace/models/compute_v2/image_tests.rb +51 -0
- data/tests/rackspace/models/compute_v2/server_tests.rb +51 -0
- data/tests/rackspace/models/identity/service_catalog_tests.rb +81 -0
- data/tests/rackspace/models/storage/file_tests.rb +10 -1
- data/tests/rackspace/rackspace_tests.rb +21 -0
- data/tests/rackspace/requests/compute_v2/metadata_tests.rb +2 -2
- data/tests/rackspace/requests/storage/object_tests.rb +2 -2
- data/tests/rackspace/storage_tests.rb +99 -3
- data/tests/riakcs/requests/provisioning/provisioning_tests.rb +174 -0
- data/tests/riakcs/requests/usage/usage_tests.rb +29 -0
- data/tests/xenserver/models/compute/network_tests.rb +18 -6
- data/tests/xenserver/models/compute/vlan_tests.rb +76 -0
- data/tests/xenserver/models/compute/vlans_tests.rb +36 -0
- data/tests/xenserver/requests/compute/create_network_tests.rb +20 -0
- data/tests/xenserver/requests/compute/create_vlan_tests.rb +36 -0
- data/tests/xenserver/requests/compute/destroy_network_tests.rb +13 -0
- data/tests/xenserver/requests/compute/destroy_vlan_tests.rb +36 -0
- metadata +178 -21
- data/lib/fog/internet_archive/models/storage/version.rb +0 -36
- data/lib/fog/internet_archive/models/storage/versions.rb +0 -38
- data/lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb +0 -88
- data/lib/fog/internet_archive/parsers/storage/get_bucket_versioning.rb +0 -24
- data/lib/fog/internet_archive/requests/storage/get_bucket_object_versions.rb +0 -162
- data/lib/fog/internet_archive/requests/storage/get_bucket_versioning.rb +0 -69
- data/lib/fog/internet_archive/requests/storage/put_bucket_versioning.rb +0 -75
- data/lib/fog/openstack/README.identity.md +0 -69
- data/lib/fog/providers.rb +0 -34
- data/lib/fog/rackspace/examples/compute_v2/README.md +0 -47
- data/tests/internet_archive/models/storage/version_tests.rb +0 -52
- data/tests/internet_archive/models/storage/versions_tests.rb +0 -56
- data/tests/internet_archive/requests/storage/versioning_tests.rb +0 -258
data/lib/fog/ovirt/compute.rb
CHANGED
@@ -16,6 +16,8 @@ module Fog
|
|
16
16
|
collection :interfaces
|
17
17
|
model :volume
|
18
18
|
collection :volumes
|
19
|
+
model :quota
|
20
|
+
collection :quotas
|
19
21
|
|
20
22
|
request_path 'fog/ovirt/requests/compute'
|
21
23
|
|
@@ -43,6 +45,8 @@ module Fog
|
|
43
45
|
request :add_volume
|
44
46
|
request :destroy_volume
|
45
47
|
request :get_api_version
|
48
|
+
request :list_quotas
|
49
|
+
request :get_quota
|
46
50
|
|
47
51
|
module Shared
|
48
52
|
# converts an OVIRT object into an hash for fog to consume.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/ovirt/models/compute/quota'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Ovirt
|
7
|
+
|
8
|
+
class Quotas < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::Compute::Ovirt::Quota
|
11
|
+
|
12
|
+
def all(filters = {})
|
13
|
+
load service.list_quotas(filters)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(id)
|
17
|
+
new service.get_quota(id)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class Real
|
5
|
+
def get_quota(id)
|
6
|
+
ovirt_attrs client.quota(id)
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def get_quota(id)
|
12
|
+
xml = read_xml('quota.xml')
|
13
|
+
ovirt_attrs OVIRT::Quota::new(self, Nokogiri::XML(xml).root)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class Real
|
5
|
+
def list_quotas(filters = {})
|
6
|
+
client.quotas(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def list_quotas(filters = {})
|
12
|
+
xml = read_xml 'quotas.xml'
|
13
|
+
Nokogiri::XML(xml).xpath('/quotas/quota').collect do |q|
|
14
|
+
ovirt_attrs OVIRT::Quotas::new(self, q)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<quotas>
|
2
|
+
<quota href="/api/datacenters/c0645886-4b4b-11e1-a0ae-5254009970cc/quotas/aae6e3f3-0798-4ef7-b4e4-c036f04a98d7" id="aae6e3f3-0798-4ef7-b4e4-c036f04a98d7">
|
3
|
+
<name>DefaultQuota-Datacenter1</name>
|
4
|
+
<description>Automatic generated Quota for Data Center Datacenter1</description>
|
5
|
+
<data_center href="/api/datacenters/c0645886-4b4b-11e1-a0ae-5254009970cc" id="c0645886-4b4b-11e1-a0ae-5254009970cc"/>
|
6
|
+
</quota>
|
7
|
+
</quotas>
|
data/lib/fog/rackspace.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
require 'fog/core'
|
2
2
|
require 'fog/rackspace/mock_data'
|
3
|
+
require 'fog/rackspace/service'
|
3
4
|
|
4
5
|
module Fog
|
5
6
|
module Rackspace
|
6
7
|
extend Fog::Provider
|
7
8
|
|
9
|
+
US_AUTH_ENDPOINT = 'https://identity.api.rackspacecloud.com/v2.0' unless defined? US_AUTH_ENDPOINT
|
10
|
+
UK_AUTH_ENDPOINT = 'https://lon.identity.api.rackspacecloud.com/v2.0' unless defined? UK_AUTH_ENDPOINT
|
11
|
+
|
8
12
|
module Errors
|
9
13
|
class ServiceError < Fog::Errors::Error
|
10
14
|
attr_reader :response_data, :status_code
|
@@ -86,6 +90,13 @@ module Fog
|
|
86
90
|
end
|
87
91
|
end
|
88
92
|
|
93
|
+
def self.normalize_url(endpoint)
|
94
|
+
return nil unless endpoint
|
95
|
+
str = endpoint.chomp " "
|
96
|
+
str = str.chomp "/"
|
97
|
+
str.downcase
|
98
|
+
end
|
99
|
+
|
89
100
|
# CGI.escape, but without special treatment on spaces
|
90
101
|
def self.escape(str,extra_exclude_chars = '')
|
91
102
|
str.gsub(/([^a-zA-Z0-9_.-#{extra_exclude_chars}]+)/) do
|
@@ -16,6 +16,8 @@ module Fog
|
|
16
16
|
requires :rackspace_api_key, :rackspace_username
|
17
17
|
recognizes :rackspace_auth_url
|
18
18
|
recognizes :rackspace_endpoint
|
19
|
+
recognizes :rackspace_region
|
20
|
+
recognizes :rackspace_block_storage_url
|
19
21
|
|
20
22
|
model_path 'fog/rackspace/models/block_storage'
|
21
23
|
model :volume
|
@@ -43,7 +45,7 @@ module Fog
|
|
43
45
|
request :get_snapshot
|
44
46
|
request :list_snapshots
|
45
47
|
|
46
|
-
class Mock
|
48
|
+
class Mock < Fog::Rackspace::Service
|
47
49
|
include Fog::Rackspace::MockData
|
48
50
|
|
49
51
|
def initialize(options = {})
|
@@ -67,26 +69,21 @@ module Fog
|
|
67
69
|
end
|
68
70
|
end
|
69
71
|
|
70
|
-
class Real
|
72
|
+
class Real < Fog::Rackspace::Service
|
71
73
|
def initialize(options = {})
|
72
74
|
@rackspace_api_key = options[:rackspace_api_key]
|
73
75
|
@rackspace_username = options[:rackspace_username]
|
74
76
|
@rackspace_auth_url = options[:rackspace_auth_url]
|
75
77
|
@rackspace_must_reauthenticate = false
|
76
78
|
@connection_options = options[:connection_options] || {}
|
77
|
-
|
78
|
-
endpoint = options[:rackspace_endpoint] || DFW_ENDPOINT
|
79
|
-
uri = URI.parse(endpoint)
|
80
|
-
|
81
|
-
@host = uri.host
|
82
|
-
@persistent = options[:persistent] || false
|
83
|
-
@path = uri.path
|
84
|
-
@port = uri.port
|
85
|
-
@scheme = uri.scheme
|
79
|
+
setup_custom_endpoint(options)
|
86
80
|
|
87
81
|
authenticate
|
88
82
|
|
89
|
-
|
83
|
+
deprecation_warnings(options)
|
84
|
+
|
85
|
+
@persistent = options[:persistent] || false
|
86
|
+
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
|
90
87
|
end
|
91
88
|
|
92
89
|
def request(params)
|
@@ -95,10 +92,10 @@ module Fog
|
|
95
92
|
:headers => {
|
96
93
|
'Content-Type' => 'application/json',
|
97
94
|
'Accept' => 'application/json',
|
98
|
-
'X-Auth-Token' =>
|
95
|
+
'X-Auth-Token' => auth_token
|
99
96
|
}.merge!(params[:headers] || {}),
|
100
|
-
:host =>
|
101
|
-
:path => "#{
|
97
|
+
:host => endpoint_uri.host,
|
98
|
+
:path => "#{endpoint_uri.path}/#{params[:path]}"
|
102
99
|
}))
|
103
100
|
rescue Excon::Errors::NotFound => error
|
104
101
|
raise NotFound.slurp error
|
@@ -115,19 +112,75 @@ module Fog
|
|
115
112
|
response
|
116
113
|
end
|
117
114
|
|
118
|
-
private
|
119
|
-
|
120
115
|
def authenticate
|
121
116
|
options = {
|
122
|
-
:rackspace_api_key
|
117
|
+
:rackspace_api_key => @rackspace_api_key,
|
123
118
|
:rackspace_username => @rackspace_username,
|
124
119
|
:rackspace_auth_url => @rackspace_auth_url
|
125
120
|
}
|
121
|
+
super(options)
|
122
|
+
end
|
123
|
+
|
124
|
+
def service_name
|
125
|
+
:cloudBlockStorage
|
126
|
+
end
|
127
|
+
|
128
|
+
def region
|
129
|
+
@rackspace_region
|
130
|
+
end
|
131
|
+
|
132
|
+
def endpoint_uri(service_endpoint_url=nil)
|
133
|
+
@uri = super(@rackspace_endpoint || service_endpoint_url, :rackspace_block_storage_url)
|
134
|
+
end
|
135
|
+
|
136
|
+
private
|
137
|
+
|
138
|
+
def setup_custom_endpoint(options)
|
139
|
+
@rackspace_endpoint = Fog::Rackspace.normalize_url(options[:rackspace_block_storage_url] || options[:rackspace_endpoint])
|
140
|
+
|
141
|
+
if v2_authentication?
|
142
|
+
case @rackspace_endpoint
|
143
|
+
when DFW_ENDPOINT
|
144
|
+
@rackspace_endpoint = nil
|
145
|
+
@rackspace_region = :dfw
|
146
|
+
when ORD_ENDPOINT
|
147
|
+
@rackspace_endpoint = nil
|
148
|
+
@rackspace_region = :ord
|
149
|
+
when LON_ENDPOINT
|
150
|
+
@rackspace_endpoint = nil
|
151
|
+
@rackspace_region = :lon
|
152
|
+
else
|
153
|
+
@rackspace_region = options[:rackspace_region] || :dfw
|
154
|
+
end
|
155
|
+
else
|
156
|
+
#if we are using auth1 and the endpoint is not set, default to DFW_ENDPOINT for historical reasons
|
157
|
+
@rackspace_endpoint ||= DFW_ENDPOINT
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def deprecation_warnings(options)
|
162
|
+
Fog::Logger.deprecation("The :rackspace_endpoint option is deprecated. Please use :rackspace_block_storage_url for custom endpoints") if options[:rackspace_endpoint]
|
163
|
+
|
164
|
+
if [DFW_ENDPOINT, ORD_ENDPOINT, LON_ENDPOINT].include?(@rackspace_endpoint) && v2_authentication?
|
165
|
+
regions = @identity_service.service_catalog.display_service_regions(service_name)
|
166
|
+
Fog::Logger.deprecation("Please specify region using :rackspace_region rather than :rackspace_endpoint. Valid region for :rackspace_region are #{regions}.")
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def append_tenant_v1(credentials)
|
171
|
+
account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1]
|
172
|
+
|
173
|
+
endpoint = @rackspace_endpoint || credentials['X-Server-Management-Url'] || DFW_ENDPOINT
|
174
|
+
@uri = URI.parse(endpoint)
|
175
|
+
@uri.path = "#{@uri.path}/#{account_id}"
|
176
|
+
end
|
177
|
+
|
178
|
+
def authenticate_v1(options)
|
126
179
|
credentials = Fog::Rackspace.authenticate(options, @connection_options)
|
180
|
+
append_tenant_v1 credentials
|
127
181
|
@auth_token = credentials['X-Auth-Token']
|
128
|
-
account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1]
|
129
|
-
@path = "#{@path}/#{account_id}"
|
130
182
|
end
|
183
|
+
|
131
184
|
end
|
132
185
|
end
|
133
186
|
end
|
data/lib/fog/rackspace/cdn.rb
CHANGED
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
class Rackspace < Fog::Service
|
7
7
|
|
8
8
|
requires :rackspace_api_key, :rackspace_username
|
9
|
-
recognizes :rackspace_auth_url, :persistent, :rackspace_cdn_ssl
|
9
|
+
recognizes :rackspace_auth_url, :persistent, :rackspace_cdn_ssl, :rackspace_region, :rackspace_cdn_url
|
10
10
|
|
11
11
|
request_path 'fog/rackspace/requests/cdn'
|
12
12
|
request :get_containers
|
@@ -24,6 +24,26 @@ module Fog
|
|
24
24
|
"X-Cdn-Ssl-Uri" => :ssl_uri
|
25
25
|
}.freeze
|
26
26
|
|
27
|
+
def service_name
|
28
|
+
:cloudFilesCDN
|
29
|
+
end
|
30
|
+
|
31
|
+
def region
|
32
|
+
@rackspace_region
|
33
|
+
end
|
34
|
+
|
35
|
+
def endpoint_uri(service_endpoint_url=nil)
|
36
|
+
@uri = super(@rackspace_cdn_url || service_endpoint_url, :rackspace_cdn_url)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Publish container to CDN
|
40
|
+
# @param [Fog::Storage::Rackspace::Directory] directory to publish
|
41
|
+
# @param [Boolean] publish If true directory is published. If false directory is unpublished.
|
42
|
+
# @return [Hash] hash containing urls for published container
|
43
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
44
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
45
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
46
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
27
47
|
def publish_container(container, publish = true)
|
28
48
|
enabled = publish ? 'True' : 'False'
|
29
49
|
response = put_container(container.key, 'X-Cdn-Enabled' => enabled)
|
@@ -31,6 +51,13 @@ module Fog
|
|
31
51
|
urls_from_headers(response.headers)
|
32
52
|
end
|
33
53
|
|
54
|
+
# Returns hash of urls for container
|
55
|
+
# @param [Fog::Storage::Rackspace::Directory] container to retrieve urls for
|
56
|
+
# @return [Hash] hash containing urls for published container
|
57
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
58
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
59
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
60
|
+
# @note If unable to find container or container is not published this method will return an empty hash.
|
34
61
|
def urls(container)
|
35
62
|
begin
|
36
63
|
response = head_container(container.key)
|
@@ -53,9 +80,9 @@ module Fog
|
|
53
80
|
end
|
54
81
|
end
|
55
82
|
|
56
|
-
class Mock
|
83
|
+
class Mock < Fog::Rackspace::Service
|
57
84
|
include Base
|
58
|
-
|
85
|
+
|
59
86
|
def self.data
|
60
87
|
@data ||= Hash.new do |hash, key|
|
61
88
|
hash[key] = {}
|
@@ -85,38 +112,41 @@ module Fog
|
|
85
112
|
|
86
113
|
end
|
87
114
|
|
88
|
-
class Real
|
115
|
+
class Real < Fog::Rackspace::Service
|
89
116
|
include Base
|
90
|
-
|
117
|
+
|
91
118
|
def initialize(options={})
|
92
119
|
@connection_options = options[:connection_options] || {}
|
93
|
-
|
94
|
-
@
|
120
|
+
@rackspace_auth_url = options[:rackspace_auth_url]
|
121
|
+
@rackspace_cdn_url = options[:rackspace_cdn_url]
|
122
|
+
@rackspace_region = options[:rackspace_region] || :dfw
|
123
|
+
authenticate(options)
|
95
124
|
@enabled = false
|
96
125
|
@persistent = options[:persistent] || false
|
97
126
|
|
98
|
-
if
|
99
|
-
|
100
|
-
@host = uri.host
|
101
|
-
@path = uri.path
|
102
|
-
@port = uri.port
|
103
|
-
@scheme = uri.scheme
|
104
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
127
|
+
if endpoint_uri
|
128
|
+
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
|
105
129
|
@enabled = true
|
106
130
|
end
|
107
131
|
end
|
108
|
-
|
132
|
+
|
133
|
+
# Returns true if CDN service is enabled
|
134
|
+
# @return [Boolean]
|
109
135
|
def enabled?
|
110
136
|
@enabled
|
111
137
|
end
|
112
138
|
|
139
|
+
# Resets CDN connection
|
113
140
|
def reload
|
114
141
|
@cdn_connection.reset
|
115
142
|
end
|
116
143
|
|
144
|
+
# Purges File
|
145
|
+
# @param [Fog::Storage::Rackspace::File] file to be purged from the CDN
|
146
|
+
# @raise [Fog::Errors::NotImplemented] returned when non file parameters are specified
|
117
147
|
def purge(file)
|
118
148
|
unless file.is_a? Fog::Storage::Rackspace::File
|
119
|
-
raise Fog::Errors::NotImplemented.new("#{object.class} does not support CDN purging")
|
149
|
+
raise Fog::Errors::NotImplemented.new("#{object.class} does not support CDN purging") if object
|
120
150
|
end
|
121
151
|
|
122
152
|
delete_object file.directory.key, file.key
|
@@ -129,10 +159,10 @@ module Fog
|
|
129
159
|
:headers => {
|
130
160
|
'Content-Type' => 'application/json',
|
131
161
|
'Accept' => 'application/json',
|
132
|
-
'X-Auth-Token' =>
|
162
|
+
'X-Auth-Token' => auth_token
|
133
163
|
}.merge!(params[:headers] || {}),
|
134
|
-
:host =>
|
135
|
-
:path => "#{
|
164
|
+
:host => endpoint_uri.host,
|
165
|
+
:path => "#{endpoint_uri.path}/#{params[:path]}",
|
136
166
|
}))
|
137
167
|
rescue Excon::Errors::HTTPStatusError => error
|
138
168
|
raise case error
|
@@ -147,6 +177,14 @@ module Fog
|
|
147
177
|
end
|
148
178
|
response
|
149
179
|
end
|
180
|
+
|
181
|
+
private
|
182
|
+
|
183
|
+
def authenticate_v1(options)
|
184
|
+
credentials = Fog::Rackspace.authenticate(options, @connection_options)
|
185
|
+
endpoint_uri credentials['X-CDN-Management-Url']
|
186
|
+
@auth_token = credentials['X-Auth-Token']
|
187
|
+
end
|
150
188
|
|
151
189
|
end
|
152
190
|
end
|