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
@@ -22,6 +22,8 @@ module Fog
|
|
22
22
|
attribute :interface_id, :aliases => "interface", :squash => "id"
|
23
23
|
attribute :server_id, :aliases => "server", :squash => "id"
|
24
24
|
attribute :load_balancer, :alias => "load_balancer", :squash => "id"
|
25
|
+
attribute :port_translators
|
26
|
+
attribute :name
|
25
27
|
|
26
28
|
def map(destination)
|
27
29
|
requires :identity
|
@@ -17,6 +17,7 @@ module Fog
|
|
17
17
|
attribute :fqdn
|
18
18
|
attribute :user_data
|
19
19
|
attribute :console_url
|
20
|
+
attribute :fqdn
|
20
21
|
attribute :console_token
|
21
22
|
|
22
23
|
# Times
|
@@ -37,7 +38,7 @@ module Fog
|
|
37
38
|
attribute :server_type
|
38
39
|
|
39
40
|
def initialize(attributes={})
|
40
|
-
self.image_id
|
41
|
+
self.image_id ||= Fog::Compute[:brightbox].default_image
|
41
42
|
super
|
42
43
|
end
|
43
44
|
|
@@ -70,8 +71,26 @@ module Fog
|
|
70
71
|
connection.snapshot_server(identity)
|
71
72
|
end
|
72
73
|
|
73
|
-
|
74
|
-
|
74
|
+
# Directly requesting a server reboot is not supported in the API
|
75
|
+
# so needs to attempt a shutdown/stop, wait and start again.
|
76
|
+
#
|
77
|
+
# Default behaviour is a hard reboot because it is more reliable
|
78
|
+
# because the state of the server's OS is irrelevant.
|
79
|
+
#
|
80
|
+
# @param [Boolean] use_hard_reboot
|
81
|
+
# @return [Boolean]
|
82
|
+
def reboot(use_hard_reboot = true)
|
83
|
+
requires :identity
|
84
|
+
if ready?
|
85
|
+
unless use_hard_reboot
|
86
|
+
soft_reboot
|
87
|
+
else
|
88
|
+
hard_reboot
|
89
|
+
end
|
90
|
+
else
|
91
|
+
# Not able to reboot if not ready in the first place
|
92
|
+
false
|
93
|
+
end
|
75
94
|
end
|
76
95
|
|
77
96
|
def start
|
@@ -151,7 +170,31 @@ module Fog
|
|
151
170
|
merge_attributes(data)
|
152
171
|
true
|
153
172
|
end
|
173
|
+
|
174
|
+
private
|
175
|
+
# Hard reboots are fast, avoiding the OS by doing a "power off"
|
176
|
+
def hard_reboot
|
177
|
+
stop
|
178
|
+
wait_for { ! ready? }
|
179
|
+
start
|
180
|
+
end
|
181
|
+
|
182
|
+
# Soft reboots often timeout if the OS missed the request so we do more
|
183
|
+
# error checking trying to detect the timeout
|
184
|
+
#
|
185
|
+
# @fixme - Using side effect of wait_for's (evaluated block) to detect timeouts
|
186
|
+
def soft_reboot
|
187
|
+
shutdown
|
188
|
+
if wait_for(20) { ! ready? }
|
189
|
+
# Server is now down, start it up again
|
190
|
+
start
|
191
|
+
else
|
192
|
+
# We timed out
|
193
|
+
false
|
194
|
+
end
|
195
|
+
end
|
154
196
|
end
|
197
|
+
|
155
198
|
end
|
156
199
|
end
|
157
200
|
end
|
@@ -120,6 +120,7 @@ module Fog
|
|
120
120
|
request :recover_virtual_machine
|
121
121
|
request :register_ssh_key_pair
|
122
122
|
request :register_user_keys
|
123
|
+
request :register_template
|
123
124
|
request :remove_from_load_balancer_rule
|
124
125
|
request :reset_password_for_virtual_machine
|
125
126
|
request :revoke_security_group_ingress
|
@@ -364,7 +365,9 @@ module Fog
|
|
364
365
|
"domain" => "ROOT",
|
365
366
|
"domainid" => "6023b6fe-5bef-4358-bc76-9f4e75afa52f",
|
366
367
|
"isextractable" => true,
|
367
|
-
"checksum" => "905cec879afd9c9d22ecc8036131a180"
|
368
|
+
"checksum" => "905cec879afd9c9d22ecc8036131a180",
|
369
|
+
"hypervisor" => "Xen"
|
370
|
+
}},
|
368
371
|
:flavors => { flavor_id => {
|
369
372
|
"id" => flavor_id,
|
370
373
|
"name" => "Medium Instance",
|
@@ -10,23 +10,32 @@ module Fog
|
|
10
10
|
model Fog::Compute::Cloudstack::Image
|
11
11
|
|
12
12
|
def all(filters={})
|
13
|
-
options =
|
14
|
-
'templatefilter' => 'self'
|
15
|
-
}.merge(filters)
|
13
|
+
options = get_filter_options(filters)
|
16
14
|
|
17
15
|
data = connection.list_templates(options)["listtemplatesresponse"]["template"] || []
|
18
16
|
load(data)
|
19
17
|
end
|
20
18
|
|
21
|
-
def get(template_id)
|
22
|
-
|
19
|
+
def get(template_id, filters={})
|
20
|
+
filter_option = get_filter_options(filters)
|
21
|
+
options = filter_option.merge('id' => template_id)
|
22
|
+
|
23
|
+
if template = connection.list_templates(options)["listtemplatesresponse"]["template"].first
|
23
24
|
new(template)
|
24
25
|
end
|
25
26
|
rescue Fog::Compute::Cloudstack::BadRequest
|
26
27
|
nil
|
27
28
|
end
|
28
|
-
end
|
29
29
|
|
30
|
+
private
|
31
|
+
|
32
|
+
def get_filter_options(filters)
|
33
|
+
default_filter = {
|
34
|
+
'templatefilter' => 'self'
|
35
|
+
}
|
36
|
+
default_filter.merge(filters)
|
37
|
+
end
|
38
|
+
end
|
30
39
|
end
|
31
40
|
end
|
32
41
|
end
|
@@ -31,7 +31,7 @@ module Fog
|
|
31
31
|
# so dirty
|
32
32
|
def result
|
33
33
|
if successful? && model = Fog::Compute::Cloudstack.constants.find{|c| c.to_s.downcase == self.job_result.keys.first.to_s}.to_s
|
34
|
-
collection = model.gsub(/.[A-Z]/){|w| "#{w[0]}_#{w[1].downcase}"}.downcase + "s" # cheap underscorize, assume simple pluralization
|
34
|
+
collection = model.gsub(/.[A-Z]/){|w| "#{w[0,1]}_#{w[1,1].downcase}"}.downcase + "s" # cheap underscorize, assume simple pluralization
|
35
35
|
connection.send(collection).new(self.job_result.values.first)
|
36
36
|
else self.job_result
|
37
37
|
end
|
@@ -8,7 +8,7 @@ module Fog
|
|
8
8
|
# {CloudStack API Reference}[http://http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/attachVolume.html]
|
9
9
|
def attach_volume(options={})
|
10
10
|
options.merge!(
|
11
|
-
'command' => 'attachVolume'
|
11
|
+
'command' => 'attachVolume'
|
12
12
|
)
|
13
13
|
|
14
14
|
request(options)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Cloudstack
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Registers an existing template into the cloud.
|
7
|
+
#
|
8
|
+
# {CloudStack API Reference}[http://download.cloud.com/releases/3.0.0/api_3.0.0/user/registerTemplate.html]
|
9
|
+
def register_template(options={})
|
10
|
+
options.merge!(
|
11
|
+
'command' => 'registerTemplate'
|
12
|
+
)
|
13
|
+
|
14
|
+
request(options)
|
15
|
+
end
|
16
|
+
|
17
|
+
end # Real
|
18
|
+
|
19
|
+
class Mock
|
20
|
+
def register_template(options={})
|
21
|
+
mock_template_id = self.data[:images].keys.first
|
22
|
+
registered_template = self.data[:images][mock_template_id]
|
23
|
+
|
24
|
+
{
|
25
|
+
'registertemplateresponse' =>
|
26
|
+
{
|
27
|
+
'count' => 1,
|
28
|
+
'template' => [registered_template]
|
29
|
+
}
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end # Mock
|
33
|
+
end # Cloudstack
|
34
|
+
end # Compute
|
35
|
+
end #Fog
|
data/lib/fog/compute.rb
CHANGED
@@ -7,7 +7,9 @@ module Fog
|
|
7
7
|
|
8
8
|
def self.new(attributes)
|
9
9
|
attributes = attributes.dup # prevent delete from having side effects
|
10
|
-
|
10
|
+
provider = attributes.delete(:provider).to_s.downcase.to_sym
|
11
|
+
|
12
|
+
case provider
|
11
13
|
when :aws
|
12
14
|
require 'fog/aws/compute'
|
13
15
|
Fog::Compute::AWS.new(attributes)
|
@@ -64,8 +66,18 @@ module Fog
|
|
64
66
|
require 'fog/ovirt/compute'
|
65
67
|
Fog::Compute::Ovirt.new(attributes)
|
66
68
|
when :rackspace
|
67
|
-
|
68
|
-
|
69
|
+
version = attributes.delete(:version)
|
70
|
+
version = version.to_s.downcase.to_sym unless version.nil?
|
71
|
+
if version == :v2
|
72
|
+
require 'fog/rackspace/compute_v2'
|
73
|
+
Fog::Compute::RackspaceV2.new(attributes)
|
74
|
+
else
|
75
|
+
require 'fog/rackspace/compute'
|
76
|
+
Fog::Compute::Rackspace.new(attributes)
|
77
|
+
end
|
78
|
+
when :serverlove
|
79
|
+
require 'fog/serverlove/compute'
|
80
|
+
Fog::Compute::Serverlove.new(attributes)
|
69
81
|
when :stormondemand
|
70
82
|
require 'fog/storm_on_demand/compute'
|
71
83
|
Fog::Compute::StormOnDemand.new(attributes)
|
data/lib/fog/core/errors.rb
CHANGED
data/lib/fog/core/time.rb
CHANGED
data/lib/fog/dynect/dns.rb
CHANGED
@@ -65,7 +65,7 @@ module Fog
|
|
65
65
|
@dynect_password = options[:dynect_password]
|
66
66
|
|
67
67
|
@connection_options = options[:connection_options] || {}
|
68
|
-
@host = '
|
68
|
+
@host = 'api-v4.dynect.net'
|
69
69
|
@port = options[:port] || 443
|
70
70
|
@path = options[:path] || '/REST'
|
71
71
|
@persistent = options[:persistent] || false
|
@@ -93,7 +93,7 @@ module Fog
|
|
93
93
|
|
94
94
|
if response.body.empty?
|
95
95
|
response.body = {}
|
96
|
-
|
96
|
+
elsif response.headers['Content-Type'] == 'application/json'
|
97
97
|
response.body = Fog::JSON.decode(response.body)
|
98
98
|
end
|
99
99
|
|
@@ -102,7 +102,7 @@ module Fog
|
|
102
102
|
end
|
103
103
|
|
104
104
|
if response.status == 307 && params[:path] !~ %r{^/REST/Job/}
|
105
|
-
response = poll_job(response)
|
105
|
+
response = poll_job(response, params[:expects])
|
106
106
|
end
|
107
107
|
|
108
108
|
response
|
@@ -118,11 +118,11 @@ module Fog
|
|
118
118
|
response
|
119
119
|
end
|
120
120
|
|
121
|
-
def poll_job(response, time_to_wait = 10)
|
121
|
+
def poll_job(response, original_expects, time_to_wait = 10)
|
122
122
|
job_location = response.headers['Location']
|
123
123
|
|
124
124
|
Fog.wait_for(time_to_wait) do
|
125
|
-
response = request(:expects =>
|
125
|
+
response = request(:expects => original_expects, :method => :get, :path => job_location)
|
126
126
|
response.body['status'] != 'incomplete'
|
127
127
|
end
|
128
128
|
|
data/lib/fog/ecloud.rb
CHANGED
data/lib/fog/ecloud/compute.rb
CHANGED
@@ -212,8 +212,10 @@ module Fog
|
|
212
212
|
request :virtual_machine_copy
|
213
213
|
request :virtual_machine_copy_identical
|
214
214
|
request :virtual_machine_edit
|
215
|
+
request :virtual_machine_add_ip
|
215
216
|
request :virtual_machine_edit_hardware_configuration
|
216
217
|
request :virtual_machine_delete
|
218
|
+
request :virtual_machine_upload_file
|
217
219
|
request :internet_service_create
|
218
220
|
request :internet_service_edit
|
219
221
|
request :internet_service_delete
|
@@ -455,7 +457,7 @@ module Fog
|
|
455
457
|
}
|
456
458
|
params[:headers].merge!(maor_headers)
|
457
459
|
if params[:method]=="POST" || params[:method]=="PUT"
|
458
|
-
params[:headers].merge!({"Content-Type" => 'application/xml'})
|
460
|
+
params[:headers].merge!({"Content-Type" => 'application/xml'}) unless params[:headers]['Content-Type']
|
459
461
|
params[:headers].merge!({"Accept" => 'application/xml'})
|
460
462
|
end
|
461
463
|
unless params[:body].empty?
|
@@ -37,7 +37,7 @@ module Fog
|
|
37
37
|
|
38
38
|
|
39
39
|
def ips
|
40
|
-
network_hash = ip_addresses[:AssignedIpAddresses][:Networks]
|
40
|
+
network_hash = ip_addresses[:AssignedIpAddresses][:Networks] || []
|
41
41
|
network_hash[:Network] = network_hash[:Network].is_a?(Hash) ? [network_hash[:Network]] : network_hash[:Network]
|
42
42
|
network_hash[:Network].each do |network|
|
43
43
|
network[:IpAddresses][:IpAddress] = network[:IpAddresses][:IpAddress].is_a?(String) ? [network[:IpAddresses][:IpAddress]] : network[:IpAddresses][:IpAddress]
|
@@ -190,6 +190,36 @@ module Fog
|
|
190
190
|
task = Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => data[:href])[0]
|
191
191
|
end
|
192
192
|
|
193
|
+
def add_ip(options)
|
194
|
+
begin
|
195
|
+
slice_ips = ips
|
196
|
+
rescue
|
197
|
+
slice_ips = []
|
198
|
+
end
|
199
|
+
begin
|
200
|
+
slice_networks = networks
|
201
|
+
rescue
|
202
|
+
slice_networks = []
|
203
|
+
end
|
204
|
+
slice_networks = slice_networks.map { |n| {:href => n.href, :name => n.name.split(' ')[0], :type => 'application/vnd.tmrk.cloud.network'} }.push({:href => options[:href], :name => options[:network_name], :type => 'application/vnd.tmrk.cloud.network'}).uniq
|
205
|
+
slice_ips = slice_ips.map { |i| {:name => i.name, :network_name => i.other_links[:Link][:name]} }.push({:name => options[:ip], :network_name => options[:network_name]})
|
206
|
+
slice_ips.each do |ip|
|
207
|
+
slice_networks.each do |network|
|
208
|
+
if network[:name] == ip[:network_name]
|
209
|
+
network[:ips] ||= []
|
210
|
+
network[:ips].push(ip[:name])
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
data = connection.virtual_machine_add_ip(href + "/assignedIps", slice_networks).body
|
215
|
+
task = Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => data[:href])[0]
|
216
|
+
end
|
217
|
+
|
218
|
+
def upload_file(options)
|
219
|
+
connection.virtual_machine_upload_file(href + "/guest/action/files", options)
|
220
|
+
true
|
221
|
+
end
|
222
|
+
|
193
223
|
def storage_size
|
194
224
|
vm_disks = disks
|
195
225
|
disks.map! { |d| d[:Size][:Value].to_i }.inject(0){|sum,item| sum + item} * 1024 * 1024
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
module Shared
|
5
|
+
|
6
|
+
def build_request_body_add_ip(networks)
|
7
|
+
xml = Builder::XmlMarkup.new
|
8
|
+
xml.AssignedIpAddresses do
|
9
|
+
xml.Networks do
|
10
|
+
networks.each do |network|
|
11
|
+
xml.Network(:href => network[:href], :type => network[:type]) do
|
12
|
+
xml.IpAddresses do
|
13
|
+
network[:ips].each do |ip|
|
14
|
+
xml.IpAddress ip
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class Real
|
25
|
+
|
26
|
+
def virtual_machine_add_ip(href, options)
|
27
|
+
body = build_request_body_add_ip(options)
|
28
|
+
request(
|
29
|
+
:expects => 202,
|
30
|
+
:method => 'PUT',
|
31
|
+
:headers => {},
|
32
|
+
:body => body,
|
33
|
+
:uri => href,
|
34
|
+
:parse => true
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|