fog 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +21 -0
- data/README.md +3 -1
- data/Rakefile +4 -1
- data/changelog.txt +462 -0
- data/docs/storage/index.markdown +4 -4
- data/fog.gemspec +2 -2
- data/lib/fog.rb +1 -1
- data/lib/fog/atmos.rb +11 -0
- data/lib/fog/atmos/models/storage/directories.rb +48 -0
- data/lib/fog/atmos/models/storage/directory.rb +53 -0
- data/lib/fog/atmos/models/storage/file.rb +107 -0
- data/lib/fog/atmos/models/storage/files.rb +73 -0
- data/lib/fog/atmos/requests/storage/delete_namespace.rb +19 -0
- data/lib/fog/atmos/requests/storage/get_namespace.rb +20 -0
- data/lib/fog/atmos/requests/storage/head_namespace.rb +20 -0
- data/lib/fog/atmos/requests/storage/post_namespace.rb +20 -0
- data/lib/fog/atmos/requests/storage/put_namespace.rb +20 -0
- data/lib/fog/atmos/storage.rb +186 -0
- data/lib/fog/aws.rb +2 -0
- data/lib/fog/aws/auto_scaling.rb +15 -1
- data/lib/fog/aws/compute.rb +26 -17
- data/lib/fog/aws/elb.rb +14 -2
- data/lib/fog/aws/glacier.rb +172 -0
- data/lib/fog/aws/iam.rb +35 -29
- data/lib/fog/aws/models/auto_scaling/group.rb +1 -1
- data/lib/fog/aws/models/compute/flavors.rb +11 -0
- data/lib/fog/aws/models/compute/security_group.rb +22 -6
- data/lib/fog/aws/models/compute/server.rb +5 -1
- data/lib/fog/aws/models/compute/spot_request.rb +12 -0
- data/lib/fog/aws/models/compute/spot_requests.rb +1 -2
- data/lib/fog/aws/models/compute/volume.rb +7 -1
- data/lib/fog/aws/models/glacier/archive.rb +70 -0
- data/lib/fog/aws/models/glacier/archives.rb +30 -0
- data/lib/fog/aws/models/glacier/job.rb +65 -0
- data/lib/fog/aws/models/glacier/jobs.rb +45 -0
- data/lib/fog/aws/models/glacier/vault.rb +53 -0
- data/lib/fog/aws/models/glacier/vaults.rb +28 -0
- data/lib/fog/aws/models/rds/server.rb +3 -1
- data/lib/fog/aws/models/rds/snapshot.rb +1 -0
- data/lib/fog/aws/models/rds/snapshots.rb +3 -0
- data/lib/fog/aws/models/storage/file.rb +4 -3
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +8 -1
- data/lib/fog/aws/parsers/compute/create_volume.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_instance_status.rb +8 -1
- data/lib/fog/aws/parsers/compute/describe_instances.rb +2 -0
- data/lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_volumes.rb +2 -2
- data/lib/fog/aws/parsers/compute/run_instances.rb +2 -0
- data/lib/fog/aws/parsers/compute/spot_instance_requests.rb +1 -1
- data/lib/fog/aws/parsers/dns/list_resource_record_sets.rb +3 -1
- data/lib/fog/aws/parsers/rds/db_parser.rb +3 -1
- data/lib/fog/aws/parsers/rds/snapshot_parser.rb +1 -0
- data/lib/fog/aws/rds.rb +9 -9
- data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +1 -0
- data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +1 -1
- data/lib/fog/aws/requests/compute/create_volume.rb +53 -14
- data/lib/fog/aws/requests/compute/describe_instance_status.rb +2 -0
- data/lib/fog/aws/requests/compute/describe_instances.rb +3 -1
- data/lib/fog/aws/requests/compute/describe_internet_gateways.rb +13 -7
- data/lib/fog/aws/requests/compute/describe_spot_instance_requests.rb +1 -0
- data/lib/fog/aws/requests/compute/describe_subnets.rb +13 -7
- data/lib/fog/aws/requests/compute/describe_volumes.rb +2 -0
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +12 -6
- data/lib/fog/aws/requests/compute/request_spot_instances.rb +2 -0
- data/lib/fog/aws/requests/compute/run_instances.rb +8 -2
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +20 -1
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +2 -2
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +1 -1
- data/lib/fog/aws/requests/glacier/abort_multipart_upload.rb +35 -0
- data/lib/fog/aws/requests/glacier/complete_multipart_upload.rb +42 -0
- data/lib/fog/aws/requests/glacier/create_archive.rb +43 -0
- data/lib/fog/aws/requests/glacier/create_vault.rb +34 -0
- data/lib/fog/aws/requests/glacier/delete_archive.rb +35 -0
- data/lib/fog/aws/requests/glacier/delete_vault.rb +34 -0
- data/lib/fog/aws/requests/glacier/delete_vault_notification_configuration.rb +33 -0
- data/lib/fog/aws/requests/glacier/describe_job.rb +35 -0
- data/lib/fog/aws/requests/glacier/describe_vault.rb +34 -0
- data/lib/fog/aws/requests/glacier/get_job_output.rb +41 -0
- data/lib/fog/aws/requests/glacier/get_vault_notification_configuration.rb +34 -0
- data/lib/fog/aws/requests/glacier/initiate_job.rb +41 -0
- data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +38 -0
- data/lib/fog/aws/requests/glacier/list_jobs.rb +39 -0
- data/lib/fog/aws/requests/glacier/list_multipart_uploads.rb +37 -0
- data/lib/fog/aws/requests/glacier/list_parts.rb +37 -0
- data/lib/fog/aws/requests/glacier/list_vaults.rb +36 -0
- data/lib/fog/aws/requests/glacier/set_vault_notification_configuration.rb +37 -0
- data/lib/fog/aws/requests/glacier/upload_part.rb +46 -0
- data/lib/fog/aws/requests/rds/create_db_instance.rb +7 -5
- data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +41 -1
- data/lib/fog/aws/requests/rds/create_db_snapshot.rb +1 -1
- data/lib/fog/aws/requests/rds/describe_db_instances.rb +8 -10
- data/lib/fog/aws/requests/rds/describe_db_security_groups.rb +1 -1
- data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +2 -0
- data/lib/fog/aws/requests/rds/modify_db_instance.rb +7 -6
- data/lib/fog/aws/requests/rds/reboot_db_instance.rb +6 -5
- data/lib/fog/aws/requests/storage/get_object.rb +45 -2
- data/lib/fog/aws/requests/storage/upload_part.rb +1 -0
- data/lib/fog/aws/signaturev4.rb +73 -0
- data/lib/fog/aws/sqs.rb +2 -6
- data/lib/fog/bare_metal_cloud/compute.rb +3 -1
- data/lib/fog/bare_metal_cloud/requests/compute/add_server_by_configuration.rb +33 -0
- data/lib/fog/bare_metal_cloud/requests/compute/get_server.rb +17 -12
- data/lib/fog/bare_metal_cloud/requests/compute/list_configurations.rb +27 -0
- data/lib/fog/bare_metal_cloud/requests/compute/list_images.rb +4 -4
- data/lib/fog/bare_metal_cloud/requests/compute/list_plans.rb +7 -7
- data/lib/fog/bare_metal_cloud/requests/compute/list_servers.rb +2 -2
- data/lib/fog/bin.rb +7 -0
- data/lib/fog/bin/atmos.rb +31 -0
- data/lib/fog/bin/aws.rb +4 -0
- data/lib/fog/bin/ecloud.rb +4 -0
- data/lib/fog/bin/rackspace.rb +7 -0
- data/lib/fog/bin/serverlove.rb +31 -0
- data/lib/fog/bluebox/requests/compute/create_block.rb +18 -4
- data/lib/fog/brightbox/compute.rb +52 -0
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +2 -0
- data/lib/fog/brightbox/models/compute/image.rb +1 -0
- data/lib/fog/brightbox/models/compute/server.rb +46 -3
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +3 -3
- data/lib/fog/cloudstack/compute.rb +4 -1
- data/lib/fog/cloudstack/models/compute/images.rb +15 -6
- data/lib/fog/cloudstack/models/compute/job.rb +1 -1
- data/lib/fog/cloudstack/requests/compute/attach_volume.rb +1 -1
- data/lib/fog/cloudstack/requests/compute/register_template.rb +35 -0
- data/lib/fog/compute.rb +15 -3
- data/lib/fog/core/errors.rb +1 -0
- data/lib/fog/core/time.rb +4 -0
- data/lib/fog/dynect/dns.rb +5 -5
- data/lib/fog/ecloud.rb +6 -0
- data/lib/fog/ecloud/compute.rb +3 -1
- data/lib/fog/ecloud/models/compute/ip_addresses.rb +1 -0
- data/lib/fog/ecloud/models/compute/networks.rb +1 -0
- data/lib/fog/ecloud/models/compute/server.rb +31 -1
- data/lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb +40 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_upload_file.rb +31 -0
- data/lib/fog/google/models/storage/directory.rb +2 -2
- data/lib/fog/google/models/storage/file.rb +2 -2
- data/lib/fog/google/requests/storage/get_bucket.rb +1 -2
- data/lib/fog/google/requests/storage/put_object.rb +1 -2
- data/lib/fog/google/storage.rb +1 -1
- data/lib/fog/hp/models/compute/image.rb +1 -1
- data/lib/fog/hp/models/compute/server.rb +4 -0
- data/lib/fog/hp/requests/compute/delete_security_group_rule.rb +4 -4
- data/lib/fog/hp/requests/storage/get_object.rb +8 -2
- data/lib/fog/hp/storage.rb +1 -0
- data/lib/fog/libvirt/models/compute/server.rb +1 -1
- data/lib/fog/libvirt/models/compute/templates/server.xml.erb +1 -1
- data/lib/fog/openstack.rb +7 -0
- data/lib/fog/openstack/compute.rb +4 -1
- data/lib/fog/openstack/models/compute/server.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +8 -2
- data/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +1 -1
- data/lib/fog/openstack/requests/identity/list_tenants.rb +1 -0
- data/lib/fog/providers.rb +2 -0
- data/lib/fog/rackspace.rb +9 -7
- data/lib/fog/rackspace/block_storage.rb +114 -0
- data/lib/fog/rackspace/compute_v2.rb +123 -0
- data/lib/fog/rackspace/models/block_storage/snapshot.rb +46 -0
- data/lib/fog/rackspace/models/block_storage/snapshots.rb +25 -0
- data/lib/fog/rackspace/models/block_storage/volume.rb +58 -0
- data/lib/fog/rackspace/models/block_storage/volume_type.rb +14 -0
- data/lib/fog/rackspace/models/block_storage/volume_types.rb +25 -0
- data/lib/fog/rackspace/models/block_storage/volumes.rb +25 -0
- data/lib/fog/rackspace/models/compute_v2/attachment.rb +34 -0
- data/lib/fog/rackspace/models/compute_v2/attachments.rb +25 -0
- data/lib/fog/rackspace/models/compute_v2/flavor.rb +17 -0
- data/lib/fog/rackspace/models/compute_v2/flavors.rb +25 -0
- data/lib/fog/rackspace/models/compute_v2/image.rb +30 -0
- data/lib/fog/rackspace/models/compute_v2/images.rb +25 -0
- data/lib/fog/rackspace/models/compute_v2/server.rb +147 -0
- data/lib/fog/rackspace/models/compute_v2/servers.rb +25 -0
- data/lib/fog/rackspace/models/storage/directory.rb +3 -3
- data/lib/fog/rackspace/requests/block_storage/create_snapshot.rb +26 -0
- data/lib/fog/rackspace/requests/block_storage/create_volume.rb +27 -0
- data/lib/fog/rackspace/requests/block_storage/delete_snapshot.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/delete_volume.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/get_snapshot.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/get_volume.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/get_volume_type.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/list_snapshots.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/list_volume_types.rb +15 -0
- data/lib/fog/rackspace/requests/block_storage/list_volumes.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/attach_volume.rb +23 -0
- data/lib/fog/rackspace/requests/compute_v2/change_server_password.rb +22 -0
- data/lib/fog/rackspace/requests/compute_v2/confirm_resize_server.rb +20 -0
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +28 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_attachment.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/get_attachment.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/get_flavor.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/get_image.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/get_server.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/list_attachments.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/list_flavors.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/list_images.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +15 -0
- data/lib/fog/rackspace/requests/compute_v2/reboot_server.rb +22 -0
- data/lib/fog/rackspace/requests/compute_v2/rebuild_server.rb +22 -0
- data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +22 -0
- data/lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb +20 -0
- data/lib/fog/rackspace/requests/compute_v2/update_server.rb +22 -0
- data/lib/fog/rackspace/requests/storage/delete_object.rb +1 -1
- data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +51 -0
- data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +37 -0
- data/lib/fog/rackspace/storage.rb +4 -0
- data/lib/fog/serverlove.rb +10 -0
- data/lib/fog/serverlove/compute.rb +97 -0
- data/lib/fog/serverlove/models/compute/image.rb +57 -0
- data/lib/fog/serverlove/models/compute/images.rb +26 -0
- data/lib/fog/serverlove/models/compute/server.rb +72 -0
- data/lib/fog/serverlove/models/compute/servers.rb +26 -0
- data/lib/fog/serverlove/requests/compute/create_image.rb +32 -0
- data/lib/fog/serverlove/requests/compute/create_server.rb +34 -0
- data/lib/fog/serverlove/requests/compute/destroy_image.rb +13 -0
- data/lib/fog/serverlove/requests/compute/destroy_server.rb +13 -0
- data/lib/fog/serverlove/requests/compute/get_image.rb +13 -0
- data/lib/fog/serverlove/requests/compute/get_images.rb +13 -0
- data/lib/fog/serverlove/requests/compute/get_server.rb +13 -0
- data/lib/fog/serverlove/requests/compute/get_servers.rb +13 -0
- data/lib/fog/serverlove/requests/compute/load_standard_image.rb +13 -0
- data/lib/fog/serverlove/requests/compute/reset_server.rb +13 -0
- data/lib/fog/serverlove/requests/compute/shutdown_server.rb +13 -0
- data/lib/fog/serverlove/requests/compute/start_server.rb +13 -0
- data/lib/fog/serverlove/requests/compute/stop_server.rb +13 -0
- data/lib/fog/serverlove/requests/compute/update_image.rb +15 -0
- data/lib/fog/serverlove/requests/compute/update_server.rb +15 -0
- data/lib/fog/serverlove/util/compute/password_generator.rb +11 -0
- data/lib/fog/storage.rb +3 -0
- data/lib/fog/terremark/models/shared/image.rb +22 -0
- data/lib/fog/terremark/models/shared/images.rb +48 -0
- data/lib/fog/terremark/models/shared/internetservice.rb +67 -0
- data/lib/fog/terremark/models/shared/internetservices.rb +42 -0
- data/lib/fog/terremark/models/shared/nodeservice.rb +52 -0
- data/lib/fog/terremark/models/shared/nodeservices.rb +32 -0
- data/lib/fog/terremark/models/shared/server.rb +114 -15
- data/lib/fog/terremark/models/shared/servers.rb +7 -8
- data/lib/fog/terremark/models/shared/vdc.rb +6 -1
- data/lib/fog/terremark/parsers/shared/get_catalog.rb +7 -2
- data/lib/fog/terremark/parsers/shared/get_keys_list.rb +56 -0
- data/lib/fog/terremark/requests/shared/add_internet_service.rb +10 -9
- data/lib/fog/terremark/requests/shared/add_node_service.rb +10 -12
- data/lib/fog/terremark/requests/shared/configure_vapp.rb +61 -0
- data/lib/fog/terremark/requests/shared/create_internet_service.rb +16 -11
- data/lib/fog/terremark/requests/shared/delete_internet_service.rb +2 -1
- data/lib/fog/terremark/requests/shared/delete_node_service.rb +2 -1
- data/lib/fog/terremark/requests/shared/delete_public_ip.rb +2 -1
- data/lib/fog/terremark/requests/shared/get_internet_services.rb +2 -1
- data/lib/fog/terremark/requests/shared/get_keys_list.rb +36 -0
- data/lib/fog/terremark/requests/shared/get_node_services.rb +2 -1
- data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +11 -1
- data/lib/fog/terremark/shared.rb +19 -1
- data/lib/fog/terremark/vcloud.rb +10 -1
- data/lib/fog/vcloud/compute.rb +13 -13
- data/lib/fog/vcloud/models/compute/catalog_items.rb +6 -2
- data/lib/fog/vcloud/models/compute/organizations.rb +1 -2
- data/lib/fog/vcloud/models/compute/server.rb +37 -3
- data/lib/fog/vcloud/models/compute/vapps.rb +1 -1
- data/lib/fog/vcloud/requests/compute/configure_org_network.rb +141 -0
- data/lib/fog/vcloud/requests/compute/configure_vm_cpus.rb +38 -0
- data/lib/fog/vcloud/requests/compute/configure_vm_memory.rb +11 -12
- data/lib/fog/vcloud/requests/compute/configure_vm_password.rb +39 -0
- data/lib/fog/vcloud/requests/compute/undeploy.rb +9 -1
- data/lib/fog/vsphere/requests/compute/vm_reboot.rb +1 -1
- data/tests/atmos/models/storage/file_update_tests.rb +19 -0
- data/tests/atmos/models/storage/nested_directories_tests.rb +23 -0
- data/tests/aws/models/compute/security_group_tests.rb +21 -12
- data/tests/aws/models/dns/records_tests.rb +8 -2
- data/tests/aws/models/glacier/model_tests.rb +47 -0
- data/tests/aws/models/iam/policies_tests.rb +2 -2
- data/tests/aws/models/rds/server_tests.rb +5 -2
- data/tests/aws/models/storage/directory_tests.rb +1 -1
- data/tests/aws/models/storage/file_tests.rb +1 -1
- data/tests/aws/models/storage/files_tests.rb +1 -1
- data/tests/aws/models/storage/url_tests.rb +8 -8
- data/tests/aws/models/storage/version_tests.rb +1 -1
- data/tests/aws/models/storage/versions_tests.rb +1 -1
- data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +5 -0
- data/tests/aws/requests/auto_scaling/helper.rb +2 -1
- data/tests/aws/requests/compute/instance_tests.rb +17 -23
- data/tests/aws/requests/compute/spot_instance_tests.rb +2 -1
- data/tests/aws/requests/compute/tag_tests.rb +1 -0
- data/tests/aws/requests/compute/volume_tests.rb +45 -4
- data/tests/aws/requests/elb/helper.rb +2 -2
- data/tests/aws/requests/elb/listener_tests.rb +2 -2
- data/tests/aws/requests/elb/load_balancer_tests.rb +1 -1
- data/tests/aws/requests/glacier/archive_tests.rb +13 -0
- data/tests/aws/requests/glacier/multipart_upload_tests.rb +30 -0
- data/tests/aws/requests/glacier/tree_hash_tests.rb +63 -0
- data/tests/aws/requests/glacier/vault_tests.rb +35 -0
- data/tests/aws/requests/rds/helper.rb +11 -5
- data/tests/aws/requests/rds/instance_tests.rb +0 -2
- data/tests/aws/requests/storage/acl_utils_tests.rb +1 -1
- data/tests/aws/requests/storage/bucket_tests.rb +1 -1
- data/tests/aws/requests/storage/multipart_upload_tests.rb +1 -1
- data/tests/aws/requests/storage/object_tests.rb +8 -0
- data/tests/aws/requests/storage/versioning_tests.rb +1 -1
- data/tests/aws/signaturev4_tests.rb +41 -0
- data/tests/brightbox/compute_tests.rb +9 -0
- data/tests/brightbox/requests/compute/helper.rb +21 -6
- data/tests/cloudstack/compute/models/volume_tests.rb +1 -1
- data/tests/cloudstack/requests/volume_tests.rb +1 -1
- data/tests/compute/helper.rb +10 -4
- data/tests/dynect/requests/dns/dns_tests.rb +39 -0
- data/tests/google/requests/storage/bucket_tests.rb +2 -3
- data/tests/google/requests/storage/object_tests.rb +1 -1
- data/tests/helper.rb +10 -3
- data/tests/helpers/formats_helper.rb +4 -2
- data/tests/helpers/formats_helper_tests.rb +9 -0
- data/tests/helpers/mock_helper.rb +6 -1
- data/tests/helpers/model_helper.rb +0 -3
- data/tests/hp/models/compute/address_tests.rb +1 -1
- data/tests/hp/models/compute/addresses_tests.rb +1 -1
- data/tests/hp/models/compute/key_pair_tests.rb +1 -1
- data/tests/hp/models/compute/key_pairs_tests.rb +1 -1
- data/tests/hp/models/compute/security_group_tests.rb +1 -1
- data/tests/hp/models/compute/security_groups_tests.rb +1 -1
- data/tests/hp/requests/cdn/container_tests.rb +1 -1
- data/tests/hp/requests/compute/address_tests.rb +1 -1
- data/tests/hp/requests/compute/flavor_tests.rb +1 -1
- data/tests/hp/requests/compute/image_tests.rb +1 -1
- data/tests/hp/requests/compute/key_pair_tests.rb +1 -1
- data/tests/hp/requests/compute/security_group_rule_tests.rb +1 -1
- data/tests/hp/requests/compute/security_group_tests.rb +1 -1
- data/tests/hp/requests/compute/server_address_tests.rb +1 -1
- data/tests/hp/requests/compute/server_tests.rb +1 -1
- data/tests/hp/requests/storage/container_tests.rb +1 -1
- data/tests/hp/requests/storage/object_tests.rb +1 -1
- data/tests/local/models/file_tests.rb +1 -1
- data/tests/rackspace/models/block_storage/snapshot_tests.rb +20 -0
- data/tests/rackspace/models/block_storage/snapshots_tests.rb +20 -0
- data/tests/rackspace/models/block_storage/volume_tests.rb +27 -0
- data/tests/rackspace/models/block_storage/volume_types_tests.rb +20 -0
- data/tests/rackspace/models/block_storage/volumes_tests.rb +11 -0
- data/tests/rackspace/models/compute_v2/flavors_tests.rb +20 -0
- data/tests/rackspace/models/compute_v2/images_tests.rb +22 -0
- data/tests/rackspace/models/compute_v2/server_tests.rb +62 -0
- data/tests/rackspace/models/compute_v2/servers_tests.rb +14 -0
- data/tests/rackspace/requests/block_storage/snapshot_tests.rb +81 -0
- data/tests/rackspace/requests/block_storage/volume_tests.rb +61 -0
- data/tests/rackspace/requests/block_storage/volume_type_tests.rb +31 -0
- data/tests/rackspace/requests/compute_v2/attachment_tests.rb +68 -0
- data/tests/rackspace/requests/compute_v2/flavor_tests.rb +43 -0
- data/tests/rackspace/requests/compute_v2/image_tests.rb +47 -0
- data/tests/rackspace/requests/compute_v2/server_tests.rb +147 -0
- data/tests/rackspace/requests/storage/account_tests.rb +17 -0
- data/tests/rackspace/requests/storage/container_tests.rb +1 -1
- data/tests/rackspace/requests/storage/large_object_tests.rb +1 -1
- data/tests/rackspace/requests/storage/object_tests.rb +41 -2
- data/tests/serverlove/requests/compute/image_tests.rb +57 -0
- data/tests/serverlove/requests/compute/server_tests.rb +85 -0
- data/tests/serverlove/util/compute/password_generator_tests.rb +19 -0
- data/tests/storage/models/directories_tests.rb +1 -1
- data/tests/storage/models/directory_test.rb +1 -1
- data/tests/storage/models/file_tests.rb +1 -1
- data/tests/storage/models/files_tests.rb +1 -1
- metadata +188 -3
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/aws/models/glacier/job'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module AWS
|
6
|
+
class Glacier
|
7
|
+
|
8
|
+
class Jobs < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::AWS::Glacier::Job
|
11
|
+
attribute :vault
|
12
|
+
attribute :filters
|
13
|
+
|
14
|
+
def initialize(attributes)
|
15
|
+
self.filters = {}
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
# acceptable filters are:
|
20
|
+
# statuscode InProgress/Failed/Succeeded
|
21
|
+
# completed (true/false)
|
22
|
+
def all(filters = self.filters)
|
23
|
+
self.filters = filters
|
24
|
+
data = connection.list_jobs(vault.id, self.filters).body['JobList']
|
25
|
+
load(data)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get(key)
|
29
|
+
data = connection.describe_job(vault.id, key).body
|
30
|
+
new(data)
|
31
|
+
rescue Excon::Errors::NotFound
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
|
35
|
+
def new(attributes = {})
|
36
|
+
requires :vault
|
37
|
+
super({ :vault => vault }.merge!(attributes))
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/aws/models/glacier/archives'
|
3
|
+
require 'fog/aws/models/glacier/jobs'
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module AWS
|
7
|
+
class Glacier
|
8
|
+
|
9
|
+
class Vault < Fog::Model
|
10
|
+
|
11
|
+
identity :id, :aliases => 'VaultName'
|
12
|
+
attribute :created_at, :aliases => 'CreationDate', :type => :time
|
13
|
+
attribute :last_inventory_at, :aliases => 'LastInventoryDate', :type => :time
|
14
|
+
attribute :number_of_archives, :aliases => 'NumberOfArchives', :type => :integer
|
15
|
+
attribute :size_in_bytes, :aliases => 'SizeInBytes', :type => :integer
|
16
|
+
attribute :arn, :aliases => 'VaultARN'
|
17
|
+
|
18
|
+
def ready?
|
19
|
+
# Glacier requests are synchronous
|
20
|
+
true
|
21
|
+
end
|
22
|
+
|
23
|
+
def archives
|
24
|
+
@archives ||= Fog::AWS::Glacier::Archives.new(:vault => self, :connection => connection)
|
25
|
+
end
|
26
|
+
|
27
|
+
def jobs(filters={})
|
28
|
+
Fog::AWS::Glacier::Jobs.new(:vault => self, :connection => connection, :filters => filters)
|
29
|
+
end
|
30
|
+
|
31
|
+
def set_notification_configuration(topic, events)
|
32
|
+
connection.set_vault_notification_configuration(id, topic, events)
|
33
|
+
end
|
34
|
+
|
35
|
+
def delete_notification_configuration
|
36
|
+
connection.delete_vault_notification_configuration
|
37
|
+
end
|
38
|
+
|
39
|
+
def save
|
40
|
+
requires :id
|
41
|
+
connection.create_vault(id)
|
42
|
+
reload
|
43
|
+
end
|
44
|
+
|
45
|
+
def destroy
|
46
|
+
requires :id
|
47
|
+
connection.delete_vault(id)
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/aws/models/glacier/vault'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module AWS
|
6
|
+
class Glacier
|
7
|
+
|
8
|
+
class Vaults < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::AWS::Glacier::Vault
|
11
|
+
|
12
|
+
def all
|
13
|
+
data = connection.list_vaults.body['VaultList']
|
14
|
+
load(data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(key)
|
18
|
+
data = connection.describe_vault(key).body
|
19
|
+
new(data)
|
20
|
+
rescue Excon::Errors::NotFound
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -29,6 +29,7 @@ module Fog
|
|
29
29
|
attribute :db_parameter_groups, :aliases => 'DBParameterGroups'
|
30
30
|
attribute :backup_retention_period, :aliases => 'BackupRetentionPeriod', :type => :integer
|
31
31
|
attribute :license_model, :aliases => 'LicenseModel'
|
32
|
+
attribute :db_subnet_group_name, :aliases => 'DBSubnetGroupName'
|
32
33
|
|
33
34
|
attr_accessor :password, :parameter_group_name, :security_group_names, :port
|
34
35
|
|
@@ -100,7 +101,8 @@ module Fog
|
|
100
101
|
'PreferredMaintenanceWindow' => preferred_maintenance_window,
|
101
102
|
'PreferredBackupWindow' => preferred_backup_window,
|
102
103
|
'MultiAZ' => multi_az,
|
103
|
-
'LicenseModel' => license_model
|
104
|
+
'LicenseModel' => license_model,
|
105
|
+
'DBSubnetGroupName' => db_subnet_group_name
|
104
106
|
}
|
105
107
|
|
106
108
|
options.delete_if {|key, value| value.nil?}
|
@@ -17,6 +17,7 @@ module Fog
|
|
17
17
|
attribute :port, :aliases => 'Port', :type => :integer
|
18
18
|
attribute :allocated_storage, :aliases => 'AllocatedStorage', :type => :integer
|
19
19
|
attribute :availability_zone, :aliases => 'AvailabilityZone'
|
20
|
+
attribute :type, :aliases => 'SnapshotType'
|
20
21
|
|
21
22
|
def ready?
|
22
23
|
state == 'available'
|
@@ -101,9 +101,9 @@ module Fog
|
|
101
101
|
requires :directory, :key
|
102
102
|
if connection.get_object_acl(directory.key, key).body['AccessControlList'].detect {|grant| grant['Grantee']['URI'] == 'http://acs.amazonaws.com/groups/global/AllUsers' && grant['Permission'] == 'READ'}
|
103
103
|
if directory.key.to_s =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\-(?![\.])){1,61}[a-z0-9]$/
|
104
|
-
"https://#{directory.key}.s3.amazonaws.com/#{Fog::AWS.escape(key)}"
|
104
|
+
"https://#{directory.key}.s3.amazonaws.com/#{Fog::AWS.escape(key)}".gsub('%2F','/')
|
105
105
|
else
|
106
|
-
"https://s3.amazonaws.com/#{directory.key}/#{Fog::AWS.escape(key)}"
|
106
|
+
"https://s3.amazonaws.com/#{directory.key}/#{Fog::AWS.escape(key)}".gsub('%2F','/')
|
107
107
|
end
|
108
108
|
else
|
109
109
|
nil
|
@@ -173,7 +173,8 @@ module Fog
|
|
173
173
|
# TODO: Support large chunk sizes without reading the chunk into memory
|
174
174
|
body.rewind if body.respond_to?(:rewind)
|
175
175
|
while (chunk = body.read(multipart_chunk_size)) do
|
176
|
-
|
176
|
+
md5 = Base64.encode64(Digest::MD5.digest(chunk)).strip
|
177
|
+
part_upload = connection.upload_part(directory.key, key, upload_id, part_tags.size + 1, chunk, 'Content-MD5' => md5 )
|
177
178
|
part_tags << part_upload.headers["ETag"]
|
178
179
|
end
|
179
180
|
|
@@ -15,7 +15,8 @@ module Fog
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def reset_auto_scaling_group
|
18
|
-
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [],
|
18
|
+
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [],
|
19
|
+
'LoadBalancerNames' => [], 'SuspendedProcesses' => [], 'TerminationPolicies' => [] }
|
19
20
|
end
|
20
21
|
|
21
22
|
def reset_enabled_metric
|
@@ -43,6 +44,8 @@ module Fog
|
|
43
44
|
@in_load_balancer_names = true
|
44
45
|
when 'SuspendedProcesses'
|
45
46
|
@in_suspended_processes = true
|
47
|
+
when 'TerminationPolicies'
|
48
|
+
@in_termination_policies = true
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
@@ -62,6 +65,8 @@ module Fog
|
|
62
65
|
elsif @in_suspended_processes
|
63
66
|
@auto_scaling_group['SuspendedProcesses'] << @suspended_process
|
64
67
|
reset_suspended_process
|
68
|
+
elsif @in_termination_policies
|
69
|
+
@auto_scaling_group['TerminationPolicies'] << value
|
65
70
|
elsif !@in_instances && !@in_policies
|
66
71
|
@results['AutoScalingGroups'] << @auto_scaling_group
|
67
72
|
reset_auto_scaling_group
|
@@ -81,6 +86,8 @@ module Fog
|
|
81
86
|
else
|
82
87
|
@auto_scaling_group[name] = value
|
83
88
|
end
|
89
|
+
when 'TerminationPolicies'
|
90
|
+
@in_termination_policies = false
|
84
91
|
|
85
92
|
when 'AvailabilityZone', 'HealthStatus', 'InstanceId', 'LifecycleState'
|
86
93
|
@instance[name] = value
|
@@ -7,11 +7,11 @@ module Fog
|
|
7
7
|
|
8
8
|
def end_element(name)
|
9
9
|
case name
|
10
|
-
when 'availabilityZone', 'requestId', 'snapshotId', 'status', 'volumeId'
|
10
|
+
when 'availabilityZone', 'requestId', 'snapshotId', 'status', 'volumeId', 'volumeType'
|
11
11
|
@response[name] = value
|
12
12
|
when 'createTime'
|
13
13
|
@response[name] = Time.parse(value)
|
14
|
-
when 'size'
|
14
|
+
when 'size', 'iops'
|
15
15
|
@response[name] = value.to_i
|
16
16
|
end
|
17
17
|
end
|
@@ -56,7 +56,14 @@ module Fog
|
|
56
56
|
@response['instanceStatusSet'] << @instance
|
57
57
|
end
|
58
58
|
@item = nil
|
59
|
-
when 'code'
|
59
|
+
when 'code'
|
60
|
+
case @inside
|
61
|
+
when :eventsSet
|
62
|
+
@item[name] = value
|
63
|
+
when :instanceState
|
64
|
+
@instance[@inside.to_s][name] = value.to_i
|
65
|
+
end
|
66
|
+
when 'description', 'notBefore', 'notAfter', 'name', 'status'
|
60
67
|
@item.nil? ? (@instance[@inside.to_s][name] = value) : (@item[name] = value)
|
61
68
|
end
|
62
69
|
end
|
@@ -19,7 +19,7 @@ module Fog
|
|
19
19
|
when 'fixedPrice', 'usagePrice'
|
20
20
|
@reserved_instances_offering[name] = value.to_f
|
21
21
|
when 'item'
|
22
|
-
@response['reservedInstancesOfferingsSet'] << @reserved_instances_offering
|
22
|
+
@response['reservedInstancesOfferingsSet'] << @reserved_instances_offering unless @reserved_instances_offering.empty?
|
23
23
|
@reserved_instances_offering = {}
|
24
24
|
when 'requestId'
|
25
25
|
@response[name] = value
|
@@ -48,7 +48,7 @@ module Fog
|
|
48
48
|
end
|
49
49
|
else
|
50
50
|
case name
|
51
|
-
when 'availabilityZone', 'snapshotId', 'status', 'volumeId'
|
51
|
+
when 'availabilityZone', 'snapshotId', 'status', 'volumeId', 'volumeType'
|
52
52
|
@volume[name] = value
|
53
53
|
when 'createTime'
|
54
54
|
@volume[name] = Time.parse(value)
|
@@ -57,7 +57,7 @@ module Fog
|
|
57
57
|
@volume = { 'attachmentSet' => [], 'tagSet' => {} }
|
58
58
|
when 'requestId'
|
59
59
|
@response[name] = value
|
60
|
-
when 'size'
|
60
|
+
when 'size', 'iops'
|
61
61
|
@volume[name] = value.to_i
|
62
62
|
end
|
63
63
|
end
|
@@ -48,7 +48,7 @@ module Fog
|
|
48
48
|
@response['spotInstanceRequestSet'] << @spot_instance_request
|
49
49
|
@spot_instance_request = { 'launchSpecification' => { 'blockDeviceMapping' => [], 'groupSet' => [] } }
|
50
50
|
end
|
51
|
-
when 'imageId', 'instanceType', 'keyname'
|
51
|
+
when 'imageId', 'instanceType', 'keyname', 'subnetId'
|
52
52
|
@spot_instance_request['launchSpecification'][name] = value
|
53
53
|
when 'enabled'
|
54
54
|
@spot_instance_request['launchSpecification']['monitoring'] = (value == 'true')
|
@@ -18,8 +18,10 @@ module Fog
|
|
18
18
|
def end_element(name)
|
19
19
|
if @section == :resource_record_set
|
20
20
|
case name
|
21
|
-
when '
|
21
|
+
when 'Type', 'TTL', 'SetIdentifier', 'Weight', 'Region'
|
22
22
|
@resource_record_set[name] = value
|
23
|
+
when 'Name'
|
24
|
+
@resource_record_set[name] = value.gsub('\\052', '*')
|
23
25
|
when 'Value'
|
24
26
|
@resource_record_set['ResourceRecords'] << value
|
25
27
|
when 'AliasTarget'
|
@@ -38,6 +38,7 @@ module Fog
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def end_element(name)
|
41
|
+
|
41
42
|
case name
|
42
43
|
|
43
44
|
when 'LatestRestorableTime', 'InstanceCreateTime'
|
@@ -45,7 +46,8 @@ module Fog
|
|
45
46
|
when 'Engine',
|
46
47
|
'DBInstanceStatus', 'DBInstanceIdentifier', 'EngineVersion',
|
47
48
|
'PreferredBackupWindow', 'PreferredMaintenanceWindow',
|
48
|
-
'AvailabilityZone', 'MasterUsername', 'DBName', 'LicenseModel'
|
49
|
+
'AvailabilityZone', 'MasterUsername', 'DBName', 'LicenseModel',
|
50
|
+
'DBSubnetGroupName'
|
49
51
|
@db_instance[name] = value
|
50
52
|
when 'MultiAZ', 'AutoMinorVersionUpgrade'
|
51
53
|
if value == 'false'
|
@@ -30,6 +30,7 @@ module Fog
|
|
30
30
|
when 'MasterUsername' then @db_snapshot['MasterUsername'] = value
|
31
31
|
when 'Port' then @db_snapshot['Port'] = value.to_i
|
32
32
|
when 'SnapshotCreateTime' then @db_snapshot['SnapshotCreateTime'] = Time.parse value
|
33
|
+
when 'SnapshotType' then @db_snapshot['SnapshotType'] = value
|
33
34
|
when 'Status' then @db_snapshot['Status'] = value
|
34
35
|
end
|
35
36
|
end
|
data/lib/fog/aws/rds.rb
CHANGED
@@ -80,30 +80,30 @@ module Fog
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
def self.reset
|
85
85
|
@data = nil
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
def initialize(options={})
|
89
|
-
|
89
|
+
|
90
90
|
@use_iam_profile = options[:use_iam_profile]
|
91
91
|
@region = options[:region] || 'us-east-1'
|
92
|
-
|
92
|
+
|
93
93
|
unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'sa-east-1'].include?(@region)
|
94
94
|
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
end
|
98
|
-
|
98
|
+
|
99
99
|
def data
|
100
100
|
self.class.data[@region][@aws_access_key_id]
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
def reset_data
|
104
104
|
self.class.data[@region].delete(@aws_access_key_id)
|
105
105
|
end
|
106
|
-
|
106
|
+
|
107
107
|
def setup_credentials(options)
|
108
108
|
@aws_access_key_id = options[:aws_access_key_id]
|
109
109
|
end
|
@@ -174,7 +174,7 @@ module Fog
|
|
174
174
|
:host => @host,
|
175
175
|
:path => @path,
|
176
176
|
:port => @port,
|
177
|
-
:version => '
|
177
|
+
:version => '2012-01-15' #'2011-04-01'
|
178
178
|
}
|
179
179
|
)
|
180
180
|
|
@@ -36,7 +36,7 @@ module Fog
|
|
36
36
|
|
37
37
|
def delete_auto_scaling_group(auto_scaling_group_name)
|
38
38
|
unless self.data[:auto_scaling_groups].delete(auto_scaling_group_name)
|
39
|
-
raise Fog::AWS::
|
39
|
+
raise Fog::AWS::AutoScaling::ValidationError, "The auto scaling group '#{auto_scaling_group_name}' does not exist."
|
40
40
|
end
|
41
41
|
|
42
42
|
response = Excon::Response.new
|
@@ -10,7 +10,10 @@ module Fog
|
|
10
10
|
# ==== Parameters
|
11
11
|
# * availability_zone<~String> - availability zone to create volume in
|
12
12
|
# * size<~Integer> - Size in GiBs for volume. Must be between 1 and 1024.
|
13
|
-
# *
|
13
|
+
# * options<~Hash>
|
14
|
+
# * 'SnapshotId'<~String> - Optional, snapshot to create volume from
|
15
|
+
# * 'VolumeType'<~String> - Optional, volume type. standard or io1, default is standard.
|
16
|
+
# * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 1000.
|
14
17
|
#
|
15
18
|
# ==== Returns
|
16
19
|
# * response<~Excon::Response>:
|
@@ -21,51 +24,87 @@ module Fog
|
|
21
24
|
# * 'snapshotId'<~String> - Snapshot volume was created from, if any
|
22
25
|
# * 'status's<~String> - State of volume
|
23
26
|
# * 'volumeId'<~String> - Reference to volume
|
27
|
+
# * 'volumeType'<~String> - Type of volume
|
28
|
+
# * 'iops'<~Integer> - Number of IOPS the volume supports
|
24
29
|
#
|
25
30
|
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVolume.html]
|
26
|
-
def create_volume(availability_zone, size,
|
27
|
-
|
31
|
+
def create_volume(availability_zone, size, options = {})
|
32
|
+
unless options.is_a?(Hash)
|
33
|
+
Fog::Logger.deprecation("create_volume with a bare snapshot_id is deprecated, use create_volume(availability_zone, size, 'SnapshotId' => snapshot_id) instead [light_black](#{caller.first})[/]")
|
34
|
+
options = { 'SnapshotId' => options }
|
35
|
+
end
|
36
|
+
|
37
|
+
request({
|
28
38
|
'Action' => 'CreateVolume',
|
29
39
|
'AvailabilityZone' => availability_zone,
|
30
40
|
'Size' => size,
|
31
|
-
'SnapshotId' => snapshot_id,
|
32
41
|
:parser => Fog::Parsers::Compute::AWS::CreateVolume.new
|
33
|
-
)
|
42
|
+
}.merge(options))
|
34
43
|
end
|
35
44
|
|
36
45
|
end
|
37
46
|
|
38
47
|
class Mock
|
39
48
|
|
40
|
-
def create_volume(availability_zone, size,
|
49
|
+
def create_volume(availability_zone, size, options = {})
|
50
|
+
unless options.is_a?(Hash)
|
51
|
+
Fog::Logger.deprecation("create_volume with a bare snapshot_id is deprecated, use create_volume(availability_zone, size, 'SnapshotId' => snapshot_id) instead [light_black](#{caller.first})[/]")
|
52
|
+
options = { 'SnapshotId' => options }
|
53
|
+
end
|
54
|
+
|
41
55
|
response = Excon::Response.new
|
42
|
-
if availability_zone && (size ||
|
43
|
-
snapshot = self.data[:snapshots][
|
44
|
-
if
|
45
|
-
raise Fog::Compute::AWS::NotFound.new("The snapshot '#{
|
56
|
+
if availability_zone && (size || options['SnapshotId'])
|
57
|
+
snapshot = self.data[:snapshots][options['SnapshotId']]
|
58
|
+
if options['SnapshotId'] && !snapshot
|
59
|
+
raise Fog::Compute::AWS::NotFound.new("The snapshot '#{options['SnapshotId']}' does not exist.")
|
46
60
|
end
|
47
61
|
|
48
62
|
if snapshot && size && size < snapshot['volumeSize']
|
49
|
-
raise Fog::Compute::AWS::NotFound.new("The snapshot '#{
|
63
|
+
raise Fog::Compute::AWS::NotFound.new("The snapshot '#{options['SnapshotId']}' has size #{snapshot['volumeSize']} which is greater than #{size}.")
|
50
64
|
elsif snapshot && !size
|
51
65
|
size = snapshot['volumeSize']
|
52
66
|
end
|
53
67
|
|
68
|
+
if options['VolumeType'] == 'io1'
|
69
|
+
iops = options['Iops']
|
70
|
+
if !iops
|
71
|
+
raise Fog::Compute::AWS::Error.new("InvalidParameterCombination => The parameter iops must be specified for io1 volumes.")
|
72
|
+
end
|
73
|
+
|
74
|
+
if size < 10
|
75
|
+
raise Fog::Compute::AWS::Error.new("InvalidParameterValue => Volume of #{size}GiB is too small; minimum is 10GiB.")
|
76
|
+
end
|
77
|
+
|
78
|
+
if (iops_to_size_ratio = iops.to_f / size.to_f) > 10.0
|
79
|
+
raise Fog::Compute::AWS::Error.new("InvalidParameterValue => Iops to volume size ratio of #{"%.1f" % iops_to_size_ratio} is too high; maximum is 10.0")
|
80
|
+
end
|
81
|
+
|
82
|
+
if iops < 100
|
83
|
+
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too low; minimum is 100.")
|
84
|
+
end
|
85
|
+
|
86
|
+
if iops > 1000
|
87
|
+
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 1000.")
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
54
91
|
response.status = 200
|
55
92
|
volume_id = Fog::AWS::Mock.volume_id
|
56
93
|
data = {
|
57
94
|
'availabilityZone' => availability_zone,
|
58
95
|
'attachmentSet' => [],
|
59
96
|
'createTime' => Time.now,
|
97
|
+
'iops' => options['Iops'],
|
60
98
|
'size' => size,
|
61
|
-
'snapshotId' =>
|
99
|
+
'snapshotId' => options['SnapshotId'],
|
62
100
|
'status' => 'creating',
|
63
|
-
'volumeId' => volume_id
|
101
|
+
'volumeId' => volume_id,
|
102
|
+
'volumeType' => options['VolumeType'] || 'standard'
|
64
103
|
}
|
65
104
|
self.data[:volumes][volume_id] = data
|
66
105
|
response.body = {
|
67
106
|
'requestId' => Fog::AWS::Mock.request_id
|
68
|
-
}.merge!(data.reject {|key,value| !['availabilityZone','createTime','size','snapshotId','status','volumeId'].include?(key) })
|
107
|
+
}.merge!(data.reject {|key,value| !['availabilityZone','createTime','size','snapshotId','status','volumeId','volumeType'].include?(key) })
|
69
108
|
else
|
70
109
|
response.status = 400
|
71
110
|
response.body = {
|