fog 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class AutoScaling
|
|
4
|
+
|
|
5
|
+
class Real
|
|
6
|
+
|
|
7
|
+
require 'fog/aws/parsers/auto_scaling/basic'
|
|
8
|
+
|
|
9
|
+
# Sets the health status of an instance.
|
|
10
|
+
#
|
|
11
|
+
# ==== Parameters
|
|
12
|
+
# * health_status<~String> - The health status of the instance.
|
|
13
|
+
# "Healthy" means that the instance is healthy and should remain in
|
|
14
|
+
# service. "Unhealthy" means that the instance is unhealthy. Auto
|
|
15
|
+
# Scaling should terminate and replace it.
|
|
16
|
+
# * instance_id<~String> - The identifier of the EC2 instance.
|
|
17
|
+
# * options<~Hash>:
|
|
18
|
+
# * 'ShouldRespectGracePeriod'<~Boolean> - If true, this call should
|
|
19
|
+
# respect the grace period associated with the group.
|
|
20
|
+
#
|
|
21
|
+
# ==== Returns
|
|
22
|
+
# * response<~Excon::Response>:
|
|
23
|
+
# * body<~Hash>:
|
|
24
|
+
# * 'ResponseMetadata'<~Hash>:
|
|
25
|
+
# * 'RequestId'<~String> - Id of request
|
|
26
|
+
#
|
|
27
|
+
# ==== See Also
|
|
28
|
+
# http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_SetInstanceHealth.html
|
|
29
|
+
#
|
|
30
|
+
def set_instance_health(health_status, instance_id, options = {})
|
|
31
|
+
request({
|
|
32
|
+
'Action' => 'SetInstanceHealth',
|
|
33
|
+
'HealthStatus' => health_status,
|
|
34
|
+
'InstanceId' => instance_id,
|
|
35
|
+
:parser => Fog::Parsers::AWS::AutoScaling::Basic.new
|
|
36
|
+
}.merge!(options))
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class Mock
|
|
42
|
+
|
|
43
|
+
def set_instance_health(health_status, instance_id, options = {})
|
|
44
|
+
unless data[:health_states].include?(health_status)
|
|
45
|
+
raise Fog::AWS::AutoScaling::ValidationError.new('Valid instance health states are: [#{data[:health_states].join(", ")}].')
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
Fog::Mock.not_implemented
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class AutoScaling
|
|
4
|
+
|
|
5
|
+
class Real
|
|
6
|
+
|
|
7
|
+
require 'fog/aws/parsers/auto_scaling/basic'
|
|
8
|
+
|
|
9
|
+
# Suspends Auto Scaling processes for an Auto Scaling group. To suspend
|
|
10
|
+
# specific process types, specify them by name with the
|
|
11
|
+
# ScalingProcesses parameter. To suspend all process types, omit the
|
|
12
|
+
# ScalingProcesses.member.N parameter.
|
|
13
|
+
#
|
|
14
|
+
# ==== Parameters
|
|
15
|
+
# * 'AutoScalingGroupName'<~String> - The name or Amazon Resource Name
|
|
16
|
+
# (ARN) of the Auto Scaling group.
|
|
17
|
+
# * options<~Hash>:
|
|
18
|
+
# * 'ScalingProcesses'<~Array> - The processes that you want to
|
|
19
|
+
# suspend. To suspend all process types, omit this parameter.
|
|
20
|
+
#
|
|
21
|
+
# ==== Returns
|
|
22
|
+
# * response<~Excon::Response>:
|
|
23
|
+
# * body<~Hash>:
|
|
24
|
+
# * 'ResponseMetadata'<~Hash>:
|
|
25
|
+
# * 'RequestId'<~String> - Id of request
|
|
26
|
+
#
|
|
27
|
+
# ==== See Also
|
|
28
|
+
# http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_SuspendProcesses.html
|
|
29
|
+
#
|
|
30
|
+
def suspend_processes(auto_scaling_group_name, options = {})
|
|
31
|
+
if scaling_processes = options.delete('ScalingProcesses')
|
|
32
|
+
options.merge!(AWS.indexed_param('ScalingProcesses.member.%d', [*scaling_processes]))
|
|
33
|
+
end
|
|
34
|
+
request({
|
|
35
|
+
'Action' => 'SuspendProcesses',
|
|
36
|
+
'AutoScalingGroupName' => auto_scaling_group_name,
|
|
37
|
+
:parser => Fog::Parsers::AWS::AutoScaling::Basic.new
|
|
38
|
+
}.merge!(options))
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
class Mock
|
|
44
|
+
|
|
45
|
+
def suspend_processes(auto_scaling_group_name, options = {})
|
|
46
|
+
unless data[:auto_scaling_groups].has_key?(auto_scaling_group_name)
|
|
47
|
+
raise Fog::AWS::AutoScaling::ValidationError.new('AutoScalingGroup name not found - null')
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
Fog::Mock.not_implemented
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class AutoScaling
|
|
4
|
+
|
|
5
|
+
class Real
|
|
6
|
+
|
|
7
|
+
require 'fog/aws/parsers/auto_scaling/terminate_instance_in_auto_scaling_group'
|
|
8
|
+
|
|
9
|
+
# Terminates the specified instance. Optionally, the desired group size
|
|
10
|
+
# can be adjusted.
|
|
11
|
+
#
|
|
12
|
+
# ==== Parameters
|
|
13
|
+
# * instance_id<~String> - The ID of the EC2 instance to be terminated.
|
|
14
|
+
# * should_decrement_desired_capacity<~Boolean> - Specifies whether
|
|
15
|
+
# (true) or not (false) terminating this instance should also
|
|
16
|
+
# decrement the size of the AutoScalingGroup.
|
|
17
|
+
#
|
|
18
|
+
# ==== Returns
|
|
19
|
+
# * response<~Excon::Response>:
|
|
20
|
+
# * body<~Hash>:
|
|
21
|
+
# * 'ResponseMetadata'<~Hash>:
|
|
22
|
+
# * 'RequestId'<~String> - Id of request
|
|
23
|
+
# * 'TerminateGroupInAutoScalingInstanceResult'<~Hash>:
|
|
24
|
+
# * 'ActivityId'<~String> - Specifies the ID of the activity.
|
|
25
|
+
# * 'AutoScalingGroupName'<~String> - The name of the Auto
|
|
26
|
+
# Scaling group.
|
|
27
|
+
# * 'Cause'<~String> - Contains the reason the activity was
|
|
28
|
+
# begun.
|
|
29
|
+
# * 'Description'<~String> - Contains a friendly, more verbose
|
|
30
|
+
# description of the scaling activity.
|
|
31
|
+
# * 'EndTime'<~Time> - Provides the end time of this activity.
|
|
32
|
+
# * 'Progress'<~Integer> - Specifies a value between 0 and 100
|
|
33
|
+
# that indicates the progress of the activity.
|
|
34
|
+
# * 'StartTime'<~Time> - Provides the start time of this
|
|
35
|
+
# activity.
|
|
36
|
+
# * 'StatusCode'<~String> - Contains the current status of the
|
|
37
|
+
# activity.
|
|
38
|
+
# * 'StatusMessage'<~String> - Contains a friendly, more verbose
|
|
39
|
+
# description of the activity status.
|
|
40
|
+
#
|
|
41
|
+
# ==== See Also
|
|
42
|
+
# http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_TerminateInstanceInAutoScalingGroup.html
|
|
43
|
+
#
|
|
44
|
+
def terminate_instance_in_auto_scaling_group(instance_id, should_decrement_desired_capacity)
|
|
45
|
+
request({
|
|
46
|
+
'Action' => 'TerminateInstanceInAutoScalingGroup',
|
|
47
|
+
'InstanceId' => instance_id,
|
|
48
|
+
'ShouldDecrementDesiredCapacity' => should_decrement_desired_capacity.to_s,
|
|
49
|
+
:parser => Fog::Parsers::AWS::AutoScaling::TerminateInstanceInAutoScalingGroup.new
|
|
50
|
+
})
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
class Mock
|
|
56
|
+
|
|
57
|
+
def terminate_instance_in_auto_scaling_group(instance_id, should_decrement_desired_capacity)
|
|
58
|
+
Fog::Mock.not_implemented
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class AutoScaling
|
|
4
|
+
|
|
5
|
+
class Real
|
|
6
|
+
|
|
7
|
+
require 'fog/aws/parsers/auto_scaling/basic'
|
|
8
|
+
|
|
9
|
+
# Updates the configuration for the specified AutoScalingGroup.
|
|
10
|
+
#
|
|
11
|
+
# The new settings are registered upon the completion of this call. Any
|
|
12
|
+
# launch configuration settings take effect on any triggers after this
|
|
13
|
+
# call returns. Triggers that are currently in progress aren't
|
|
14
|
+
# affected.
|
|
15
|
+
#
|
|
16
|
+
# ==== Parameters
|
|
17
|
+
# * auto_scaling_group_name<~String> - The name of the Auto Scaling
|
|
18
|
+
# group.
|
|
19
|
+
# * options<~Hash>:
|
|
20
|
+
# * 'AvailabilityZones'<~Array>: Availability zones for the group
|
|
21
|
+
# * 'DefaultCooldown'<~Integer> - Amount of time, in seconds, after a
|
|
22
|
+
# scaling activity completes before any further trigger-related
|
|
23
|
+
# scaling activities can start
|
|
24
|
+
# * 'DesiredCapacity'<~Integer> - Desired capacity for the scaling group
|
|
25
|
+
# * 'HealthCheckGracePeriod'<~Integer> - Length of time that Auto
|
|
26
|
+
# Scaling waits before checking an instance's health status
|
|
27
|
+
# * 'HealthCheckType'<~String> - Service of interest for the health
|
|
28
|
+
# status check, either "EC2" or "ELB".
|
|
29
|
+
# * 'LaunchConfigurationName'<~String> - Name of the launch configuration
|
|
30
|
+
# * 'MaxSize'<~Integer> - Maximum size of the Auto Scaling group
|
|
31
|
+
# * 'MinSize'<~Integer> - Minimum size of the Auto Scaling group
|
|
32
|
+
# * 'PlacementGroup'<~String> - Name of the cluster placement group,
|
|
33
|
+
# if applicable
|
|
34
|
+
# * 'VPCZoneIdentifier'<~String> - Identifier for the VPC connection,
|
|
35
|
+
# if applicable
|
|
36
|
+
#
|
|
37
|
+
# ==== Returns
|
|
38
|
+
# * response<~Excon::Response>:
|
|
39
|
+
# * body<~Hash>:
|
|
40
|
+
# * 'ResponseMetadata'<~Hash>:
|
|
41
|
+
# * 'RequestId'<~String> - Id of request
|
|
42
|
+
#
|
|
43
|
+
# ==== See Also
|
|
44
|
+
# http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_UpdateAutoScalingGroup.html
|
|
45
|
+
#
|
|
46
|
+
def update_auto_scaling_group(auto_scaling_group_name, options = {})
|
|
47
|
+
if availability_zones = options.delete('AvailabilityZones')
|
|
48
|
+
options.merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones]))
|
|
49
|
+
end
|
|
50
|
+
request({
|
|
51
|
+
'Action' => 'UpdateAutoScalingGroup',
|
|
52
|
+
'AutoScalingGroupName' => auto_scaling_group_name,
|
|
53
|
+
:parser => Fog::Parsers::AWS::AutoScaling::Basic.new
|
|
54
|
+
}.merge!(options))
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
class Mock
|
|
60
|
+
|
|
61
|
+
def update_auto_scaling_group(auto_scaling_group_name, options = {})
|
|
62
|
+
unless data[:auto_scaling_groups].has_key?(auto_scaling_group_name)
|
|
63
|
+
raise Fog::AWS::AutoScaling::ValidationError.new('AutoScalingGroup name not found - null')
|
|
64
|
+
end
|
|
65
|
+
data[:auto_scaling_group_name][auto_scaling_group_name].merge!(options)
|
|
66
|
+
|
|
67
|
+
response = Excon::Response.new
|
|
68
|
+
response.status = 200
|
|
69
|
+
response.body = {
|
|
70
|
+
'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
|
|
71
|
+
}
|
|
72
|
+
response
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class CloudWatch
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
require 'fog/aws/parsers/cloud_watch/get_metric_statistics'
|
|
7
|
+
|
|
8
|
+
# Fetch datapoints for a metric. At most 1440 datapoints will be returned, the most datapoints that can be queried is 50850
|
|
9
|
+
# StartTime is capped to 2 weeks ago
|
|
10
|
+
# ==== Options
|
|
11
|
+
# * Namespace<~String>: the namespace of the metric
|
|
12
|
+
# * MetricName<~String>: the name of the metric
|
|
13
|
+
# * StartTime<~Datetime>: when to start fetching datapoints from (inclusive)
|
|
14
|
+
# * EndTime<~Datetime>: used to determine the last datapoint to fetch (exclusive)
|
|
15
|
+
# * Period<~Integer>: Granularity, in seconds of the returned datapoints. Must be a multiple of 60, and at least 60
|
|
16
|
+
# * Statistics<~Array>: An array of up to 5 strings, which name the statistics to return
|
|
17
|
+
# * Unit<~String>: The unit for the metric
|
|
18
|
+
# * Dimensions<~Array>: a list of dimensions to filter against (optional)
|
|
19
|
+
# Name : The name of the dimension
|
|
20
|
+
# Value : The value to filter against
|
|
21
|
+
# ==== Returns
|
|
22
|
+
# * response<~Excon::Response>:
|
|
23
|
+
#
|
|
24
|
+
# ==== See Also
|
|
25
|
+
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html
|
|
26
|
+
#
|
|
27
|
+
def get_metric_statistics(options={})
|
|
28
|
+
%w{Statistics StartTime EndTime Period MetricName Namespace}.each do |required_parameter|
|
|
29
|
+
raise ArgumentError, "Must prodide #{required_parameter}" unless options.has_key?(required_parameter)
|
|
30
|
+
end
|
|
31
|
+
statistics = options.delete 'Statistics'
|
|
32
|
+
options.merge!(AWS.indexed_param('Statistics.member.%d', [*statistics]))
|
|
33
|
+
|
|
34
|
+
if dimensions = options.delete('Dimensions')
|
|
35
|
+
options.merge!(AWS.indexed_param('Dimensions.member.%d.Name', dimensions.collect {|dimension| dimension['Name']}))
|
|
36
|
+
options.merge!(AWS.indexed_param('Dimensions.member.%d.Value', dimensions.collect {|dimension| dimension['Value']}))
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
request({
|
|
40
|
+
'Action' => 'GetMetricStatistics',
|
|
41
|
+
:parser => Fog::Parsers::AWS::CloudWatch::GetMetricStatistics.new
|
|
42
|
+
}.merge(options))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class CloudWatch
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
require 'fog/aws/parsers/cloud_watch/list_metrics'
|
|
7
|
+
|
|
8
|
+
# List availabe metrics
|
|
9
|
+
#
|
|
10
|
+
# ==== Options
|
|
11
|
+
# * Dimensions<~Array>: a list of dimensions to filter against,
|
|
12
|
+
# Name : The name of the dimension
|
|
13
|
+
# Value : The value to filter against
|
|
14
|
+
# * MetricName<~String>: The name of the metric to filter against
|
|
15
|
+
# * Namespace<~String>: The namespace to filter against
|
|
16
|
+
# * NextToken<~String> The token returned by a previous call to indicate that there is more data available
|
|
17
|
+
# ==== Returns
|
|
18
|
+
# * response<~Excon::Response>:
|
|
19
|
+
#
|
|
20
|
+
# ==== See Also
|
|
21
|
+
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html
|
|
22
|
+
#
|
|
23
|
+
def list_metrics(options={})
|
|
24
|
+
if dimensions = options.delete('Dimensions')
|
|
25
|
+
options.merge!(AWS.indexed_param('Dimensions.member.%d.Name', dimensions.collect {|dimension| dimension['Name']}))
|
|
26
|
+
options.merge!(AWS.indexed_param('Dimensions.member.%d.Value', dimensions.collect {|dimension| dimension['Value']}))
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
request({
|
|
30
|
+
'Action' => 'ListMetrics',
|
|
31
|
+
:parser => Fog::Parsers::AWS::CloudWatch::ListMetrics.new
|
|
32
|
+
}.merge(options))
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class CloudWatch
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
require 'fog/aws/parsers/cloud_watch/put_metric_data'
|
|
7
|
+
|
|
8
|
+
# Publishes one or more data points to CloudWatch. A new metric is created if necessary
|
|
9
|
+
# ==== Options
|
|
10
|
+
# * Namespace<~String>: the namespace of the metric data
|
|
11
|
+
# * MetricData<~Array>: the datapoints to publish of the metric
|
|
12
|
+
# * MetricName<~String>: the name of the metric
|
|
13
|
+
# * Timestamp<~String>: the timestamp for the data point. If omitted defaults to the time at which the data is received by CloudWatch
|
|
14
|
+
# * Unit<~String>: the unit
|
|
15
|
+
# * Value<~Double> the value for the metric
|
|
16
|
+
# * StatisticValues<~Hash>:
|
|
17
|
+
# * Maximum<~Double>: the maximum value of the sample set
|
|
18
|
+
# * Sum<~Double>: the sum of the values of the sample set
|
|
19
|
+
# * SampleCount<~Double>: the number of samples used for the statistic set
|
|
20
|
+
# * Minimum<~Double>: the minimum value of the sample set
|
|
21
|
+
# * Dimensions<~Array>: the dimensions for the metric. From 0 to 10 may be included
|
|
22
|
+
# * Name<~String>
|
|
23
|
+
# * Value<~String>
|
|
24
|
+
# ==== Returns
|
|
25
|
+
# * response<~Excon::Response>:
|
|
26
|
+
#
|
|
27
|
+
# ==== See Also
|
|
28
|
+
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html
|
|
29
|
+
#
|
|
30
|
+
|
|
31
|
+
def put_metric_data(namespace, metric_data)
|
|
32
|
+
options = {'Namespace' => namespace}
|
|
33
|
+
|
|
34
|
+
#first index the dimensions for any of the datums that have dimensions
|
|
35
|
+
metric_data.collect! do |metric_datum|
|
|
36
|
+
if dimensions = metric_datum.delete('Dimensions')
|
|
37
|
+
metric_datum.merge!(AWS.indexed_param('Dimensions.member.%d.Name', dimensions.collect {|dimension| dimension['Name']}))
|
|
38
|
+
metric_datum.merge!(AWS.indexed_param('Dimensions.member.%d.Value', dimensions.collect {|dimension| dimension['Value']}))
|
|
39
|
+
end
|
|
40
|
+
metric_datum
|
|
41
|
+
end
|
|
42
|
+
#then flatten out an hashes in the metric_data array
|
|
43
|
+
metric_data.collect! { |metric_datum| flatten_hash(metric_datum) }
|
|
44
|
+
#then index the metric_data array
|
|
45
|
+
options.merge!(AWS.indexed_param('MetricData.member.%d', [*metric_data]))
|
|
46
|
+
#then finally flatten out an hashes in the overall options array
|
|
47
|
+
options = flatten_hash(options)
|
|
48
|
+
|
|
49
|
+
request({
|
|
50
|
+
'Action' => 'PutMetricData',
|
|
51
|
+
:parser => Fog::Parsers::AWS::CloudWatch::PutMetricData.new
|
|
52
|
+
}.merge(options))
|
|
53
|
+
end
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
def flatten_hash(starting)
|
|
57
|
+
finishing = {}
|
|
58
|
+
starting.each do |top_level_key, top_level_value|
|
|
59
|
+
if top_level_value.is_a?(Hash)
|
|
60
|
+
nested_hash = top_level_value
|
|
61
|
+
nested_hash.each do |nested_key, nested_value|
|
|
62
|
+
finishing["#{top_level_key}.#{nested_key}"] = nested_value
|
|
63
|
+
end
|
|
64
|
+
else
|
|
65
|
+
finishing[top_level_key] = top_level_value
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
return finishing
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -36,6 +36,30 @@ module Fog
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
end
|
|
39
|
+
|
|
40
|
+
class Mock
|
|
41
|
+
def configure_health_check(lb_name, health_check)
|
|
42
|
+
if load_balancer = self.data[:load_balancers][lb_name]
|
|
43
|
+
response = Excon::Response.new
|
|
44
|
+
response.status = 200
|
|
45
|
+
|
|
46
|
+
load_balancer['HealthCheck'] = health_check
|
|
47
|
+
|
|
48
|
+
response.body = {
|
|
49
|
+
'ResponseMetadata' => {
|
|
50
|
+
'RequestId' => Fog::AWS::Mock.request_id
|
|
51
|
+
},
|
|
52
|
+
'ConfigureHealthCheckResult' => {
|
|
53
|
+
'HealthCheck' => load_balancer['HealthCheck']
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
response
|
|
58
|
+
else
|
|
59
|
+
raise Fog::AWS::ELB::NotFound
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
39
63
|
end
|
|
40
64
|
end
|
|
41
65
|
end
|