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/docs/index.markdown
CHANGED
@@ -17,10 +17,10 @@ With a rapidly expanding community and codebase the advantages of fog just keep
|
|
17
17
|
|
18
18
|
Now type 'fog' to try stuff, confident that fog will let you know what to do. Here is an example of wading through server creation for Amazon Elastic Compute Cloud:
|
19
19
|
|
20
|
-
>> server =
|
20
|
+
>> server = Compute[:aws].servers.create
|
21
21
|
ArgumentError: image_id is required for this operation
|
22
22
|
|
23
|
-
>> server =
|
23
|
+
>> server = Compute[:aws].servers.create(:image_id => 'ami-5ee70037')
|
24
24
|
<Fog::AWS::EC2::Server [...]>
|
25
25
|
|
26
26
|
>> server.destroy # cleanup after yourself or regret it, trust me
|
data/fog.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
6
6
|
## If your rubyforge_project name is different, then edit it and comment out
|
7
7
|
## the sub! line in the Rakefile
|
8
8
|
s.name = 'fog'
|
9
|
-
s.version = '0.
|
10
|
-
s.date = '2011-
|
9
|
+
s.version = '0.10.0'
|
10
|
+
s.date = '2011-07-25'
|
11
11
|
s.rubyforge_project = 'fog'
|
12
12
|
|
13
13
|
## Make sure your summary is short. The description may be as long
|
@@ -37,13 +37,13 @@ Gem::Specification.new do |s|
|
|
37
37
|
## List your runtime dependencies here. Runtime dependencies are those
|
38
38
|
## that are needed for an end user to actually USE your code.
|
39
39
|
s.add_dependency('builder')
|
40
|
-
s.add_dependency('excon', '~>0.6.
|
41
|
-
s.add_dependency('formatador', '
|
42
|
-
s.add_dependency('
|
40
|
+
s.add_dependency('excon', '~>0.6.5')
|
41
|
+
s.add_dependency('formatador', '~>0.2.0')
|
42
|
+
s.add_dependency('multi_json', '~>1.0.3')
|
43
43
|
s.add_dependency('mime-types')
|
44
|
-
s.add_dependency('net-scp', '
|
45
|
-
s.add_dependency('net-ssh', '
|
46
|
-
s.add_dependency('nokogiri', '
|
44
|
+
s.add_dependency('net-scp', '~>1.0.4')
|
45
|
+
s.add_dependency('net-ssh', '~>2.1.4')
|
46
|
+
s.add_dependency('nokogiri', '~>1.5.0')
|
47
47
|
s.add_dependency('ruby-hmac')
|
48
48
|
|
49
49
|
## List your development dependencies here. Development dependencies are
|
@@ -51,9 +51,9 @@ Gem::Specification.new do |s|
|
|
51
51
|
s.add_development_dependency('jekyll')
|
52
52
|
s.add_development_dependency('rake')
|
53
53
|
s.add_development_dependency('rdoc')
|
54
|
-
s.add_development_dependency('rspec', '1.3.1')
|
55
|
-
s.add_development_dependency('shindo', '0.3.4')
|
56
|
-
s.add_development_dependency('virtualbox', '0.8.3')
|
54
|
+
s.add_development_dependency('rspec', '~>1.3.1')
|
55
|
+
s.add_development_dependency('shindo', '~>0.3.4')
|
56
|
+
s.add_development_dependency('virtualbox', '~>0.8.3')
|
57
57
|
|
58
58
|
s.files = `git ls-files`.split("\n")
|
59
59
|
s.test_files = `git ls-files -- {spec,tests}/*`.split("\n")
|
data/lib/fog.rb
CHANGED
@@ -0,0 +1,221 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class AutoScaling < Fog::Service
|
4
|
+
|
5
|
+
class IdentifierTaken < Fog::Errors::Error; end
|
6
|
+
class ResourceInUse < Fog::Errors::Error; end
|
7
|
+
class ValidationError < Fog::Errors::Error; end
|
8
|
+
|
9
|
+
requires :aws_access_key_id, :aws_secret_access_key
|
10
|
+
recognizes :host, :path, :port, :scheme, :persistent, :region
|
11
|
+
|
12
|
+
request_path 'fog/aws/requests/auto_scaling'
|
13
|
+
request :create_auto_scaling_group
|
14
|
+
request :create_launch_configuration
|
15
|
+
request :delete_auto_scaling_group
|
16
|
+
request :delete_launch_configuration
|
17
|
+
request :delete_policy
|
18
|
+
request :delete_scheduled_action
|
19
|
+
request :describe_adjustment_types
|
20
|
+
request :describe_auto_scaling_groups
|
21
|
+
request :describe_auto_scaling_instances
|
22
|
+
request :describe_launch_configurations
|
23
|
+
request :describe_metric_collection_types
|
24
|
+
request :describe_policies
|
25
|
+
request :describe_scaling_activities
|
26
|
+
request :describe_scaling_process_types
|
27
|
+
request :describe_scheduled_actions
|
28
|
+
request :disable_metrics_collection
|
29
|
+
request :enable_metrics_collection
|
30
|
+
request :execute_policy
|
31
|
+
request :put_scaling_policy
|
32
|
+
request :put_scheduled_update_group_action
|
33
|
+
request :resume_processes
|
34
|
+
request :set_desired_capacity
|
35
|
+
request :set_instance_health
|
36
|
+
request :suspend_processes
|
37
|
+
request :terminate_instance_in_auto_scaling_group
|
38
|
+
request :update_auto_scaling_group
|
39
|
+
|
40
|
+
model_path 'fog/aws/models/auto_scaling'
|
41
|
+
model :activity
|
42
|
+
collection :activities
|
43
|
+
model :configuration
|
44
|
+
collection :configurations
|
45
|
+
model :group
|
46
|
+
collection :groups
|
47
|
+
model :instance
|
48
|
+
collection :instances
|
49
|
+
|
50
|
+
class Real
|
51
|
+
|
52
|
+
# Initialize connection to AutoScaling
|
53
|
+
#
|
54
|
+
# ==== Notes
|
55
|
+
# options parameter must include values for :aws_access_key_id and
|
56
|
+
# :aws_secret_access_key in order to create a connection
|
57
|
+
#
|
58
|
+
# ==== Examples
|
59
|
+
# as = AutoScaling.new(
|
60
|
+
# :aws_access_key_id => your_aws_access_key_id,
|
61
|
+
# :aws_secret_access_key => your_aws_secret_access_key
|
62
|
+
# )
|
63
|
+
#
|
64
|
+
# ==== Parameters
|
65
|
+
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
66
|
+
#
|
67
|
+
# ==== Returns
|
68
|
+
# * AutoScaling object with connection to AWS.
|
69
|
+
def initialize(options={})
|
70
|
+
require 'fog/core/parser'
|
71
|
+
|
72
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
73
|
+
@aws_secret_access_key = options[:aws_secret_access_key]
|
74
|
+
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
75
|
+
|
76
|
+
options[:region] ||= 'us-east-1'
|
77
|
+
@host = options[:host] || case options[:region]
|
78
|
+
when 'ap-northeast-1'
|
79
|
+
'autoscaling.ap-northeast-1.amazonaws.com'
|
80
|
+
when 'ap-southeast-1'
|
81
|
+
'autoscaling.ap-southeast-1.amazonaws.com'
|
82
|
+
when 'eu-west-1'
|
83
|
+
'autoscaling.eu-west-1.amazonaws.com'
|
84
|
+
when 'us-east-1'
|
85
|
+
'autoscaling.us-east-1.amazonaws.com'
|
86
|
+
when 'us-west-1'
|
87
|
+
'autoscaling.us-west-1.amazonaws.com'
|
88
|
+
else
|
89
|
+
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
90
|
+
end
|
91
|
+
@path = options[:path] || '/'
|
92
|
+
@port = options[:port] || 443
|
93
|
+
@scheme = options[:scheme] || 'https'
|
94
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
|
95
|
+
end
|
96
|
+
|
97
|
+
def reload
|
98
|
+
@connection.reset
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def request(params)
|
104
|
+
idempotent = params.delete(:idempotent)
|
105
|
+
parser = params.delete(:parser)
|
106
|
+
|
107
|
+
body = AWS.signed_params(
|
108
|
+
params,
|
109
|
+
{
|
110
|
+
:aws_access_key_id => @aws_access_key_id,
|
111
|
+
:hmac => @hmac,
|
112
|
+
:host => @host,
|
113
|
+
:path => @path,
|
114
|
+
:port => @port,
|
115
|
+
:version => '2010-08-01'
|
116
|
+
}
|
117
|
+
)
|
118
|
+
|
119
|
+
begin
|
120
|
+
response = @connection.request({
|
121
|
+
:body => body,
|
122
|
+
:expects => 200,
|
123
|
+
:idempotent => idempotent,
|
124
|
+
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
125
|
+
:host => @host,
|
126
|
+
:method => 'POST',
|
127
|
+
:parser => parser
|
128
|
+
})
|
129
|
+
rescue Excon::Errors::HTTPStatusError => error
|
130
|
+
if match = error.message.match(/<Code>(.*)<\/Code>.*<Message>(.*)<\/Message>/)
|
131
|
+
case match[1]
|
132
|
+
when 'AlreadyExists'
|
133
|
+
#raise Fog::AWS::AutoScaling::IdentifierTaken.new(match[2])
|
134
|
+
raise Fog::AWS::AutoScaling::IdentifierTaken.slurp(error, match[2])
|
135
|
+
when 'ResourceInUse'
|
136
|
+
raise Fog::AWS::AutoScaling::ResourceInUse.slurp(error, match[2])
|
137
|
+
when 'ValidationError'
|
138
|
+
raise Fog::AWS::AutoScaling::ValidationError.slurp(error, match[2])
|
139
|
+
else
|
140
|
+
raise Fog::AWS::Compute::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
141
|
+
end
|
142
|
+
else
|
143
|
+
raise
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
response
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
|
152
|
+
class Mock
|
153
|
+
|
154
|
+
def self.data
|
155
|
+
@data ||= Hash.new do |hash, region|
|
156
|
+
owner_id = Fog::AWS::Mock.owner_id
|
157
|
+
hash[region] = Hash.new do |region_hash, key|
|
158
|
+
region_hash[key] = {
|
159
|
+
:adjustment_types => [
|
160
|
+
'ChangeInCapacity',
|
161
|
+
'ExactCapacity',
|
162
|
+
'PercentChangeInCapacity'
|
163
|
+
],
|
164
|
+
:auto_scaling_groups => {},
|
165
|
+
:health_states => ['Healthy', 'Unhealthy'],
|
166
|
+
:launch_configurations => {},
|
167
|
+
:metric_collection_types => {
|
168
|
+
:granularities => [ '1Minute' ],
|
169
|
+
:metrics => [
|
170
|
+
'GroupMinSize',
|
171
|
+
'GroupMaxSize',
|
172
|
+
'GroupDesiredCapacity',
|
173
|
+
'GroupInServiceInstances',
|
174
|
+
'GroupPendingInstances',
|
175
|
+
'GroupTerminatingInstances',
|
176
|
+
'GroupTotalInstances'
|
177
|
+
],
|
178
|
+
},
|
179
|
+
:process_types => [
|
180
|
+
'AZRebalance',
|
181
|
+
'AlarmNotification',
|
182
|
+
'HealthCheck',
|
183
|
+
'Launch',
|
184
|
+
'ReplaceUnhealthy',
|
185
|
+
'ScheduledActions',
|
186
|
+
'Terminate'
|
187
|
+
]
|
188
|
+
}
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
def self.reset
|
194
|
+
@data = nil
|
195
|
+
end
|
196
|
+
|
197
|
+
def initialize(options={})
|
198
|
+
|
199
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
200
|
+
|
201
|
+
@region = options[:region] || 'us-east-1'
|
202
|
+
|
203
|
+
unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1'].include?(@region)
|
204
|
+
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
205
|
+
end
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
def data
|
210
|
+
self.class.data[@region][@aws_access_key_id]
|
211
|
+
end
|
212
|
+
|
213
|
+
def reset_data
|
214
|
+
self.class.data[@region].delete(@aws_access_key_id)
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
@@ -43,7 +43,7 @@ module Fog
|
|
43
43
|
# * CloudFormation object with connection to AWS.
|
44
44
|
def initialize(options={})
|
45
45
|
require 'fog/core/parser'
|
46
|
-
require '
|
46
|
+
require 'multi_json'
|
47
47
|
|
48
48
|
@aws_access_key_id = options[:aws_access_key_id]
|
49
49
|
@aws_secret_access_key = options[:aws_secret_access_key]
|
@@ -0,0 +1,110 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class CloudWatch < Fog::Service
|
4
|
+
|
5
|
+
|
6
|
+
requires :aws_access_key_id, :aws_secret_access_key
|
7
|
+
recognizes :region, :host, :path, :port, :scheme, :persistent
|
8
|
+
|
9
|
+
request_path 'fog/aws/requests/cloud_watch'
|
10
|
+
|
11
|
+
request :list_metrics
|
12
|
+
request :get_metric_statistics
|
13
|
+
request :put_metric_data
|
14
|
+
|
15
|
+
model_path 'fog/aws/models/cloud_watch'
|
16
|
+
model :metric
|
17
|
+
collection :metrics
|
18
|
+
model :metric_statistic
|
19
|
+
collection :metric_statistics
|
20
|
+
|
21
|
+
class Mock
|
22
|
+
|
23
|
+
def initialize(options={})
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
class Real
|
29
|
+
|
30
|
+
# Initialize connection to Cloudwatch
|
31
|
+
#
|
32
|
+
# ==== Notes
|
33
|
+
# options parameter must include values for :aws_access_key_id and
|
34
|
+
# :aws_secret_access_key in order to create a connection
|
35
|
+
#
|
36
|
+
# ==== Examples
|
37
|
+
# elb = CloudWatch.new(
|
38
|
+
# :aws_access_key_id => your_aws_access_key_id,
|
39
|
+
# :aws_secret_access_key => your_aws_secret_access_key
|
40
|
+
# )
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
44
|
+
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'ap-southeast-1', 'ap-northeast-1']
|
45
|
+
#
|
46
|
+
# ==== Returns
|
47
|
+
# * CloudWatch object with connection to AWS.
|
48
|
+
def initialize(options={})
|
49
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
50
|
+
@aws_secret_access_key = options[:aws_secret_access_key]
|
51
|
+
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
52
|
+
|
53
|
+
options[:region] ||= 'us-east-1'
|
54
|
+
@host = options[:host] || case options[:region]
|
55
|
+
when 'ap-northeast-1'
|
56
|
+
'monitoring.ap-northeast-1.amazonaws.com'
|
57
|
+
when 'ap-southeast-1'
|
58
|
+
'monitoring.ap-southeast-1.amazonaws.com'
|
59
|
+
when 'eu-west-1'
|
60
|
+
'monitoring.eu-west-1.amazonaws.com'
|
61
|
+
when 'us-east-1'
|
62
|
+
'monitoring.us-east-1.amazonaws.com'
|
63
|
+
when 'us-west-1'
|
64
|
+
'monitoring.us-west-1.amazonaws.com'
|
65
|
+
else
|
66
|
+
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
67
|
+
end
|
68
|
+
@path = options[:path] || '/'
|
69
|
+
@port = options[:port] || 443
|
70
|
+
@scheme = options[:scheme] || 'https'
|
71
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
|
72
|
+
end
|
73
|
+
|
74
|
+
def reload
|
75
|
+
@connection.reset
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def request(params)
|
81
|
+
idempotent = params.delete(:idempotent)
|
82
|
+
parser = params.delete(:parser)
|
83
|
+
|
84
|
+
body = AWS.signed_params(
|
85
|
+
params,
|
86
|
+
{
|
87
|
+
:aws_access_key_id => @aws_access_key_id,
|
88
|
+
:hmac => @hmac,
|
89
|
+
:host => @host,
|
90
|
+
:path => @path,
|
91
|
+
:port => @port,
|
92
|
+
:version => '2010-08-01'
|
93
|
+
}
|
94
|
+
)
|
95
|
+
|
96
|
+
response = @connection.request({
|
97
|
+
:body => body,
|
98
|
+
:expects => 200,
|
99
|
+
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
100
|
+
:idempotent => idempotent,
|
101
|
+
:host => @host,
|
102
|
+
:method => 'POST',
|
103
|
+
:parser => parser
|
104
|
+
})
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
data/lib/fog/aws/elb.rb
CHANGED
@@ -23,7 +23,7 @@ module Fog
|
|
23
23
|
request :disable_availability_zones_for_load_balancer
|
24
24
|
request :enable_availability_zones_for_load_balancer
|
25
25
|
request :register_instances_with_load_balancer
|
26
|
-
|
26
|
+
request :set_load_balancer_listener_ssl_certificate
|
27
27
|
request :set_load_balancer_policies_of_listener
|
28
28
|
|
29
29
|
model_path 'fog/aws/models/elb'
|
@@ -36,10 +36,43 @@ module Fog
|
|
36
36
|
|
37
37
|
class Mock
|
38
38
|
|
39
|
+
def self.data
|
40
|
+
@data ||= Hash.new do |hash, region|
|
41
|
+
owner_id = Fog::AWS::Mock.owner_id
|
42
|
+
hash[region] = Hash.new do |region_hash, key|
|
43
|
+
region_hash[key] = {
|
44
|
+
:owner_id => owner_id,
|
45
|
+
:load_balancers => {}
|
46
|
+
}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.dns_name(name, region)
|
52
|
+
"#{name}-#{Fog::Mock.random_hex(8)}.#{region}.elb.amazonaws.com"
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.reset
|
56
|
+
@data = nil
|
57
|
+
end
|
58
|
+
|
39
59
|
def initialize(options={})
|
40
|
-
|
60
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
61
|
+
|
62
|
+
@region = options[:region] || 'us-east-1'
|
63
|
+
|
64
|
+
unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1'].include?(@region)
|
65
|
+
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def data
|
70
|
+
self.class.data[@region][@aws_access_key_id]
|
41
71
|
end
|
42
72
|
|
73
|
+
def reset_data
|
74
|
+
self.class.data[@region].delete(@aws_access_key_id)
|
75
|
+
end
|
43
76
|
end
|
44
77
|
|
45
78
|
class Real
|
@@ -111,34 +144,33 @@ module Fog
|
|
111
144
|
:version => '2011-04-05'
|
112
145
|
}
|
113
146
|
)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
end
|
147
|
+
|
148
|
+
response = @connection.request({
|
149
|
+
:body => body,
|
150
|
+
:expects => 200,
|
151
|
+
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
152
|
+
:idempotent => idempotent,
|
153
|
+
:host => @host,
|
154
|
+
:method => 'POST',
|
155
|
+
:parser => parser
|
156
|
+
})
|
157
|
+
rescue Excon::Errors::HTTPStatusError => error
|
158
|
+
if match = error.message.match(/<Code>(.*)<\/Code>(?:.*<Message>(.*)<\/Message>)?/m)
|
159
|
+
case match[1]
|
160
|
+
when 'CertificateNotFound'
|
161
|
+
raise Fog::AWS::IAM::NotFound.slurp(error, match[2])
|
162
|
+
when 'LoadBalancerNotFound'
|
163
|
+
raise Fog::AWS::ELB::NotFound.slurp(error, match[2])
|
164
|
+
when 'DuplicateLoadBalancerName'
|
165
|
+
raise Fog::AWS::ELB::IdentifierTaken.slurp(error, match[2])
|
166
|
+
when 'InvalidInstance'
|
167
|
+
raise Fog::AWS::ELB::InvalidInstance.slurp(error, match[2])
|
136
168
|
else
|
137
169
|
raise
|
138
170
|
end
|
171
|
+
else
|
172
|
+
raise
|
139
173
|
end
|
140
|
-
|
141
|
-
response
|
142
174
|
end
|
143
175
|
end
|
144
176
|
end
|