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,36 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Storage
|
5
|
-
class InternetArchive
|
6
|
-
|
7
|
-
class Version < Fog::Model
|
8
|
-
|
9
|
-
identity :version, :aliases => 'VersionId'
|
10
|
-
|
11
|
-
attribute :key, :aliases => 'Key'
|
12
|
-
attribute :last_modified, :aliases => ['Last-Modified', 'LastModified']
|
13
|
-
attribute :latest, :aliases => 'IsLatest', :type => :boolean
|
14
|
-
attribute :content_length, :aliases => ['Content-Length', 'Size'], :type => :integer
|
15
|
-
attribute :delete_marker, :type => :boolean
|
16
|
-
|
17
|
-
def file
|
18
|
-
@file ||= if collection.file
|
19
|
-
collection.file.directory.files.get(key, 'versionId' => version)
|
20
|
-
else
|
21
|
-
collection.directory.files.get(key, 'versionId' => version)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def destroy
|
26
|
-
if collection.file
|
27
|
-
collection.service.delete_object(collection.file.directory.key, key, 'versionId' => version)
|
28
|
-
else
|
29
|
-
collection.service.delete_object(collection.directory.key, key, 'versionId' => version)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/internet_archive/models/storage/version'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Storage
|
6
|
-
class InternetArchive
|
7
|
-
|
8
|
-
class Versions < Fog::Collection
|
9
|
-
|
10
|
-
attribute :file
|
11
|
-
attribute :directory
|
12
|
-
|
13
|
-
model Fog::Storage::InternetArchive::Version
|
14
|
-
|
15
|
-
def all(options = {})
|
16
|
-
data = if file
|
17
|
-
service.get_bucket_object_versions(file.directory.key, options.merge('prefix' => file.key)).body['Versions']
|
18
|
-
else
|
19
|
-
service.get_bucket_object_versions(directory.key, options).body['Versions']
|
20
|
-
end
|
21
|
-
|
22
|
-
load(data)
|
23
|
-
end
|
24
|
-
|
25
|
-
def new(attributes = {})
|
26
|
-
version_type = attributes.keys.first
|
27
|
-
|
28
|
-
model = super(attributes[version_type])
|
29
|
-
model.delete_marker = version_type == 'DeleteMarker'
|
30
|
-
|
31
|
-
model
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module Storage
|
4
|
-
module InternetArchive
|
5
|
-
|
6
|
-
class GetBucketObjectVersions < Fog::Parsers::Base
|
7
|
-
|
8
|
-
def reset
|
9
|
-
@delete_marker = { 'Owner' => {} }
|
10
|
-
@version = { 'Owner' => {} }
|
11
|
-
|
12
|
-
@in_delete_marke = false
|
13
|
-
@in_version = false
|
14
|
-
|
15
|
-
@response = { 'Versions' => [] }
|
16
|
-
end
|
17
|
-
|
18
|
-
def start_element(name, attrs = [])
|
19
|
-
super
|
20
|
-
case name
|
21
|
-
when 'DeleteMarker'
|
22
|
-
@in_delete_marker = true
|
23
|
-
when 'Version'
|
24
|
-
@in_version = true
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def end_element(name)
|
29
|
-
case name
|
30
|
-
when 'DeleteMarker'
|
31
|
-
@response['Versions'] << {'DeleteMarker' => @delete_marker }
|
32
|
-
@delete_marker = { 'Owner' => {} }
|
33
|
-
@in_delete_marker = false
|
34
|
-
when 'Version'
|
35
|
-
@response['Versions'] << {'Version' => @version }
|
36
|
-
@version = { 'Owner' => {} }
|
37
|
-
@in_version = false
|
38
|
-
when 'DisplayName', 'ID'
|
39
|
-
if @in_delete_marker
|
40
|
-
@delete_marker
|
41
|
-
elsif @in_version
|
42
|
-
@version
|
43
|
-
end['Owner'][name] = value
|
44
|
-
when 'ETag'
|
45
|
-
@version[name] = value.gsub('"', '')
|
46
|
-
when 'IsLatest'
|
47
|
-
if @in_delete_marker
|
48
|
-
@delete_marker
|
49
|
-
elsif @in_version
|
50
|
-
@version
|
51
|
-
end['IsLatest'] = if value == 'true'
|
52
|
-
true
|
53
|
-
else
|
54
|
-
false
|
55
|
-
end
|
56
|
-
when 'IsTruncated'
|
57
|
-
if value == 'true'
|
58
|
-
@response['IsTruncated'] = true
|
59
|
-
else
|
60
|
-
@response['IsTruncated'] = false
|
61
|
-
end
|
62
|
-
when 'LastModified'
|
63
|
-
if @in_delete_marker
|
64
|
-
@delete_marker
|
65
|
-
elsif @in_version
|
66
|
-
@version
|
67
|
-
end['LastModified'] = Time.parse(value)
|
68
|
-
when 'MaxKeys'
|
69
|
-
@response['MaxKeys'] = value.to_i
|
70
|
-
when 'Size'
|
71
|
-
@version['Size'] = value.to_i
|
72
|
-
when 'Key', 'KeyMarker', 'Name', 'NextKeyMarker', 'NextVersionIdMarker', 'Prefix', 'StorageClass', 'VersionId', 'VersionIdMarker'
|
73
|
-
if @in_delete_marker
|
74
|
-
@delete_marker
|
75
|
-
elsif @in_version
|
76
|
-
@version
|
77
|
-
else
|
78
|
-
@response
|
79
|
-
end[name] = value
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module Storage
|
4
|
-
module InternetArchive
|
5
|
-
|
6
|
-
class GetBucketVersioning < Fog::Parsers::Base
|
7
|
-
|
8
|
-
def reset
|
9
|
-
@response = { 'VersioningConfiguration' => {} }
|
10
|
-
end
|
11
|
-
|
12
|
-
def end_element(name)
|
13
|
-
case name
|
14
|
-
when 'Status', 'MfaDelete'
|
15
|
-
@response['VersioningConfiguration'][name] = value
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,162 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Storage
|
3
|
-
class InternetArchive
|
4
|
-
class Real
|
5
|
-
|
6
|
-
require 'fog/internet_archive/parsers/storage/get_bucket_object_versions'
|
7
|
-
|
8
|
-
# List information about object versions in an S3 bucket
|
9
|
-
#
|
10
|
-
# @param bucket_name [String] name of bucket to list object keys from
|
11
|
-
# @param options [Hash] config arguments for list
|
12
|
-
# @option options delimiter [String] causes keys with the same string between the prefix value and the first occurence of delimiter to be rolled up
|
13
|
-
# @option options key-marker [String] limits object keys to only those that appear lexicographically after its value.
|
14
|
-
# @option options max-keys [Integer] limits number of object keys returned
|
15
|
-
# @option options prefix [String] limits object keys to those beginning with its value.
|
16
|
-
# @option options version-id-marker [String] limits object versions to only those that appear lexicographically after its value
|
17
|
-
#
|
18
|
-
# @return [Excon::Response] response:
|
19
|
-
# * body [Hash]:
|
20
|
-
# * Delimeter [String] - Delimiter specified for query
|
21
|
-
# * KeyMarker [String] - Key marker specified for query
|
22
|
-
# * MaxKeys [Integer] - Maximum number of keys specified for query
|
23
|
-
# * Name [String] - Name of the bucket
|
24
|
-
# * Prefix [String] - Prefix specified for query
|
25
|
-
# * VersionIdMarker [String] - Version id marker specified for query
|
26
|
-
# * IsTruncated [Boolean] - Whether or not this is the totality of the bucket
|
27
|
-
# * Versions [Array]:
|
28
|
-
# * DeleteMarker [Hash]:
|
29
|
-
# * IsLatest [Boolean] - Whether or not this is the latest version
|
30
|
-
# * Key [String] - Name of object
|
31
|
-
# * LastModified [String]: Timestamp of last modification of object
|
32
|
-
# * Owner [Hash]:
|
33
|
-
# * DisplayName [String] - Display name of object owner
|
34
|
-
# * ID [String] - Id of object owner
|
35
|
-
# * VersionId [String] - The id of this version
|
36
|
-
# or
|
37
|
-
# * Version [Hash]:
|
38
|
-
# * ETag [String]: Etag of object
|
39
|
-
# * IsLatest [Boolean] - Whether or not this is the latest version
|
40
|
-
# * Key [String] - Name of object
|
41
|
-
# * LastModified [String]: Timestamp of last modification of object
|
42
|
-
# * Owner [Hash]:
|
43
|
-
# * DisplayName [String] - Display name of object owner
|
44
|
-
# * ID [String] - Id of object owner
|
45
|
-
# * Size [Integer] - Size of object
|
46
|
-
# * StorageClass [String] - Storage class of object
|
47
|
-
# * VersionId [String] - The id of this version
|
48
|
-
#
|
49
|
-
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETVersion.html
|
50
|
-
|
51
|
-
def get_bucket_object_versions(bucket_name, options = {})
|
52
|
-
unless bucket_name
|
53
|
-
raise ArgumentError.new('bucket_name is required')
|
54
|
-
end
|
55
|
-
request({
|
56
|
-
:expects => 200,
|
57
|
-
:headers => {},
|
58
|
-
:host => "#{bucket_name}.#{@host}",
|
59
|
-
:idempotent => true,
|
60
|
-
:method => 'GET',
|
61
|
-
:parser => Fog::Parsers::Storage::InternetArchive::GetBucketObjectVersions.new,
|
62
|
-
:query => {'versions' => nil}.merge!(options) })
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
class Mock
|
68
|
-
def get_bucket_object_versions(bucket_name, options = {})
|
69
|
-
delimiter, key_marker, max_keys, prefix, version_id_marker = \
|
70
|
-
options['delimiter'], options['key-marker'], options['max-keys'],options['prefix'],options['version-id-marker']
|
71
|
-
|
72
|
-
unless bucket_name
|
73
|
-
raise ArgumentError.new('bucket_name is required')
|
74
|
-
end
|
75
|
-
|
76
|
-
response = Excon::Response.new
|
77
|
-
|
78
|
-
# Invalid arguments.
|
79
|
-
if version_id_marker && !key_marker
|
80
|
-
response.status = 400
|
81
|
-
response.body = {
|
82
|
-
'Error' => {
|
83
|
-
'Code' => 'InvalidArgument',
|
84
|
-
'Message' => 'A version-id marker cannot be specified without a key marker.',
|
85
|
-
'ArgumentValue' => version_id_marker,
|
86
|
-
'RequestId' => Fog::Mock.random_hex(16),
|
87
|
-
'HostId' => Fog::Mock.random_base64(65)
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
# Valid case.
|
92
|
-
# TODO: (nirvdrum 12/15/11) It's not clear to me how to actually use version-id-marker, so I didn't implement it below.
|
93
|
-
elsif bucket = self.data[:buckets][bucket_name]
|
94
|
-
# We need to order results by S3 key, but since our data store is key => [versions], we want to ensure the integrity
|
95
|
-
# of the versions as well. So, sort the keys, then fetch the versions, and then combine them all as a sorted list by
|
96
|
-
# flattening the results.
|
97
|
-
contents = bucket[:objects].keys.sort.collect { |key| bucket[:objects][key] }.flatten.reject do |object|
|
98
|
-
(prefix && object['Key'][0...prefix.length] != prefix) ||
|
99
|
-
(key_marker && object['Key'] <= key_marker) ||
|
100
|
-
(delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \
|
101
|
-
&& common_prefixes << object['Key'].sub(/^(#{prefix}[^#{delimiter}]+.).*/, '\1'))
|
102
|
-
end.map do |object|
|
103
|
-
if object.has_key?(:delete_marker)
|
104
|
-
tag_name = 'DeleteMarker'
|
105
|
-
extracted_attrs = ['Key', 'VersionId']
|
106
|
-
else
|
107
|
-
tag_name = 'Version'
|
108
|
-
extracted_attrs = ['ETag', 'Key', 'StorageClass', 'VersionId']
|
109
|
-
end
|
110
|
-
|
111
|
-
data = {}
|
112
|
-
data[tag_name] = object.reject { |key, value| !extracted_attrs.include?(key) }
|
113
|
-
data[tag_name].merge!({
|
114
|
-
'LastModified' => Time.parse(object['Last-Modified']),
|
115
|
-
'Owner' => bucket['Owner'],
|
116
|
-
'IsLatest' => object == bucket[:objects][object['Key']].first
|
117
|
-
})
|
118
|
-
|
119
|
-
data[tag_name]['Size'] = object['Content-Length'].to_i if tag_name == 'Version'
|
120
|
-
data
|
121
|
-
end
|
122
|
-
|
123
|
-
max_keys = max_keys || 1000
|
124
|
-
size = [max_keys, 1000].min
|
125
|
-
truncated_contents = contents[0...size]
|
126
|
-
|
127
|
-
response.status = 200
|
128
|
-
response.body = {
|
129
|
-
'Versions' => truncated_contents,
|
130
|
-
'IsTruncated' => truncated_contents.size != contents.size,
|
131
|
-
'KeyMarker' => key_marker,
|
132
|
-
'VersionIdMarker' => version_id_marker,
|
133
|
-
'MaxKeys' => max_keys,
|
134
|
-
'Name' => bucket['Name'],
|
135
|
-
'Prefix' => prefix
|
136
|
-
}
|
137
|
-
if max_keys && max_keys < response.body['Versions'].length
|
138
|
-
response.body['IsTruncated'] = true
|
139
|
-
response.body['Versions'] = response.body['Versions'][0...max_keys]
|
140
|
-
end
|
141
|
-
|
142
|
-
# Missing bucket case.
|
143
|
-
else
|
144
|
-
response.status = 404
|
145
|
-
response.body = {
|
146
|
-
'Error' => {
|
147
|
-
'Code' => 'NoSuchBucket',
|
148
|
-
'Message' => 'The specified bucket does not exist',
|
149
|
-
'BucketName' => bucket_name,
|
150
|
-
'RequestId' => Fog::Mock.random_hex(16),
|
151
|
-
'HostId' => Fog::Mock.random_base64(65)
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
|
-
raise(Excon::Errors.status_error({:expects => 200}, response))
|
156
|
-
end
|
157
|
-
response
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Storage
|
3
|
-
class InternetArchive
|
4
|
-
class Real
|
5
|
-
|
6
|
-
require 'fog/internet_archive/parsers/storage/get_bucket_versioning'
|
7
|
-
|
8
|
-
# Get versioning status for an S3 bucket
|
9
|
-
#
|
10
|
-
# @param bucket_name [String] name of bucket to get versioning status for
|
11
|
-
#
|
12
|
-
# @return [Excon::Response] response:
|
13
|
-
# * body [Hash]:
|
14
|
-
# * VersioningConfiguration [Hash]:
|
15
|
-
# * Status [String] - Versioning status in ['Enabled', 'Suspended', nil]
|
16
|
-
#
|
17
|
-
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETversioningStatus.html
|
18
|
-
|
19
|
-
def get_bucket_versioning(bucket_name)
|
20
|
-
unless bucket_name
|
21
|
-
raise ArgumentError.new('bucket_name is required')
|
22
|
-
end
|
23
|
-
request({
|
24
|
-
:expects => 200,
|
25
|
-
:headers => {},
|
26
|
-
:host => "#{bucket_name}.#{@host}",
|
27
|
-
:idempotent => true,
|
28
|
-
:method => 'GET',
|
29
|
-
:parser => Fog::Parsers::Storage::InternetArchive::GetBucketVersioning.new,
|
30
|
-
:query => {'versioning' => nil}
|
31
|
-
})
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class Mock
|
36
|
-
def get_bucket_versioning(bucket_name)
|
37
|
-
response = Excon::Response.new
|
38
|
-
bucket = self.data[:buckets][bucket_name]
|
39
|
-
|
40
|
-
if bucket
|
41
|
-
response.status = 200
|
42
|
-
|
43
|
-
if bucket[:versioning]
|
44
|
-
response.body = { 'VersioningConfiguration' => { 'Status' => bucket[:versioning] } }
|
45
|
-
else
|
46
|
-
response.body = { 'VersioningConfiguration' => {} }
|
47
|
-
end
|
48
|
-
|
49
|
-
else
|
50
|
-
response.status = 404
|
51
|
-
response.body = {
|
52
|
-
'Error' => {
|
53
|
-
'Code' => 'NoSuchBucket',
|
54
|
-
'Message' => 'The specified bucket does not exist',
|
55
|
-
'BucketName' => bucket_name,
|
56
|
-
'RequestId' => Fog::Mock.random_hex(16),
|
57
|
-
'HostId' => Fog::Mock.random_base64(65)
|
58
|
-
}
|
59
|
-
}
|
60
|
-
|
61
|
-
raise(Excon::Errors.status_error({:expects => 200}, response))
|
62
|
-
end
|
63
|
-
|
64
|
-
response
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Storage
|
3
|
-
class InternetArchive
|
4
|
-
class Real
|
5
|
-
|
6
|
-
# Change versioning status for an S3 bucket
|
7
|
-
#
|
8
|
-
# @param bucket_name [String] name of bucket to modify
|
9
|
-
# @param status [String] Status to change to in ['Enabled', 'Suspended']
|
10
|
-
#
|
11
|
-
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html
|
12
|
-
|
13
|
-
def put_bucket_versioning(bucket_name, status)
|
14
|
-
data =
|
15
|
-
<<-DATA
|
16
|
-
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
17
|
-
<Status>#{status}</Status>
|
18
|
-
</VersioningConfiguration>
|
19
|
-
DATA
|
20
|
-
|
21
|
-
request({
|
22
|
-
:body => data,
|
23
|
-
:expects => 200,
|
24
|
-
:headers => {},
|
25
|
-
:host => "#{bucket_name}.#{@host}",
|
26
|
-
:method => 'PUT',
|
27
|
-
:query => {'versioning' => nil}
|
28
|
-
})
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class Mock
|
33
|
-
def put_bucket_versioning(bucket_name, status)
|
34
|
-
response = Excon::Response.new
|
35
|
-
bucket = self.data[:buckets][bucket_name]
|
36
|
-
|
37
|
-
if bucket
|
38
|
-
if ['Enabled', 'Suspended'].include?(status)
|
39
|
-
bucket[:versioning] = status
|
40
|
-
|
41
|
-
response.status = 200
|
42
|
-
else
|
43
|
-
response.status = 400
|
44
|
-
response.body = {
|
45
|
-
'Error' => {
|
46
|
-
'Code' => 'MalformedXML',
|
47
|
-
'Message' => 'The XML you provided was not well-formed or did not validate against our published schema',
|
48
|
-
'RequestId' => Fog::Mock.random_hex(16),
|
49
|
-
'HostId' => Fog::Mock.random_base64(65)
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
raise(Excon::Errors.status_error({:expects => 200}, response))
|
54
|
-
end
|
55
|
-
else
|
56
|
-
response.status = 404
|
57
|
-
response.body = {
|
58
|
-
'Error' => {
|
59
|
-
'Code' => 'NoSuchBucket',
|
60
|
-
'Message' => 'The specified bucket does not exist',
|
61
|
-
'BucketName' => bucket_name,
|
62
|
-
'RequestId' => Fog::Mock.random_hex(16),
|
63
|
-
'HostId' => Fog::Mock.random_base64(65)
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
raise(Excon::Errors.status_error({:expects => 200}, response))
|
68
|
-
end
|
69
|
-
|
70
|
-
response
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|