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
@@ -13,6 +13,10 @@ module Fog
|
|
13
13
|
# * headers<~Hash>:
|
14
14
|
# * 'X-Container-Object-Count'<~String> - Count of containers
|
15
15
|
# * 'X-Container-Bytes-Used'<~String> - Bytes used
|
16
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
17
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
18
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
19
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
16
20
|
def head_container(container)
|
17
21
|
request(
|
18
22
|
:expects => 204,
|
@@ -10,6 +10,10 @@ module Fog
|
|
10
10
|
# * headers<~Hash>:
|
11
11
|
# * 'X-Account-Container-Count'<~String> - Count of containers
|
12
12
|
# * 'X-Account-Bytes-Used'<~String> - Bytes used
|
13
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
14
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
15
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
16
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
13
17
|
def head_containers
|
14
18
|
request(
|
15
19
|
:expects => 204,
|
@@ -8,7 +8,10 @@ module Fog
|
|
8
8
|
# ==== Parameters
|
9
9
|
# * container<~String> - Name of container to look in
|
10
10
|
# * object<~String> - Name of object to look for
|
11
|
-
#
|
11
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
12
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
13
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
14
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
12
15
|
def head_object(container, object)
|
13
16
|
request({
|
14
17
|
:expects => 200,
|
@@ -19,7 +19,10 @@ module Fog
|
|
19
19
|
#
|
20
20
|
# ==== Returns
|
21
21
|
# * response<~Excon::Response>
|
22
|
-
#
|
22
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
23
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
24
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
25
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
23
26
|
# ==== See Also
|
24
27
|
# http://docs.rackspace.com/files/api/v1/cf-devguide/content/Set_Account_Metadata-d1a4460.html
|
25
28
|
def post_set_meta_temp_url_key(key)
|
@@ -7,7 +7,10 @@ module Fog
|
|
7
7
|
#
|
8
8
|
# ==== Parameters
|
9
9
|
# * name<~String> - Name for container, should be < 256 bytes and must not contain '/'
|
10
|
-
#
|
10
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
11
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
12
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
13
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
11
14
|
def put_container(name, options={})
|
12
15
|
request(
|
13
16
|
:expects => [201, 202],
|
@@ -10,7 +10,10 @@ module Fog
|
|
10
10
|
# * object<~String> - Name for object
|
11
11
|
# * data<~String|File> - data to upload
|
12
12
|
# * options<~Hash> - config headers for object. Defaults to {}.
|
13
|
-
#
|
13
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
14
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
15
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
16
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
14
17
|
def put_object(container, object, data, options = {})
|
15
18
|
data = Fog::Storage.parse_data(data)
|
16
19
|
headers = data[:headers].merge!(options)
|
@@ -8,7 +8,10 @@ module Fog
|
|
8
8
|
# ==== Parameters
|
9
9
|
# * container<~String> - Name for container, should be < 256 bytes and must not contain '/'
|
10
10
|
# * object<~String> - Name for object
|
11
|
-
#
|
11
|
+
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
12
|
+
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
13
|
+
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
14
|
+
# @raise [Fog::Rackspace::Errors::ServiceError]
|
12
15
|
def put_object_manifest(container, object)
|
13
16
|
path = "#{Fog::Rackspace.escape(container)}/#{Fog::Rackspace.escape(object)}"
|
14
17
|
request(
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Service
|
4
|
+
|
5
|
+
def service_name
|
6
|
+
raise Fog::Errors::NotImplemented.new("Please implement the #service_name method")
|
7
|
+
end
|
8
|
+
|
9
|
+
def region
|
10
|
+
raise Fog::Errors::NotImplemented.new("Please implement the #region method")
|
11
|
+
end
|
12
|
+
|
13
|
+
def endpoint_uri(service_endpoint=nil, endpoint_name=nil)
|
14
|
+
return @uri if @uri
|
15
|
+
|
16
|
+
url = service_endpoint
|
17
|
+
|
18
|
+
unless url
|
19
|
+
if v1_authentication?
|
20
|
+
raise "Service Endpoint must be specified via #{endpoint_name} parameter"
|
21
|
+
else
|
22
|
+
url = endpoint_uri_v2
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
@uri = URI.parse url
|
27
|
+
end
|
28
|
+
|
29
|
+
def authenticate(options)
|
30
|
+
self.send authentication_method, options
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def authentication_method
|
36
|
+
if v2_authentication?
|
37
|
+
:authenticate_v2
|
38
|
+
else
|
39
|
+
Fog::Logger.deprecation "Authentication using a v1.0/v1.1 endpoint is deprecated. Please specify a v2.0 endpoint using :rackpace_auth_url.\
|
40
|
+
For a list of v2.0 endpoints refer to http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/Endpoints-d1e180.html"
|
41
|
+
:authenticate_v1
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def v1_authentication?
|
46
|
+
!v2_authentication?
|
47
|
+
end
|
48
|
+
|
49
|
+
def v2_authentication?
|
50
|
+
@rackspace_auth_url.nil? || @rackspace_auth_url =~ /v2(\.\d)?\w*$/
|
51
|
+
end
|
52
|
+
|
53
|
+
def authenticate_v2(identity_options)
|
54
|
+
hash = {
|
55
|
+
:rackspace_api_key => identity_options[:rackspace_api_key],
|
56
|
+
:rackspace_username => identity_options[:rackspace_username],
|
57
|
+
:rackspace_auth_url => identity_options[:rackspace_auth_url]
|
58
|
+
}
|
59
|
+
|
60
|
+
@identity_service = Fog::Rackspace::Identity.new(hash)
|
61
|
+
@auth_token = @identity_service.auth_token
|
62
|
+
end
|
63
|
+
|
64
|
+
def authenticate_v1(options)
|
65
|
+
raise Fog::Errors::NotImplemented.new("Authentication of legacy endpoints is not implemented for this service.")
|
66
|
+
end
|
67
|
+
|
68
|
+
def endpoint_uri_v2
|
69
|
+
@uri = @identity_service.service_catalog.get_endpoint(service_name, region)
|
70
|
+
end
|
71
|
+
|
72
|
+
def auth_token
|
73
|
+
@auth_token || @identity_service.auth_token
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -6,8 +6,8 @@ module Fog
|
|
6
6
|
class Rackspace < Fog::Service
|
7
7
|
|
8
8
|
requires :rackspace_api_key, :rackspace_username
|
9
|
-
recognizes :rackspace_auth_url, :rackspace_servicenet, :rackspace_cdn_ssl, :persistent
|
10
|
-
recognizes :rackspace_temp_url_key
|
9
|
+
recognizes :rackspace_auth_url, :rackspace_servicenet, :rackspace_cdn_ssl, :persistent, :rackspace_region
|
10
|
+
recognizes :rackspace_temp_url_key, :rackspace_storage_url, :rackspace_cdn_url
|
11
11
|
|
12
12
|
model_path 'fog/rackspace/models/storage'
|
13
13
|
model :directory
|
@@ -39,7 +39,9 @@ module Fog
|
|
39
39
|
:provider => 'Rackspace',
|
40
40
|
:rackspace_api_key => @rackspace_api_key,
|
41
41
|
:rackspace_auth_url => @rackspace_auth_url,
|
42
|
+
:rackspace_cdn_url => @rackspace_cdn_url,
|
42
43
|
:rackspace_username => @rackspace_username,
|
44
|
+
:rackspace_region => @rackspace_region,
|
43
45
|
:rackspace_cdn_ssl => @rackspace_cdn_ssl
|
44
46
|
)
|
45
47
|
if @cdn.enabled?
|
@@ -47,9 +49,9 @@ module Fog
|
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
50
|
-
end
|
52
|
+
end
|
51
53
|
|
52
|
-
class Mock
|
54
|
+
class Mock < Fog::Rackspace::Service
|
53
55
|
include Utils
|
54
56
|
|
55
57
|
def self.data
|
@@ -76,10 +78,19 @@ module Fog
|
|
76
78
|
self.class.data.delete(@rackspace_username)
|
77
79
|
end
|
78
80
|
|
81
|
+
def service_name
|
82
|
+
:cloudFiles
|
83
|
+
end
|
84
|
+
|
85
|
+
def region
|
86
|
+
@rackspace_region
|
87
|
+
end
|
88
|
+
|
79
89
|
end
|
80
90
|
|
81
|
-
class Real
|
91
|
+
class Real < Fog::Rackspace::Service
|
82
92
|
include Utils
|
93
|
+
|
83
94
|
attr_reader :rackspace_cdn_ssl
|
84
95
|
|
85
96
|
def initialize(options={})
|
@@ -91,24 +102,33 @@ module Fog
|
|
91
102
|
@rackspace_servicenet = options[:rackspace_servicenet]
|
92
103
|
@rackspace_auth_token = options[:rackspace_auth_token]
|
93
104
|
@rackspace_storage_url = options[:rackspace_storage_url]
|
105
|
+
@rackspace_cdn_url = options[:rackspace_cdn_url]
|
106
|
+
@rackspace_region = options[:rackspace_region] || :dfw
|
94
107
|
@rackspace_temp_url_key = options[:rackspace_temp_url_key]
|
95
108
|
@rackspace_must_reauthenticate = false
|
96
109
|
@connection_options = options[:connection_options] || {}
|
110
|
+
|
97
111
|
authenticate
|
98
112
|
@persistent = options[:persistent] || false
|
99
|
-
Excon.defaults[:ssl_verify_peer] = false if
|
100
|
-
@connection = Fog::Connection.new(
|
101
|
-
end
|
113
|
+
Excon.defaults[:ssl_verify_peer] = false if service_net?
|
114
|
+
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
|
115
|
+
end
|
102
116
|
|
117
|
+
# Return Account Details
|
118
|
+
# @return [Fog::Storage::Rackspace::Account] account details object
|
103
119
|
def account
|
104
120
|
account = Fog::Storage::Rackspace::Account.new(:service => self)
|
105
121
|
account.reload
|
106
122
|
end
|
107
123
|
|
124
|
+
# Using SSL?
|
125
|
+
# @return [Boolean] return true if service is returning SSL-Secured URLs in public_url methods
|
126
|
+
# @see Directory#public_url
|
108
127
|
def ssl?
|
109
128
|
!rackspace_cdn_ssl.nil?
|
110
129
|
end
|
111
130
|
|
131
|
+
# Resets presistent service connections
|
112
132
|
def reload
|
113
133
|
@connection.reset
|
114
134
|
end
|
@@ -119,10 +139,10 @@ module Fog
|
|
119
139
|
:headers => {
|
120
140
|
'Content-Type' => 'application/json',
|
121
141
|
'Accept' => 'application/json',
|
122
|
-
'X-Auth-Token' =>
|
142
|
+
'X-Auth-Token' => auth_token
|
123
143
|
}.merge!(params[:headers] || {}),
|
124
|
-
:host =>
|
125
|
-
:path => "#{
|
144
|
+
:host => endpoint_uri.host,
|
145
|
+
:path => "#{endpoint_uri.path}/#{params[:path]}",
|
126
146
|
}), &block)
|
127
147
|
rescue Excon::Errors::Unauthorized => error
|
128
148
|
if error.response.body != 'Bad username or password' # token expiration
|
@@ -146,28 +166,48 @@ module Fog
|
|
146
166
|
response
|
147
167
|
end
|
148
168
|
|
149
|
-
|
150
|
-
|
169
|
+
def service_net?
|
170
|
+
@rackspace_servicenet == true
|
171
|
+
end
|
172
|
+
|
151
173
|
def authenticate
|
152
174
|
if @rackspace_must_reauthenticate || @rackspace_auth_token.nil?
|
153
175
|
options = {
|
154
176
|
:rackspace_api_key => @rackspace_api_key,
|
155
177
|
:rackspace_username => @rackspace_username,
|
156
178
|
:rackspace_auth_url => @rackspace_auth_url
|
157
|
-
}
|
158
|
-
|
159
|
-
@auth_token = credentials['X-Auth-Token']
|
160
|
-
uri = URI.parse(credentials['X-Storage-Url'])
|
179
|
+
}
|
180
|
+
super(options)
|
161
181
|
else
|
162
182
|
@auth_token = @rackspace_auth_token
|
163
|
-
uri = URI.parse(@rackspace_storage_url)
|
183
|
+
@uri = URI.parse(@rackspace_storage_url)
|
164
184
|
end
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
185
|
+
end
|
186
|
+
|
187
|
+
def service_name
|
188
|
+
:cloudFiles
|
189
|
+
end
|
190
|
+
|
191
|
+
def region
|
192
|
+
@rackspace_region
|
169
193
|
end
|
170
194
|
|
195
|
+
def endpoint_uri(service_endpoint_url=nil)
|
196
|
+
return @uri if @uri
|
197
|
+
|
198
|
+
@uri = super(@rackspace_storage_url || service_endpoint_url, :rackspace_storage_url)
|
199
|
+
@uri.host = "snet-#{@uri.host}" if service_net?
|
200
|
+
@uri
|
201
|
+
end
|
202
|
+
|
203
|
+
private
|
204
|
+
|
205
|
+
def authenticate_v1(options)
|
206
|
+
credentials = Fog::Rackspace.authenticate(options, @connection_options)
|
207
|
+
endpoint_uri credentials['X-Storage-Url']
|
208
|
+
@auth_token = credentials['X-Auth-Token']
|
209
|
+
end
|
210
|
+
|
171
211
|
end
|
172
212
|
end
|
173
213
|
end
|
data/lib/fog/riakcs.rb
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
require(File.expand_path(File.join(File.dirname(__FILE__), 'core')))
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module RiakCS
|
5
|
+
|
6
|
+
module MultipartUtils
|
7
|
+
require 'net/http'
|
8
|
+
|
9
|
+
class Headers
|
10
|
+
include Net::HTTPHeader
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
initialize_http_header({})
|
14
|
+
end
|
15
|
+
|
16
|
+
# Parse a single header line into its key and value
|
17
|
+
# @param [String] chunk a single header line
|
18
|
+
def self.parse(chunk)
|
19
|
+
line = chunk.strip
|
20
|
+
# thanks Net::HTTPResponse
|
21
|
+
return [nil,nil] if chunk =~ /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)\s*(.*)\z/in
|
22
|
+
m = /\A([^:]+):\s*/.match(line)
|
23
|
+
[m[1], m.post_match] rescue [nil, nil]
|
24
|
+
end
|
25
|
+
|
26
|
+
# Parses a header line and adds it to the header collection
|
27
|
+
# @param [String] chunk a single header line
|
28
|
+
def parse(chunk)
|
29
|
+
key, value = self.class.parse(chunk)
|
30
|
+
add_field(key, value) if key && value
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def parse(data, boundary)
|
35
|
+
contents = data.match(end_boundary_regex(boundary)).pre_match rescue ""
|
36
|
+
contents.split(inner_boundary_regex(boundary)).reject(&:empty?).map do |part|
|
37
|
+
parse_multipart_section(part)
|
38
|
+
end.compact
|
39
|
+
end
|
40
|
+
|
41
|
+
def extract_boundary(header_string)
|
42
|
+
$1 if header_string =~ /boundary=([A-Za-z0-9\'()+_,-.\/:=?]+)/
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
def end_boundary_regex(boundary)
|
47
|
+
/\r?\n--#{Regexp.escape(boundary)}--\r?\n?/
|
48
|
+
end
|
49
|
+
|
50
|
+
def inner_boundary_regex(boundary)
|
51
|
+
/\r?\n--#{Regexp.escape(boundary)}\r?\n/
|
52
|
+
end
|
53
|
+
|
54
|
+
def parse_multipart_section(part)
|
55
|
+
headers = Headers.new
|
56
|
+
if md = part.match(/\r?\n\r?\n/)
|
57
|
+
body = md.post_match
|
58
|
+
md.pre_match.split(/\r?\n/).each do |line|
|
59
|
+
headers.parse(line)
|
60
|
+
end
|
61
|
+
|
62
|
+
if headers["content-type"] =~ /multipart\/mixed/
|
63
|
+
boundary = extract_boundary(headers.to_hash["content-type"].first)
|
64
|
+
parse(body, boundary)
|
65
|
+
else
|
66
|
+
{:headers => headers.to_hash, :body => body}
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
module UserUtils
|
73
|
+
def update_riakcs_user(key_id, user)
|
74
|
+
response = @s3_connection.put_object('riak-cs', "user/#{key_id}", MultiJson.encode(user), { 'Content-Type' => 'application/json' })
|
75
|
+
if !response.body.empty?
|
76
|
+
response.body = MultiJson.decode(response.body)
|
77
|
+
end
|
78
|
+
response
|
79
|
+
end
|
80
|
+
|
81
|
+
def update_mock_user(key_id, user)
|
82
|
+
if data[key_id]
|
83
|
+
if status = user[:status]
|
84
|
+
data[key_id][:status] = status
|
85
|
+
end
|
86
|
+
|
87
|
+
if regrant = user[:new_key_secret]
|
88
|
+
data[key_id][:key_secret] = rand(100).to_s
|
89
|
+
end
|
90
|
+
|
91
|
+
Excon::Response.new.tap do |response|
|
92
|
+
response.status = 200
|
93
|
+
response.body = data[key_id]
|
94
|
+
end
|
95
|
+
else
|
96
|
+
Excon::Response.new.tap do |response|
|
97
|
+
response.status = 403
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
module Utils
|
104
|
+
def configure_uri_options(options = {})
|
105
|
+
@host = options[:host] || 'localhost'
|
106
|
+
@persistent = options[:persistent] || true
|
107
|
+
@port = options[:port] || 8080
|
108
|
+
@scheme = options[:scheme] || 'http'
|
109
|
+
end
|
110
|
+
|
111
|
+
def riakcs_uri
|
112
|
+
"#{@scheme}://#{@host}:#{@port}"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
extend Fog::Provider
|
117
|
+
|
118
|
+
service(:provisioning, 'riakcs/provisioning', 'Provisioning')
|
119
|
+
service(:usage, 'riakcs/usage', 'Usage')
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|