fog 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +7 -4
- data/bin/fog +4 -1
- data/changelog.txt +464 -0
- data/docs/index.markdown +2 -2
- data/fog.gemspec +11 -11
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/auto_scaling.rb +221 -0
- data/lib/fog/aws/cloud_formation.rb +1 -1
- data/lib/fog/aws/cloud_watch.rb +110 -0
- data/lib/fog/aws/elb.rb +58 -26
- data/lib/fog/aws/iam.rb +65 -13
- data/lib/fog/aws/models/auto_scaling/activities.rb +30 -0
- data/lib/fog/aws/models/auto_scaling/activity.rb +29 -0
- data/lib/fog/aws/models/auto_scaling/configuration.rb +63 -0
- data/lib/fog/aws/models/auto_scaling/configurations.rb +35 -0
- data/lib/fog/aws/models/auto_scaling/group.rb +140 -0
- data/lib/fog/aws/models/auto_scaling/groups.rb +35 -0
- data/lib/fog/aws/models/auto_scaling/instance.rb +60 -0
- data/lib/fog/aws/models/auto_scaling/instances.rb +30 -0
- data/lib/fog/aws/models/cloud_watch/metric.rb +14 -0
- data/lib/fog/aws/models/cloud_watch/metric_statistic.rb +46 -0
- data/lib/fog/aws/models/cloud_watch/metric_statistics.rb +23 -0
- data/lib/fog/aws/models/cloud_watch/metrics.rb +32 -0
- data/lib/fog/aws/models/elb/listener.rb +6 -0
- data/lib/fog/aws/models/elb/listeners.rb +2 -2
- data/lib/fog/aws/models/elb/load_balancer.rb +8 -5
- data/lib/fog/aws/models/rds/server.rb +3 -1
- data/lib/fog/aws/parsers/auto_scaling/basic.rb +28 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_adjustment_types.rb +39 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +126 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_instances.rb +43 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +94 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb +66 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_policies.rb +66 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_scaling_activities.rb +47 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_scaling_process_types.rb +39 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_scheduled_actions.rb +46 -0
- data/lib/fog/aws/parsers/auto_scaling/put_scaling_policy.rb +30 -0
- data/lib/fog/aws/parsers/auto_scaling/terminate_instance_in_auto_scaling_group.rb +35 -0
- data/lib/fog/aws/parsers/cloud_watch/get_metric_statistics.rb +42 -0
- data/lib/fog/aws/parsers/cloud_watch/list_metrics.rb +58 -0
- data/lib/fog/aws/parsers/cloud_watch/put_metric_data.rb +26 -0
- data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +1 -1
- data/lib/fog/aws/parsers/iam/get_group_policy.rb +27 -0
- data/lib/fog/aws/parsers/iam/list_account_aliases.rb +28 -0
- data/lib/fog/aws/parsers/rds/db_engine_version_parser.rb +35 -0
- data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
- data/lib/fog/aws/parsers/rds/describe_db_engine_versions.rb +39 -0
- data/lib/fog/aws/parsers/rds/describe_db_reserved_instances.rb +43 -0
- data/lib/fog/aws/parsers/sns/add_permission.rb +24 -0
- data/lib/fog/aws/parsers/sns/confirm_subscription.rb +24 -0
- data/lib/fog/aws/parsers/sns/create_topic.rb +24 -0
- data/lib/fog/aws/parsers/sns/delete_topic.rb +24 -0
- data/lib/fog/aws/parsers/sns/get_topic_attributes.rb +32 -0
- data/lib/fog/aws/parsers/sns/list_subscriptions.rb +29 -0
- data/lib/fog/aws/parsers/sns/list_topics.rb +26 -0
- data/lib/fog/aws/parsers/sns/publish.rb +24 -0
- data/lib/fog/aws/parsers/sns/remove_permission.rb +24 -0
- data/lib/fog/aws/parsers/sns/set_topic_attributes.rb +24 -0
- data/lib/fog/aws/parsers/sns/subscribe.rb +24 -0
- data/lib/fog/aws/parsers/sns/unsubscribe.rb +24 -0
- data/lib/fog/aws/parsers/sqs/basic.rb +23 -0
- data/lib/fog/aws/parsers/sqs/create_queue.rb +26 -0
- data/lib/fog/aws/parsers/sqs/get_queue_attributes.rb +35 -0
- data/lib/fog/aws/parsers/sqs/list_queues.rb +25 -0
- data/lib/fog/aws/parsers/sqs/receive_message.rb +41 -0
- data/lib/fog/aws/parsers/sqs/send_message.rb +28 -0
- data/lib/fog/aws/rds.rb +3 -1
- data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +108 -0
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +105 -0
- data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +45 -0
- data/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb +48 -0
- data/lib/fog/aws/requests/auto_scaling/delete_policy.rb +47 -0
- data/lib/fog/aws/requests/auto_scaling/delete_scheduled_action.rb +48 -0
- data/lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb +52 -0
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb +128 -0
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb +96 -0
- data/lib/fog/aws/requests/auto_scaling/describe_launch_configurations.rb +108 -0
- data/lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb +60 -0
- data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +85 -0
- data/lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb +88 -0
- data/lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb +54 -0
- data/lib/fog/aws/requests/auto_scaling/describe_scheduled_actions.rb +83 -0
- data/lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb +56 -0
- data/lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb +66 -0
- data/lib/fog/aws/requests/auto_scaling/execute_policy.rb +50 -0
- data/lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb +66 -0
- data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +57 -0
- data/lib/fog/aws/requests/auto_scaling/resume_processes.rb +50 -0
- data/lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb +87 -0
- data/lib/fog/aws/requests/auto_scaling/set_instance_health.rb +55 -0
- data/lib/fog/aws/requests/auto_scaling/suspend_processes.rb +57 -0
- data/lib/fog/aws/requests/auto_scaling/terminate_instance_in_auto_scaling_group.rb +65 -0
- data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +79 -0
- data/lib/fog/aws/requests/cloud_watch/get_metric_statistics.rb +48 -0
- data/lib/fog/aws/requests/cloud_watch/list_metrics.rb +38 -0
- data/lib/fog/aws/requests/cloud_watch/put_metric_data.rb +73 -0
- data/lib/fog/aws/requests/elb/configure_health_check.rb +24 -0
- data/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb +21 -0
- data/lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb +21 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +55 -0
- data/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +28 -0
- data/lib/fog/aws/requests/elb/delete_load_balancer.rb +18 -0
- data/lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb +20 -1
- data/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb +23 -0
- data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +21 -5
- data/lib/fog/aws/requests/elb/describe_instance_health.rb +35 -0
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +29 -0
- data/lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb +18 -5
- data/lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb +18 -3
- data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +22 -5
- data/lib/fog/aws/requests/elb/set_load_balancer_listener_ssl_certificate.rb +40 -0
- data/lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb +37 -0
- data/lib/fog/aws/requests/iam/create_account_alias.rb +19 -0
- data/lib/fog/aws/requests/iam/delete_account_alias.rb +19 -0
- data/lib/fog/aws/requests/iam/delete_server_certificate.rb +14 -0
- data/lib/fog/aws/requests/iam/get_group_policy.rb +36 -0
- data/lib/fog/aws/requests/iam/get_server_certificate.rb +50 -0
- data/lib/fog/aws/requests/iam/list_account_aliases.rb +18 -0
- data/lib/fog/aws/requests/iam/list_server_certificates.rb +12 -0
- data/lib/fog/aws/requests/iam/put_group_policy.rb +1 -1
- data/lib/fog/aws/requests/iam/put_user_policy.rb +1 -1
- data/lib/fog/aws/requests/iam/upload_server_certificate.rb +53 -5
- data/lib/fog/aws/requests/rds/describe_db_engine_versions.rb +34 -0
- data/lib/fog/aws/requests/rds/describe_db_reserved_instances.rb +42 -0
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +29 -17
- data/lib/fog/aws/requests/simpledb/select.rb +11 -3
- data/lib/fog/aws/requests/sns/add_permission.rb +26 -0
- data/lib/fog/aws/requests/sns/confirm_subscription.rb +33 -0
- data/lib/fog/aws/requests/sns/create_topic.rb +29 -0
- data/lib/fog/aws/requests/sns/delete_topic.rb +29 -0
- data/lib/fog/aws/requests/sns/get_topic_attributes.rb +29 -0
- data/lib/fog/aws/requests/sns/list_subscriptions.rb +29 -0
- data/lib/fog/aws/requests/sns/list_subscriptions_by_topic.rb +31 -0
- data/lib/fog/aws/requests/sns/list_topics.rb +29 -0
- data/lib/fog/aws/requests/sns/publish.rb +34 -0
- data/lib/fog/aws/requests/sns/remove_permission.rb +26 -0
- data/lib/fog/aws/requests/sns/set_topic_attributes.rb +33 -0
- data/lib/fog/aws/requests/sns/subscribe.rb +33 -0
- data/lib/fog/aws/requests/sns/unsubscribe.rb +29 -0
- data/lib/fog/aws/requests/sqs/change_message_visibility.rb +33 -0
- data/lib/fog/aws/requests/sqs/create_queue.rb +31 -0
- data/lib/fog/aws/requests/sqs/delete_message.rb +31 -0
- data/lib/fog/aws/requests/sqs/delete_queue.rb +29 -0
- data/lib/fog/aws/requests/sqs/get_queue_attributes.rb +31 -0
- data/lib/fog/aws/requests/sqs/list_queues.rb +28 -0
- data/lib/fog/aws/requests/sqs/receive_message.rb +34 -0
- data/lib/fog/aws/requests/sqs/send_message.rb +31 -0
- data/lib/fog/aws/requests/sqs/set_queue_attributes.rb +33 -0
- data/lib/fog/aws/sns.rb +112 -0
- data/lib/fog/aws/sqs.rb +115 -0
- data/lib/fog/bin.rb +1 -0
- data/lib/fog/bin/aws.rb +16 -0
- data/lib/fog/bin/brightbox.rb +1 -1
- data/lib/fog/bin/ninefold.rb +5 -0
- data/lib/fog/bin/vcloud.rb +30 -0
- data/lib/fog/bin/virtual_box.rb +5 -1
- data/lib/fog/cdn/rackspace.rb +16 -8
- data/lib/fog/compute.rb +4 -1
- data/lib/fog/compute/aws.rb +16 -4
- data/lib/fog/compute/bluebox.rb +2 -2
- data/lib/fog/compute/brightbox.rb +4 -4
- data/lib/fog/compute/go_grid.rb +2 -2
- data/lib/fog/compute/linode.rb +2 -2
- data/lib/fog/compute/models/aws/server.rb +17 -3
- data/lib/fog/compute/models/aws/spot_request.rb +93 -0
- data/lib/fog/compute/models/aws/spot_requests.rb +48 -0
- data/lib/fog/compute/models/aws/volume.rb +13 -13
- data/lib/fog/compute/models/bluebox/server.rb +4 -4
- data/lib/fog/compute/models/go_grid/server.rb +2 -2
- data/lib/fog/compute/models/ninefold/server.rb +18 -14
- data/lib/fog/compute/models/rackspace/flavor.rb +3 -2
- data/lib/fog/compute/models/rackspace/server.rb +2 -2
- data/lib/fog/compute/models/slicehost/server.rb +1 -1
- data/lib/fog/compute/models/vcloud/catalog.rb +22 -0
- data/lib/fog/compute/models/vcloud/catalog_item.rb +29 -0
- data/lib/fog/compute/models/vcloud/catalog_items.rb +32 -0
- data/lib/fog/compute/models/vcloud/catalogs.rb +39 -0
- data/lib/fog/compute/models/vcloud/ip.rb +42 -0
- data/lib/fog/compute/models/vcloud/ips.rb +33 -0
- data/lib/fog/compute/models/vcloud/network.rb +65 -0
- data/lib/fog/compute/models/vcloud/networks.rb +34 -0
- data/lib/fog/compute/models/vcloud/server.rb +291 -0
- data/lib/fog/compute/models/vcloud/servers.rb +58 -0
- data/lib/fog/compute/models/vcloud/task.rb +21 -0
- data/lib/fog/compute/models/vcloud/tasks.rb +32 -0
- data/lib/fog/compute/models/vcloud/vdc.rb +56 -0
- data/lib/fog/compute/models/vcloud/vdcs.rb +40 -0
- data/lib/fog/compute/models/virtual_box/server.rb +2 -2
- data/lib/fog/compute/ninefold.rb +3 -3
- data/lib/fog/compute/parsers/aws/cancel_spot_instance_requests.rb +30 -0
- data/lib/fog/compute/parsers/aws/describe_instances.rb +9 -4
- data/lib/fog/compute/parsers/aws/describe_placement_groups.rb +30 -0
- data/lib/fog/compute/parsers/aws/describe_reserved_instances.rb +1 -1
- data/lib/fog/compute/parsers/aws/describe_reserved_instances_offerings.rb +2 -2
- data/lib/fog/compute/parsers/aws/describe_spot_price_history.rb +34 -0
- data/lib/fog/compute/parsers/aws/purchase_reserved_instances_offering.rb +24 -0
- data/lib/fog/compute/parsers/aws/run_instances.rb +17 -16
- data/lib/fog/compute/parsers/aws/spot_datafeed_subscription.rb +29 -0
- data/lib/fog/compute/parsers/aws/spot_instance_requests.rb +67 -0
- data/lib/fog/compute/rackspace.rb +6 -5
- data/lib/fog/compute/requests/aws/cancel_spot_instance_requests.rb +34 -0
- data/lib/fog/compute/requests/aws/create_placement_group.rb +34 -0
- data/lib/fog/compute/requests/aws/create_spot_datafeed_subscription.rb +41 -0
- data/lib/fog/compute/requests/aws/delete_placement_group.rb +32 -0
- data/lib/fog/compute/requests/aws/delete_spot_datafeed_subscription.rb +28 -0
- data/lib/fog/compute/requests/aws/describe_placement_groups.rb +35 -0
- data/lib/fog/compute/requests/aws/describe_reserved_instances.rb +14 -0
- data/lib/fog/compute/requests/aws/describe_reserved_instances_offerings.rb +25 -0
- data/lib/fog/compute/requests/aws/describe_spot_datafeed_subscription.rb +35 -0
- data/lib/fog/compute/requests/aws/describe_spot_instance_requests.rb +47 -0
- data/lib/fog/compute/requests/aws/describe_spot_price_history.rb +37 -0
- data/lib/fog/compute/requests/aws/describe_volumes.rb +1 -1
- data/lib/fog/compute/requests/aws/purchase_reserved_instances_offering.rb +63 -0
- data/lib/fog/compute/requests/aws/request_spot_instances.rb +83 -0
- data/lib/fog/compute/requests/aws/run_instances.rb +2 -3
- data/lib/fog/compute/requests/brightbox/activate_console_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/create_api_client.rb +1 -1
- data/lib/fog/compute/requests/brightbox/create_cloud_ip.rb +1 -1
- data/lib/fog/compute/requests/brightbox/create_image.rb +1 -1
- data/lib/fog/compute/requests/brightbox/create_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/create_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/destroy_api_client.rb +1 -1
- data/lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb +1 -1
- data/lib/fog/compute/requests/brightbox/destroy_image.rb +1 -1
- data/lib/fog/compute/requests/brightbox/destroy_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/destroy_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_account.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_api_client.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_cloud_ip.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_image.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_interface.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_server_type.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_user.rb +1 -1
- data/lib/fog/compute/requests/brightbox/get_zone.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_api_clients.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_cloud_ips.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_images.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_load_balancers.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_server_types.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_servers.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_users.rb +1 -1
- data/lib/fog/compute/requests/brightbox/list_zones.rb +1 -1
- data/lib/fog/compute/requests/brightbox/map_cloud_ip.rb +1 -1
- data/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb +1 -1
- data/lib/fog/compute/requests/brightbox/resize_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/shutdown_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/snapshot_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/start_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/stop_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb +1 -1
- data/lib/fog/compute/requests/brightbox/update_account.rb +1 -1
- data/lib/fog/compute/requests/brightbox/update_api_client.rb +1 -1
- data/lib/fog/compute/requests/brightbox/update_image.rb +1 -1
- data/lib/fog/compute/requests/brightbox/update_load_balancer.rb +1 -1
- data/lib/fog/compute/requests/brightbox/update_server.rb +1 -1
- data/lib/fog/compute/requests/brightbox/update_user.rb +1 -1
- data/lib/fog/compute/requests/linode/linode_disk_createfromstackscript.rb +1 -1
- data/lib/fog/compute/requests/rackspace/create_image.rb +1 -1
- data/lib/fog/compute/requests/rackspace/create_server.rb +1 -1
- data/lib/fog/compute/requests/rackspace/server_action.rb +2 -2
- data/lib/fog/compute/requests/rackspace/update_server.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/add_balancer_node.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/clone_server.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/create_server.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/delete_server.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/get_server.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/get_stats.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/list_balancers.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/list_configs.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/list_images.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/list_private_ips.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/list_servers.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/list_templates.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/reboot_server.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/remove_balancer_node.rb +1 -1
- data/lib/fog/compute/requests/storm_on_demand/resize_server.rb +1 -1
- data/lib/fog/compute/requests/vcloud/clone_vapp.rb +40 -0
- data/lib/fog/compute/requests/vcloud/configure_network.rb +43 -0
- data/lib/fog/compute/requests/vcloud/configure_network_ip.rb +46 -0
- data/lib/fog/compute/requests/vcloud/configure_node.rb +38 -0
- data/lib/fog/compute/requests/vcloud/configure_vapp.rb +112 -0
- data/lib/fog/compute/requests/vcloud/configure_vm.rb +247 -0
- data/lib/fog/compute/requests/vcloud/configure_vm_disks.rb +100 -0
- data/lib/fog/compute/requests/vcloud/configure_vm_memory.rb +40 -0
- data/lib/fog/compute/requests/vcloud/configure_vm_name_description.rb +30 -0
- data/lib/fog/compute/requests/vcloud/delete_node.rb +10 -0
- data/lib/fog/compute/requests/vcloud/delete_vapp.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_catalog.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_catalog_item.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_customization_options.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_network.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_network_extensions.rb +11 -0
- data/lib/fog/compute/requests/vcloud/get_network_ip.rb +15 -0
- data/lib/fog/compute/requests/vcloud/get_network_ips.rb +15 -0
- data/lib/fog/compute/requests/vcloud/get_organization.rb +11 -0
- data/lib/fog/compute/requests/vcloud/get_task.rb +11 -0
- data/lib/fog/compute/requests/vcloud/get_task_list.rb +11 -0
- data/lib/fog/compute/requests/vcloud/get_vapp.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_vapp_template.rb +11 -0
- data/lib/fog/compute/requests/vcloud/get_vdc.rb +10 -0
- data/lib/fog/compute/requests/vcloud/get_vm_disks.rb +16 -0
- data/lib/fog/compute/requests/vcloud/get_vm_memory.rb +16 -0
- data/lib/fog/compute/requests/vcloud/instantiate_vapp_template.rb +83 -0
- data/lib/fog/compute/requests/vcloud/login.rb +23 -0
- data/lib/fog/compute/requests/vcloud/power_off.rb +10 -0
- data/lib/fog/compute/requests/vcloud/power_on.rb +11 -0
- data/lib/fog/compute/requests/vcloud/power_reset.rb +11 -0
- data/lib/fog/compute/requests/vcloud/power_shutdown.rb +11 -0
- data/lib/fog/compute/requests/vcloud/undeploy.rb +23 -0
- data/lib/fog/compute/storm_on_demand.rb +2 -2
- data/lib/fog/compute/vcloud.rb +310 -0
- data/lib/fog/core.rb +2 -1
- data/lib/fog/core/attributes.rb +23 -11
- data/lib/fog/core/collection.rb +7 -7
- data/lib/fog/core/credentials.rb +4 -2
- data/lib/fog/core/model.rb +4 -4
- data/lib/fog/core/time.rb +1 -2
- data/lib/fog/core/timeout.rb +11 -0
- data/lib/fog/core/wait_for.rb +2 -2
- data/lib/fog/dns/dnsimple.rb +2 -2
- data/lib/fog/dns/dnsmadeeasy.rb +2 -2
- data/lib/fog/dns/linode.rb +2 -2
- data/lib/fog/dns/requests/dnsimple/create_domain.rb +1 -1
- data/lib/fog/dns/requests/dnsimple/create_record.rb +1 -1
- data/lib/fog/dns/requests/dnsimple/update_record.rb +1 -1
- data/lib/fog/dns/requests/dnsmadeeasy/create_record.rb +1 -1
- data/lib/fog/dns/requests/dnsmadeeasy/create_secondary.rb +1 -1
- data/lib/fog/dns/requests/dnsmadeeasy/update_record.rb +1 -1
- data/lib/fog/dns/requests/dnsmadeeasy/update_secondary.rb +1 -1
- data/lib/fog/providers.rb +1 -0
- data/lib/fog/providers/aws.rb +15 -2
- data/lib/fog/providers/ninefold.rb +1 -0
- data/lib/fog/providers/rackspace.rb +4 -3
- data/lib/fog/providers/vcloud.rb +11 -0
- data/lib/fog/storage.rb +9 -6
- data/lib/fog/storage/aws.rb +18 -1
- data/lib/fog/storage/google.rb +19 -1
- data/lib/fog/storage/models/aws/file.rb +3 -3
- data/lib/fog/storage/models/aws/files.rb +9 -2
- data/lib/fog/storage/models/google/files.rb +9 -2
- data/lib/fog/storage/models/ninefold/directories.rb +48 -0
- data/lib/fog/storage/models/ninefold/directory.rb +53 -0
- data/lib/fog/storage/models/ninefold/file.rb +99 -0
- data/lib/fog/storage/models/ninefold/files.rb +72 -0
- data/lib/fog/storage/models/rackspace/directory.rb +7 -2
- data/lib/fog/storage/ninefold.rb +149 -0
- data/lib/fog/storage/rackspace.rb +8 -2
- data/lib/fog/storage/requests/aws/get_bucket_policy.rb +1 -1
- data/lib/fog/storage/requests/aws/get_object.rb +6 -2
- data/lib/fog/storage/requests/aws/get_object_http_url.rb +51 -0
- data/lib/fog/storage/requests/aws/get_object_https_url.rb +51 -0
- data/lib/fog/storage/requests/aws/get_object_url.rb +4 -24
- data/lib/fog/storage/requests/aws/post_object_hidden_fields.rb +1 -1
- data/lib/fog/storage/requests/aws/put_bucket_policy.rb +1 -1
- data/lib/fog/storage/requests/google/get_object_http_url.rb +51 -0
- data/lib/fog/storage/requests/google/get_object_https_url.rb +51 -0
- data/lib/fog/storage/requests/google/get_object_url.rb +8 -25
- data/lib/fog/storage/requests/ninefold/delete_namespace.rb +19 -0
- data/lib/fog/storage/requests/ninefold/get_namespace.rb +20 -0
- data/lib/fog/storage/requests/ninefold/post_namespace.rb +20 -0
- data/lib/fog/storage/requests/ninefold/put_namespace.rb +20 -0
- data/lib/fog/storage/requests/rackspace/put_object.rb +3 -0
- data/lib/fog/storage/requests/rackspace/put_object_manifest.rb +25 -0
- data/tests/aws/models/auto_scaling/activities_tests.rb +6 -0
- data/tests/aws/models/auto_scaling/configuration_test.rb +13 -0
- data/tests/aws/models/auto_scaling/configurations_tests.rb +11 -0
- data/tests/aws/models/auto_scaling/helper.rb +0 -0
- data/tests/aws/models/auto_scaling/instances_tests.rb +6 -0
- data/tests/aws/models/cloud_watch/metric_statistics_tests.rb +51 -0
- data/tests/aws/models/cloud_watch/metrics_tests.rb +17 -0
- data/tests/aws/{requests → models}/elb/model_tests.rb +82 -18
- data/tests/aws/models/rds/security_group_tests.rb +1 -1
- data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +80 -0
- data/tests/aws/requests/auto_scaling/helper.rb +185 -0
- data/tests/aws/requests/auto_scaling/model_tests.rb +235 -0
- data/tests/aws/requests/cloud_formation/stack_tests.rb +1 -1
- data/tests/aws/requests/cloud_watch/get_metric_statistics_tests.rb +28 -0
- data/tests/aws/requests/cloud_watch/list_metrics_test.rb +64 -0
- data/tests/aws/requests/cloud_watch/put_metric_data_tests.rb +36 -0
- data/tests/aws/requests/elb/listener_tests.rb +50 -0
- data/tests/aws/requests/elb/load_balancer_tests.rb +23 -44
- data/tests/aws/requests/elb/policy_tests.rb +41 -0
- data/tests/aws/requests/iam/helper.rb +29 -0
- data/tests/aws/requests/iam/login_profile_tests.rb +2 -2
- data/tests/aws/requests/iam/server_certificate_tests.rb +39 -6
- data/tests/aws/requests/rds/helper.rb +1 -0
- data/tests/aws/requests/simpledb/attributes_tests.rb +10 -15
- data/tests/aws/requests/sns/helper.rb +9 -0
- data/tests/aws/requests/sns/subscription_tests.rb +86 -0
- data/tests/aws/requests/sns/topic_tests.rb +50 -0
- data/tests/aws/requests/sqs/helper.rb +15 -0
- data/tests/aws/requests/sqs/message_tests.rb +57 -0
- data/tests/aws/requests/sqs/queue_tests.rb +55 -0
- data/tests/aws/signed_params_tests.rb +3 -1
- data/tests/compute/models/aws/volume_tests.rb +13 -0
- data/tests/compute/models/vcloud/helper.rb +25 -0
- data/tests/compute/models/vcloud/servers_tests.rb +95 -0
- data/tests/compute/requests/aws/address_tests.rb +1 -1
- data/tests/compute/requests/aws/instance_tests.rb +65 -4
- data/tests/compute/requests/aws/placement_group_tests.rb +48 -0
- data/tests/compute/requests/aws/spot_datafeed_subscription_tests.rb +47 -0
- data/tests/compute/requests/aws/spot_instance_tests.rb +53 -0
- data/tests/compute/requests/aws/spot_price_history_tests.rb +24 -0
- data/tests/compute/requests/aws/volume_tests.rb +4 -0
- data/tests/compute/requests/brightbox/helper.rb +2 -1
- data/tests/compute/requests/brightbox/interface_tests.rb +4 -4
- data/tests/compute/requests/ninefold/helper.rb +1 -1
- data/tests/compute/requests/vcloud/disk_configure_tests.rb +114 -0
- data/tests/compute/requests/voxel/server_tests.rb +2 -2
- data/tests/core/attribute_tests.rb +10 -1
- data/tests/core/credential_tests.rb +6 -0
- data/tests/core/timeout_tests.rb +10 -0
- data/tests/helpers/collection_helper.rb +4 -1
- data/tests/helpers/formats_helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +5 -0
- data/tests/storage/helper.rb +4 -1
- data/tests/storage/models/ninefold/file_update_tests.rb +19 -0
- data/tests/storage/models/ninefold/nested_directories_tests.rb +23 -0
- data/tests/storage/requests/aws/multipart_upload_tests.rb +2 -5
- data/tests/storage/requests/rackspace/large_object_tests.rb +47 -0
- metadata +366 -105
data/lib/fog/core/collection.rb
CHANGED
@@ -6,19 +6,19 @@ module Fog
|
|
6
6
|
|
7
7
|
Array.public_instance_methods(false).each do |method|
|
8
8
|
unless [:reject, :select, :slice].include?(method.to_sym)
|
9
|
-
class_eval <<-
|
9
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
10
10
|
def #{method}(*args)
|
11
11
|
unless @loaded
|
12
12
|
lazy_load
|
13
13
|
end
|
14
14
|
super
|
15
15
|
end
|
16
|
-
|
16
|
+
EOS
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
%w[reject select slice].each do |method|
|
21
|
-
class_eval <<-
|
21
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
22
22
|
def #{method}(*args)
|
23
23
|
unless @loaded
|
24
24
|
lazy_load
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
data = super
|
27
27
|
result = self.clone.clear.concat(data)
|
28
28
|
end
|
29
|
-
|
29
|
+
EOS
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.model(new_model=nil)
|
@@ -115,9 +115,9 @@ module Fog
|
|
115
115
|
Formatador.display_table(self.map {|instance| instance.attributes}, attributes)
|
116
116
|
end
|
117
117
|
|
118
|
-
def to_json
|
119
|
-
require '
|
120
|
-
self.map {|member| member.attributes}
|
118
|
+
def to_json(options = {})
|
119
|
+
require 'multi_json'
|
120
|
+
MultiJson.encode(self.map {|member| member.attributes})
|
121
121
|
end
|
122
122
|
|
123
123
|
private
|
data/lib/fog/core/credentials.rb
CHANGED
@@ -21,6 +21,8 @@ module Fog
|
|
21
21
|
@credential_path ||= begin
|
22
22
|
path = ENV["FOG_RC"] || (ENV['HOME'] && File.directory?(ENV['HOME']) && '~/.fog')
|
23
23
|
File.expand_path(path) if path
|
24
|
+
rescue
|
25
|
+
nil
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
@@ -45,9 +47,9 @@ module Fog
|
|
45
47
|
|
46
48
|
def self.symbolize_credentials(args)
|
47
49
|
if args.is_a? Hash
|
48
|
-
Hash[ args.collect do |key, value|
|
50
|
+
Hash[ *args.collect do |key, value|
|
49
51
|
[key.to_sym, self.symbolize_credentials(value)]
|
50
|
-
end ]
|
52
|
+
end.flatten ]
|
51
53
|
else
|
52
54
|
args
|
53
55
|
end
|
data/lib/fog/core/model.rb
CHANGED
@@ -37,12 +37,12 @@ module Fog
|
|
37
37
|
self
|
38
38
|
end
|
39
39
|
|
40
|
-
def to_json
|
41
|
-
require '
|
42
|
-
attributes
|
40
|
+
def to_json(options = {})
|
41
|
+
require 'multi_json'
|
42
|
+
MultiJson.encode(attributes)
|
43
43
|
end
|
44
44
|
|
45
|
-
def wait_for(timeout=
|
45
|
+
def wait_for(timeout=Fog.timeout, interval=1, &block)
|
46
46
|
reload
|
47
47
|
retries = 3
|
48
48
|
Fog.wait_for(timeout, interval) do
|
data/lib/fog/core/time.rb
CHANGED
@@ -19,8 +19,7 @@ module Fog
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def to_date_header
|
22
|
-
|
23
|
-
now.strftime("#{DAYS[now.wday]}, %d #{MONTHS[now.month - 1]} %Y %H:%M:%S +0000")
|
22
|
+
self.utc.strftime("#{DAYS[self.utc.wday]}, %d #{MONTHS[self.utc.month - 1]} %Y %H:%M:%S +0000")
|
24
23
|
end
|
25
24
|
|
26
25
|
end
|
data/lib/fog/core/wait_for.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
2
|
|
3
|
-
def self.wait_for(timeout=
|
3
|
+
def self.wait_for(timeout=Fog.timeout, interval=1, &block)
|
4
4
|
duration = 0
|
5
5
|
start = Time.now
|
6
6
|
until yield || duration > timeout
|
@@ -14,4 +14,4 @@ module Fog
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
end
|
17
|
+
end
|
data/lib/fog/dns/dnsimple.rb
CHANGED
@@ -52,7 +52,7 @@ module Fog
|
|
52
52
|
class Real
|
53
53
|
|
54
54
|
def initialize(options={})
|
55
|
-
require '
|
55
|
+
require 'multi_json'
|
56
56
|
|
57
57
|
@dnsimple_email = options[:dnsimple_email]
|
58
58
|
@dnsimple_password = options[:dnsimple_password]
|
@@ -82,7 +82,7 @@ module Fog
|
|
82
82
|
response = @connection.request(params.merge!({:host => @host}))
|
83
83
|
|
84
84
|
unless response.body.empty?
|
85
|
-
response.body =
|
85
|
+
response.body = MultiJson.decode(response.body)
|
86
86
|
end
|
87
87
|
response
|
88
88
|
end
|
data/lib/fog/dns/dnsmadeeasy.rb
CHANGED
@@ -77,7 +77,7 @@ module Fog
|
|
77
77
|
# * dns object with connection to aws.
|
78
78
|
def initialize(options={})
|
79
79
|
require 'fog/core/parser'
|
80
|
-
require '
|
80
|
+
require 'multi_json'
|
81
81
|
|
82
82
|
@dnsmadeeasy_api_key = options[:dnsmadeeasy_api_key]
|
83
83
|
@dnsmadeeasy_secret_key = options[:dnsmadeeasy_secret_key]
|
@@ -117,7 +117,7 @@ module Fog
|
|
117
117
|
end
|
118
118
|
|
119
119
|
unless response.body.empty?
|
120
|
-
response.body =
|
120
|
+
response.body = MultiJson.decode(response.body)
|
121
121
|
end
|
122
122
|
|
123
123
|
response
|
data/lib/fog/dns/linode.rb
CHANGED
@@ -50,7 +50,7 @@ module Fog
|
|
50
50
|
class Real
|
51
51
|
|
52
52
|
def initialize(options={})
|
53
|
-
require '
|
53
|
+
require 'multi_json'
|
54
54
|
@linode_api_key = options[:linode_api_key]
|
55
55
|
@host = options[:host] || "api.linode.com"
|
56
56
|
@port = options[:port] || 443
|
@@ -69,7 +69,7 @@ module Fog
|
|
69
69
|
response = @connection.request(params.merge!({:host => @host}))
|
70
70
|
|
71
71
|
unless response.body.empty?
|
72
|
-
response.body =
|
72
|
+
response.body = MultiJson.decode(response.body)
|
73
73
|
if data = response.body['ERRORARRAY'].first
|
74
74
|
error = case data['ERRORCODE']
|
75
75
|
when 5
|
data/lib/fog/providers.rb
CHANGED
@@ -21,6 +21,7 @@ require 'fog/providers/ninefold'
|
|
21
21
|
require 'fog/providers/rackspace'
|
22
22
|
require 'fog/providers/slicehost'
|
23
23
|
require 'fog/providers/storm_on_demand'
|
24
|
+
require 'fog/providers/vcloud'
|
24
25
|
require 'fog/providers/virtual_box'
|
25
26
|
require 'fog/providers/voxel'
|
26
27
|
require 'fog/providers/zerigo'
|
data/lib/fog/providers/aws.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'fog/core'
|
2
|
-
require 'fog/core/parser'
|
3
2
|
require 'openssl' # For RSA key pairs
|
4
3
|
require 'base64' # For console output
|
5
4
|
|
@@ -8,15 +7,19 @@ module Fog
|
|
8
7
|
|
9
8
|
extend Fog::Provider
|
10
9
|
|
10
|
+
service(:auto_scaling, 'aws/auto_scaling')
|
11
11
|
service(:cdn, 'cdn/aws')
|
12
12
|
service(:compute, 'compute/aws')
|
13
13
|
service(:cloud_formation, 'aws/cloud_formation')
|
14
|
+
service(:cloud_watch, 'aws/cloud_watch')
|
14
15
|
service(:dns, 'dns/aws')
|
15
16
|
service(:elb, 'aws/elb')
|
16
17
|
service(:iam, 'aws/iam')
|
17
18
|
service(:rds, 'aws/rds')
|
18
19
|
service(:ses, 'aws/ses')
|
19
20
|
service(:simpledb, 'aws/simpledb')
|
21
|
+
service(:sns, 'aws/sns')
|
22
|
+
service(:sqs, 'aws/sqs')
|
20
23
|
service(:storage, 'storage/aws')
|
21
24
|
|
22
25
|
def self.indexed_param(key, values)
|
@@ -44,7 +47,9 @@ module Fog
|
|
44
47
|
end
|
45
48
|
|
46
49
|
def self.escape(string)
|
47
|
-
string.gsub(
|
50
|
+
string.gsub(/([^a-zA-Z0-9_.\-~]+)/) {
|
51
|
+
"%" + $1.unpack("H2" * $1.bytesize).join("%").upcase
|
52
|
+
}
|
48
53
|
end
|
49
54
|
|
50
55
|
def self.signed_params(params, options = {})
|
@@ -71,6 +76,10 @@ module Fog
|
|
71
76
|
|
72
77
|
class Mock
|
73
78
|
|
79
|
+
def self.arn(vendor, account_id, path, region = nil)
|
80
|
+
"arn:aws:#{vendor}:#{region}:#{account_id}:#{path}"
|
81
|
+
end
|
82
|
+
|
74
83
|
def self.availability_zone(region)
|
75
84
|
"#{region}#{Fog::Mock.random_selection('abcd', 1)}"
|
76
85
|
end
|
@@ -167,6 +176,10 @@ module Fog
|
|
167
176
|
request_id << Fog::Mock.random_hex(12)
|
168
177
|
request_id.join('-')
|
169
178
|
end
|
179
|
+
class << self
|
180
|
+
alias :reserved_instances_id :request_id
|
181
|
+
alias :reserved_instances_offering_id :request_id
|
182
|
+
end
|
170
183
|
|
171
184
|
def self.reservation_id
|
172
185
|
"r-#{Fog::Mock.random_hex(8)}"
|
@@ -13,18 +13,19 @@ module Fog
|
|
13
13
|
rackspace_auth_url = options[:rackspace_auth_url] || "auth.api.rackspacecloud.com"
|
14
14
|
url = rackspace_auth_url.match(/^https?:/) ? \
|
15
15
|
rackspace_auth_url : 'https://' + rackspace_auth_url
|
16
|
+
uri = URI.parse(url)
|
16
17
|
connection = Fog::Connection.new(url)
|
17
18
|
@rackspace_api_key = options[:rackspace_api_key]
|
18
19
|
@rackspace_username = options[:rackspace_username]
|
19
20
|
response = connection.request({
|
20
|
-
:expects => 204,
|
21
|
+
:expects => [200, 204],
|
21
22
|
:headers => {
|
22
23
|
'X-Auth-Key' => @rackspace_api_key,
|
23
24
|
'X-Auth-User' => @rackspace_username
|
24
25
|
},
|
25
|
-
:host =>
|
26
|
+
:host => uri.host,
|
26
27
|
:method => 'GET',
|
27
|
-
:path => 'v1.0'
|
28
|
+
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v1.0'
|
28
29
|
})
|
29
30
|
response.headers.reject do |key, value|
|
30
31
|
!['X-Server-Management-Url', 'X-Storage-Url', 'X-CDN-Management-Url', 'X-Auth-Token'].include?(key)
|
data/lib/fog/storage.rb
CHANGED
@@ -17,6 +17,9 @@ module Fog
|
|
17
17
|
when :local
|
18
18
|
require 'fog/storage/local'
|
19
19
|
Fog::Storage::Local.new(attributes)
|
20
|
+
when :ninefold
|
21
|
+
require 'fog/storage/ninefold'
|
22
|
+
Fog::Storage::Ninefold.new(attributes)
|
20
23
|
when :rackspace
|
21
24
|
require 'fog/storage/rackspace'
|
22
25
|
Fog::Storage::Rackspace.new(attributes)
|
@@ -27,7 +30,7 @@ module Fog
|
|
27
30
|
|
28
31
|
def self.directories
|
29
32
|
directories = []
|
30
|
-
for provider in [:aws, :google, :local, :rackspace]
|
33
|
+
for provider in [:aws, :google, :local, :ninefold, :rackspace]
|
31
34
|
begin
|
32
35
|
directories.concat(self[provider].directories)
|
33
36
|
rescue # ignore any missing credentials/etc
|
@@ -50,17 +53,17 @@ module Fog
|
|
50
53
|
0
|
51
54
|
end
|
52
55
|
end
|
53
|
-
|
56
|
+
|
54
57
|
def self.parse_data(data)
|
55
58
|
metadata = {
|
56
59
|
:body => nil,
|
57
60
|
:headers => {}
|
58
61
|
}
|
59
|
-
|
62
|
+
|
60
63
|
metadata[:body] = data
|
61
64
|
metadata[:headers]['Content-Length'] = get_body_size(data)
|
62
|
-
|
63
|
-
if data.respond_to?(:path)
|
65
|
+
|
66
|
+
if data.respond_to?(:path) and !data.path.nil?
|
64
67
|
filename = ::File.basename(data.path)
|
65
68
|
unless (mime_types = MIME::Types.of(filename)).empty?
|
66
69
|
metadata[:headers]['Content-Type'] = mime_types.first.content_type
|
@@ -69,6 +72,6 @@ module Fog
|
|
69
72
|
# metadata[:headers]['Content-MD5'] = Base64.encode64(Digest::MD5.digest(metadata[:body])).strip
|
70
73
|
metadata
|
71
74
|
end
|
72
|
-
|
75
|
+
|
73
76
|
end
|
74
77
|
end
|
data/lib/fog/storage/aws.rb
CHANGED
@@ -30,6 +30,8 @@ module Fog
|
|
30
30
|
request :get_object
|
31
31
|
request :get_object_acl
|
32
32
|
request :get_object_torrent
|
33
|
+
request :get_object_http_url
|
34
|
+
request :get_object_https_url
|
33
35
|
request :get_object_url
|
34
36
|
request :get_request_payment
|
35
37
|
request :get_service
|
@@ -60,7 +62,22 @@ module Fog
|
|
60
62
|
)
|
61
63
|
end
|
62
64
|
|
65
|
+
def http_url(params, expires)
|
66
|
+
"http://" << host_path_query(params, expires)
|
67
|
+
end
|
68
|
+
|
69
|
+
def https_url(params, expires)
|
70
|
+
"https://" << host_path_query(params, expires)
|
71
|
+
end
|
72
|
+
|
63
73
|
def url(params, expires)
|
74
|
+
Formatador.display_line("[yellow][WARN] #{Fog::Storage::AWS} => #url is deprecated, use #https_url instead[/] [light_black](#{caller.first})[/]")
|
75
|
+
https_url(params, expires)
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def host_path_query(params, expires)
|
64
81
|
params[:headers] ||= {}
|
65
82
|
params[:headers]['Date'] = expires.to_i
|
66
83
|
params[:path] = Fog::AWS.escape(params[:path]).gsub('%2F', '/')
|
@@ -73,7 +90,7 @@ module Fog
|
|
73
90
|
query << "AWSAccessKeyId=#{@aws_access_key_id}"
|
74
91
|
query << "Signature=#{Fog::AWS.escape(signature(params))}"
|
75
92
|
query << "Expires=#{params[:headers]['Date']}"
|
76
|
-
"
|
93
|
+
"#{@host}/#{params[:path]}?#{query.join('&')}"
|
77
94
|
end
|
78
95
|
|
79
96
|
end
|
data/lib/fog/storage/google.rb
CHANGED
@@ -20,6 +20,8 @@ module Fog
|
|
20
20
|
request :get_object
|
21
21
|
request :get_object_acl
|
22
22
|
request :get_object_torrent
|
23
|
+
request :get_object_http_url
|
24
|
+
request :get_object_https_url
|
23
25
|
request :get_object_url
|
24
26
|
request :get_service
|
25
27
|
request :head_object
|
@@ -30,14 +32,30 @@ module Fog
|
|
30
32
|
|
31
33
|
module Utils
|
32
34
|
|
35
|
+
|
36
|
+
def http_url(params, expires)
|
37
|
+
"http://" << host_path_query(params, expires)
|
38
|
+
end
|
39
|
+
|
40
|
+
def https_url(params, expires)
|
41
|
+
"https://" << host_path_query(params, expires)
|
42
|
+
end
|
43
|
+
|
33
44
|
def url(params, expires)
|
45
|
+
Formatador.display_line("[yellow][WARN] Fog::Storage::Google => #url is deprecated, use #https_url instead[/] [light_black](#{caller.first})[/]")
|
46
|
+
https_url(params, expires)
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def host_path_query(params, expires)
|
34
52
|
params[:headers]['Date'] = expires.to_i
|
35
53
|
params[:path] = CGI.escape(params[:path]).gsub('%2F', '/')
|
36
54
|
query = [params[:query]].compact
|
37
55
|
query << "GoogleAccessKeyId=#{@google_storage_access_key_id}"
|
38
56
|
query << "Signature=#{CGI.escape(signature(params))}"
|
39
57
|
query << "Expires=#{params[:headers]['Date']}"
|
40
|
-
"
|
58
|
+
"#{params[:host]}/#{params[:path]}?#{query.join('&')}"
|
41
59
|
end
|
42
60
|
|
43
61
|
end
|