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
@@ -9,6 +9,57 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
9
9
|
:metadata => { 'fog_test' => 'true' }
|
10
10
|
}
|
11
11
|
|
12
|
+
tests('ready?') do
|
13
|
+
@server = Fog::Compute::RackspaceV2::Server.new
|
14
|
+
|
15
|
+
tests('default in ready state').returns(true) do
|
16
|
+
@server.state = Fog::Compute::RackspaceV2::Server::ACTIVE
|
17
|
+
@server.ready?
|
18
|
+
end
|
19
|
+
|
20
|
+
tests('custom ready state').returns(true) do
|
21
|
+
@server.state = Fog::Compute::RackspaceV2::Server::VERIFY_RESIZE
|
22
|
+
@server.ready?(Fog::Compute::RackspaceV2::Server::VERIFY_RESIZE)
|
23
|
+
end
|
24
|
+
|
25
|
+
tests('default NOT in ready state').returns(false) do
|
26
|
+
@server.state = Fog::Compute::RackspaceV2::Server::REBOOT
|
27
|
+
@server.ready?
|
28
|
+
end
|
29
|
+
|
30
|
+
tests('custom NOT ready state').returns(false) do
|
31
|
+
@server.state = Fog::Compute::RackspaceV2::Server::REBOOT
|
32
|
+
@server.ready?(Fog::Compute::RackspaceV2::Server::VERIFY_RESIZE)
|
33
|
+
end
|
34
|
+
|
35
|
+
tests('default error state').returns(true) do
|
36
|
+
@server.state = Fog::Compute::RackspaceV2::Server::ERROR
|
37
|
+
exception_occurred = false
|
38
|
+
begin
|
39
|
+
@server.ready?
|
40
|
+
rescue Fog::Compute::RackspaceV2::InvalidServerStateException => e
|
41
|
+
exception_occurred = true
|
42
|
+
returns(true) {e.desired_state == Fog::Compute::RackspaceV2::Server::ACTIVE }
|
43
|
+
returns(true) {e.current_state == Fog::Compute::RackspaceV2::Server::ERROR }
|
44
|
+
end
|
45
|
+
exception_occurred
|
46
|
+
end
|
47
|
+
|
48
|
+
tests('custom error state').returns(true) do
|
49
|
+
@server.state = Fog::Compute::RackspaceV2::Server::ACTIVE
|
50
|
+
exception_occurred = false
|
51
|
+
begin
|
52
|
+
@server.ready?(Fog::Compute::RackspaceV2::Server::VERIFY_RESIZE, Fog::Compute::RackspaceV2::Server::ACTIVE)
|
53
|
+
rescue Fog::Compute::RackspaceV2::InvalidServerStateException => e
|
54
|
+
exception_occurred = true
|
55
|
+
returns(true) {e.desired_state == Fog::Compute::RackspaceV2::Server::VERIFY_RESIZE }
|
56
|
+
returns(true) {e.current_state == Fog::Compute::RackspaceV2::Server::ACTIVE }
|
57
|
+
end
|
58
|
+
exception_occurred
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
12
63
|
model_tests(service.servers, options, true) do
|
13
64
|
@instance.wait_for(timeout=1500) { ready? }
|
14
65
|
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'fog/rackspace/models/identity/service_catalog'
|
2
|
+
|
3
|
+
Shindo.tests('Fog::Rackspace::ServiceCatalog | users', ['rackspace']) do
|
4
|
+
|
5
|
+
tests('#from_response') do
|
6
|
+
before_hash = {"access"=>{"token"=>{"expires"=>"2013-02-20T10:31:00.000-06:00", "tenant"=>{"name"=>"777", "id"=>"777"}, "id"=>"6ca10877-7c50-4a5c-b58f-004d835c39c3"},
|
7
|
+
"serviceCatalog"=>[{"type"=>"volume", "endpoints"=>[{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.blockstorage.api.rackspacecloud.com/v1/777"},
|
8
|
+
{"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.blockstorage.api.rackspacecloud.com/v1/777"}], "name"=>"cloudBlockStorage"},
|
9
|
+
{"type"=>"rax:load-balancer", "endpoints"=>[{"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"},
|
10
|
+
{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudLoadBalancers"},
|
11
|
+
{"type"=>"object-store", "endpoints"=>[{"internalURL"=>"https://snet-storage101.dfw1.clouddrive.com/v1/Mosso777", "region"=>"DFW",
|
12
|
+
"tenantId"=>"Mosso777",
|
13
|
+
"publicURL"=>"https://storage101.dfw1.clouddrive.com/v1/Mosso777"},
|
14
|
+
{"internalURL"=>"https://snet-storage101.ord1.clouddrive.com/v1/Mosso777", "region"=>"ORD",
|
15
|
+
"tenantId"=>"Mosso777",
|
16
|
+
"publicURL"=>"https://storage101.ord1.clouddrive.com/v1/Mosso777"}], "name"=>"cloudFiles"}, {"type"=>"rax:database",
|
17
|
+
"endpoints"=>[{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.databases.api.rackspacecloud.com/v1.0/777"}, {"region"=>"ORD", "tenantId"=>"777",
|
18
|
+
"publicURL"=>"https://ord.databases.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudDatabases"}, {"type"=>"rax:dns", "endpoints"=>[{"tenantId"=>"777",
|
19
|
+
"publicURL"=>"https://dns.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudDNS"}, {"type"=>"compute", "endpoints"=>[{"versionId"=>"1.0", "tenantId"=>"777",
|
20
|
+
"versionList"=>"https://servers.api.rackspacecloud.com/", "versionInfo"=>"https://servers.api.rackspacecloud.com/v1.0",
|
21
|
+
"publicURL"=>"https://servers.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudServers"}, {"type"=>"compute", "endpoints"=>[{"region"=>"DFW", "versionId"=>"2",
|
22
|
+
"tenantId"=>"777", "versionList"=>"https://dfw.servers.api.rackspacecloud.com/", "versionInfo"=>"https://dfw.servers.api.rackspacecloud.com/v2",
|
23
|
+
"publicURL"=>"https://dfw.servers.api.rackspacecloud.com/v2/777"}, {"region"=>"ORD", "versionId"=>"2", "tenantId"=>"777",
|
24
|
+
"versionList"=>"https://ord.servers.api.rackspacecloud.com/", "versionInfo"=>"https://ord.servers.api.rackspacecloud.com/v2",
|
25
|
+
"publicURL"=>"https://ord.servers.api.rackspacecloud.com/v2/777"}], "name"=>"cloudServersOpenStack"}, {"type"=>"rax:monitor", "endpoints"=>[{"tenantId"=>"777",
|
26
|
+
"publicURL"=>"https://monitoring.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudMonitoring"}, {"type"=>"rax:object-cdn", "endpoints"=>[{"region"=>"DFW",
|
27
|
+
"tenantId"=>"Mosso777", "publicURL"=>"https://cdn1.clouddrive.com/v1/Mosso777"},
|
28
|
+
{"region"=>"ORD", "tenantId"=>"Mosso777",
|
29
|
+
"publicURL"=>"https://cdn2.clouddrive.com/v1/Mosso777"}], "name"=>"cloudFilesCDN"}], "user"=>{"roles"=>[{"description"=>"User Admin
|
30
|
+
Role.", "name"=>"identity:user-admin", "id"=>"3"}], "name"=>"joe-racker", "RAX-AUTH:defaultRegion"=>"", "id"=>"TK421"}}}
|
31
|
+
|
32
|
+
after_hash = {:cloudServers=>"https://servers.api.rackspacecloud.com/v1.0/777", :cloudServersOpenStack=>{:dfw=>"https://dfw.servers.api.rackspacecloud.com/v2/777", :ord=>"https://ord.servers.api.rackspacecloud.com/v2/777"}, :cloudFiles=>{:dfw=>"https://storage101.dfw1.clouddrive.com/v1/Mosso777", :ord=>"https://storage101.ord1.clouddrive.com/v1/Mosso777"}, :cloudBlockStorage=>{:dfw=>"https://dfw.blockstorage.api.rackspacecloud.com/v1/777", :ord=>"https://ord.blockstorage.api.rackspacecloud.com/v1/777"}, :cloudMonitoring=>"https://monitoring.api.rackspacecloud.com/v1.0/777", :cloudLoadBalancers=>{:dfw=>"https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/777", :ord=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}, :cloudFilesCDN=>{:dfw=>"https://cdn1.clouddrive.com/v1/Mosso777", :ord=>"https://cdn2.clouddrive.com/v1/Mosso777"}, :cloudDatabases=>{:dfw=>"https://dfw.databases.api.rackspacecloud.com/v1.0/777", :ord=>"https://ord.databases.api.rackspacecloud.com/v1.0/777"}, :cloudDNS=>"https://dns.api.rackspacecloud.com/v1.0/777"}
|
33
|
+
@service_catalog = Fog::Rackspace::Identity::ServiceCatalog.from_response(nil, before_hash)
|
34
|
+
returns(after_hash) { @service_catalog.catalog }
|
35
|
+
end
|
36
|
+
|
37
|
+
tests('services') do
|
38
|
+
services = ["cloudBlockStorage", "cloudDNS", "cloudDatabases", "cloudFiles", "cloudFilesCDN", "cloudLoadBalancers", "cloudMonitoring", "cloudServers", "cloudServersOpenStack"]
|
39
|
+
returns(services) { @service_catalog.services.collect {|s| s.to_s }.sort }
|
40
|
+
end
|
41
|
+
|
42
|
+
tests('get_endpoints') do
|
43
|
+
endpoints = {:dfw=>"https://dfw.servers.api.rackspacecloud.com/v2/777", :ord=>"https://ord.servers.api.rackspacecloud.com/v2/777"}
|
44
|
+
returns(endpoints) { @service_catalog.get_endpoints(:cloudServersOpenStack) }
|
45
|
+
returns(endpoints) { @service_catalog.get_endpoints('cloudServersOpenStack') }
|
46
|
+
returns(nil) { @service_catalog.get_endpoints('non-existent') }
|
47
|
+
end
|
48
|
+
|
49
|
+
tests('get_endpoint') do
|
50
|
+
tests('service with mulitple endpoints') do
|
51
|
+
returns("https://dfw.servers.api.rackspacecloud.com/v2/777") { @service_catalog.get_endpoint(:cloudServersOpenStack, :dfw) }
|
52
|
+
returns("https://ord.servers.api.rackspacecloud.com/v2/777") { @service_catalog.get_endpoint(:cloudServersOpenStack, :ord) }
|
53
|
+
returns("https://dfw.servers.api.rackspacecloud.com/v2/777") { @service_catalog.get_endpoint(:cloudServersOpenStack, 'dfw') }
|
54
|
+
returns("https://dfw.servers.api.rackspacecloud.com/v2/777") { @service_catalog.get_endpoint('cloudServersOpenStack', 'dfw') }
|
55
|
+
end
|
56
|
+
|
57
|
+
tests('with one endpoint') do
|
58
|
+
returns("https://monitoring.api.rackspacecloud.com/v1.0/777") { @service_catalog.get_endpoint(:cloudMonitoring, 'dfw') }
|
59
|
+
end
|
60
|
+
|
61
|
+
tests('error conditions') do
|
62
|
+
raises(RuntimeError) { @service_catalog.get_endpoint(:cloudServersOpenStack) }
|
63
|
+
raises(RuntimeError) { @service_catalog.get_endpoint(:cloudServersOpenStack, :sat) }
|
64
|
+
raises(RuntimeError) { @service_catalog.get_endpoint('non-existent') }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
tests('reload').succeeds do
|
69
|
+
pending if Fog.mocking?
|
70
|
+
|
71
|
+
service = Fog::Identity[:rackspace]
|
72
|
+
service_catalog = service.service_catalog
|
73
|
+
service_catalog.catalog[:fakeService] = "http:///fake-endpoint.com"
|
74
|
+
returns("http:///fake-endpoint.com") { service_catalog.get_endpoint :fakeService }
|
75
|
+
returns("http:///fake-endpoint.com") { service.service_catalog.get_endpoint :fakeService }
|
76
|
+
service_catalog.reload
|
77
|
+
raises(RuntimeError) { service_catalog.get_endpoint :fakeService }
|
78
|
+
raises(RuntimeError) { service.service_catalog.get_endpoint :fakeService }
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -2,8 +2,12 @@ Shindo.tests('Fog::Rackspace::Storage | file', ['rackspace']) do
|
|
2
2
|
|
3
3
|
pending if Fog.mocking?
|
4
4
|
|
5
|
+
def object_attributes(file=@instance)
|
6
|
+
@instance.service.head_object(@directory.key, file.key).headers
|
7
|
+
end
|
8
|
+
|
5
9
|
def object_meta_attributes(file=@instance)
|
6
|
-
|
10
|
+
object_attributes(file).reject {|k, v| !(k =~ /X-Object-Meta-/)}
|
7
11
|
end
|
8
12
|
|
9
13
|
def clear_metadata
|
@@ -85,6 +89,11 @@ Shindo.tests('Fog::Rackspace::Storage | file', ['rackspace']) do
|
|
85
89
|
@file = @directory.files.create :key => 'meta-test', :body => lorem_file, :metadata => {:works => true }
|
86
90
|
object_meta_attributes(@file)["X-Object-Meta-Works"]
|
87
91
|
end
|
92
|
+
|
93
|
+
tests("sets Content-Disposition on create").returns("ho-ho-ho") do
|
94
|
+
@file = @directory.files.create :key => 'meta-test', :body => lorem_file, :content_disposition => 'ho-ho-ho'
|
95
|
+
object_attributes(@file)["Content-Disposition"]
|
96
|
+
end
|
88
97
|
ensure
|
89
98
|
@file.destroy if @file
|
90
99
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Shindo.tests('Fog::Rackspace', ['rackspace']) do
|
2
|
+
|
3
|
+
tests('normalize_url') do
|
4
|
+
tests('should return nil if endpoint is nil').returns(nil) do
|
5
|
+
Fog::Rackspace.normalize_url nil
|
6
|
+
end
|
7
|
+
tests('should remove trailing spaces').returns("https://dfw.blockstorage.api.rackspacecloud.com/v1") do
|
8
|
+
Fog::Rackspace.normalize_url "https://dfw.blockstorage.api.rackspacecloud.com/v1 "
|
9
|
+
end
|
10
|
+
tests('should remove trailing /').returns("https://dfw.blockstorage.api.rackspacecloud.com/v1") do
|
11
|
+
Fog::Rackspace.normalize_url "https://dfw.blockstorage.api.rackspacecloud.com/v1/"
|
12
|
+
end
|
13
|
+
tests('should downcase url').returns("https://dfw.blockstorage.api.rackspacecloud.com/v1") do
|
14
|
+
Fog::Rackspace.normalize_url "HTTPS://DFW.BLOCKSTORAGE.API.RACKSPACECLOUD.COM/V1"
|
15
|
+
end
|
16
|
+
tests('show do all three').returns("https://dfw.blockstorage.api.rackspacecloud.com/v1") do
|
17
|
+
Fog::Rackspace.normalize_url "HTTPS://DFW.BLOCKSTORAGE.API.RACKSPACECLOUD.COM/V1/ "
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -16,8 +16,8 @@ Shindo.tests('Fog::Compute::RackspaceV2 | metadata_tests', ['rackspace']) do
|
|
16
16
|
|
17
17
|
|
18
18
|
@server_id = @server.id
|
19
|
-
@
|
20
|
-
@
|
19
|
+
@image = @server.create_image(name, :metadata => metadata)
|
20
|
+
@image_id = @image.id
|
21
21
|
else
|
22
22
|
@image_id = 1
|
23
23
|
@server_id = 1
|
@@ -6,7 +6,7 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
|
|
6
6
|
|
7
7
|
module RackspaceStorageHelpers
|
8
8
|
def override_path(path)
|
9
|
-
@path = path
|
9
|
+
@uri.path = path
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -70,7 +70,7 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
|
|
70
70
|
storage = Fog::Storage::Rackspace.new(:rackspace_temp_url_key => "super_secret")
|
71
71
|
storage.extend RackspaceStorageHelpers
|
72
72
|
storage.override_path('/fake_version/fake_tenant')
|
73
|
-
object_url = storage.get_object_https_url('fogobjecttests', 'fog-object', expires_at)
|
73
|
+
object_url = storage.get_object_https_url('fogobjecttests', 'fog-object', expires_at)
|
74
74
|
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog%2Dobject\?temp_url_sig=a24dd5fc955a57adce7d1b5bc4ec2c7660ab8396&temp_url_expires=1344149532/
|
75
75
|
end
|
76
76
|
|
@@ -1,8 +1,104 @@
|
|
1
|
-
Shindo.tests('
|
1
|
+
Shindo.tests('Rackspace | Storage', ['rackspace']) do
|
2
2
|
|
3
|
-
|
3
|
+
def assert_method(url, method)
|
4
|
+
@service.instance_variable_set "@rackspace_auth_url", url
|
5
|
+
returns(method) { @service.send :authentication_method }
|
6
|
+
end
|
7
|
+
|
8
|
+
tests('#authentication_method') do
|
9
|
+
@service = Fog::Storage::Rackspace.new
|
10
|
+
|
11
|
+
assert_method nil, :authenticate_v2
|
12
|
+
|
13
|
+
assert_method 'https://identity.api.rackspacecloud.com', :authenticate_v1
|
14
|
+
assert_method 'https://identity.api.rackspacecloud.com/v1', :authenticate_v1
|
15
|
+
assert_method 'https://identity.api.rackspacecloud.com/v1.1', :authenticate_v1
|
16
|
+
assert_method 'https://identity.api.rackspacecloud.com/v2.0', :authenticate_v2
|
17
|
+
|
18
|
+
assert_method 'https://lon.identity.api.rackspacecloud.com', :authenticate_v1
|
19
|
+
assert_method 'https://lon.identity.api.rackspacecloud.com/v1', :authenticate_v1
|
20
|
+
assert_method 'https://lon.identity.api.rackspacecloud.com/v1.1', :authenticate_v1
|
21
|
+
assert_method 'https://lon.identity.api.rackspacecloud.com/v2.0', :authenticate_v2
|
22
|
+
end
|
23
|
+
|
24
|
+
tests('authentication v1') do
|
25
|
+
pending if Fog.mocking?
|
26
|
+
|
27
|
+
tests('variables populated').succeeds do
|
28
|
+
@service = Fog::Storage::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v1.0'
|
29
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
30
|
+
returns(false, "path populated") { @service.instance_variable_get("@uri").nil? }
|
31
|
+
returns(true, "identity_service was not used") { @service.instance_variable_get("@identity_service").nil? }
|
32
|
+
@service.head_containers
|
33
|
+
end
|
34
|
+
tests('custom endpoint') do
|
35
|
+
@service = Fog::Storage::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v1.0',
|
36
|
+
:rackspace_storage_url => 'https://my-custom-endpoint.com'
|
37
|
+
returns(false, "auth token populated") { @service.send(:auth_token).nil? }
|
38
|
+
returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /my-custom-endpoint\.com/) != nil }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
tests('authentation v2') do
|
43
|
+
pending if Fog.mocking?
|
44
|
+
|
45
|
+
tests('variables populated').succeeds do
|
46
|
+
@service = Fog::Storage::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0'
|
47
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
48
|
+
returns(false, "path populated") { @service.instance_variable_get("@uri").nil? }
|
49
|
+
returns(false, "identity service was used") { @service.instance_variable_get("@identity_service").nil? }
|
50
|
+
@service.head_containers
|
51
|
+
end
|
52
|
+
tests('dfw region').succeeds do
|
53
|
+
@service = Fog::Storage::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :rackspace_region => :dfw
|
54
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
55
|
+
returns(true) { (@service.instance_variable_get("@uri").host =~ /dfw\d/) != nil }
|
56
|
+
@service.head_containers
|
57
|
+
end
|
58
|
+
tests('ord region').succeeds do
|
59
|
+
@service = Fog::Storage::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :rackspace_region => :ord
|
60
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
61
|
+
returns(true) { (@service.instance_variable_get("@uri").host =~ /ord\d/) != nil }
|
62
|
+
@service.head_containers
|
63
|
+
end
|
64
|
+
tests('custom endpoint').succeeds do
|
65
|
+
@service = Fog::Storage::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0',
|
66
|
+
:rackspace_storage_url => 'https://my-custom-endpoint.com'
|
67
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
68
|
+
returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /my-custom-endpoint\.com/) != nil }
|
69
|
+
end
|
70
|
+
end
|
4
71
|
|
72
|
+
tests('default auth') do
|
73
|
+
pending if Fog.mocking?
|
74
|
+
|
75
|
+
tests('no params').succeeds do
|
76
|
+
@service = Fog::Storage::Rackspace.new
|
77
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
78
|
+
returns(true) { (@service.instance_variable_get("@uri").host =~ /dfw\d/) != nil }
|
79
|
+
@service.head_containers
|
80
|
+
end
|
81
|
+
tests('specify region').succeeds do
|
82
|
+
@service = Fog::Storage::Rackspace.new :rackspace_region => :ord
|
83
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
84
|
+
returns(true) { (@service.instance_variable_get("@uri").host =~ /ord\d/ ) != nil }
|
85
|
+
@service.head_containers
|
86
|
+
end
|
87
|
+
tests('custom endpoint') do
|
88
|
+
@service = Fog::Storage::Rackspace.new :rackspace_storage_url => 'https://my-custom-endpoint.com'
|
89
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
90
|
+
returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /my-custom-endpoint\.com/) != nil }
|
91
|
+
end
|
92
|
+
tests('rackspace_servicenet') do
|
93
|
+
@service = Fog::Storage::Rackspace.new :rackspace_servicenet => true
|
94
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
95
|
+
returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /snet-/) != nil }
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
5
99
|
tests('account').succeeds do
|
100
|
+
pending if Fog.mocking?
|
6
101
|
Fog::Storage[:rackspace].account
|
7
102
|
end
|
8
|
-
end
|
103
|
+
end
|
104
|
+
|
@@ -0,0 +1,174 @@
|
|
1
|
+
Shindo.tests('RiakCS::Provisioning | provisioning requests', ['riakcs']) do
|
2
|
+
|
3
|
+
current_timestamp = Time.now.to_i
|
4
|
+
|
5
|
+
user_format = {
|
6
|
+
'email' => String,
|
7
|
+
'display_name' => String,
|
8
|
+
'name' => String,
|
9
|
+
'key_id' => String,
|
10
|
+
'key_secret' => String,
|
11
|
+
'id' => String,
|
12
|
+
'status' => String,
|
13
|
+
}
|
14
|
+
|
15
|
+
tests('User creation') do
|
16
|
+
|
17
|
+
tests('is successful').returns(String) do
|
18
|
+
|
19
|
+
# Create a user.
|
20
|
+
#
|
21
|
+
email, name = "successful_user_creation_test_#{current_timestamp}@example.com", "Fog User"
|
22
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
23
|
+
key_id.class
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
tests('is successful anonymously').returns(String) do
|
28
|
+
|
29
|
+
# Create a user.
|
30
|
+
#
|
31
|
+
email, name = "successful_anonymous_user_creation_test_#{current_timestamp}@example.com", "Fog User"
|
32
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name, :anonymous => true).body['key_id']
|
33
|
+
key_id.class
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
tests('fails if duplicate').raises(Fog::RiakCS::Provisioning::UserAlreadyExists) do
|
38
|
+
2.times do
|
39
|
+
email, name = "failed_duplicate_user_creation_test_#{current_timestamp}@example.com", "Fog User"
|
40
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
tests('fails if invalid email').raises(Fog::RiakCS::Provisioning::ServiceUnavailable) do
|
45
|
+
email, name = "failed_duplicate_user_creation_test_#{current_timestamp}", "Fog User"
|
46
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
tests('User disable') do
|
52
|
+
|
53
|
+
tests('is successful').returns(200) do
|
54
|
+
|
55
|
+
# Create a user.
|
56
|
+
#
|
57
|
+
email, name = "successful_user_disable_test_#{current_timestamp}@example.com", "Fog User"
|
58
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
59
|
+
|
60
|
+
Fog::RiakCS[:provisioning].disable_user(key_id).status
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
tests('User enable') do
|
67
|
+
|
68
|
+
tests('is successful').returns(200) do
|
69
|
+
|
70
|
+
# Create a user.
|
71
|
+
#
|
72
|
+
email, name = "successful_user_disable_enable_test_#{current_timestamp}@example.com", "Fog User"
|
73
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
74
|
+
|
75
|
+
Fog::RiakCS[:provisioning].disable_user(key_id).status
|
76
|
+
Fog::RiakCS[:provisioning].enable_user(key_id).status
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
tests('User granted new key secret') do
|
83
|
+
|
84
|
+
tests('is successful').returns(true) do
|
85
|
+
|
86
|
+
# Create a user.
|
87
|
+
#
|
88
|
+
email, name = "successful_user_regrant_test_#{current_timestamp}@example.com", "Fog User"
|
89
|
+
user = Fog::RiakCS[:provisioning].create_user(email, name).body
|
90
|
+
key_id, key_secret = user['key_id'], user['key_secret']
|
91
|
+
|
92
|
+
Fog::RiakCS[:provisioning].regrant_secret(key_id).status
|
93
|
+
|
94
|
+
# Verify new secret.
|
95
|
+
#
|
96
|
+
new_key_secret = Fog::RiakCS[:provisioning].get_user(key_id).body['key_secret']
|
97
|
+
new_key_secret != key_secret
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
tests('User retrieval') do
|
104
|
+
|
105
|
+
tests('is successful').formats(user_format) do
|
106
|
+
|
107
|
+
# Create a user.
|
108
|
+
#
|
109
|
+
email, name = "user_retrieval_test_#{current_timestamp}@example.com", "Fog User"
|
110
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
111
|
+
|
112
|
+
# Get user details.
|
113
|
+
#
|
114
|
+
Fog::RiakCS[:provisioning].get_user(key_id).body
|
115
|
+
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
tests('User listing') do
|
121
|
+
|
122
|
+
tests('sucessfully lists users').formats(user_format) do
|
123
|
+
|
124
|
+
# Create a user.
|
125
|
+
#
|
126
|
+
email, name = "user_listing_test_#{current_timestamp}@example.com", "Fog User"
|
127
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
128
|
+
|
129
|
+
# Ensure the list users response contains the user that we just
|
130
|
+
# created.
|
131
|
+
#
|
132
|
+
Fog::RiakCS[:provisioning].list_users.body.select { |x| x['email'] == email }.first
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
tests('successfully lists users containing no disabled users').returns(nil) do
|
137
|
+
|
138
|
+
# Create a user.
|
139
|
+
#
|
140
|
+
email, name = "user_listing_without_disabled_users_test_#{current_timestamp}@example.com", "Fog User"
|
141
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
142
|
+
|
143
|
+
# Disable that user.
|
144
|
+
#
|
145
|
+
Fog::RiakCS[:provisioning].disable_user(key_id)
|
146
|
+
|
147
|
+
# Ensure the list users response does not contain the user that we
|
148
|
+
# just created and disabled.
|
149
|
+
#
|
150
|
+
Fog::RiakCS[:provisioning].list_users(:status => :enabled).body.select { |x| x['Email'] == email }.first
|
151
|
+
|
152
|
+
end
|
153
|
+
|
154
|
+
tests('successfully lists users containing disabled users').formats(user_format) do
|
155
|
+
|
156
|
+
# Create a user.
|
157
|
+
#
|
158
|
+
email, name = "user_listing_with_disabled_users_test_#{current_timestamp}@example.com", "Fog User"
|
159
|
+
key_id = Fog::RiakCS[:provisioning].create_user(email, name).body['key_id']
|
160
|
+
|
161
|
+
# Disable that user.
|
162
|
+
#
|
163
|
+
Fog::RiakCS[:provisioning].disable_user(key_id)
|
164
|
+
|
165
|
+
# Ensure the list users response contains the user that we just
|
166
|
+
# created and disabled.
|
167
|
+
#
|
168
|
+
Fog::RiakCS[:provisioning].list_users.body.select { |x| x['email'] == email }.first
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|