fog 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/changelog.txt +743 -0
- data/fog.gemspec +3 -5
- data/lib/fog/aws.rb +1 -0
- data/lib/fog/aws/credential_fetcher.rb +1 -1
- data/lib/fog/aws/data_pipeline.rb +114 -0
- data/lib/fog/aws/dynamodb.rb +1 -1
- data/lib/fog/aws/models/compute/flavors.rb +1 -1
- data/lib/fog/aws/models/compute/spot_request.rb +2 -0
- data/lib/fog/aws/models/data_pipeline/pipeline.rb +67 -0
- data/lib/fog/aws/models/data_pipeline/pipelines.rb +36 -0
- data/lib/fog/aws/parsers/cloud_watch/list_metrics.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_instances.rb +1 -1
- data/lib/fog/aws/parsers/compute/spot_instance_requests.rb +2 -0
- data/lib/fog/aws/requests/compute/request_spot_instances.rb +1 -0
- data/lib/fog/aws/requests/data_pipeline/activate_pipeline.rb +35 -0
- data/lib/fog/aws/requests/data_pipeline/create_pipeline.rb +41 -0
- data/lib/fog/aws/requests/data_pipeline/delete_pipeline.rb +35 -0
- data/lib/fog/aws/requests/data_pipeline/describe_pipelines.rb +36 -0
- data/lib/fog/aws/requests/data_pipeline/list_pipelines.rb +36 -0
- data/lib/fog/aws/requests/data_pipeline/put_pipeline_definition.rb +72 -0
- data/lib/fog/aws/requests/rds/describe_db_instances.rb +8 -9
- data/lib/fog/aws/requests/storage/get_service.rb +1 -2
- data/lib/fog/aws/requests/storage/list_multipart_uploads.rb +3 -3
- data/lib/fog/aws/requests/storage/put_bucket_policy.rb +2 -2
- data/lib/fog/aws/storage.rb +1 -1
- data/lib/fog/bin.rb +2 -1
- data/lib/fog/bin/aws.rb +4 -0
- data/lib/fog/bin/bluebox.rb +2 -0
- data/lib/fog/bin/dreamhost.rb +31 -0
- data/lib/fog/bin/hp.rb +7 -0
- data/lib/fog/bin/internet_archive.rb +34 -0
- data/lib/fog/bin/openstack.rb +17 -2
- data/lib/fog/bluebox.rb +1 -0
- data/lib/fog/bluebox/blb.rb +85 -0
- data/lib/fog/bluebox/models/blb/lb_application.rb +32 -0
- data/lib/fog/bluebox/models/blb/lb_applications.rb +26 -0
- data/lib/fog/bluebox/models/blb/lb_backend.rb +22 -0
- data/lib/fog/bluebox/models/blb/lb_backends.rb +30 -0
- data/lib/fog/bluebox/models/blb/lb_service.rb +35 -0
- data/lib/fog/bluebox/models/blb/lb_services.rb +29 -0
- data/lib/fog/bluebox/requests/blb/add_machine_to_lb_application.rb +33 -0
- data/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb +31 -0
- data/lib/fog/bluebox/requests/blb/get_lb_application.rb +33 -0
- data/lib/fog/bluebox/requests/blb/get_lb_applications.rb +31 -0
- data/lib/fog/bluebox/requests/blb/get_lb_backend.rb +36 -0
- data/lib/fog/bluebox/requests/blb/get_lb_backends.rb +36 -0
- data/lib/fog/bluebox/requests/blb/get_lb_machine.rb +35 -0
- data/lib/fog/bluebox/requests/blb/get_lb_machines.rb +35 -0
- data/lib/fog/bluebox/requests/blb/get_lb_service.rb +36 -0
- data/lib/fog/bluebox/requests/blb/get_lb_services.rb +36 -0
- data/lib/fog/bluebox/requests/blb/remove_machine_from_lb_backend.rb +28 -0
- data/lib/fog/bluebox/requests/blb/update_lb_backend_machine.rb +29 -0
- data/lib/fog/brightbox/compute.rb +1 -0
- data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +1 -0
- data/lib/fog/brightbox/requests/compute/update_firewall_policy.rb +25 -0
- data/lib/fog/brightbox/requests/compute/update_server.rb +1 -0
- data/lib/fog/cdn.rb +5 -12
- data/lib/fog/compute.rb +7 -68
- data/lib/fog/core/errors.rb +5 -1
- data/lib/fog/core/scp.rb +1 -0
- data/lib/fog/core/ssh.rb +1 -0
- data/lib/fog/dns.rb +7 -27
- data/lib/fog/dreamhost.rb +11 -0
- data/lib/fog/dreamhost/dns.rb +86 -0
- data/lib/fog/dreamhost/examples/dns/getting_started.md +105 -0
- data/lib/fog/dreamhost/models/dns/record.rb +35 -0
- data/lib/fog/dreamhost/models/dns/records.rb +38 -0
- data/lib/fog/dreamhost/models/dns/zone.rb +59 -0
- data/lib/fog/dreamhost/models/dns/zones.rb +41 -0
- data/lib/fog/dreamhost/requests/dns/create_record.rb +32 -0
- data/lib/fog/dreamhost/requests/dns/delete_record.rb +31 -0
- data/lib/fog/dreamhost/requests/dns/list_records.rb +25 -0
- data/lib/fog/ecloud/models/compute/detached_disks.rb +1 -5
- data/lib/fog/ecloud/models/compute/internet_services.rb +1 -5
- data/lib/fog/ecloud/models/compute/nodes.rb +1 -5
- data/lib/fog/ecloud/models/compute/public_ips.rb +1 -5
- data/lib/fog/ecloud/models/compute/servers.rb +2 -6
- data/lib/fog/ecloud/requests/compute/get_detached_disk.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_internet_service.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_node.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_public_ip.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_server.rb +1 -1
- data/lib/fog/ecloud/requests/compute/virtual_machine_create_from_template.rb +1 -1
- data/lib/fog/glesys/compute.rb +5 -1
- data/lib/fog/glesys/models/compute/ip.rb +47 -46
- data/lib/fog/glesys/models/compute/ips.rb +95 -12
- data/lib/fog/glesys/models/compute/server.rb +66 -5
- data/lib/fog/glesys/models/compute/servers.rb +7 -1
- data/lib/fog/glesys/models/compute/template.rb +8 -16
- data/lib/fog/glesys/models/compute/templates.rb +23 -5
- data/lib/fog/glesys/requests/compute/ip_details.rb +2 -2
- data/lib/fog/glesys/requests/compute/server_details.rb +2 -2
- data/lib/fog/glesys/requests/compute/template_list.rb +2 -2
- data/lib/fog/hp.rb +56 -26
- data/lib/fog/hp/CHANGELOG.hp +113 -0
- data/lib/fog/hp/README_HP.rdoc +7 -6
- data/lib/fog/hp/block_storage.rb +169 -0
- data/lib/fog/hp/cdn.rb +29 -7
- data/lib/fog/hp/compute.rb +88 -17
- data/lib/fog/hp/models/block_storage/bootable_volumes.rb +28 -0
- data/lib/fog/hp/models/block_storage/snapshot.rb +56 -0
- data/lib/fog/hp/models/block_storage/snapshots.rb +29 -0
- data/lib/fog/hp/models/block_storage/volume.rb +102 -0
- data/lib/fog/hp/models/block_storage/volumes.rb +28 -0
- data/lib/fog/hp/models/compute/address.rb +0 -1
- data/lib/fog/hp/models/compute/image.rb +43 -4
- data/lib/fog/hp/models/compute/images.rb +0 -5
- data/lib/fog/hp/models/compute/key_pair.rb +0 -5
- data/lib/fog/hp/models/compute/meta.rb +29 -0
- data/lib/fog/hp/models/compute/metadata.rb +79 -0
- data/lib/fog/hp/models/compute/server.rb +84 -20
- data/lib/fog/hp/models/meta_parent.rb +33 -0
- data/lib/fog/hp/models/storage/directories.rb +34 -9
- data/lib/fog/hp/models/storage/directory.rb +111 -26
- data/lib/fog/hp/models/storage/file.rb +10 -0
- data/lib/fog/hp/models/storage/files.rb +8 -0
- data/lib/fog/hp/models/storage/shared_directories.rb +55 -0
- data/lib/fog/hp/models/storage/shared_directory.rb +39 -0
- data/lib/fog/hp/models/storage/shared_file.rb +67 -0
- data/lib/fog/hp/models/storage/shared_files.rb +64 -0
- data/lib/fog/hp/requests/block_storage/create_snapshot.rb +76 -0
- data/lib/fog/hp/requests/block_storage/create_volume.rb +87 -0
- data/lib/fog/hp/requests/block_storage/delete_snapshot.rb +38 -0
- data/lib/fog/hp/requests/block_storage/delete_volume.rb +38 -0
- data/lib/fog/hp/requests/block_storage/get_bootable_volume_details.rb +59 -0
- data/lib/fog/hp/requests/block_storage/get_snapshot_details.rb +54 -0
- data/lib/fog/hp/requests/block_storage/get_volume_details.rb +58 -0
- data/lib/fog/hp/requests/block_storage/list_bootable_volumes.rb +53 -0
- data/lib/fog/hp/requests/block_storage/list_snapshots.rb +48 -0
- data/lib/fog/hp/requests/block_storage/list_volumes.rb +52 -0
- data/lib/fog/hp/requests/compute/attach_volume.rb +78 -0
- data/lib/fog/hp/requests/compute/create_image.rb +5 -8
- data/lib/fog/hp/requests/compute/create_persistent_server.rb +168 -0
- data/lib/fog/hp/requests/compute/create_server.rb +36 -20
- data/lib/fog/hp/requests/compute/delete_meta.rb +55 -0
- data/lib/fog/hp/requests/compute/delete_security_group_rule.rb +4 -4
- data/lib/fog/hp/requests/compute/detach_volume.rb +47 -0
- data/lib/fog/hp/requests/compute/get_console_output.rb +43 -0
- data/lib/fog/hp/requests/compute/get_meta.rb +57 -0
- data/lib/fog/hp/requests/compute/get_windows_password.rb +43 -0
- data/lib/fog/hp/requests/compute/list_metadata.rb +56 -0
- data/lib/fog/hp/requests/compute/list_server_volumes.rb +49 -0
- data/lib/fog/hp/requests/compute/set_metadata.rb +60 -0
- data/lib/fog/hp/requests/compute/update_meta.rb +61 -0
- data/lib/fog/hp/requests/compute/update_metadata.rb +60 -0
- data/lib/fog/hp/requests/storage/delete_shared_object.rb +38 -0
- data/lib/fog/hp/requests/storage/get_object.rb +12 -10
- data/lib/fog/hp/requests/storage/get_object_temp_url.rb +31 -0
- data/lib/fog/hp/requests/storage/get_shared_container.rb +75 -0
- data/lib/fog/hp/requests/storage/get_shared_object.rb +66 -0
- data/lib/fog/hp/requests/storage/head_container.rb +1 -0
- data/lib/fog/hp/requests/storage/head_object.rb +1 -0
- data/lib/fog/hp/requests/storage/head_shared_container.rb +45 -0
- data/lib/fog/hp/requests/storage/head_shared_object.rb +39 -0
- data/lib/fog/hp/requests/storage/put_container.rb +6 -6
- data/lib/fog/hp/requests/storage/put_object.rb +12 -1
- data/lib/fog/hp/requests/storage/put_shared_object.rb +85 -0
- data/lib/fog/hp/storage.rb +175 -33
- data/lib/fog/identity.rb +5 -4
- data/lib/fog/image.rb +5 -6
- data/lib/fog/internet_archive.rb +290 -0
- data/lib/fog/internet_archive/models/storage/directories.rb +43 -0
- data/lib/fog/internet_archive/models/storage/directory.rb +126 -0
- data/lib/fog/internet_archive/models/storage/file.rb +286 -0
- data/lib/fog/internet_archive/models/storage/files.rb +122 -0
- data/lib/fog/internet_archive/models/storage/version.rb +36 -0
- data/lib/fog/internet_archive/models/storage/versions.rb +38 -0
- data/lib/fog/internet_archive/parsers/storage/access_control_list.rb +46 -0
- data/lib/fog/internet_archive/parsers/storage/complete_multipart_upload.rb +24 -0
- data/lib/fog/internet_archive/parsers/storage/copy_object.rb +22 -0
- data/lib/fog/internet_archive/parsers/storage/cors_configuration.rb +41 -0
- data/lib/fog/internet_archive/parsers/storage/delete_multiple_objects.rb +50 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket.rb +62 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket_lifecycle.rb +66 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket_location.rb +20 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket_logging.rb +40 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb +88 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket_versioning.rb +24 -0
- data/lib/fog/internet_archive/parsers/storage/get_bucket_website.rb +26 -0
- data/lib/fog/internet_archive/parsers/storage/get_request_payment.rb +20 -0
- data/lib/fog/internet_archive/parsers/storage/get_service.rb +32 -0
- data/lib/fog/internet_archive/parsers/storage/initiate_multipart_upload.rb +24 -0
- data/lib/fog/internet_archive/parsers/storage/list_multipart_uploads.rb +56 -0
- data/lib/fog/internet_archive/parsers/storage/list_parts.rb +40 -0
- data/lib/fog/internet_archive/requests/storage/abort_multipart_upload.rb +28 -0
- data/lib/fog/internet_archive/requests/storage/acl_utils.rb +62 -0
- data/lib/fog/internet_archive/requests/storage/complete_multipart_upload.rb +48 -0
- data/lib/fog/internet_archive/requests/storage/copy_object.rb +81 -0
- data/lib/fog/internet_archive/requests/storage/cors_utils.rb +41 -0
- data/lib/fog/internet_archive/requests/storage/delete_bucket.rb +47 -0
- data/lib/fog/internet_archive/requests/storage/delete_bucket_cors.rb +29 -0
- data/lib/fog/internet_archive/requests/storage/delete_bucket_lifecycle.rb +27 -0
- data/lib/fog/internet_archive/requests/storage/delete_bucket_policy.rb +29 -0
- data/lib/fog/internet_archive/requests/storage/delete_bucket_website.rb +29 -0
- data/lib/fog/internet_archive/requests/storage/delete_multiple_objects.rb +167 -0
- data/lib/fog/internet_archive/requests/storage/delete_object.rb +118 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket.rb +112 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_acl.rb +69 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_cors.rb +65 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_lifecycle.rb +38 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_location.rb +58 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_logging.rb +47 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_object_versions.rb +162 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_policy.rb +34 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_versioning.rb +69 -0
- data/lib/fog/internet_archive/requests/storage/get_bucket_website.rb +40 -0
- data/lib/fog/internet_archive/requests/storage/get_object.rb +188 -0
- data/lib/fog/internet_archive/requests/storage/get_object_acl.rb +80 -0
- data/lib/fog/internet_archive/requests/storage/get_object_http_url.rb +55 -0
- data/lib/fog/internet_archive/requests/storage/get_object_https_url.rb +37 -0
- data/lib/fog/internet_archive/requests/storage/get_object_torrent.rb +47 -0
- data/lib/fog/internet_archive/requests/storage/get_object_url.rb +55 -0
- data/lib/fog/internet_archive/requests/storage/get_request_payment.rb +49 -0
- data/lib/fog/internet_archive/requests/storage/get_service.rb +55 -0
- data/lib/fog/internet_archive/requests/storage/head_object.rb +66 -0
- data/lib/fog/internet_archive/requests/storage/initiate_multipart_upload.rb +44 -0
- data/lib/fog/internet_archive/requests/storage/list_multipart_uploads.rb +55 -0
- data/lib/fog/internet_archive/requests/storage/list_parts.rb +55 -0
- data/lib/fog/internet_archive/requests/storage/post_object_hidden_fields.rb +38 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket.rb +74 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_acl.rb +71 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_cors.rb +49 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_lifecycle.rb +77 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_logging.rb +81 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_policy.rb +28 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_versioning.rb +75 -0
- data/lib/fog/internet_archive/requests/storage/put_bucket_website.rb +64 -0
- data/lib/fog/internet_archive/requests/storage/put_object.rb +113 -0
- data/lib/fog/internet_archive/requests/storage/put_object_acl.rb +80 -0
- data/lib/fog/internet_archive/requests/storage/put_object_url.rb +48 -0
- data/lib/fog/internet_archive/requests/storage/put_request_payment.rb +49 -0
- data/lib/fog/internet_archive/requests/storage/sync_clock.rb +28 -0
- data/lib/fog/internet_archive/requests/storage/upload_part.rb +41 -0
- data/lib/fog/internet_archive/signaturev4.rb +73 -0
- data/lib/fog/internet_archive/storage.rb +402 -0
- data/lib/fog/joyent/models/compute/server.rb +1 -1
- data/lib/fog/joyent/requests/compute/resize_machine.rb +2 -0
- data/lib/fog/libvirt/models/compute/volume.rb +1 -1
- data/lib/fog/network.rb +5 -6
- data/lib/fog/openstack.rb +10 -0
- data/lib/fog/openstack/compute.rb +11 -4
- data/lib/fog/openstack/identity.rb +5 -2
- data/lib/fog/openstack/models/compute/images.rb +2 -1
- data/lib/fog/openstack/models/compute/metadata.rb +4 -5
- data/lib/fog/openstack/models/compute/server.rb +36 -21
- data/lib/fog/openstack/models/identity/role.rb +1 -1
- data/lib/fog/openstack/models/network/floating_ip.rb +1 -1
- data/lib/fog/openstack/models/network/floating_ips.rb +2 -2
- data/lib/fog/openstack/models/network/network.rb +8 -0
- data/lib/fog/openstack/models/storage/directories.rb +39 -0
- data/lib/fog/openstack/models/storage/directory.rb +50 -0
- data/lib/fog/openstack/models/storage/file.rb +150 -0
- data/lib/fog/openstack/models/storage/files.rb +94 -0
- data/lib/fog/openstack/requests/compute/allocate_address.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_meta.rb +43 -0
- data/lib/fog/openstack/requests/compute/get_limits.rb +1 -1
- data/lib/fog/openstack/requests/compute/get_snapshot_details.rb +1 -1
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_servers.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -0
- data/lib/fog/openstack/requests/compute/remove_fixed_ip.rb +1 -1
- data/lib/fog/openstack/requests/compute/update_meta.rb +46 -0
- data/lib/fog/openstack/requests/compute/update_server.rb +1 -1
- data/lib/fog/openstack/requests/identity/delete_user_role.rb +2 -2
- data/lib/fog/openstack/requests/identity/get_user_by_name.rb +2 -2
- data/lib/fog/openstack/requests/image/create_image.rb +1 -1
- data/lib/fog/openstack/requests/network/associate_floating_ip.rb +3 -3
- data/lib/fog/openstack/requests/network/create_floating_ip.rb +3 -3
- data/lib/fog/openstack/requests/network/delete_floating_ip.rb +1 -1
- data/lib/fog/openstack/requests/network/disassociate_floating_ip.rb +3 -3
- data/lib/fog/openstack/requests/network/get_floating_ip.rb +1 -1
- data/lib/fog/openstack/requests/network/list_floating_ips.rb +1 -1
- data/lib/fog/openstack/requests/storage/copy_object.rb +27 -0
- data/lib/fog/openstack/requests/storage/delete_container.rb +22 -0
- data/lib/fog/openstack/requests/storage/delete_object.rb +23 -0
- data/lib/fog/openstack/requests/storage/get_container.rb +44 -0
- data/lib/fog/openstack/requests/storage/get_containers.rb +33 -0
- data/lib/fog/openstack/requests/storage/get_object.rb +29 -0
- data/lib/fog/openstack/requests/storage/get_object_https_url.rb +51 -0
- data/lib/fog/openstack/requests/storage/head_container.rb +28 -0
- data/lib/fog/openstack/requests/storage/head_containers.rb +25 -0
- data/lib/fog/openstack/requests/storage/head_object.rb +23 -0
- data/lib/fog/openstack/requests/storage/post_set_meta_temp_url_key.rb +37 -0
- data/lib/fog/openstack/requests/storage/put_container.rb +22 -0
- data/lib/fog/openstack/requests/storage/put_object.rb +30 -0
- data/lib/fog/openstack/requests/storage/put_object_manifest.rb +25 -0
- data/lib/fog/openstack/storage.rb +159 -0
- data/lib/fog/openstack/volume.rb +4 -2
- data/lib/fog/ovirt/compute.rb +1 -0
- data/lib/fog/ovirt/models/compute/server.rb +2 -2
- data/lib/fog/ovirt/models/compute/volume.rb +1 -0
- data/lib/fog/ovirt/requests/compute/get_api_version.rb +16 -0
- data/lib/fog/providers.rb +2 -1
- data/lib/fog/rackspace/block_storage.rb +1 -0
- data/lib/fog/rackspace/cdn.rb +61 -7
- data/lib/fog/rackspace/compute_v2.rb +16 -3
- data/lib/fog/rackspace/databases.rb +4 -3
- data/lib/fog/rackspace/docs/compute_v2.md +663 -0
- data/lib/fog/rackspace/docs/getting_started.md +9 -9
- data/lib/fog/rackspace/examples/README.md +47 -0
- data/lib/fog/rackspace/examples/compute_v2/README.md +47 -0
- data/lib/fog/rackspace/examples/compute_v2/create_image.rb +61 -0
- data/lib/fog/rackspace/examples/compute_v2/create_server.rb +89 -0
- data/lib/fog/rackspace/examples/compute_v2/delete_image.rb +61 -0
- data/lib/fog/rackspace/examples/compute_v2/delete_server.rb +56 -0
- data/lib/fog/rackspace/examples/compute_v2/detach_volume.rb +93 -0
- data/lib/fog/rackspace/examples/compute_v2/resize_server.rb +106 -0
- data/lib/fog/rackspace/examples/compute_v2/server_attachments.rb +69 -0
- data/lib/fog/rackspace/examples/compute_v2/server_metadata.rb +85 -0
- data/lib/fog/rackspace/identity.rb +1 -1
- data/lib/fog/rackspace/load_balancers.rb +2 -2
- data/lib/fog/rackspace/mock_data.rb +114 -96
- data/lib/fog/rackspace/models/compute_v2/attachment.rb +16 -0
- data/lib/fog/rackspace/models/compute_v2/attachments.rb +6 -0
- data/lib/fog/rackspace/models/compute_v2/flavor.rb +18 -0
- data/lib/fog/rackspace/models/compute_v2/flavors.rb +9 -1
- data/lib/fog/rackspace/models/compute_v2/image.rb +52 -7
- data/lib/fog/rackspace/models/compute_v2/images.rb +9 -0
- data/lib/fog/rackspace/models/compute_v2/meta_parent.rb +9 -0
- data/lib/fog/rackspace/models/compute_v2/metadata.rb +30 -7
- data/lib/fog/rackspace/models/compute_v2/metadatum.rb +4 -0
- data/lib/fog/rackspace/models/compute_v2/network.rb +27 -0
- data/lib/fog/rackspace/models/compute_v2/networks.rb +23 -0
- data/lib/fog/rackspace/models/compute_v2/server.rb +235 -24
- data/lib/fog/rackspace/models/compute_v2/servers.rb +19 -1
- data/lib/fog/rackspace/models/dns/zones.rb +35 -2
- data/lib/fog/rackspace/models/identity/credentials.rb +3 -2
- data/lib/fog/rackspace/models/storage/account.rb +24 -0
- data/lib/fog/rackspace/models/storage/directories.rb +3 -0
- data/lib/fog/rackspace/models/storage/directory.rb +68 -39
- data/lib/fog/rackspace/models/storage/file.rb +38 -67
- data/lib/fog/rackspace/models/storage/files.rb +11 -4
- data/lib/fog/rackspace/models/storage/metadata.rb +129 -0
- data/lib/fog/rackspace/requests/cdn/delete_object.rb +37 -0
- data/lib/fog/rackspace/requests/cdn/get_containers.rb +34 -0
- data/lib/fog/rackspace/requests/cdn/head_container.rb +24 -0
- data/lib/fog/rackspace/requests/cdn/post_container.rb +21 -0
- data/lib/fog/rackspace/requests/cdn/put_container.rb +21 -0
- data/lib/fog/rackspace/requests/compute_v2/attach_volume.rb +13 -0
- data/lib/fog/rackspace/requests/compute_v2/change_server_password.rb +7 -0
- data/lib/fog/rackspace/requests/compute_v2/confirm_resize_server.rb +9 -0
- data/lib/fog/rackspace/requests/compute_v2/create_image.rb +9 -5
- data/lib/fog/rackspace/requests/compute_v2/create_network.rb +36 -0
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +38 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_attachment.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_image.rb +2 -4
- data/lib/fog/rackspace/requests/compute_v2/delete_metadata_item.rb +6 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_network.rb +21 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +4 -0
- data/lib/fog/rackspace/requests/compute_v2/get_attachment.rb +12 -0
- data/lib/fog/rackspace/requests/compute_v2/get_flavor.rb +14 -0
- data/lib/fog/rackspace/requests/compute_v2/get_image.rb +18 -0
- data/lib/fog/rackspace/requests/compute_v2/get_metadata_item.rb +9 -0
- data/lib/fog/rackspace/requests/compute_v2/get_network.rb +21 -0
- data/lib/fog/rackspace/requests/compute_v2/get_server.rb +32 -0
- data/lib/fog/rackspace/requests/compute_v2/list_addresses.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/list_addresses_by_network.rb +12 -0
- data/lib/fog/rackspace/requests/compute_v2/list_attachments.rb +12 -0
- data/lib/fog/rackspace/requests/compute_v2/list_flavors.rb +10 -0
- data/lib/fog/rackspace/requests/compute_v2/list_images.rb +10 -0
- data/lib/fog/rackspace/requests/compute_v2/list_metadata.rb +8 -0
- data/lib/fog/rackspace/requests/compute_v2/list_networks.rb +18 -0
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +31 -0
- data/lib/fog/rackspace/requests/compute_v2/reboot_server.rb +5 -0
- data/lib/fog/rackspace/requests/compute_v2/rebuild_server.rb +37 -0
- data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +10 -0
- data/lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb +10 -0
- data/lib/fog/rackspace/requests/compute_v2/set_metadata.rb +9 -0
- data/lib/fog/rackspace/requests/compute_v2/set_metadata_item.rb +10 -0
- data/lib/fog/rackspace/requests/compute_v2/update_metadata.rb +9 -0
- data/lib/fog/rackspace/requests/compute_v2/update_server.rb +9 -0
- data/lib/fog/rackspace/requests/storage/get_object.rb +0 -1
- data/lib/fog/rackspace/requests/storage/put_container.rb +2 -1
- data/lib/fog/rackspace/storage.rb +14 -2
- data/lib/fog/schema/data_validator.rb +154 -0
- data/lib/fog/storage.rb +8 -24
- data/lib/fog/terremark/models/shared/server.rb +5 -3
- data/lib/fog/terremark/parser.rb +14 -13
- data/lib/fog/terremark/parsers/shared/get_catalog.rb +5 -19
- data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +4 -14
- data/lib/fog/terremark/parsers/shared/get_internet_services.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_keys_list.rb +4 -18
- data/lib/fog/terremark/parsers/shared/get_network_ips.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_node_services.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_organization.rb +4 -3
- data/lib/fog/terremark/parsers/shared/get_organizations.rb +3 -2
- data/lib/fog/terremark/parsers/shared/get_public_ips.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +4 -17
- data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +3 -14
- data/lib/fog/terremark/parsers/shared/get_vdc.rb +6 -38
- data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +3 -14
- data/lib/fog/terremark/parsers/shared/internet_service.rb +2 -5
- data/lib/fog/terremark/parsers/shared/network.rb +3 -11
- data/lib/fog/terremark/parsers/shared/node_service.rb +1 -1
- data/lib/fog/terremark/parsers/shared/public_ip.rb +1 -1
- data/lib/fog/terremark/parsers/shared/task.rb +3 -14
- data/lib/fog/terremark/parsers/shared/vapp.rb +3 -14
- data/lib/fog/vcloud/compute.rb +1 -0
- data/lib/fog/vcloud/models/compute/server.rb +15 -2
- data/lib/fog/vcloud/models/compute/vapp.rb +11 -0
- data/lib/fog/vcloud/requests/compute/configure_vm_network.rb +37 -0
- data/lib/fog/vcloud/requests/compute/instantiate_vapp_template.rb +8 -4
- data/lib/fog/version.rb +1 -1
- data/lib/fog/volume.rb +6 -6
- data/lib/fog/vsphere/requests/compute/create_vm.rb +18 -3
- data/lib/fog/vsphere/requests/compute/list_vm_interfaces.rb +1 -1
- data/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb +1 -1
- data/tests/aws/models/data_pipeline/pipeline_tests.rb +8 -0
- data/tests/aws/models/data_pipeline/pipelines_tests.rb +8 -0
- data/tests/aws/models/rds/server_tests.rb +10 -9
- data/tests/aws/requests/compute/image_tests.rb +2 -2
- data/tests/aws/requests/compute/security_group_tests.rb +1 -1
- data/tests/aws/requests/compute/spot_instance_tests.rb +3 -2
- data/tests/aws/requests/data_pipeline/helper.rb +44 -0
- data/tests/aws/requests/data_pipeline/pipeline_tests.rb +54 -0
- data/tests/aws/requests/rds/instance_tests.rb +8 -5
- data/tests/bluebox/requests/blb/helper.rb +64 -0
- data/tests/bluebox/requests/blb/lb_tests.rb +75 -0
- data/tests/brightbox/requests/compute/firewall_policy_tests.rb +7 -0
- data/tests/brightbox/requests/compute/helper.rb +4 -2
- data/tests/compute/helper.rb +8 -0
- data/tests/core/user_agent_tests.rb +6 -0
- data/tests/dreamhost/README.md +56 -0
- data/tests/dreamhost/dns_tests.rb +20 -0
- data/tests/dreamhost/helper.rb +19 -0
- data/tests/dreamhost/models/dns/record_tests.rb +73 -0
- data/tests/dreamhost/models/dns/records_tests.rb +29 -0
- data/tests/dreamhost/models/dns/zone_tests.rb +62 -0
- data/tests/dreamhost/models/dns/zones_tests.rb +29 -0
- data/tests/dreamhost/requests/dns/create_record_tests.rb +39 -0
- data/tests/dreamhost/requests/dns/delete_record_tests.rb +26 -0
- data/tests/dreamhost/requests/dns/list_records_tests.rb +31 -0
- data/tests/glesys/requests/compute/helper.rb +5 -5
- data/tests/helper.rb +1 -1
- data/tests/helpers/formats_helper.rb +63 -50
- data/tests/helpers/formats_helper_tests.rb +87 -36
- data/tests/helpers/mock_helper.rb +4 -1
- data/tests/helpers/schema_validator_tests.rb +107 -0
- data/tests/hp/models/block_storage/bootable_volume_tests.rb +23 -0
- data/tests/hp/models/block_storage/snapshot_tests.rb +23 -0
- data/tests/hp/models/block_storage/volume_tests.rb +21 -0
- 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/metadata_image_tests.rb +60 -0
- data/tests/hp/models/compute/metadata_server_tests.rb +54 -0
- data/tests/hp/models/compute/security_group_tests.rb +3 -1
- data/tests/hp/models/compute/security_groups_tests.rb +1 -1
- data/tests/hp/models/storage/directories_tests.rb +23 -0
- data/tests/hp/models/storage/directory_tests.rb +62 -0
- data/tests/hp/models/storage/file_tests.rb +44 -0
- data/tests/hp/models/storage/files_tests.rb +38 -0
- data/tests/hp/requests/block_storage/bootable_volume_tests.rb +78 -0
- data/tests/hp/requests/block_storage/snapshot_tests.rb +56 -0
- data/tests/hp/requests/block_storage/volume_tests.rb +94 -0
- data/tests/hp/requests/cdn/container_tests.rb +1 -1
- data/tests/hp/requests/compute/address_tests.rb +5 -6
- 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/metadata_tests.rb +70 -0
- data/tests/hp/requests/compute/persistent_server_tests.rb +66 -0
- 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 +5 -6
- data/tests/hp/requests/compute/server_volume_tests.rb +76 -0
- data/tests/hp/requests/storage/container_tests.rb +1 -1
- data/tests/hp/requests/storage/object_tests.rb +9 -1
- data/tests/hp/user_agent_tests.rb +13 -0
- data/tests/internet_archive/models/storage/directory_tests.rb +51 -0
- data/tests/internet_archive/models/storage/file_tests.rb +80 -0
- data/tests/internet_archive/models/storage/files_tests.rb +56 -0
- data/tests/internet_archive/models/storage/url_tests.rb +28 -0
- data/tests/internet_archive/models/storage/version_tests.rb +52 -0
- data/tests/internet_archive/models/storage/versions_tests.rb +56 -0
- data/tests/internet_archive/requests/storage/acl_utils_tests.rb +209 -0
- data/tests/internet_archive/requests/storage/bucket_tests.rb +328 -0
- data/tests/internet_archive/requests/storage/cors_utils_tests.rb +108 -0
- data/tests/internet_archive/requests/storage/multipart_upload_tests.rb +132 -0
- data/tests/internet_archive/requests/storage/object_tests.rb +166 -0
- data/tests/internet_archive/requests/storage/versioning_tests.rb +258 -0
- data/tests/internet_archive/signaturev4_tests.rb +41 -0
- data/tests/internet_archive/signed_params_tests.rb +5 -0
- data/tests/openstack/models/compute/images_tests.rb +14 -0
- data/tests/openstack/models/compute/server_tests.rb +42 -1
- data/tests/openstack/models/identity/roles_tests.rb +1 -0
- data/tests/openstack/models/identity/user_tests.rb +2 -2
- data/tests/openstack/models/network/network_tests.rb +21 -1
- data/tests/openstack/models/storage/file_tests.rb +178 -0
- data/tests/openstack/requests/compute/limit_tests.rb +1 -1
- data/tests/openstack/requests/compute/tenant_tests.rb +2 -2
- data/tests/openstack/requests/identity/ec2_credentials_tests.rb +7 -4
- data/tests/openstack/requests/identity/helper.rb +17 -0
- data/tests/openstack/requests/identity/role_tests.rb +6 -0
- data/tests/openstack/requests/identity/tenant_tests.rb +14 -12
- data/tests/openstack/requests/identity/user_tests.rb +9 -5
- data/tests/openstack/requests/storage/container_tests.rb +64 -0
- data/tests/openstack/requests/storage/large_object_tests.rb +47 -0
- data/tests/openstack/requests/storage/object_tests.rb +84 -0
- data/tests/openstack/volume_tests.rb +15 -0
- data/tests/rackspace/cdn_tests.rb +78 -0
- data/tests/rackspace/helper.rb +9 -0
- data/tests/rackspace/models/compute_v2/flavors_tests.rb +1 -1
- data/tests/rackspace/models/compute_v2/image_tests.rb +2 -4
- data/tests/rackspace/models/compute_v2/images_tests.rb +1 -1
- data/tests/rackspace/models/compute_v2/metadata_tests.rb +5 -3
- data/tests/rackspace/models/compute_v2/network_tests.rb +10 -0
- data/tests/rackspace/models/compute_v2/networks_tests.rb +10 -0
- data/tests/rackspace/models/compute_v2/server_tests.rb +8 -7
- data/tests/rackspace/models/compute_v2/servers_tests.rb +5 -7
- data/tests/rackspace/models/dns/zones_tests.rb +22 -0
- data/tests/rackspace/models/identity/credentials_tests.rb +14 -5
- data/tests/rackspace/models/storage/account_tests.rb +28 -0
- data/tests/rackspace/models/storage/directories_tests.rb +29 -0
- data/tests/rackspace/models/storage/directory_tests.rb +141 -0
- data/tests/rackspace/models/storage/file_tests.rb +86 -11
- data/tests/rackspace/models/storage/metadata_tests.rb +174 -0
- data/tests/rackspace/requests/cdn/cdn_tests.rb +76 -0
- data/tests/rackspace/requests/compute/image_tests.rb +2 -2
- data/tests/rackspace/requests/compute_v2/image_tests.rb +6 -6
- data/tests/rackspace/requests/compute_v2/network_tests.rb +49 -0
- data/tests/rackspace/requests/identity/user_tests.rb +0 -4
- data/tests/rackspace/requests/storage/container_tests.rb +8 -1
- data/tests/rackspace/storage_tests.rb +8 -0
- data/tests/storage/helper.rb +3 -0
- metadata +341 -40
- data/docs/storage/aws.markdown +0 -21
- data/lib/fog/bin/virtual_box.rb +0 -57
- data/lib/fog/rackspace/docs/cloud_servers.md +0 -65
- data/lib/fog/rackspace/requests/identity/get_credentials.rb +0 -15
- data/lib/fog/virtual_box.rb +0 -11
- data/lib/fog/virtual_box/compute.rb +0 -59
- data/lib/fog/virtual_box/models/compute/medium.rb +0 -87
- data/lib/fog/virtual_box/models/compute/medium_format.rb +0 -34
- data/lib/fog/virtual_box/models/compute/mediums.rb +0 -32
- data/lib/fog/virtual_box/models/compute/nat_engine.rb +0 -65
- data/lib/fog/virtual_box/models/compute/nat_redirect.rb +0 -91
- data/lib/fog/virtual_box/models/compute/nat_redirects.rb +0 -41
- data/lib/fog/virtual_box/models/compute/network_adapter.rb +0 -82
- data/lib/fog/virtual_box/models/compute/network_adapters.rb +0 -42
- data/lib/fog/virtual_box/models/compute/server.rb +0 -199
- data/lib/fog/virtual_box/models/compute/servers.rb +0 -41
- data/lib/fog/virtual_box/models/compute/storage_controller.rb +0 -83
- data/lib/fog/virtual_box/models/compute/storage_controllers.rb +0 -38
@@ -0,0 +1,85 @@
|
|
1
|
+
module Fog
|
2
|
+
module Storage
|
3
|
+
class HP
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Create a new object in a shared container
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * shared_container_url<~String> - Shared url for the container
|
10
|
+
# * object<~String> - Name of the object
|
11
|
+
# * options<~Hash> - header options
|
12
|
+
#
|
13
|
+
def put_shared_object(shared_container_url, object_name, data, options = {}, &block)
|
14
|
+
# split up the shared object url
|
15
|
+
uri = URI.parse(shared_container_url)
|
16
|
+
path = uri.path
|
17
|
+
|
18
|
+
data = Fog::Storage.parse_data(data)
|
19
|
+
headers = data[:headers].merge!(options)
|
20
|
+
if block_given?
|
21
|
+
headers['Transfer-Encoding'] = 'chunked'
|
22
|
+
headers.delete('Content-Length')
|
23
|
+
return shared_request(
|
24
|
+
:request_block => block,
|
25
|
+
:expects => 201,
|
26
|
+
:headers => headers,
|
27
|
+
:method => 'PUT',
|
28
|
+
:path => "#{path}/#{Fog::HP.escape(object_name)}"
|
29
|
+
)
|
30
|
+
end
|
31
|
+
if headers.has_key?('Transfer-Encoding')
|
32
|
+
headers.delete('Content-Length')
|
33
|
+
end
|
34
|
+
response = shared_request(
|
35
|
+
:body => data[:body],
|
36
|
+
:expects => 201,
|
37
|
+
:headers => headers,
|
38
|
+
:method => 'PUT',
|
39
|
+
:path => "#{path}/#{Fog::HP.escape(object_name)}"
|
40
|
+
)
|
41
|
+
response
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
class Mock # :nodoc:all
|
47
|
+
|
48
|
+
def put_shared_object(shared_container_url, object_name, data, options = {}, &block)
|
49
|
+
response = Excon::Response.new
|
50
|
+
data = Fog::Storage.parse_data(data)
|
51
|
+
unless data[:body].is_a?(String)
|
52
|
+
data[:body] = data[:body].read
|
53
|
+
end
|
54
|
+
response.status = 201
|
55
|
+
object = {
|
56
|
+
:body => data[:body],
|
57
|
+
'Content-Type' => options['Content-Type'] || data[:headers]['Content-Type'],
|
58
|
+
'ETag' => Fog::HP::Mock.etag,
|
59
|
+
'Key' => object_name,
|
60
|
+
'Date' => Fog::Time.now.to_date_header,
|
61
|
+
'Content-Length' => options['Content-Length'] || data[:headers]['Content-Length'],
|
62
|
+
}
|
63
|
+
|
64
|
+
for key, value in options
|
65
|
+
case key
|
66
|
+
when 'Cache-Control', 'Content-Disposition', 'Content-Encoding', 'Content-MD5', 'Expires', /^X-Object-Meta-/
|
67
|
+
object[key] = value
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
response.headers = {
|
72
|
+
'Content-Length' => object['Content-Length'],
|
73
|
+
'Content-Type' => object['Content-Type'],
|
74
|
+
'ETag' => object['ETag'],
|
75
|
+
'Date' => object['Date']
|
76
|
+
}
|
77
|
+
|
78
|
+
response
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/fog/hp/storage.rb
CHANGED
@@ -5,28 +5,42 @@ module Fog
|
|
5
5
|
module Storage
|
6
6
|
class HP < Fog::Service
|
7
7
|
|
8
|
-
requires :hp_secret_key, :
|
9
|
-
recognizes :hp_auth_uri, :
|
8
|
+
requires :hp_secret_key, :hp_tenant_id, :hp_avl_zone
|
9
|
+
recognizes :hp_auth_uri, :hp_cdn_ssl, :hp_cdn_uri
|
10
|
+
recognizes :persistent, :connection_options
|
11
|
+
recognizes :hp_use_upass_auth_style, :hp_auth_version, :user_agent
|
12
|
+
recognizes :hp_access_key, :hp_account_id # :hp_account_id is deprecated use hp_access_key instead
|
10
13
|
|
11
14
|
secrets :hp_secret_key
|
12
15
|
|
13
16
|
model_path 'fog/hp/models/storage'
|
14
17
|
model :directory
|
15
18
|
collection :directories
|
19
|
+
model :shared_directory
|
20
|
+
collection :shared_directories
|
16
21
|
model :file
|
17
22
|
collection :files
|
23
|
+
model :shared_file
|
24
|
+
collection :shared_files
|
18
25
|
|
19
26
|
request_path 'fog/hp/requests/storage'
|
20
27
|
request :delete_container
|
21
28
|
request :delete_object
|
29
|
+
request :delete_shared_object
|
22
30
|
request :get_container
|
23
31
|
request :get_containers
|
24
32
|
request :get_object
|
33
|
+
request :get_object_temp_url
|
34
|
+
request :get_shared_container
|
35
|
+
request :get_shared_object
|
25
36
|
request :head_container
|
26
37
|
request :head_containers
|
27
38
|
request :head_object
|
39
|
+
request :head_shared_container
|
40
|
+
request :head_shared_object
|
28
41
|
request :put_container
|
29
42
|
request :put_object
|
43
|
+
request :put_shared_object
|
30
44
|
|
31
45
|
module Utils
|
32
46
|
|
@@ -34,11 +48,12 @@ module Fog
|
|
34
48
|
unless @hp_cdn_uri.nil?
|
35
49
|
@cdn ||= Fog::CDN.new(
|
36
50
|
:provider => 'HP',
|
37
|
-
:
|
51
|
+
:hp_access_key => @hp_access_key,
|
38
52
|
:hp_secret_key => @hp_secret_key,
|
39
53
|
:hp_auth_uri => @hp_auth_uri,
|
40
54
|
:hp_cdn_uri => @hp_cdn_uri,
|
41
55
|
:hp_tenant_id => @hp_tenant_id,
|
56
|
+
:hp_avl_zone => @hp_avl_zone,
|
42
57
|
:connection_options => @connection_options
|
43
58
|
)
|
44
59
|
if @cdn.enabled?
|
@@ -53,35 +68,118 @@ module Fog
|
|
53
68
|
"#{@scheme}://#{@host}:#{@port}#{@path}"
|
54
69
|
end
|
55
70
|
|
56
|
-
def
|
71
|
+
def public_url(container=nil, object=nil)
|
72
|
+
public_url = nil
|
73
|
+
unless container.nil?
|
74
|
+
if object.nil?
|
75
|
+
# return container public url
|
76
|
+
public_url = "#{url}/#{Fog::HP.escape(container)}"
|
77
|
+
else
|
78
|
+
# return object public url
|
79
|
+
public_url = "#{url}/#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
public_url
|
83
|
+
end
|
84
|
+
|
85
|
+
def perm_to_acl(perm, users=[])
|
86
|
+
read_perm_acl = []
|
87
|
+
write_perm_acl = []
|
88
|
+
valid_public_perms = ['pr', 'pw', 'prw']
|
89
|
+
valid_account_perms = ['r', 'w', 'rw']
|
90
|
+
valid_perms = valid_public_perms + valid_account_perms
|
91
|
+
unless valid_perms.include?(perm)
|
92
|
+
raise ArgumentError.new("permission must be one of [#{valid_perms.join(', ')}]")
|
93
|
+
end
|
94
|
+
# tackle the public access differently
|
95
|
+
if valid_public_perms.include?(perm)
|
96
|
+
case perm
|
97
|
+
when "pr"
|
98
|
+
read_perm_acl = [".r:*",".rlistings"]
|
99
|
+
when "pw"
|
100
|
+
write_perm_acl = ["*"]
|
101
|
+
when "prw"
|
102
|
+
read_perm_acl = [".r:*",".rlistings"]
|
103
|
+
write_perm_acl = ["*"]
|
104
|
+
end
|
105
|
+
elsif valid_account_perms.include?(perm)
|
106
|
+
# tackle the user access differently
|
107
|
+
unless (users.nil? || users.empty?)
|
108
|
+
# return the correct acls
|
109
|
+
tenant_id = "*" # this might change later
|
110
|
+
acl_array = users.map { |u| "#{tenant_id}:#{u}" }
|
111
|
+
#acl_string = acl_array.join(',')
|
112
|
+
case perm
|
113
|
+
when "r"
|
114
|
+
read_perm_acl = acl_array
|
115
|
+
when "w"
|
116
|
+
write_perm_acl = acl_array
|
117
|
+
when "rw"
|
118
|
+
read_perm_acl = acl_array
|
119
|
+
write_perm_acl = acl_array
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
return read_perm_acl, write_perm_acl
|
124
|
+
end
|
125
|
+
|
126
|
+
def perm_acl_to_header(read_perm_acl, write_perm_acl)
|
57
127
|
header = {}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
when "public-read-write"
|
67
|
-
header['X-Container-Read'] = ".r:*,.rlistings"
|
68
|
-
header['X-Container-Write'] = "*"
|
128
|
+
if read_perm_acl.nil? && write_perm_acl.nil?
|
129
|
+
header = {'X-Container-Read' => "", 'X-Container-Write' => ""}
|
130
|
+
elsif !read_perm_acl.nil? && write_perm_acl.nil?
|
131
|
+
header = {'X-Container-Read' => "#{read_perm_acl.join(',')}", 'X-Container-Write' => ""}
|
132
|
+
elsif read_perm_acl.nil? && !write_perm_acl.nil?
|
133
|
+
header = {'X-Container-Read' => "", 'X-Container-Write' => "#{write_perm_acl.join(',')}"}
|
134
|
+
elsif !read_perm_acl.nil? && !write_perm_acl.nil?
|
135
|
+
header = {'X-Container-Read' => "#{read_perm_acl.join(',')}", 'X-Container-Write' => "#{write_perm_acl.join(',')}"}
|
69
136
|
end
|
70
137
|
header
|
71
138
|
end
|
72
139
|
|
73
|
-
def
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
140
|
+
def header_to_perm_acl(read_header=nil, write_header=nil)
|
141
|
+
read_h, write_h = nil
|
142
|
+
read_h = read_header.split(',') unless read_header.nil?
|
143
|
+
write_h = write_header.split(',') unless write_header.nil?
|
144
|
+
return read_h, write_h
|
145
|
+
end
|
146
|
+
|
147
|
+
def generate_object_temp_url(container, object, expires_secs, method)
|
148
|
+
return unless (container && object && expires_secs && method)
|
149
|
+
|
150
|
+
# POST not allowed
|
151
|
+
allowed_methods = %w{GET PUT HEAD}
|
152
|
+
unless allowed_methods.include?(method)
|
153
|
+
raise ArgumentError.new("Invalid method '#{method}' specified. Valid methods are: #{allowed_methods.join(', ')}")
|
83
154
|
end
|
155
|
+
|
156
|
+
expires = (Time.now + expires_secs.to_i).to_i
|
157
|
+
|
158
|
+
# split up the storage uri
|
159
|
+
uri = URI.parse(@hp_storage_uri)
|
160
|
+
host = uri.host
|
161
|
+
path = uri.path
|
162
|
+
port = uri.port
|
163
|
+
scheme = uri.scheme
|
164
|
+
|
165
|
+
# do not encode before signature generation, encode after
|
166
|
+
sig_path = "#{path}/#{container}/#{object}"
|
167
|
+
encoded_path = "#{path}/#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}"
|
168
|
+
|
169
|
+
string_to_sign = "#{method}\n#{expires}\n#{sig_path}"
|
170
|
+
# Only works with 1.9+ Not compatible with 1.8.7
|
171
|
+
#signed_string = Digest::HMAC.hexdigest(string_to_sign, @hp_secret_key, Digest::SHA1)
|
172
|
+
# Compatible with 1.8.7 onwards
|
173
|
+
hmac = OpenSSL::HMAC.new(@hp_secret_key, OpenSSL::Digest::SHA1.new)
|
174
|
+
signed_string = hmac.update(string_to_sign).hexdigest
|
175
|
+
|
176
|
+
signature = @hp_tenant_id.to_s + ":" + @hp_access_key.to_s + ":" + signed_string
|
177
|
+
signature = Fog::HP.escape(signature)
|
178
|
+
|
179
|
+
# generate the temp url using the signature and expiry
|
180
|
+
temp_url = "#{scheme}://#{host}:#{port}#{encoded_path}?temp_url_sig=#{signature}&temp_url_expires=#{expires}"
|
84
181
|
end
|
182
|
+
|
85
183
|
end
|
86
184
|
|
87
185
|
class Mock
|
@@ -108,16 +206,25 @@ module Fog
|
|
108
206
|
|
109
207
|
def initialize(options={})
|
110
208
|
require 'mime/types'
|
209
|
+
# deprecate hp_account_id
|
210
|
+
if options[:hp_account_id]
|
211
|
+
Fog::Logger.deprecation(":hp_account_id is deprecated, please use :hp_access_key instead.")
|
212
|
+
@hp_access_key = options.delete(:hp_account_id)
|
213
|
+
end
|
214
|
+
@hp_access_key = options[:hp_access_key]
|
215
|
+
unless @hp_access_key
|
216
|
+
raise ArgumentError.new("Missing required arguments: hp_access_key. :hp_account_id is deprecated, please use :hp_access_key instead.")
|
217
|
+
end
|
111
218
|
@hp_secret_key = options[:hp_secret_key]
|
112
|
-
@
|
219
|
+
@hp_tenant_id = options[:hp_tenant_id]
|
113
220
|
end
|
114
221
|
|
115
222
|
def data
|
116
|
-
self.class.data[@
|
223
|
+
self.class.data[@hp_access_key]
|
117
224
|
end
|
118
225
|
|
119
226
|
def reset_data
|
120
|
-
self.class.data.delete(@
|
227
|
+
self.class.data.delete(@hp_access_key)
|
121
228
|
end
|
122
229
|
|
123
230
|
end
|
@@ -128,16 +235,25 @@ module Fog
|
|
128
235
|
|
129
236
|
def initialize(options={})
|
130
237
|
require 'mime/types'
|
238
|
+
# deprecate hp_account_id
|
239
|
+
if options[:hp_account_id]
|
240
|
+
Fog::Logger.deprecation(":hp_account_id is deprecated, please use :hp_access_key instead.")
|
241
|
+
options[:hp_access_key] = options.delete(:hp_account_id)
|
242
|
+
end
|
243
|
+
@hp_access_key = options[:hp_access_key]
|
244
|
+
unless @hp_access_key
|
245
|
+
raise ArgumentError.new("Missing required arguments: hp_access_key. :hp_account_id is deprecated, please use :hp_access_key instead.")
|
246
|
+
end
|
131
247
|
@hp_secret_key = options[:hp_secret_key]
|
132
|
-
@hp_account_id = options[:hp_account_id]
|
133
248
|
@hp_auth_uri = options[:hp_auth_uri]
|
134
249
|
@hp_cdn_ssl = options[:hp_cdn_ssl]
|
135
250
|
@connection_options = options[:connection_options] || {}
|
136
251
|
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
|
137
252
|
auth_version = options[:hp_auth_version] || :v2
|
138
|
-
### Pass the service
|
139
|
-
options[:hp_service_type] = "
|
253
|
+
### Pass the service name for object storage to the authentication call
|
254
|
+
options[:hp_service_type] = "Object Storage"
|
140
255
|
@hp_tenant_id = options[:hp_tenant_id]
|
256
|
+
@hp_avl_zone = options[:hp_avl_zone]
|
141
257
|
|
142
258
|
### Make the authentication call
|
143
259
|
if (auth_version == :v2)
|
@@ -157,12 +273,11 @@ module Fog
|
|
157
273
|
@auth_token = credentials[:auth_token]
|
158
274
|
|
159
275
|
uri = URI.parse(@hp_storage_uri)
|
160
|
-
@host =
|
276
|
+
@host = uri.host
|
161
277
|
@path = uri.path
|
162
278
|
@persistent = options[:persistent] || false
|
163
279
|
@port = uri.port
|
164
280
|
@scheme = uri.scheme
|
165
|
-
Excon.ssl_verify_peer = false if options[:hp_servicenet] == true
|
166
281
|
|
167
282
|
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
168
283
|
end
|
@@ -195,6 +310,33 @@ module Fog
|
|
195
310
|
response
|
196
311
|
end
|
197
312
|
|
313
|
+
# this request is used only for get_shared_container and get_shared_object calls
|
314
|
+
def shared_request(params, parse_json = true, &block)
|
315
|
+
begin
|
316
|
+
response = @connection.request(params.merge!({
|
317
|
+
:headers => {
|
318
|
+
'Content-Type' => 'application/json',
|
319
|
+
'X-Auth-Token' => @auth_token
|
320
|
+
}.merge!(params[:headers] || {}),
|
321
|
+
:host => @host,
|
322
|
+
:path => "#{params[:path]}",
|
323
|
+
}), &block)
|
324
|
+
rescue Excon::Errors::HTTPStatusError => error
|
325
|
+
raise case error
|
326
|
+
when Excon::Errors::NotFound
|
327
|
+
Fog::Storage::HP::NotFound.slurp(error)
|
328
|
+
when Excon::Errors::Forbidden
|
329
|
+
Fog::HP::Errors::Forbidden.slurp(error)
|
330
|
+
else
|
331
|
+
error
|
332
|
+
end
|
333
|
+
end
|
334
|
+
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
|
335
|
+
response.body = Fog::JSON.decode(response.body)
|
336
|
+
end
|
337
|
+
response
|
338
|
+
end
|
339
|
+
|
198
340
|
end
|
199
341
|
end
|
200
342
|
end
|
data/lib/fog/identity.rb
CHANGED
@@ -11,16 +11,17 @@ module Fog
|
|
11
11
|
when :rackspace
|
12
12
|
require 'fog/rackspace/identity'
|
13
13
|
Fog::Rackspace::Identity.new(attributes)
|
14
|
-
when :openstack
|
15
|
-
require 'fog/openstack/identity'
|
16
|
-
Fog::Identity::OpenStack.new(attributes)
|
17
14
|
else
|
15
|
+
if self.providers.include?(provider)
|
16
|
+
require "fog/#{provider}/identity"
|
17
|
+
return Fog::Identity.const_get(Fog.providers[provider]).new(attributes)
|
18
|
+
end
|
18
19
|
raise ArgumentError.new("#{provider} has no identity service")
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
22
23
|
def self.providers
|
23
|
-
Fog.services[:
|
24
|
+
Fog.services[:identity]
|
24
25
|
end
|
25
26
|
|
26
27
|
end
|
data/lib/fog/image.rb
CHANGED
@@ -7,13 +7,12 @@ module Fog
|
|
7
7
|
|
8
8
|
def self.new(attributes)
|
9
9
|
attributes = attributes.dup # Prevent delete from having side effects
|
10
|
-
|
11
|
-
|
12
|
-
require
|
13
|
-
Fog::Image
|
14
|
-
else
|
15
|
-
raise ArgumentError.new("#{provider} has no identity service")
|
10
|
+
provider = attributes.delete(:provider).to_s.downcase.to_sym
|
11
|
+
if self.providers.include?(provider)
|
12
|
+
require "fog/#{provider}/image"
|
13
|
+
return Fog::Image.const_get(Fog.providers[provider]).new(attributes)
|
16
14
|
end
|
15
|
+
raise ArgumentError.new("#{provider} has no identity service")
|
17
16
|
end
|
18
17
|
|
19
18
|
def self.providers
|
@@ -0,0 +1,290 @@
|
|
1
|
+
require 'fog/core'
|
2
|
+
require 'fog/internet_archive/signaturev4'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module InternetArchive
|
6
|
+
|
7
|
+
COMPLIANT_BUCKET_NAMES = /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\-(?![\.])){1,61}[a-z0-9]$/
|
8
|
+
|
9
|
+
DOMAIN_NAME = 'us.archive.org'
|
10
|
+
|
11
|
+
extend Fog::Provider
|
12
|
+
|
13
|
+
service(:storage, 'internet_archive/storage', 'Storage')
|
14
|
+
|
15
|
+
def self.indexed_param(key, values)
|
16
|
+
params = {}
|
17
|
+
unless key.include?('%d')
|
18
|
+
key << '.%d'
|
19
|
+
end
|
20
|
+
[*values].each_with_index do |value, index|
|
21
|
+
if value.respond_to?('keys')
|
22
|
+
k = format(key, index + 1)
|
23
|
+
value.each do | vkey, vvalue |
|
24
|
+
params["#{k}.#{vkey}"] = vvalue
|
25
|
+
end
|
26
|
+
else
|
27
|
+
params[format(key, index + 1)] = value
|
28
|
+
end
|
29
|
+
end
|
30
|
+
params
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.serialize_keys(key, value, options = {})
|
34
|
+
case value
|
35
|
+
when Hash
|
36
|
+
value.each do | k, v |
|
37
|
+
options.merge!(serialize_keys("#{key}.#{k}", v))
|
38
|
+
end
|
39
|
+
return options
|
40
|
+
when Array
|
41
|
+
value.each_with_index do | it, idx |
|
42
|
+
options.merge!(serialize_keys("#{key}.member.#{(idx + 1)}", it))
|
43
|
+
end
|
44
|
+
return options
|
45
|
+
else
|
46
|
+
return {key => value}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.indexed_request_param(name, values)
|
51
|
+
idx = -1
|
52
|
+
Array(values).inject({}) do |params, value|
|
53
|
+
params["#{name}.#{idx += 1}"] = value
|
54
|
+
params
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.indexed_filters(filters)
|
59
|
+
params = {}
|
60
|
+
filters.keys.each_with_index do |key, key_index|
|
61
|
+
key_index += 1
|
62
|
+
params[format('Filter.%d.Name', key_index)] = key
|
63
|
+
[*filters[key]].each_with_index do |value, value_index|
|
64
|
+
value_index += 1
|
65
|
+
params[format('Filter.%d.Value.%d', key_index, value_index)] = value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
params
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.escape(string)
|
72
|
+
string.gsub(/([^a-zA-Z0-9_.\-~]+)/) {
|
73
|
+
"%" + $1.unpack("H2" * $1.bytesize).join("%").upcase
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.signed_params(params, options = {})
|
78
|
+
params.merge!({
|
79
|
+
'AWSAccessKeyId' => options[:ia_access_key_id],
|
80
|
+
'SignatureMethod' => 'HmacSHA256',
|
81
|
+
'SignatureVersion' => '2',
|
82
|
+
'Timestamp' => Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
83
|
+
'Version' => options[:version]
|
84
|
+
})
|
85
|
+
|
86
|
+
params.merge!({
|
87
|
+
'SecurityToken' => options[:ia_session_token]
|
88
|
+
}) if options[:ia_session_token]
|
89
|
+
|
90
|
+
body = ''
|
91
|
+
for key in params.keys.sort
|
92
|
+
unless (value = params[key]).nil?
|
93
|
+
body << "#{key}=#{escape(value.to_s)}&"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
string_to_sign = "POST\n#{options[:host]}:#{options[:port]}\n#{options[:path]}\n" << body.chop
|
97
|
+
signed_string = options[:hmac].sign(string_to_sign)
|
98
|
+
body << "Signature=#{escape(Base64.encode64(signed_string).chomp!)}"
|
99
|
+
|
100
|
+
body
|
101
|
+
end
|
102
|
+
|
103
|
+
class Mock
|
104
|
+
|
105
|
+
def self.arn(vendor, account_id, path, region = nil)
|
106
|
+
"arn:aws:#{vendor}:#{region}:#{account_id}:#{path}"
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.availability_zone(region)
|
110
|
+
"#{region}#{Fog::Mock.random_selection('abcd', 1)}"
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.box_usage
|
114
|
+
sprintf("%0.10f", rand / 100).to_f
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.console_output
|
118
|
+
# "[ 0.000000] Linux version 2.6.18-xenU-ec2-v1.2 (root@domU-12-31-39-07-51-82) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)) #2 SMP Wed Aug 19 09:04:38 EDT 2009"
|
119
|
+
Base64.decode64("WyAwLjAwMDAwMF0gTGludXggdmVyc2lvbiAyLjYuMTgteGVuVS1lYzItdjEu\nMiAocm9vdEBkb21VLTEyLTMxLTM5LTA3LTUxLTgyKSAoZ2NjIHZlcnNpb24g\nNC4xLjIgMjAwNzA2MjYgKFJlZCBIYXQgNC4xLjItMTMpKSAjMiBTTVAgV2Vk\nIEF1ZyAxOSAwOTowNDozOCBFRFQgMjAwOQ==\n")
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.dns_name_for(ip_address)
|
123
|
+
"ec2-#{ip_address.gsub('.','-')}.compute-1.amazonaws.com"
|
124
|
+
end
|
125
|
+
|
126
|
+
def self.private_dns_name_for(ip_address)
|
127
|
+
"ip-#{ip_address.gsub('.','-')}.ec2.internal"
|
128
|
+
end
|
129
|
+
|
130
|
+
def self.image
|
131
|
+
path = []
|
132
|
+
(rand(3) + 2).times do
|
133
|
+
path << Fog::Mock.random_letters(rand(9) + 8)
|
134
|
+
end
|
135
|
+
{
|
136
|
+
"imageOwnerId" => Fog::Mock.random_letters(rand(5) + 4),
|
137
|
+
"blockDeviceMapping" => [],
|
138
|
+
"productCodes" => [],
|
139
|
+
"kernelId" => kernel_id,
|
140
|
+
"ramdiskId" => ramdisk_id,
|
141
|
+
"imageState" => "available",
|
142
|
+
"imageId" => image_id,
|
143
|
+
"architecture" => "i386",
|
144
|
+
"isPublic" => true,
|
145
|
+
"imageLocation" => path.join('/'),
|
146
|
+
"imageType" => "machine",
|
147
|
+
"rootDeviceType" => ["ebs","instance-store"][rand(2)],
|
148
|
+
"rootDeviceName" => "/dev/sda1"
|
149
|
+
}
|
150
|
+
end
|
151
|
+
|
152
|
+
def self.image_id
|
153
|
+
"ami-#{Fog::Mock.random_hex(8)}"
|
154
|
+
end
|
155
|
+
|
156
|
+
def self.key_fingerprint
|
157
|
+
fingerprint = []
|
158
|
+
20.times do
|
159
|
+
fingerprint << Fog::Mock.random_hex(2)
|
160
|
+
end
|
161
|
+
fingerprint.join(':')
|
162
|
+
end
|
163
|
+
|
164
|
+
def self.instance_id
|
165
|
+
"i-#{Fog::Mock.random_hex(8)}"
|
166
|
+
end
|
167
|
+
|
168
|
+
def self.ip_address
|
169
|
+
ip = []
|
170
|
+
4.times do
|
171
|
+
ip << Fog::Mock.random_numbers(rand(3) + 1).to_i.to_s # remove leading 0
|
172
|
+
end
|
173
|
+
ip.join('.')
|
174
|
+
end
|
175
|
+
|
176
|
+
def self.private_ip_address
|
177
|
+
ip_address.gsub(/^\d{1,3}\./,"10.")
|
178
|
+
end
|
179
|
+
|
180
|
+
def self.kernel_id
|
181
|
+
"aki-#{Fog::Mock.random_hex(8)}"
|
182
|
+
end
|
183
|
+
|
184
|
+
def self.key_material
|
185
|
+
OpenSSL::PKey::RSA.generate(1024).to_s
|
186
|
+
end
|
187
|
+
|
188
|
+
def self.owner_id
|
189
|
+
Fog::Mock.random_numbers(12)
|
190
|
+
end
|
191
|
+
|
192
|
+
def self.ramdisk_id
|
193
|
+
"ari-#{Fog::Mock.random_hex(8)}"
|
194
|
+
end
|
195
|
+
|
196
|
+
def self.request_id
|
197
|
+
request_id = []
|
198
|
+
request_id << Fog::Mock.random_hex(8)
|
199
|
+
3.times do
|
200
|
+
request_id << Fog::Mock.random_hex(4)
|
201
|
+
end
|
202
|
+
request_id << Fog::Mock.random_hex(12)
|
203
|
+
request_id.join('-')
|
204
|
+
end
|
205
|
+
class << self
|
206
|
+
alias :reserved_instances_id :request_id
|
207
|
+
alias :reserved_instances_offering_id :request_id
|
208
|
+
alias :sqs_message_id :request_id
|
209
|
+
alias :sqs_sender_id :request_id
|
210
|
+
end
|
211
|
+
|
212
|
+
def self.reservation_id
|
213
|
+
"r-#{Fog::Mock.random_hex(8)}"
|
214
|
+
end
|
215
|
+
|
216
|
+
def self.snapshot_id
|
217
|
+
"snap-#{Fog::Mock.random_hex(8)}"
|
218
|
+
end
|
219
|
+
|
220
|
+
def self.volume_id
|
221
|
+
"vol-#{Fog::Mock.random_hex(8)}"
|
222
|
+
end
|
223
|
+
|
224
|
+
def self.security_group_id
|
225
|
+
"sg-#{Fog::Mock.random_hex(8)}"
|
226
|
+
end
|
227
|
+
|
228
|
+
def self.network_interface_id
|
229
|
+
"eni-#{Fog::Mock.random_hex(8)}"
|
230
|
+
end
|
231
|
+
def self.internet_gateway_id
|
232
|
+
"igw-#{Fog::Mock.random_hex(8)}"
|
233
|
+
end
|
234
|
+
def self.dhcp_options_id
|
235
|
+
"dopt-#{Fog::Mock.random_hex(8)}"
|
236
|
+
end
|
237
|
+
def self.vpc_id
|
238
|
+
"vpc-#{Fog::Mock.random_hex(8)}"
|
239
|
+
end
|
240
|
+
def self.subnet_id
|
241
|
+
"subnet-#{Fog::Mock.random_hex(8)}"
|
242
|
+
end
|
243
|
+
def self.zone_id
|
244
|
+
"zone-#{Fog::Mock.random_hex(8)}"
|
245
|
+
end
|
246
|
+
def self.change_id
|
247
|
+
"change-#{Fog::Mock.random_hex(8)}"
|
248
|
+
end
|
249
|
+
def self.nameservers
|
250
|
+
[
|
251
|
+
'ns-2048.awsdns-64.com',
|
252
|
+
'ns-2049.awsdns-65.net',
|
253
|
+
'ns-2050.awsdns-66.org',
|
254
|
+
'ns-2051.awsdns-67.co.uk'
|
255
|
+
]
|
256
|
+
end
|
257
|
+
|
258
|
+
def self.key_id(length=21)
|
259
|
+
#Probably close enough
|
260
|
+
Fog::Mock.random_selection('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',length)
|
261
|
+
end
|
262
|
+
|
263
|
+
def self.rds_address(db_name,region)
|
264
|
+
"#{db_name}.#{Fog::Mock.random_letters(rand(12) + 4)}.#{region}.rds.amazonaws.com"
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
def self.parse_security_group_options(group_name, options)
|
269
|
+
options ||= Hash.new
|
270
|
+
if group_name.is_a?(Hash)
|
271
|
+
options = group_name
|
272
|
+
elsif group_name
|
273
|
+
if options.key?('GroupName')
|
274
|
+
raise Fog::Compute::InternetArchive::Error, 'Arguments specified both group_name and GroupName in options'
|
275
|
+
end
|
276
|
+
options = options.clone
|
277
|
+
options['GroupName'] = group_name
|
278
|
+
end
|
279
|
+
name_specified = options.key?('GroupName') && !options['GroupName'].nil?
|
280
|
+
group_id_specified = options.key?('GroupId') && !options['GroupId'].nil?
|
281
|
+
unless name_specified || group_id_specified
|
282
|
+
raise Fog::Compute::InternetArchive::Error, 'Neither GroupName nor GroupId specified'
|
283
|
+
end
|
284
|
+
if name_specified && group_id_specified
|
285
|
+
options.delete('GroupName')
|
286
|
+
end
|
287
|
+
options
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|