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/bin.rb
CHANGED
data/lib/fog/bin/aws.rb
CHANGED
@@ -3,10 +3,14 @@ class AWS < Fog::Bin
|
|
3
3
|
|
4
4
|
def class_for(key)
|
5
5
|
case key
|
6
|
+
when :auto_scaling
|
7
|
+
Fog::AWS::AutoScaling
|
6
8
|
when :cdn
|
7
9
|
Fog::CDN::AWS
|
8
10
|
when :cloud_formation
|
9
11
|
Fog::AWS::CloudFormation
|
12
|
+
when :cloud_watch
|
13
|
+
Fog::AWS::CloudWatch
|
10
14
|
when :compute
|
11
15
|
Fog::Compute::AWS
|
12
16
|
when :dns
|
@@ -19,10 +23,14 @@ class AWS < Fog::Bin
|
|
19
23
|
Fog::AWS::SimpleDB
|
20
24
|
when :ses
|
21
25
|
Fog::AWS::SES
|
26
|
+
when :sqs
|
27
|
+
Fog::AWS::SQS
|
22
28
|
when :eu_storage, :storage
|
23
29
|
Fog::Storage::AWS
|
24
30
|
when :rds
|
25
31
|
Fog::AWS::RDS
|
32
|
+
when :sns
|
33
|
+
Fog::AWS::SNS
|
26
34
|
else
|
27
35
|
# @todo Replace most instances of ArgumentError with NotImplementedError
|
28
36
|
# @todo For a list of widely supported Exceptions, see:
|
@@ -34,11 +42,15 @@ class AWS < Fog::Bin
|
|
34
42
|
def [](service)
|
35
43
|
@@connections ||= Hash.new do |hash, key|
|
36
44
|
hash[key] = case key
|
45
|
+
when :auto_scaling
|
46
|
+
Fog::AWS::AutoScaling.new
|
37
47
|
when :cdn
|
38
48
|
Formatador.display_line("[yellow][WARN] AWS[:cdn] is deprecated, use CDN[:aws] instead[/]")
|
39
49
|
Fog::CDN.new(:provider => 'AWS')
|
40
50
|
when :cloud_formation
|
41
51
|
Fog::AWS::CloudFormation.new
|
52
|
+
when :cloud_watch
|
53
|
+
Fog::AWS::CloudWatch.new
|
42
54
|
when :compute
|
43
55
|
Formatador.display_line("[yellow][WARN] AWS[:compute] is deprecated, use Compute[:aws] instead[/]")
|
44
56
|
Fog::Compute.new(:provider => 'AWS')
|
@@ -57,9 +69,13 @@ class AWS < Fog::Bin
|
|
57
69
|
Fog::AWS::SimpleDB.new
|
58
70
|
when :ses
|
59
71
|
Fog::AWS::SES.new
|
72
|
+
when :sqs
|
73
|
+
Fog::AWS::SQS.new
|
60
74
|
when :storage
|
61
75
|
Formatador.display_line("[yellow][WARN] AWS[:storage] is deprecated, use Storage[:aws] instead[/]")
|
62
76
|
Fog::Storage.new(:provider => 'AWS')
|
77
|
+
when :sns
|
78
|
+
Fog::AWS::SNS.new
|
63
79
|
else
|
64
80
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
65
81
|
end
|
data/lib/fog/bin/brightbox.rb
CHANGED
@@ -14,7 +14,7 @@ class Brightbox < Fog::Bin
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
15
15
|
hash[key] = case key
|
16
16
|
when :compute
|
17
|
-
Formatador.display_line("[yellow][WARN] Brightbox[:compute] is deprecated, use
|
17
|
+
Formatador.display_line("[yellow][WARN] Brightbox[:compute] is deprecated, use Compute[:brightbox] instead[/]")
|
18
18
|
Fog::Compute.new(:provider => 'Brightbox')
|
19
19
|
else
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/ninefold.rb
CHANGED
@@ -5,6 +5,8 @@ class Ninefold < Fog::Bin
|
|
5
5
|
case key
|
6
6
|
when :compute
|
7
7
|
Fog::Compute::Ninefold
|
8
|
+
when :storage
|
9
|
+
Fog::Storage::Ninefold
|
8
10
|
else
|
9
11
|
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
10
12
|
end
|
@@ -16,6 +18,9 @@ class Ninefold < Fog::Bin
|
|
16
18
|
when :compute
|
17
19
|
Formatador.display_line("[yellow][WARN] Ninefold[:compute] is deprecated, use Compute[:ninefold] instead[/]")
|
18
20
|
Fog::Compute.new(:provider => 'Ninefold')
|
21
|
+
when :storage
|
22
|
+
Formatador.display_line("[yellow][WARN] Ninefold[:storage] is deprecated, use Storage[:ninefold] instead[/]")
|
23
|
+
Fog::Storage.new(:provider => 'Ninefold')
|
19
24
|
else
|
20
25
|
raise ArgumentError, "Unrecognized service: #{service}"
|
21
26
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class Vcloud < Fog::Bin
|
2
|
+
class << self
|
3
|
+
|
4
|
+
def class_for(key)
|
5
|
+
case key
|
6
|
+
when :compute
|
7
|
+
Fog::Vcloud::Compute
|
8
|
+
else
|
9
|
+
raise ArgumentError, "Unrecognized service: #{key}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def [](service)
|
14
|
+
@@connections ||= Hash.new do |hash, key|
|
15
|
+
hash[key] = case key
|
16
|
+
when :compute
|
17
|
+
Fog::Compute.new(:provider => 'Vcloud')
|
18
|
+
else
|
19
|
+
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
@@connections[service]
|
23
|
+
end
|
24
|
+
|
25
|
+
def services
|
26
|
+
Fog::Vcloud.services
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
data/lib/fog/bin/virtual_box.rb
CHANGED
@@ -24,7 +24,11 @@ module VirtualBox # deviates from other bin stuff to accomodate gem
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def available?
|
27
|
-
availability =
|
27
|
+
availability = if Gem::Specification.respond_to?(:find_all_by_name)
|
28
|
+
!Gem::Specification.find_all_by_name('virtualbox').empty? # newest rubygems
|
29
|
+
else
|
30
|
+
!Gem.source_index.find_name('virtualbox').empty? # legacy
|
31
|
+
end
|
28
32
|
if availability
|
29
33
|
for service in services
|
30
34
|
for collection in self.class_for(service).collections
|
data/lib/fog/cdn/rackspace.rb
CHANGED
@@ -42,16 +42,24 @@ module Fog
|
|
42
42
|
class Real
|
43
43
|
|
44
44
|
def initialize(options={})
|
45
|
-
require '
|
45
|
+
require 'multi_json'
|
46
46
|
credentials = Fog::Rackspace.authenticate(options)
|
47
47
|
@auth_token = credentials['X-Auth-Token']
|
48
|
+
@enabled = false
|
49
|
+
|
50
|
+
if credentials['X-CDN-Management-Url']
|
51
|
+
uri = URI.parse(credentials['X-CDN-Management-Url'])
|
52
|
+
@host = uri.host
|
53
|
+
@path = uri.path
|
54
|
+
@port = uri.port
|
55
|
+
@scheme = uri.scheme
|
56
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
57
|
+
@enabled = true
|
58
|
+
end
|
59
|
+
end
|
48
60
|
|
49
|
-
|
50
|
-
@
|
51
|
-
@path = uri.path
|
52
|
-
@port = uri.port
|
53
|
-
@scheme = uri.scheme
|
54
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
61
|
+
def enabled?
|
62
|
+
@enabled
|
55
63
|
end
|
56
64
|
|
57
65
|
def reload
|
@@ -77,7 +85,7 @@ module Fog
|
|
77
85
|
end
|
78
86
|
end
|
79
87
|
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
|
80
|
-
response.body =
|
88
|
+
response.body = MultiJson.decode(response.body)
|
81
89
|
end
|
82
90
|
response
|
83
91
|
end
|
data/lib/fog/compute.rb
CHANGED
@@ -41,7 +41,10 @@ module Fog
|
|
41
41
|
when :stormondemand
|
42
42
|
require 'fog/compute/storm_on_demand'
|
43
43
|
Fog::Compute::StormOnDemand.new(attributes)
|
44
|
-
when :
|
44
|
+
when :vcloud
|
45
|
+
require 'fog/compute/vcloud'
|
46
|
+
Fog::Vcloud::Compute.new(attributes)
|
47
|
+
when 'VirtualBox'
|
45
48
|
require 'fog/compute/virtual_box'
|
46
49
|
Fog::Compute::VirtualBox.new(attributes)
|
47
50
|
when :voxel
|
data/lib/fog/compute/aws.rb
CHANGED
@@ -24,21 +24,28 @@ module Fog
|
|
24
24
|
collection :tags
|
25
25
|
model :volume
|
26
26
|
collection :volumes
|
27
|
+
model :spot_request
|
28
|
+
collection :spot_requests
|
27
29
|
|
28
30
|
request_path 'fog/compute/requests/aws'
|
29
31
|
request :allocate_address
|
30
32
|
request :associate_address
|
31
33
|
request :attach_volume
|
32
34
|
request :authorize_security_group_ingress
|
35
|
+
request :cancel_spot_instance_requests
|
33
36
|
request :create_image
|
34
37
|
request :create_key_pair
|
38
|
+
request :create_placement_group
|
35
39
|
request :create_security_group
|
36
40
|
request :create_snapshot
|
41
|
+
request :create_spot_datafeed_subscription
|
37
42
|
request :create_tags
|
38
43
|
request :create_volume
|
39
44
|
request :delete_key_pair
|
40
45
|
request :delete_security_group
|
46
|
+
request :delete_placement_group
|
41
47
|
request :delete_snapshot
|
48
|
+
request :delete_spot_datafeed_subscription
|
42
49
|
request :delete_tags
|
43
50
|
request :delete_volume
|
44
51
|
request :deregister_image
|
@@ -48,10 +55,14 @@ module Fog
|
|
48
55
|
request :describe_instances
|
49
56
|
request :describe_reserved_instances
|
50
57
|
request :describe_key_pairs
|
58
|
+
request :describe_placement_groups
|
51
59
|
request :describe_regions
|
52
60
|
request :describe_reserved_instances_offerings
|
53
61
|
request :describe_security_groups
|
54
62
|
request :describe_snapshots
|
63
|
+
request :describe_spot_datafeed_subscription
|
64
|
+
request :describe_spot_instance_requests
|
65
|
+
request :describe_spot_price_history
|
55
66
|
request :describe_tags
|
56
67
|
request :describe_volumes
|
57
68
|
request :detach_volume
|
@@ -61,9 +72,11 @@ module Fog
|
|
61
72
|
request :import_key_pair
|
62
73
|
request :modify_image_attributes
|
63
74
|
request :modify_snapshot_attribute
|
75
|
+
request :purchase_reserved_instances_offering
|
64
76
|
request :reboot_instances
|
65
77
|
request :release_address
|
66
78
|
request :register_image
|
79
|
+
request :request_spot_instances
|
67
80
|
request :revoke_security_group_ingress
|
68
81
|
request :run_instances
|
69
82
|
request :terminate_instances
|
@@ -83,6 +96,7 @@ module Fog
|
|
83
96
|
:addresses => {},
|
84
97
|
:images => {},
|
85
98
|
:instances => {},
|
99
|
+
:reserved_instances => {},
|
86
100
|
:key_pairs => {},
|
87
101
|
:limits => { :addresses => 5 },
|
88
102
|
:owner_id => owner_id,
|
@@ -129,8 +143,6 @@ module Fog
|
|
129
143
|
end
|
130
144
|
|
131
145
|
def initialize(options={})
|
132
|
-
require 'fog/compute/parsers/aws/basic'
|
133
|
-
|
134
146
|
@aws_access_key_id = options[:aws_access_key_id]
|
135
147
|
|
136
148
|
@region = options[:region] || 'us-east-1'
|
@@ -249,7 +261,7 @@ module Fog
|
|
249
261
|
:host => @host,
|
250
262
|
:path => @path,
|
251
263
|
:port => @port,
|
252
|
-
:version => '
|
264
|
+
:version => '2011-05-15'
|
253
265
|
}
|
254
266
|
)
|
255
267
|
|
@@ -266,7 +278,7 @@ module Fog
|
|
266
278
|
rescue Excon::Errors::HTTPStatusError => error
|
267
279
|
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
268
280
|
raise case match[1].split('.').last
|
269
|
-
when 'NotFound'
|
281
|
+
when 'NotFound', 'Unknown'
|
270
282
|
Fog::Compute::AWS::NotFound.slurp(error, match[2])
|
271
283
|
else
|
272
284
|
Fog::Compute::AWS::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
data/lib/fog/compute/bluebox.rb
CHANGED
@@ -53,7 +53,7 @@ module Fog
|
|
53
53
|
class Real
|
54
54
|
|
55
55
|
def initialize(options={})
|
56
|
-
require '
|
56
|
+
require 'multi_json'
|
57
57
|
@bluebox_api_key = options[:bluebox_api_key]
|
58
58
|
@bluebox_customer_id = options[:bluebox_customer_id]
|
59
59
|
@host = options[:bluebox_host] || "boxpanel.bluebox.net"
|
@@ -83,7 +83,7 @@ module Fog
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
unless response.body.empty?
|
86
|
-
response.body =
|
86
|
+
response.body = MultiJson.decode(response.body)
|
87
87
|
end
|
88
88
|
response
|
89
89
|
end
|
@@ -88,7 +88,7 @@ module Fog
|
|
88
88
|
class Real
|
89
89
|
|
90
90
|
def initialize(options)
|
91
|
-
require
|
91
|
+
require 'multi_json'
|
92
92
|
# Currently authentication and api endpoints are the same but may change
|
93
93
|
@auth_url = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL
|
94
94
|
@api_url = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL
|
@@ -106,7 +106,7 @@ module Fog
|
|
106
106
|
response = authenticated_request(params)
|
107
107
|
end
|
108
108
|
unless response.body.empty?
|
109
|
-
response =
|
109
|
+
response = MultiJson.decode(response.body)
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -119,7 +119,7 @@ module Fog
|
|
119
119
|
auth_url = options[:brightbox_auth_url] || @auth_url
|
120
120
|
|
121
121
|
connection = Fog::Connection.new(auth_url)
|
122
|
-
@authentication_body = {'client_id' => @brightbox_client_id, 'grant_type' => 'none'}
|
122
|
+
@authentication_body = MultiJson.encode({'client_id' => @brightbox_client_id, 'grant_type' => 'none'})
|
123
123
|
|
124
124
|
response = connection.request({
|
125
125
|
:path => "/token",
|
@@ -131,7 +131,7 @@ module Fog
|
|
131
131
|
:method => 'POST',
|
132
132
|
:body => @authentication_body
|
133
133
|
})
|
134
|
-
@oauth_token =
|
134
|
+
@oauth_token = MultiJson.decode(response.body)["access_token"]
|
135
135
|
return @oauth_token
|
136
136
|
end
|
137
137
|
|
data/lib/fog/compute/go_grid.rb
CHANGED
@@ -58,7 +58,7 @@ module Fog
|
|
58
58
|
|
59
59
|
def initialize(options={})
|
60
60
|
require 'digest/md5'
|
61
|
-
require '
|
61
|
+
require 'multi_json'
|
62
62
|
@go_grid_api_key = options[:go_grid_api_key]
|
63
63
|
@go_grid_shared_secret = options[:go_grid_shared_secret]
|
64
64
|
@host = options[:host] || "api.gogrid.com"
|
@@ -100,7 +100,7 @@ module Fog
|
|
100
100
|
end
|
101
101
|
|
102
102
|
unless response.body.empty?
|
103
|
-
response.body =
|
103
|
+
response.body = MultiJson.decode(response.body)
|
104
104
|
end
|
105
105
|
|
106
106
|
response
|
data/lib/fog/compute/linode.rb
CHANGED
@@ -77,7 +77,7 @@ module Fog
|
|
77
77
|
class Real
|
78
78
|
|
79
79
|
def initialize(options={})
|
80
|
-
require '
|
80
|
+
require 'multi_json'
|
81
81
|
@linode_api_key = options[:linode_api_key]
|
82
82
|
@host = options[:host] || "api.linode.com"
|
83
83
|
@port = options[:port] || 443
|
@@ -96,7 +96,7 @@ module Fog
|
|
96
96
|
response = @connection.request(params.merge!({:host => @host}))
|
97
97
|
|
98
98
|
unless response.body.empty?
|
99
|
-
response.body =
|
99
|
+
response.body = MultiJson.decode(response.body)
|
100
100
|
if data = response.body['ERRORARRAY'].first
|
101
101
|
error = case data['ERRORCODE']
|
102
102
|
when 5
|
@@ -12,7 +12,7 @@ module Fog
|
|
12
12
|
|
13
13
|
attr_accessor :architecture
|
14
14
|
attribute :ami_launch_index, :aliases => 'amiLaunchIndex'
|
15
|
-
attribute :availability_zone, :aliases =>
|
15
|
+
attribute :availability_zone, :aliases => 'availabilityZone'
|
16
16
|
attribute :block_device_mapping, :aliases => 'blockDeviceMapping'
|
17
17
|
attribute :client_token, :aliases => 'clientToken'
|
18
18
|
attribute :dns_name, :aliases => 'dnsName'
|
@@ -24,6 +24,7 @@ module Fog
|
|
24
24
|
attribute :key_name, :aliases => 'keyName'
|
25
25
|
attribute :created_at, :aliases => 'launchTime'
|
26
26
|
attribute :monitoring, :squash => 'state'
|
27
|
+
attribute :placement_group, :aliases => 'groupName'
|
27
28
|
attribute :product_codes, :aliases => 'productCodes'
|
28
29
|
attribute :private_dns_name, :aliases => 'privateDnsName'
|
29
30
|
attribute :private_ip_address, :aliases => 'privateIpAddress'
|
@@ -35,6 +36,7 @@ module Fog
|
|
35
36
|
attribute :state, :aliases => 'instanceState', :squash => 'name'
|
36
37
|
attribute :state_reason, :aliases => 'stateReason'
|
37
38
|
attribute :subnet_id, :aliases => 'subnetId'
|
39
|
+
attribute :tenancy
|
38
40
|
attribute :tags, :aliases => 'tagSet'
|
39
41
|
attribute :user_data
|
40
42
|
|
@@ -145,6 +147,8 @@ module Fog
|
|
145
147
|
'KeyName' => key_name,
|
146
148
|
'Monitoring.Enabled' => monitoring,
|
147
149
|
'Placement.AvailabilityZone' => availability_zone,
|
150
|
+
'Placement.GroupName' => placement_group,
|
151
|
+
'Placement.Tenancy' => tenancy,
|
148
152
|
'RamdiskId' => ramdisk_id,
|
149
153
|
'SecurityGroup' => groups,
|
150
154
|
'SubnetId' => subnet_id,
|
@@ -168,12 +172,12 @@ module Fog
|
|
168
172
|
|
169
173
|
def setup(credentials = {})
|
170
174
|
requires :identity, :public_ip_address, :username
|
171
|
-
require '
|
175
|
+
require 'multi_json'
|
172
176
|
|
173
177
|
commands = [
|
174
178
|
%{mkdir .ssh},
|
175
179
|
%{passwd -l #{username}},
|
176
|
-
%{echo "#{attributes
|
180
|
+
%{echo "#{MultiJson.encode(attributes)}" >> ~/attributes.json}
|
177
181
|
]
|
178
182
|
if public_key
|
179
183
|
commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys}
|
@@ -249,6 +253,16 @@ module Fog
|
|
249
253
|
self.monitoring = new_monitor
|
250
254
|
end
|
251
255
|
|
256
|
+
private
|
257
|
+
|
258
|
+
def placement=(new_placement)
|
259
|
+
if new_placement.is_a?(Hash)
|
260
|
+
merge_attributes(new_placement)
|
261
|
+
else
|
262
|
+
self.attributes[:placement] = new_placement
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
252
266
|
end
|
253
267
|
|
254
268
|
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class AWS
|
6
|
+
|
7
|
+
class SpotRequest < Fog::Model
|
8
|
+
|
9
|
+
identity :id, :aliases => 'spotInstanceRequestId'
|
10
|
+
|
11
|
+
attribute :price, :aliases => 'spotPrice'
|
12
|
+
attribute :request_type, :aliases => 'type'
|
13
|
+
attribute :created_at, :aliases => 'createTime'
|
14
|
+
attribute :instance_count, :aliases => 'instanceCount'
|
15
|
+
attribute :instance_id, :aliases => 'instanceId'
|
16
|
+
attribute :state
|
17
|
+
|
18
|
+
attribute :valid_from, :aliases => 'validFrom'
|
19
|
+
attribute :valid_until, :aliases => 'validUntil'
|
20
|
+
attribute :launch_group, :aliases => 'launchGroup'
|
21
|
+
attribute :availability_zone_group, :aliases => 'availabilityZoneGroup'
|
22
|
+
attribute :product_description, :aliases => 'productDescription'
|
23
|
+
|
24
|
+
attribute :groups, :aliases => 'LaunchSpecification.SecurityGroup'
|
25
|
+
attribute :key_name, :aliases => 'LaunchSpecification.KeyName'
|
26
|
+
attribute :availability_zone, :aliases => 'LaunchSpecification.Placement.AvailabilityZone'
|
27
|
+
attribute :flavor_id, :aliases => 'LaunchSpecification.InstanceType'
|
28
|
+
attribute :image_id, :aliases => 'LaunchSpecification.ImageId'
|
29
|
+
attribute :monitoring, :aliases => 'LaunchSpecification.Monitoring'
|
30
|
+
attribute :block_device_mapping, :aliases => 'LaunchSpecification.BlockDeviceMapping'
|
31
|
+
attribute :tags, :aliases => 'tagSet'
|
32
|
+
attribute :fault, :squash => 'message'
|
33
|
+
attribute :user_data
|
34
|
+
|
35
|
+
attr_writer :username
|
36
|
+
|
37
|
+
def initialize(attributes={})
|
38
|
+
self.groups ||= ["default"]
|
39
|
+
self.flavor_id ||= 't1.micro'
|
40
|
+
self.image_id ||= begin
|
41
|
+
self.username = 'ubuntu'
|
42
|
+
case attributes[:connection].instance_variable_get(:@region) # Ubuntu 10.04 LTS 64bit (EBS)
|
43
|
+
when 'ap-northeast-1'
|
44
|
+
'ami-5e0fa45f'
|
45
|
+
when 'ap-southeast-1'
|
46
|
+
'ami-f092eca2'
|
47
|
+
when 'eu-west-1'
|
48
|
+
'ami-3d1f2b49'
|
49
|
+
when 'us-east-1'
|
50
|
+
'ami-3202f25b'
|
51
|
+
when 'us-west-1'
|
52
|
+
'ami-f5bfefb0'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
super
|
56
|
+
end
|
57
|
+
|
58
|
+
def save
|
59
|
+
requires :image_id, :flavor_id, :price
|
60
|
+
|
61
|
+
options = {
|
62
|
+
'AvailabilityZoneGroup' => availability_zone_group,
|
63
|
+
'InstanceCount' => instance_count,
|
64
|
+
'LaunchGroup' => launch_group,
|
65
|
+
'LaunchSpecification.BlockDeviceMapping' => block_device_mapping,
|
66
|
+
'LaunchSpecification.KeyName' => key_name,
|
67
|
+
'LaunchSpecification.Monitoring.Enabled' => monitoring,
|
68
|
+
'LaunchSpecification.Placement.AvailabilityZone' => availability_zone,
|
69
|
+
'LaunchSpecification.SecurityGroup' => groups,
|
70
|
+
'LaunchSpecification.UserData' => user_data,
|
71
|
+
'Type' => request_type,
|
72
|
+
'ValidFrom' => valid_from,
|
73
|
+
'ValidUntil' => valid_until }
|
74
|
+
options.delete_if {|key, value| value.nil?}
|
75
|
+
|
76
|
+
data = connection.request_spot_instances(image_id, flavor_id, price, options).body
|
77
|
+
spot_instance_request = data['spotInstanceRequestSet'].first
|
78
|
+
spot_instance_request['launchSpecification'].each do |name,value|
|
79
|
+
spot_instance_request['LaunchSpecification.' + name[0,1].upcase + name[1..-1]] = value
|
80
|
+
end
|
81
|
+
spot_instance_request.merge(:groups => spot_instance_request['LaunchSpecification.GroupSet'])
|
82
|
+
spot_instance_request.merge(options)
|
83
|
+
merge_attributes( spot_instance_request )
|
84
|
+
end
|
85
|
+
|
86
|
+
def ready?
|
87
|
+
state == 'active'
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|