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
@@ -1,69 +0,0 @@
|
|
1
|
-
# OpenStack Identity Service (Keystone) Example
|
2
|
-
|
3
|
-
require 'fog'
|
4
|
-
require 'pp'
|
5
|
-
|
6
|
-
auth_url = "https://example.net/v2.0/tokens"
|
7
|
-
username = 'admin@example.net'
|
8
|
-
password = 'secret'
|
9
|
-
|
10
|
-
keystone = Fog::Identity.new :provider => 'OpenStack',
|
11
|
-
:openstack_auth_url => auth_url,
|
12
|
-
:openstack_username => username,
|
13
|
-
:openstack_api_key => password
|
14
|
-
# Optional, self-signed certs
|
15
|
-
#:connection_options => { :ssl_verify_peer => false }
|
16
|
-
|
17
|
-
#
|
18
|
-
# Listing keystone tenants
|
19
|
-
#
|
20
|
-
keystone.tenants.each do |tenant|
|
21
|
-
# <Fog::Identity::OpenStack::Tenant
|
22
|
-
# id="46b4ab...",
|
23
|
-
# description=nil,
|
24
|
-
# enabled=1,
|
25
|
-
# name="admin@example.net"
|
26
|
-
# >
|
27
|
-
#pp tenant
|
28
|
-
end
|
29
|
-
|
30
|
-
#
|
31
|
-
# List users
|
32
|
-
#
|
33
|
-
keystone.users.each do |user|
|
34
|
-
# <Fog::Identity::OpenStack::User
|
35
|
-
# id="c975f...",
|
36
|
-
# email="quantum@example.net",
|
37
|
-
# enabled=true,
|
38
|
-
# name="quantum",
|
39
|
-
# tenant_id="00928...",
|
40
|
-
# password=nil
|
41
|
-
# >
|
42
|
-
# ...
|
43
|
-
#pp user
|
44
|
-
end
|
45
|
-
|
46
|
-
#
|
47
|
-
# Create a new tenant
|
48
|
-
#
|
49
|
-
tenant = keystone.tenants.create :name => 'rubiojr@example.net',
|
50
|
-
:description => 'My foo tenant'
|
51
|
-
|
52
|
-
#
|
53
|
-
# Create a new user
|
54
|
-
#
|
55
|
-
user = keystone.users.create :name => 'rubiojr@example.net',
|
56
|
-
:tenant_id => tenant.id,
|
57
|
-
:password => 'rubiojr@example.net',
|
58
|
-
:email => 'rubiojr@example.net'
|
59
|
-
|
60
|
-
|
61
|
-
# Find the recently created tenant
|
62
|
-
tenant = keystone.tenants.find { |t| t.name == 'rubiojr@example.net' }
|
63
|
-
# Destroy the tenant
|
64
|
-
tenant.destroy
|
65
|
-
|
66
|
-
# Find the recently created user
|
67
|
-
user = keystone.users.find { |u| u.name == 'rubiojr@example.net' }
|
68
|
-
# Destroy the user
|
69
|
-
user.destroy
|
data/lib/fog/providers.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'fog/atmos'
|
2
|
-
require 'fog/aws'
|
3
|
-
require 'fog/bluebox'
|
4
|
-
require 'fog/brightbox'
|
5
|
-
require 'fog/cloudstack'
|
6
|
-
require 'fog/clodo'
|
7
|
-
require 'fog/dnsimple'
|
8
|
-
require 'fog/dnsmadeeasy'
|
9
|
-
require 'fog/dreamhost'
|
10
|
-
require 'fog/dynect'
|
11
|
-
require 'fog/ecloud'
|
12
|
-
require 'fog/glesys'
|
13
|
-
require 'fog/go_grid'
|
14
|
-
require 'fog/google'
|
15
|
-
require 'fog/hp'
|
16
|
-
require 'fog/ibm'
|
17
|
-
require 'fog/internet_archive'
|
18
|
-
require 'fog/joyent'
|
19
|
-
require 'fog/libvirt'
|
20
|
-
require 'fog/linode'
|
21
|
-
require 'fog/local'
|
22
|
-
require 'fog/bare_metal_cloud'
|
23
|
-
require 'fog/ninefold'
|
24
|
-
require 'fog/rackspace'
|
25
|
-
require 'fog/openstack'
|
26
|
-
require 'fog/ovirt'
|
27
|
-
require 'fog/serverlove'
|
28
|
-
require 'fog/storm_on_demand'
|
29
|
-
require 'fog/vcloud'
|
30
|
-
require 'fog/vmfusion'
|
31
|
-
require 'fog/vsphere'
|
32
|
-
require 'fog/voxel'
|
33
|
-
require 'fog/xenserver'
|
34
|
-
require 'fog/zerigo'
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# Getting Started Examples
|
2
|
-
|
3
|
-
## Download
|
4
|
-
|
5
|
-
You can find examples using the Rackspace and Fog in the [fog repository](https://github.com/fog/fog) under the `fog/lib/fog/rackspace/examples` directory.
|
6
|
-
|
7
|
-
You can download this repository by executing the following command:
|
8
|
-
|
9
|
-
git clone git://github.com/fog/fog.git
|
10
|
-
|
11
|
-
Optionally you can download a zip by clicking on this [link](https://github.com/fog/fog/archive/master.zip).
|
12
|
-
|
13
|
-
## Requirements
|
14
|
-
|
15
|
-
Examples require the following:
|
16
|
-
|
17
|
-
* Rackspace Cloud account
|
18
|
-
* Ruby 1.8.x or 1.9.x
|
19
|
-
* `fog` gem
|
20
|
-
|
21
|
-
For more information please refer to the [Getting Started with Fog and the Rackspace Cloud](https://github.com/fog/fog/blob/master/lib/fog/rackspace/docs/getting_started.md) document.
|
22
|
-
|
23
|
-
## Credentials
|
24
|
-
|
25
|
-
Examples will prompt for Rackspace Cloud credentials. You can skip prompts by creating a `.fog` file in the user's home directory. This is an example of a `.fog` file for the Rackspace Cloud:
|
26
|
-
|
27
|
-
default:
|
28
|
-
rackspace_username: RACKSPACE_USERNAME
|
29
|
-
rackspace_api_key: RACKSPACE_API_KEY
|
30
|
-
|
31
|
-
**Note:** *Replace capitalized values with the appropriate credential information.*
|
32
|
-
|
33
|
-
## Executing
|
34
|
-
|
35
|
-
To execute scripts using `bundler`:
|
36
|
-
|
37
|
-
bundle exec ruby <script>
|
38
|
-
|
39
|
-
To execute scripts without `bundler`:
|
40
|
-
|
41
|
-
ruby <script>
|
42
|
-
|
43
|
-
## Support and Feedback
|
44
|
-
|
45
|
-
Your feedback is appreciated! If you have specific issues with the **fog** SDK, you should file an [issue via Github](https://github.com/fog/fog/issues).
|
46
|
-
|
47
|
-
For general feedback and support requests, send an email to: <sdk-support@rackspace.com>.
|
@@ -1,52 +0,0 @@
|
|
1
|
-
Shindo.tests("Storage[:internet_archive] | version", ["internet_archive"]) do
|
2
|
-
|
3
|
-
file_attributes = {
|
4
|
-
:key => 'fog_file_tests',
|
5
|
-
:body => lorem_file,
|
6
|
-
:public => true
|
7
|
-
}
|
8
|
-
|
9
|
-
directory_attributes = {
|
10
|
-
:key => 'fogfilestests'
|
11
|
-
}
|
12
|
-
|
13
|
-
@directory = Fog::Storage[:internetarchive].directories.create(directory_attributes)
|
14
|
-
@directory.versioning = true
|
15
|
-
|
16
|
-
model_tests(@directory.files, file_attributes, Fog.mocking?) do
|
17
|
-
|
18
|
-
@version_instance = @instance.versions.first
|
19
|
-
@directory.connection.put_object(@directory.key, @instance.key, 'second version content')
|
20
|
-
|
21
|
-
tests("#file") do
|
22
|
-
tests("#file should return the object associated with the version").returns(@version_instance.version) do
|
23
|
-
@version_instance.file.version
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
tests("#delete_marker") do
|
28
|
-
tests("#delete_marker should be false if the version isn't a DeleteMarker'").returns(false) do
|
29
|
-
@version_instance.delete_marker
|
30
|
-
end
|
31
|
-
|
32
|
-
tests("#delete_marker should be true if the version is a DeleteMarker'").returns(true) do
|
33
|
-
@instance.destroy
|
34
|
-
|
35
|
-
@instance.versions.all.first.delete_marker
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
tests("#destroy") do
|
40
|
-
tests("#destroy removes the specific version").returns(false) do
|
41
|
-
@version_instance.destroy
|
42
|
-
|
43
|
-
@instance.versions.all.collect(&:version).include?(@version_instance.version)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
@directory.versions.each(&:destroy)
|
50
|
-
@directory.destroy
|
51
|
-
|
52
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
Shindo.tests("Storage[:internet_archive] | versions", ["internet_archive"]) do
|
2
|
-
|
3
|
-
file_attributes = {
|
4
|
-
:key => 'fog_file_tests',
|
5
|
-
:body => lorem_file,
|
6
|
-
:public => true
|
7
|
-
}
|
8
|
-
|
9
|
-
directory_attributes = {
|
10
|
-
:key => 'fogfilestests'
|
11
|
-
}
|
12
|
-
|
13
|
-
model_tests(Fog::Storage[:internetarchive].directories, directory_attributes, Fog.mocking?) do
|
14
|
-
@instance.versioning = true
|
15
|
-
|
16
|
-
versions = []
|
17
|
-
versions << @instance.connection.put_object(@instance.key, 'one', 'abcde').headers['x-amz-version-id']
|
18
|
-
|
19
|
-
puts versions.first
|
20
|
-
|
21
|
-
versions << @instance.connection.put_object(@instance.key, 'one', '32423').headers['x-amz-version-id']
|
22
|
-
versions << @instance.connection.delete_object(@instance.key, 'one').headers['x-amz-version-id']
|
23
|
-
versions.reverse!
|
24
|
-
|
25
|
-
puts versions.first
|
26
|
-
|
27
|
-
versions << @instance.connection.put_object(@instance.key, 'two', 'aoeu').headers['x-amz-version-id']
|
28
|
-
|
29
|
-
tests('#versions') do
|
30
|
-
tests('#versions.size includes versions (including DeleteMarkers) for all keys').returns(4) do
|
31
|
-
@instance.versions.all.size
|
32
|
-
end
|
33
|
-
|
34
|
-
tests('#versions returns the correct versions').returns(versions) do
|
35
|
-
@instance.versions.all.collect(&:version)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
tests("#all") do
|
40
|
-
tests("#all for a directory returns all versions, regardless of key").returns(versions) do
|
41
|
-
@instance.versions.all.collect(&:version)
|
42
|
-
end
|
43
|
-
|
44
|
-
tests("#all for file returns only versions for that file").returns(1) do
|
45
|
-
@instance.files.get('two').versions.all.collect(&:version).size
|
46
|
-
end
|
47
|
-
|
48
|
-
tests("#all for file returns only versions for that file").returns(versions.last) do
|
49
|
-
@instance.files.get('two').versions.all.collect(&:version).first
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
@instance.versions.each(&:destroy)
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
@@ -1,258 +0,0 @@
|
|
1
|
-
def clear_bucket
|
2
|
-
Fog::Storage[:internetarchive].get_bucket_object_versions(@ia_bucket_name).body['Versions'].each do |version|
|
3
|
-
object = version[version.keys.first]
|
4
|
-
Fog::Storage[:internetarchive].delete_object(@ia_bucket_name, object['Key'], 'versionId' => object['VersionId'])
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
def create_versioned_bucket
|
9
|
-
@ia_bucket_name = 'fogbuckettests-' + Fog::Mock.random_hex(16)
|
10
|
-
Fog::Storage[:internetarchive].put_bucket(@ia_bucket_name)
|
11
|
-
Fog::Storage[:internetarchive].put_bucket_versioning(@ia_bucket_name, 'Enabled')
|
12
|
-
end
|
13
|
-
|
14
|
-
def delete_bucket
|
15
|
-
Fog::Storage[:internetarchive].get_bucket_object_versions(@ia_bucket_name).body['Versions'].each do |version|
|
16
|
-
object = version[version.keys.first]
|
17
|
-
Fog::Storage[:internetarchive].delete_object(@ia_bucket_name, object['Key'], 'versionId' => object['VersionId'])
|
18
|
-
end
|
19
|
-
|
20
|
-
Fog::Storage[:internetarchive].delete_bucket(@ia_bucket_name)
|
21
|
-
end
|
22
|
-
|
23
|
-
Shindo.tests('Fog::Storage[:internetarchive] | versioning', ["internet_archive"]) do
|
24
|
-
tests('success') do
|
25
|
-
tests("#put_bucket_versioning") do
|
26
|
-
@ia_bucket_name = 'fogbuckettests-' + Fog::Mock.random_hex(16)
|
27
|
-
Fog::Storage[:internetarchive].put_bucket(@ia_bucket_name)
|
28
|
-
|
29
|
-
tests("#put_bucket_versioning('#{@ia_bucket_name}', 'Enabled')").succeeds do
|
30
|
-
Fog::Storage[:internetarchive].put_bucket_versioning(@ia_bucket_name, 'Enabled')
|
31
|
-
end
|
32
|
-
|
33
|
-
tests("#put_bucket_versioning('#{@ia_bucket_name}', 'Suspended')").succeeds do
|
34
|
-
Fog::Storage[:internetarchive].put_bucket_versioning(@ia_bucket_name, 'Suspended')
|
35
|
-
end
|
36
|
-
|
37
|
-
delete_bucket
|
38
|
-
end
|
39
|
-
|
40
|
-
tests("#get_bucket_versioning('#{@ia_bucket_name}')") do
|
41
|
-
@ia_bucket_name = 'fogbuckettests-' + Fog::Mock.random_hex(16)
|
42
|
-
Fog::Storage[:internetarchive].put_bucket(@ia_bucket_name)
|
43
|
-
|
44
|
-
tests("#get_bucket_versioning('#{@ia_bucket_name}') without versioning").returns({}) do
|
45
|
-
Fog::Storage[:internetarchive].get_bucket_versioning(@ia_bucket_name).body['VersioningConfiguration']
|
46
|
-
end
|
47
|
-
|
48
|
-
tests("#get_bucket_versioning('#{@ia_bucket_name}') with versioning enabled").returns('Enabled') do
|
49
|
-
Fog::Storage[:internetarchive].put_bucket_versioning(@ia_bucket_name, 'Enabled')
|
50
|
-
Fog::Storage[:internetarchive].get_bucket_versioning(@ia_bucket_name).body['VersioningConfiguration']['Status']
|
51
|
-
end
|
52
|
-
|
53
|
-
tests("#get_bucket_versioning('#{@ia_bucket_name}') with versioning suspended").returns('Suspended') do
|
54
|
-
Fog::Storage[:internetarchive].put_bucket_versioning(@ia_bucket_name, 'Suspended')
|
55
|
-
Fog::Storage[:internetarchive].get_bucket_versioning(@ia_bucket_name).body['VersioningConfiguration']['Status']
|
56
|
-
end
|
57
|
-
|
58
|
-
delete_bucket
|
59
|
-
end
|
60
|
-
|
61
|
-
tests("#get_bucket_object_versions('#{@ia_bucket_name}')") do
|
62
|
-
|
63
|
-
create_versioned_bucket
|
64
|
-
|
65
|
-
before do
|
66
|
-
@versions = Fog::Storage[:internetarchive].get_bucket_object_versions(@ia_bucket_name)
|
67
|
-
end
|
68
|
-
|
69
|
-
v1 = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'a', :key => 'file')
|
70
|
-
v2 = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'ab', :key => v1.key)
|
71
|
-
v3 = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'abc', :key => v1.key)
|
72
|
-
v4 = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'abcd', :key => v1.key)
|
73
|
-
|
74
|
-
tests("versions").returns([v4.version, v3.version, v2.version, v1.version]) do
|
75
|
-
@versions.body['Versions'].collect {|v| v['Version']['VersionId']}
|
76
|
-
end
|
77
|
-
|
78
|
-
tests("version sizes").returns([4, 3, 2, 1]) do
|
79
|
-
@versions.body['Versions'].collect {|v| v['Version']['Size']}
|
80
|
-
end
|
81
|
-
|
82
|
-
tests("latest version").returns(v4.version) do
|
83
|
-
latest = @versions.body['Versions'].find {|v| v['Version']['IsLatest']}
|
84
|
-
latest['Version']['VersionId']
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
tests("get_object('#{@ia_bucket_name}', 'file')") do
|
89
|
-
clear_bucket
|
90
|
-
|
91
|
-
v1 = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'a', :key => 'file')
|
92
|
-
v2 = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'ab', :key => v1.key)
|
93
|
-
|
94
|
-
tests("get_object('#{@ia_bucket_name}', '#{v2.key}') returns the latest version").returns(v2.version) do
|
95
|
-
res = Fog::Storage[:internetarchive].get_object(@ia_bucket_name, v2.key)
|
96
|
-
res.headers['x-amz-version-id']
|
97
|
-
end
|
98
|
-
|
99
|
-
tests("get_object('#{@ia_bucket_name}', '#{v1.key}', 'versionId' => '#{v1.version}') returns the specified version").returns(v1.version) do
|
100
|
-
res = Fog::Storage[:internetarchive].get_object(@ia_bucket_name, v1.key, 'versionId' => v1.version)
|
101
|
-
res.headers['x-amz-version-id']
|
102
|
-
end
|
103
|
-
|
104
|
-
v2.destroy
|
105
|
-
|
106
|
-
tests("get_object('#{@ia_bucket_name}', '#{v2.key}') raises exception if delete marker is latest version").raises(Excon::Errors::NotFound) do
|
107
|
-
Fog::Storage[:internetarchive].get_object(@ia_bucket_name, v2.key)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
tests("delete_object('#{@ia_bucket_name}', 'file')") do
|
112
|
-
clear_bucket
|
113
|
-
|
114
|
-
file = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'a', :key => 'file')
|
115
|
-
|
116
|
-
tests("deleting an object just stores a delete marker").returns(true) do
|
117
|
-
file.destroy
|
118
|
-
versions = Fog::Storage[:internetarchive].get_bucket_object_versions(@ia_bucket_name)
|
119
|
-
versions.body['Versions'].first.has_key?('DeleteMarker')
|
120
|
-
end
|
121
|
-
|
122
|
-
tests("there are two versions: the original and the delete marker").returns(2) do
|
123
|
-
versions = Fog::Storage[:internetarchive].get_bucket_object_versions(@ia_bucket_name)
|
124
|
-
versions.body['Versions'].size
|
125
|
-
end
|
126
|
-
|
127
|
-
tests("deleting the delete marker makes the object available again").returns(file.version) do
|
128
|
-
versions = Fog::Storage[:internetarchive].get_bucket_object_versions(@ia_bucket_name)
|
129
|
-
delete_marker = versions.body['Versions'].find { |v| v.has_key?('DeleteMarker') }
|
130
|
-
Fog::Storage[:internetarchive].delete_object(@ia_bucket_name, file.key, 'versionId' => delete_marker['DeleteMarker']['VersionId'])
|
131
|
-
|
132
|
-
res = Fog::Storage[:internetarchive].get_object(@ia_bucket_name, file.key)
|
133
|
-
res.headers['x-amz-version-id']
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
tests("deleting_multiple_objects('#{@ia_bucket_name}", 'file') do
|
138
|
-
clear_bucket
|
139
|
-
|
140
|
-
bucket = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name)
|
141
|
-
|
142
|
-
file_count = 5
|
143
|
-
file_names = []
|
144
|
-
files = {}
|
145
|
-
file_count.times do |id|
|
146
|
-
file_names << "file_#{id}"
|
147
|
-
files[file_names.last] = bucket.files.create(:body => 'a',
|
148
|
-
:key => file_names.last)
|
149
|
-
end
|
150
|
-
|
151
|
-
tests("deleting an object just stores a delete marker").returns(true) do
|
152
|
-
Fog::Storage[:internetarchive].delete_multiple_objects(@ia_bucket_name,
|
153
|
-
file_names)
|
154
|
-
versions = Fog::Storage[:internetarchive].get_bucket_object_versions(
|
155
|
-
@ia_bucket_name)
|
156
|
-
all_versions = {}
|
157
|
-
versions.body['Versions'].each do |version|
|
158
|
-
object = version[version.keys.first]
|
159
|
-
next if file_names.index(object['Key']).nil?
|
160
|
-
if !all_versions.has_key?(object['Key'])
|
161
|
-
all_versions[object['Key']] = version.has_key?('DeleteMarker')
|
162
|
-
else
|
163
|
-
all_versions[object['Key']] |= version.has_key?('DeleteMarker')
|
164
|
-
end
|
165
|
-
end
|
166
|
-
all_true = true
|
167
|
-
all_versions.values.each do |marker|
|
168
|
-
all_true = false if !marker
|
169
|
-
end
|
170
|
-
all_true
|
171
|
-
end
|
172
|
-
|
173
|
-
tests("there are two versions: the original and the delete marker").
|
174
|
-
returns(file_count*2) do
|
175
|
-
versions = Fog::Storage[:internetarchive].get_bucket_object_versions(
|
176
|
-
@ia_bucket_name)
|
177
|
-
versions.body['Versions'].size
|
178
|
-
end
|
179
|
-
|
180
|
-
tests("deleting the delete marker makes the object available again").
|
181
|
-
returns(true) do
|
182
|
-
versions = Fog::Storage[:internetarchive].get_bucket_object_versions(
|
183
|
-
@ia_bucket_name)
|
184
|
-
delete_markers = []
|
185
|
-
file_versions = {}
|
186
|
-
versions.body['Versions'].each do |version|
|
187
|
-
object = version[version.keys.first]
|
188
|
-
next if object['VersionId'] == files[object['Key']].version
|
189
|
-
file_versions[object['Key']] = object['VersionId']
|
190
|
-
end
|
191
|
-
|
192
|
-
Fog::Storage[:internetarchive].delete_multiple_objects(@ia_bucket_name,
|
193
|
-
file_names,
|
194
|
-
'versionId' => file_versions)
|
195
|
-
all_true = true
|
196
|
-
file_names.each do |file|
|
197
|
-
res = Fog::Storage[:internetarchive].get_object(@ia_bucket_name, file)
|
198
|
-
all_true = false if res.headers['x-amz-version-id'] !=
|
199
|
-
files[file].version
|
200
|
-
end
|
201
|
-
all_true
|
202
|
-
end
|
203
|
-
|
204
|
-
end
|
205
|
-
|
206
|
-
tests("get_bucket('#{@ia_bucket_name}'") do
|
207
|
-
clear_bucket
|
208
|
-
|
209
|
-
file = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'a', :key => 'file')
|
210
|
-
|
211
|
-
tests("includes a non-DeleteMarker object").returns(1) do
|
212
|
-
Fog::Storage[:internetarchive].get_bucket(@ia_bucket_name).body['Contents'].size
|
213
|
-
end
|
214
|
-
|
215
|
-
file.destroy
|
216
|
-
|
217
|
-
tests("does not include a DeleteMarker object").returns(0) do
|
218
|
-
Fog::Storage[:internetarchive].get_bucket(@ia_bucket_name).body['Contents'].size
|
219
|
-
end
|
220
|
-
end
|
221
|
-
|
222
|
-
delete_bucket
|
223
|
-
end
|
224
|
-
|
225
|
-
tests('failure') do
|
226
|
-
create_versioned_bucket
|
227
|
-
|
228
|
-
tests("#put_bucket_versioning('#{@ia_bucket_name}', 'bad_value')").raises(Excon::Errors::BadRequest) do
|
229
|
-
Fog::Storage[:internetarchive].put_bucket_versioning(@ia_bucket_name, 'bad_value')
|
230
|
-
end
|
231
|
-
|
232
|
-
tests("#put_bucket_versioning('fognonbucket', 'Enabled')").raises(Excon::Errors::NotFound) do
|
233
|
-
Fog::Storage[:internetarchive].put_bucket_versioning('fognonbucket', 'Enabled')
|
234
|
-
end
|
235
|
-
|
236
|
-
tests("#get_bucket_versioning('fognonbucket')").raises(Excon::Errors::NotFound) do
|
237
|
-
Fog::Storage[:internetarchive].get_bucket_versioning('fognonbucket')
|
238
|
-
end
|
239
|
-
|
240
|
-
tests("#get_bucket_object_versions('fognonbucket')").raises(Excon::Errors::NotFound) do
|
241
|
-
Fog::Storage[:internetarchive].get_bucket_object_versions('fognonbucket')
|
242
|
-
end
|
243
|
-
|
244
|
-
file = Fog::Storage[:internetarchive].directories.get(@ia_bucket_name).files.create(:body => 'y', :key => 'x')
|
245
|
-
|
246
|
-
tests("#get_object('#{@ia_bucket_name}', '#{file.key}', 'versionId' => 'bad_version'").raises(Excon::Errors::BadRequest) do
|
247
|
-
Fog::Storage[:internetarchive].get_object(@ia_bucket_name, file.key, 'versionId' => '-1')
|
248
|
-
end
|
249
|
-
|
250
|
-
tests("#delete_object('#{@ia_bucket_name}', '#{file.key}', 'versionId' => 'bad_version'").raises(Excon::Errors::BadRequest) do
|
251
|
-
Fog::Storage[:internetarchive].delete_object(@ia_bucket_name, file.key, 'versionId' => '-1')
|
252
|
-
end
|
253
|
-
|
254
|
-
end
|
255
|
-
|
256
|
-
# don't keep the bucket around
|
257
|
-
delete_bucket
|
258
|
-
end
|