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,60 @@
|
|
|
1
|
+
require 'fog/core/model'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module AWS
|
|
5
|
+
class AutoScaling
|
|
6
|
+
class Instance < Fog::Model
|
|
7
|
+
|
|
8
|
+
identity :id, :aliases => 'InstanceId'
|
|
9
|
+
attribute :auto_scaling_group_name, :aliases => 'AutoScalingGroupName'
|
|
10
|
+
attribute :availability_zone, :aliases => 'AvailabilityZone'
|
|
11
|
+
attribute :health_status, :aliases => 'HealthStatus'
|
|
12
|
+
attribute :launch_configuration_name, :aliases => 'LaunchConfigurationName'
|
|
13
|
+
attribute :life_cycle_state, :aliases => 'LifecycleState'
|
|
14
|
+
|
|
15
|
+
def initialize(attributes={})
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def group
|
|
20
|
+
connection.groups.get(attributes['AutoScalingGroupName'])
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def configuration
|
|
24
|
+
connection.configurations.get(attributes['LaunchConfigurationName'])
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def set_health(health_status, options)
|
|
28
|
+
requires :id
|
|
29
|
+
connection.set_instance_health(health_status, id, options)
|
|
30
|
+
reload
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def terminate(should_decrement_desired_capacity)
|
|
34
|
+
requires :id
|
|
35
|
+
connection.terminate_instance_in_auto_scaling_group(id, should_decrement_desired_capacity)
|
|
36
|
+
reload
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def healthy?
|
|
40
|
+
health_status == 'HEALTHY'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def ready?
|
|
44
|
+
life_cycle_state == 'InService'
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def reload
|
|
48
|
+
super
|
|
49
|
+
self
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
#def destroy
|
|
53
|
+
# requires :id
|
|
54
|
+
# connection.delete_auto_scaling_group(id)
|
|
55
|
+
#end
|
|
56
|
+
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'fog/aws/models/auto_scaling/instance'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module AWS
|
|
5
|
+
class AutoScaling
|
|
6
|
+
class Instances < Fog::Collection
|
|
7
|
+
|
|
8
|
+
model Fog::AWS::AutoScaling::Instance
|
|
9
|
+
|
|
10
|
+
def all
|
|
11
|
+
data = []
|
|
12
|
+
next_token = nil
|
|
13
|
+
loop do
|
|
14
|
+
result = connection.describe_auto_scaling_instances('NextToken' => next_token).body['DescribeAutoScalingInstancesResult']
|
|
15
|
+
data += result['AutoScalingInstances']
|
|
16
|
+
next_token = result['NextToken']
|
|
17
|
+
break if next_token.nil?
|
|
18
|
+
end
|
|
19
|
+
load(data)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def get(identity)
|
|
23
|
+
data = connection.describe_auto_scaling_instances('InstanceIds' => identity).body['DescribeAutoScalingInstancesResult']['AutoScalingInstances'].first
|
|
24
|
+
new(data) unless data.nil?
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'fog/core/model'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module AWS
|
|
5
|
+
class CloudWatch
|
|
6
|
+
|
|
7
|
+
class Metric < Fog::Model
|
|
8
|
+
attribute :name, :aliases => 'MetricName'
|
|
9
|
+
attribute :namespace, :aliases => 'Namespace'
|
|
10
|
+
attribute :dimensions, :aliases => 'Dimensions'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require 'fog/core/model'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module AWS
|
|
5
|
+
class CloudWatch
|
|
6
|
+
|
|
7
|
+
class MetricStatistic < Fog::Model
|
|
8
|
+
attribute :label, :aliases => 'Label'
|
|
9
|
+
attribute :minimum, :aliases => 'Minimum'
|
|
10
|
+
attribute :maximum, :aliases => 'Maximum'
|
|
11
|
+
attribute :sum, :aliases => 'Sum'
|
|
12
|
+
attribute :average, :aliases => 'Average'
|
|
13
|
+
attribute :sample_count, :aliases => 'SampleCount'
|
|
14
|
+
attribute :timestamp, :aliases => 'Timestamp'
|
|
15
|
+
attribute :unit, :aliases => 'Unit'
|
|
16
|
+
attribute :metric_name, :aliases => 'MetricName'
|
|
17
|
+
attribute :namespace, :aliases => 'Namespace'
|
|
18
|
+
attribute :dimensions, :aliases => 'Dimensions'
|
|
19
|
+
attribute :value
|
|
20
|
+
|
|
21
|
+
def save
|
|
22
|
+
requires :metric_name
|
|
23
|
+
requires :namespace
|
|
24
|
+
requires :unit
|
|
25
|
+
|
|
26
|
+
put_opts = {'MetricName' => metric_name, 'Unit' => unit}
|
|
27
|
+
put_opts.merge!('Dimensions' => dimensions) if dimensions
|
|
28
|
+
put_opts.merge!('Timestamp' => dimensions) if timestamp
|
|
29
|
+
if value
|
|
30
|
+
put_opts.merge!('Value' => value)
|
|
31
|
+
else
|
|
32
|
+
put_opts.merge!('StatisticValues' => {
|
|
33
|
+
'Minimum' => minimum,
|
|
34
|
+
'Maximum' => maximum,
|
|
35
|
+
'Sum' => sum,
|
|
36
|
+
'Average' => average,
|
|
37
|
+
'SampleCount' => sample_count
|
|
38
|
+
})
|
|
39
|
+
end
|
|
40
|
+
connection.put_metric_data(namespace, [put_opts])
|
|
41
|
+
true
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'fog/core/collection'
|
|
2
|
+
require 'fog/aws/models/cloud_watch/metric_statistic'
|
|
3
|
+
|
|
4
|
+
module Fog
|
|
5
|
+
module AWS
|
|
6
|
+
class CloudWatch
|
|
7
|
+
class MetricStatistics < Fog::Collection
|
|
8
|
+
model Fog::AWS::CloudWatch::MetricStatistic
|
|
9
|
+
|
|
10
|
+
def all(conditions)
|
|
11
|
+
metricName = conditions['MetricName']
|
|
12
|
+
namespace = conditions['Namespace']
|
|
13
|
+
dimensions = conditions['Dimensions']
|
|
14
|
+
get_metric_opts = {"StartTime" => (Time.now-3600).iso8601, "EndTime" => Time.now.iso8601, "Period" => 300}.merge(conditions)
|
|
15
|
+
data = connection.get_metric_statistics(get_metric_opts).body['GetMetricStatisticsResult']['Datapoints']
|
|
16
|
+
data.collect! { |datum| datum.merge('MetricName' => metricName, 'Namespace' => namespace, 'Dimensions' => dimensions) }
|
|
17
|
+
load(data) # data is an array of attribute hashes
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'fog/core/collection'
|
|
2
|
+
require 'fog/aws/models/cloud_watch/metric'
|
|
3
|
+
|
|
4
|
+
module Fog
|
|
5
|
+
module AWS
|
|
6
|
+
class CloudWatch
|
|
7
|
+
|
|
8
|
+
class Metrics < Fog::Collection
|
|
9
|
+
model Fog::AWS::CloudWatch::Metric
|
|
10
|
+
|
|
11
|
+
def all(conditions={})
|
|
12
|
+
data = connection.list_metrics(conditions).body['ListMetricsResult']['Metrics']
|
|
13
|
+
load(data) # data is an array of attribute hashes
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def get(namespace, metric_name, dimensions=nil)
|
|
17
|
+
list_opts = {'Namespace' => namespace, 'MetricName' => metric_name}
|
|
18
|
+
if dimensions
|
|
19
|
+
dimensions_array = dimensions.collect do |name, value|
|
|
20
|
+
{'Name' => name, 'Value' => value}
|
|
21
|
+
end
|
|
22
|
+
# list_opts.merge!('Dimensions' => dimensions_array)
|
|
23
|
+
end
|
|
24
|
+
if data = connection.list_metrics(list_opts).body['ListMetricsResult']['Metrics'].first
|
|
25
|
+
new(data)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -10,6 +10,12 @@ module Fog
|
|
|
10
10
|
attribute :protocol, :aliases => 'Protocol'
|
|
11
11
|
attribute :ssl_id, :aliases => 'SSLCertificateId'
|
|
12
12
|
|
|
13
|
+
def initialize(attributes={})
|
|
14
|
+
# set defaults, which may be overridden in super
|
|
15
|
+
merge_attributes(:policy_names => [], :instance_port => 80, :lb_port => 80, :protocol => 'HTTP')
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
|
|
13
19
|
def save
|
|
14
20
|
requires :load_balancer, :instance_port, :lb_port, :protocol
|
|
15
21
|
connection.create_load_balancer_listeners(load_balancer.id, [to_params])
|
|
@@ -17,9 +17,9 @@ module Fog
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
private
|
|
20
|
-
# Munge an array of
|
|
20
|
+
# Munge an array of ListenerDescription hashes like:
|
|
21
21
|
# {'Listener' => listener, 'PolicyNames' => []}
|
|
22
|
-
# to an array of listeners
|
|
22
|
+
# to an array of listeners with a PolicyNames key
|
|
23
23
|
def munged_data
|
|
24
24
|
data.map {|description|
|
|
25
25
|
description['Listener'].merge('PolicyNames' => description['PolicyNames'])
|
|
@@ -14,11 +14,14 @@ module Fog
|
|
|
14
14
|
attribute :source_group, :aliases => 'SourceSecurityGroup'
|
|
15
15
|
|
|
16
16
|
def initialize(attributes={})
|
|
17
|
-
attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d)
|
|
18
|
-
attributes['ListenerDescriptions']
|
|
19
|
-
|
|
20
|
-
'
|
|
21
|
-
|
|
17
|
+
attributes[:availability_zones] ||= attributes['AvailabilityZones'] || %w(us-east-1a us-east-1b us-east-1c us-east-1d)
|
|
18
|
+
unless attributes['ListenerDescriptions']
|
|
19
|
+
new_listener = Fog::AWS::ELB::Listener.new
|
|
20
|
+
attributes['ListenerDescriptions'] = [{
|
|
21
|
+
'Listener' => new_listener.to_params,
|
|
22
|
+
'PolicyNames' => new_listener.policy_names
|
|
23
|
+
}]
|
|
24
|
+
end
|
|
22
25
|
attributes['Policies'] ||= {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => []}
|
|
23
26
|
super
|
|
24
27
|
end
|
|
@@ -28,6 +28,7 @@ module Fog
|
|
|
28
28
|
attribute :db_security_groups, :aliases => 'DBSecurityGroups'
|
|
29
29
|
attribute :db_parameter_groups, :aliases => 'DBParameterGroups'
|
|
30
30
|
attribute :backup_retention_period, :aliases => 'BackupRetentionPeriod', :type => :integer
|
|
31
|
+
attribute :license_model, :aliases => 'LicenseModel'
|
|
31
32
|
|
|
32
33
|
attr_accessor :password, :parameter_group_name, :security_group_names, :port
|
|
33
34
|
|
|
@@ -89,7 +90,8 @@ module Fog
|
|
|
89
90
|
'MasterUserPassword' => password,
|
|
90
91
|
'PreferredMaintenanceWindow' => preferred_maintenance_window,
|
|
91
92
|
'PreferredBackupWindow' => preferred_backup_window,
|
|
92
|
-
'MultiAZ' => multi_az
|
|
93
|
+
'MultiAZ' => multi_az,
|
|
94
|
+
'LicenseModel' => license_model
|
|
93
95
|
}
|
|
94
96
|
options.delete_if {|key, value| value.nil?}
|
|
95
97
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Parsers
|
|
3
|
+
module AWS
|
|
4
|
+
module AutoScaling
|
|
5
|
+
|
|
6
|
+
class Basic < Fog::Parsers::Base
|
|
7
|
+
|
|
8
|
+
def reset
|
|
9
|
+
@response = { 'ResponseMetadata' => {} }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def start_element(name, attrs = [])
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def end_element(name)
|
|
17
|
+
case name
|
|
18
|
+
when 'RequestId'
|
|
19
|
+
@response['ResponseMetadata'][name] = value
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Parsers
|
|
3
|
+
module AWS
|
|
4
|
+
module AutoScaling
|
|
5
|
+
|
|
6
|
+
class DescribeAdjustmentTypes < Fog::Parsers::Base
|
|
7
|
+
|
|
8
|
+
def reset
|
|
9
|
+
reset_adjustment_type
|
|
10
|
+
@results = { 'AdjustmentTypes' => [] }
|
|
11
|
+
@response = { 'DescribeAdjustmentTypesResult' => {}, 'ResponseMetadata' => {} }
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def reset_adjustment_type
|
|
15
|
+
@adjustment_type = {}
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def end_element(name)
|
|
19
|
+
case name
|
|
20
|
+
when 'member'
|
|
21
|
+
@results['AdjustmentTypes'] << @adjustment_type
|
|
22
|
+
reset_adjustment_type
|
|
23
|
+
|
|
24
|
+
when 'AdjustmentType'
|
|
25
|
+
@adjustment_type[name] = value
|
|
26
|
+
|
|
27
|
+
when 'RequestId'
|
|
28
|
+
@response['ResponseMetadata'][name] = value
|
|
29
|
+
|
|
30
|
+
when 'DescribeAdjustmentTypesResponse'
|
|
31
|
+
@response['DescribeAdjustmentTypesResult'] = @results
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Parsers
|
|
3
|
+
module AWS
|
|
4
|
+
module AutoScaling
|
|
5
|
+
|
|
6
|
+
class DescribeAutoScalingGroups < Fog::Parsers::Base
|
|
7
|
+
|
|
8
|
+
def reset
|
|
9
|
+
reset_auto_scaling_group
|
|
10
|
+
reset_enabled_metric
|
|
11
|
+
reset_instance
|
|
12
|
+
reset_suspended_process
|
|
13
|
+
@results = { 'AutoScalingGroups' => [] }
|
|
14
|
+
@response = { 'DescribeAutoScalingGroupsResult' => {}, 'ResponseMetadata' => {} }
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def reset_auto_scaling_group
|
|
18
|
+
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [], 'LoadBalancerNames' => [], 'SuspendedProcesses' => [] }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def reset_enabled_metric
|
|
22
|
+
@enabled_metric = {}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def reset_instance
|
|
26
|
+
@instance = {}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def reset_suspended_process
|
|
30
|
+
@suspended_process = {}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def start_element(name, attrs = [])
|
|
34
|
+
super
|
|
35
|
+
case name
|
|
36
|
+
when 'AvailabilityZones'
|
|
37
|
+
@in_availability_zones = true
|
|
38
|
+
when 'EnabledMetrics'
|
|
39
|
+
@in_enabled_metrics = true
|
|
40
|
+
when 'Instances'
|
|
41
|
+
@in_instances = true
|
|
42
|
+
when 'LoadBalancerNames'
|
|
43
|
+
@in_load_balancer_names = true
|
|
44
|
+
when 'SuspendedProcesses'
|
|
45
|
+
@in_suspended_processes = true
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def end_element(name)
|
|
50
|
+
case name
|
|
51
|
+
when 'member'
|
|
52
|
+
if @in_availability_zones
|
|
53
|
+
@auto_scaling_group['AvailabilityZones'] << value
|
|
54
|
+
elsif @in_enabled_metrics
|
|
55
|
+
@auto_scaling_group['EnabledMetrics'] << @enabled_metric
|
|
56
|
+
reset_enabled_metric
|
|
57
|
+
elsif @in_instances
|
|
58
|
+
@auto_scaling_group['Instances'] << @instance
|
|
59
|
+
reset_instance
|
|
60
|
+
elsif @in_load_balancer_names
|
|
61
|
+
@auto_scaling_group['LoadBalancerNames'] << value
|
|
62
|
+
elsif @in_suspended_processes
|
|
63
|
+
@auto_scaling_group['SuspendedProcesses'] << @suspended_process
|
|
64
|
+
reset_suspended_process
|
|
65
|
+
elsif !@in_instances && !@in_policies
|
|
66
|
+
@results['AutoScalingGroups'] << @auto_scaling_group
|
|
67
|
+
reset_auto_scaling_group
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
when 'AvailabilityZones'
|
|
71
|
+
@in_availability_zones = false
|
|
72
|
+
|
|
73
|
+
when 'Granularity', 'Metric'
|
|
74
|
+
@enabled_metric[name] = value
|
|
75
|
+
when 'EnabledMetrics'
|
|
76
|
+
@in_enabled_metrics = false
|
|
77
|
+
|
|
78
|
+
when 'LaunchConfigurationName'
|
|
79
|
+
if @in_instances
|
|
80
|
+
@instance[name] = value
|
|
81
|
+
else
|
|
82
|
+
@auto_scaling_group[name] = value
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
when 'AvailabilityZone', 'HealthStatus', 'InstanceId', 'LifecycleState'
|
|
86
|
+
@instance[name] = value
|
|
87
|
+
when 'Instances'
|
|
88
|
+
@in_instances = false
|
|
89
|
+
|
|
90
|
+
when 'LoadBalancerNames'
|
|
91
|
+
@in_load_balancer_names = false
|
|
92
|
+
|
|
93
|
+
when 'ProcessName', 'SuspensionReason'
|
|
94
|
+
@suspended_process[name] = value
|
|
95
|
+
when 'SuspendedProcesses'
|
|
96
|
+
@in_suspended_processes = false
|
|
97
|
+
|
|
98
|
+
when 'AutoScalingGroupARN', 'AutoScalingGroupName'
|
|
99
|
+
@auto_scaling_group[name] = value
|
|
100
|
+
when 'CreatedTime'
|
|
101
|
+
@auto_scaling_group[name] = Time.parse(value)
|
|
102
|
+
when 'DefaultCooldown', 'DesiredCapacity', 'HealthCheckGracePeriod'
|
|
103
|
+
@auto_scaling_group[name] = value.to_i
|
|
104
|
+
when 'HealthCheckType'
|
|
105
|
+
@auto_scaling_group[name] = value
|
|
106
|
+
when 'MaxSize', 'MinSize'
|
|
107
|
+
@auto_scaling_group[name] = value.to_i
|
|
108
|
+
when 'PlacementGroup', 'VPCZoneIdentifier'
|
|
109
|
+
@auto_scaling_group[name] = value
|
|
110
|
+
|
|
111
|
+
when 'NextToken'
|
|
112
|
+
@results[name] = value
|
|
113
|
+
|
|
114
|
+
when 'RequestId'
|
|
115
|
+
@response['ResponseMetadata'][name] = value
|
|
116
|
+
|
|
117
|
+
when 'DescribeAutoScalingGroupsResponse'
|
|
118
|
+
@response['DescribeAutoScalingGroupsResult'] = @results
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|