fog 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -12
- data/Rakefile +3 -2
- data/benchs/parse_vs_push.rb +17 -8
- data/bin/fog +2 -2
- data/changelog.txt +123 -0
- data/docs/_layouts/default.html +21 -8
- data/docs/{_posts/2011-01-01-contributing.markdown → about/contributing.markdown} +0 -0
- data/docs/about/getting_started.markdown +83 -0
- data/docs/{_posts/2011-01-01-press.markdown → about/press.markdown} +6 -1
- data/docs/{_posts/2011-01-01-structure.markdown → about/structure.markdown} +0 -0
- data/docs/{_posts/2011-01-01-users.markdown → about/users.markdown} +0 -0
- data/docs/{_posts/2011-01-01-cdn.markdown → cdn/index.markdown} +12 -12
- data/docs/{_posts/2011-01-01-dns.markdown → dns/index.markdown} +18 -18
- data/docs/index.markdown +5 -4
- data/docs/{_posts/2011-01-01-storage.markdown → storage/index.markdown} +59 -21
- data/fog.gemspec +3 -9
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/elb.rb +46 -12
- data/lib/fog/aws/iam.rb +1 -0
- data/lib/fog/aws/models/elb/listener.rb +51 -0
- data/lib/fog/aws/models/elb/listeners.rb +32 -0
- data/lib/fog/aws/models/elb/load_balancer.rb +129 -0
- data/lib/fog/aws/models/elb/load_balancers.rb +28 -0
- data/lib/fog/aws/models/elb/policies.rb +40 -0
- data/lib/fog/aws/models/elb/policy.rb +52 -0
- data/lib/fog/aws/{rds/models → models/rds}/parameter.rb +0 -0
- data/lib/fog/aws/{rds/models → models/rds}/parameter_group.rb +0 -0
- data/lib/fog/aws/{rds/models → models/rds}/parameter_groups.rb +1 -1
- data/lib/fog/aws/{rds/models → models/rds}/parameters.rb +1 -1
- data/lib/fog/aws/{rds/models → models/rds}/security_group.rb +0 -0
- data/lib/fog/aws/{rds/models → models/rds}/security_groups.rb +1 -1
- data/lib/fog/aws/{rds/models → models/rds}/server.rb +0 -0
- data/lib/fog/aws/{rds/models → models/rds}/servers.rb +1 -1
- data/lib/fog/aws/{rds/models → models/rds}/snapshot.rb +0 -0
- data/lib/fog/aws/{rds/models → models/rds}/snapshots.rb +1 -1
- data/lib/fog/aws/parsers/cloud_formation/create_stack.rb +1 -1
- data/lib/fog/aws/parsers/cloud_formation/describe_stack_events.rb +3 -3
- data/lib/fog/aws/parsers/cloud_formation/describe_stack_resources.rb +3 -3
- data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +6 -6
- data/lib/fog/aws/parsers/cloud_formation/get_template.rb +1 -1
- data/lib/fog/aws/parsers/cloud_formation/validate_template.rb +5 -5
- data/lib/fog/aws/parsers/elb/configure_health_check.rb +37 -0
- data/lib/fog/aws/parsers/elb/create_load_balancer.rb +2 -2
- data/lib/fog/aws/parsers/elb/delete_load_balancer.rb +1 -1
- data/lib/fog/aws/parsers/elb/deregister_instances_from_load_balancer.rb +2 -2
- data/lib/fog/aws/parsers/elb/describe_instance_health.rb +2 -2
- data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +36 -16
- data/lib/fog/aws/parsers/elb/disable_availability_zones_for_load_balancer.rb +2 -2
- data/lib/fog/aws/parsers/elb/empty.rb +28 -0
- data/lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb +2 -2
- data/lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb +2 -2
- data/lib/fog/aws/parsers/iam/basic.rb +1 -1
- data/lib/fog/aws/parsers/iam/create_access_key.rb +2 -2
- data/lib/fog/aws/parsers/iam/create_group.rb +2 -2
- data/lib/fog/aws/parsers/iam/create_user.rb +2 -2
- data/lib/fog/aws/parsers/iam/get_group.rb +6 -6
- data/lib/fog/aws/parsers/iam/get_user.rb +2 -2
- data/lib/fog/aws/parsers/iam/get_user_policy.rb +2 -2
- data/lib/fog/aws/parsers/iam/list_access_keys.rb +3 -3
- data/lib/fog/aws/parsers/iam/list_groups.rb +3 -3
- data/lib/fog/aws/parsers/iam/list_groups_for_user.rb +3 -3
- data/lib/fog/aws/parsers/iam/list_policies.rb +3 -3
- data/lib/fog/aws/parsers/iam/list_server_certificates.rb +38 -0
- data/lib/fog/aws/parsers/iam/list_signing_certificates.rb +3 -3
- data/lib/fog/aws/parsers/iam/list_users.rb +3 -3
- data/lib/fog/aws/parsers/iam/login_profile.rb +3 -3
- data/lib/fog/aws/parsers/iam/update_group.rb +2 -2
- data/lib/fog/aws/parsers/iam/update_user.rb +2 -2
- data/lib/fog/aws/parsers/iam/upload_server_certificate.rb +5 -3
- data/lib/fog/aws/parsers/iam/upload_signing_certificate.rb +2 -2
- data/lib/fog/aws/parsers/rds/authorize_db_security_group_ingress.rb +1 -1
- data/lib/fog/aws/parsers/rds/create_db_instance.rb +1 -1
- data/lib/fog/aws/parsers/rds/create_db_instance_read_replica.rb +1 -1
- data/lib/fog/aws/parsers/rds/create_db_parameter_group.rb +4 -4
- data/lib/fog/aws/parsers/rds/create_db_security_group.rb +1 -1
- data/lib/fog/aws/parsers/rds/create_db_snapshot.rb +1 -1
- data/lib/fog/aws/parsers/rds/db_parser.rb +16 -16
- data/lib/fog/aws/parsers/rds/delete_db_instance.rb +1 -1
- data/lib/fog/aws/parsers/rds/delete_db_parameter_group.rb +1 -1
- data/lib/fog/aws/parsers/rds/delete_db_security_group.rb +1 -1
- data/lib/fog/aws/parsers/rds/delete_db_snapshot.rb +1 -1
- data/lib/fog/aws/parsers/rds/describe_db_instances.rb +2 -2
- data/lib/fog/aws/parsers/rds/describe_db_parameter_groups.rb +5 -5
- data/lib/fog/aws/parsers/rds/describe_db_parameters.rb +10 -10
- data/lib/fog/aws/parsers/rds/describe_db_security_groups.rb +2 -2
- data/lib/fog/aws/parsers/rds/describe_db_snapshots.rb +2 -2
- data/lib/fog/aws/parsers/rds/modify_db_instance.rb +1 -1
- data/lib/fog/aws/parsers/rds/modify_db_parameter_group.rb +2 -2
- data/lib/fog/aws/parsers/rds/reboot_db_instance.rb +1 -1
- data/lib/fog/aws/parsers/rds/restore_db_instance_from_db_snapshot.rb +1 -1
- data/lib/fog/aws/parsers/rds/restore_db_instance_to_point_in_time.rb +1 -1
- data/lib/fog/aws/parsers/rds/revoke_db_security_group_ingress.rb +1 -1
- data/lib/fog/aws/parsers/rds/security_group_parser.rb +4 -4
- data/lib/fog/aws/parsers/rds/snapshot_parser.rb +11 -11
- data/lib/fog/aws/parsers/ses/delete_verified_email_address.rb +1 -1
- data/lib/fog/aws/parsers/ses/get_send_quota.rb +2 -2
- data/lib/fog/aws/parsers/ses/get_send_statistics.rb +2 -2
- data/lib/fog/aws/parsers/ses/list_verified_email_addresses.rb +2 -2
- data/lib/fog/aws/parsers/ses/send_email.rb +2 -2
- data/lib/fog/aws/parsers/ses/send_raw_email.rb +2 -2
- data/lib/fog/aws/parsers/ses/verify_email_address.rb +1 -1
- data/lib/fog/aws/parsers/simpledb/basic.rb +2 -2
- data/lib/fog/aws/parsers/simpledb/domain_metadata.rb +4 -4
- data/lib/fog/aws/parsers/simpledb/get_attributes.rb +4 -4
- data/lib/fog/aws/parsers/simpledb/list_domains.rb +3 -3
- data/lib/fog/aws/parsers/simpledb/select.rb +5 -5
- data/lib/fog/aws/rds.rb +2 -3
- data/lib/fog/aws/requests/elb/configure_health_check.rb +41 -0
- data/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb +33 -0
- data/lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb +35 -0
- data/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +51 -0
- data/lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb +31 -0
- data/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb +31 -0
- data/lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb +43 -0
- data/lib/fog/aws/requests/iam/list_server_certificates.rb +42 -0
- data/lib/fog/aws/requests/ses/send_raw_email.rb +4 -4
- data/lib/fog/aws/simpledb.rb +2 -2
- data/lib/fog/bin.rb +1 -0
- data/lib/fog/bin/stormondemand.rb +30 -0
- data/lib/fog/cdn/parsers/aws/distribution.rb +11 -11
- data/lib/fog/cdn/parsers/aws/get_distribution_list.rb +9 -9
- data/lib/fog/cdn/parsers/aws/post_invalidation.rb +3 -3
- data/lib/fog/compute.rb +3 -0
- data/lib/fog/compute/aws.rb +4 -2
- data/lib/fog/compute/models/aws/server.rb +16 -2
- data/lib/fog/compute/models/bluebox/server.rb +11 -2
- data/lib/fog/compute/models/brightbox/server.rb +6 -0
- data/lib/fog/compute/models/ecloud/servers.rb +3 -1
- data/lib/fog/compute/models/go_grid/server.rb +1 -0
- data/lib/fog/compute/models/rackspace/server.rb +2 -1
- data/lib/fog/compute/models/slicehost/server.rb +2 -1
- data/lib/fog/compute/models/storm_on_demand/balancer.rb +38 -0
- data/lib/fog/compute/models/storm_on_demand/balancers.rb +21 -0
- data/lib/fog/compute/models/storm_on_demand/config.rb +25 -0
- data/lib/fog/compute/models/storm_on_demand/configs.rb +22 -0
- data/lib/fog/compute/models/storm_on_demand/image.rb +20 -0
- data/lib/fog/compute/models/storm_on_demand/images.rb +21 -0
- data/lib/fog/compute/models/storm_on_demand/private_ip.rb +19 -0
- data/lib/fog/compute/models/storm_on_demand/private_ips.rb +31 -0
- data/lib/fog/compute/models/storm_on_demand/server.rb +74 -0
- data/lib/fog/compute/models/storm_on_demand/servers.rb +26 -0
- data/lib/fog/compute/models/storm_on_demand/stat.rb +23 -0
- data/lib/fog/compute/models/storm_on_demand/stats.rb +22 -0
- data/lib/fog/compute/models/storm_on_demand/template.rb +22 -0
- data/lib/fog/compute/models/storm_on_demand/templates.rb +21 -0
- data/lib/fog/compute/models/voxel/image.rb +4 -1
- data/lib/fog/compute/models/voxel/server.rb +1 -0
- data/lib/fog/compute/parsers/aws/allocate_address.rb +1 -1
- data/lib/fog/compute/parsers/aws/attach_volume.rb +2 -2
- data/lib/fog/compute/parsers/aws/basic.rb +2 -2
- data/lib/fog/compute/parsers/aws/create_image.rb +1 -1
- data/lib/fog/compute/parsers/aws/create_key_pair.rb +1 -1
- data/lib/fog/compute/parsers/aws/create_snapshot.rb +4 -4
- data/lib/fog/compute/parsers/aws/create_volume.rb +3 -3
- data/lib/fog/compute/parsers/aws/deregister_image.rb +1 -1
- data/lib/fog/compute/parsers/aws/describe_addresses.rb +2 -2
- data/lib/fog/compute/parsers/aws/describe_availability_zones.rb +3 -3
- data/lib/fog/compute/parsers/aws/describe_images.rb +7 -7
- data/lib/fog/compute/parsers/aws/describe_instances.rb +17 -17
- data/lib/fog/compute/parsers/aws/describe_key_pairs.rb +2 -2
- data/lib/fog/compute/parsers/aws/describe_regions.rb +2 -2
- data/lib/fog/compute/parsers/aws/describe_reserved_instances.rb +5 -5
- data/lib/fog/compute/parsers/aws/describe_reserved_instances_offerings.rb +4 -4
- data/lib/fog/compute/parsers/aws/describe_security_groups.rb +8 -8
- data/lib/fog/compute/parsers/aws/describe_snapshots.rb +5 -5
- data/lib/fog/compute/parsers/aws/describe_tags.rb +2 -2
- data/lib/fog/compute/parsers/aws/describe_volumes.rb +8 -8
- data/lib/fog/compute/parsers/aws/detach_volume.rb +2 -2
- data/lib/fog/compute/parsers/aws/get_console_output.rb +3 -7
- data/lib/fog/compute/parsers/aws/import_key_pair.rb +1 -1
- data/lib/fog/compute/parsers/aws/monitor_unmonitor_instances.rb +3 -3
- data/lib/fog/compute/parsers/aws/register_image.rb +1 -1
- data/lib/fog/compute/parsers/aws/run_instances.rb +14 -22
- data/lib/fog/compute/parsers/aws/start_stop_instances.rb +3 -3
- data/lib/fog/compute/parsers/aws/terminate_instances.rb +6 -6
- data/lib/fog/compute/parsers/slicehost/create_slice.rb +4 -4
- data/lib/fog/compute/parsers/slicehost/get_backups.rb +3 -3
- data/lib/fog/compute/parsers/slicehost/get_flavor.rb +2 -2
- data/lib/fog/compute/parsers/slicehost/get_flavors.rb +2 -2
- data/lib/fog/compute/parsers/slicehost/get_image.rb +2 -2
- data/lib/fog/compute/parsers/slicehost/get_images.rb +2 -2
- data/lib/fog/compute/parsers/slicehost/get_slice.rb +4 -4
- data/lib/fog/compute/parsers/slicehost/get_slices.rb +4 -4
- data/lib/fog/compute/parsers/voxel/devices_list.rb +12 -12
- data/lib/fog/compute/parsers/voxel/images_list.rb +5 -5
- data/lib/fog/compute/parsers/voxel/voxcloud_create.rb +2 -2
- data/lib/fog/compute/parsers/voxel/voxcloud_status.rb +2 -2
- data/lib/fog/compute/requests/aws/describe_availability_zones.rb +17 -1
- data/lib/fog/compute/requests/aws/describe_instances.rb +6 -1
- data/lib/fog/compute/requests/storm_on_demand/add_balancer_node.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/clone_server.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/create_server.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/delete_server.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/get_server.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/get_stats.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/list_balancers.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/list_configs.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/list_images.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/list_private_ips.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/list_servers.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/list_templates.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/reboot_server.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/remove_balancer_node.rb +16 -0
- data/lib/fog/compute/requests/storm_on_demand/resize_server.rb +16 -0
- data/lib/fog/compute/requests/voxel/images_list.rb +3 -3
- data/lib/fog/compute/storm_on_demand.rb +122 -0
- data/lib/fog/core/attributes.rb +12 -0
- data/lib/fog/core/credentials.rb +1 -52
- data/lib/fog/core/errors.rb +53 -0
- data/lib/fog/core/model.rb +10 -5
- data/lib/fog/core/parser.rb +8 -3
- data/lib/fog/dns/models/aws/records.rb +1 -1
- data/lib/fog/dns/models/aws/zones.rb +1 -1
- data/lib/fog/dns/parsers/aws/change_resource_record_sets.rb +2 -2
- data/lib/fog/dns/parsers/aws/create_hosted_zone.rb +5 -5
- data/lib/fog/dns/parsers/aws/delete_hosted_zone.rb +1 -1
- data/lib/fog/dns/parsers/aws/get_change.rb +2 -2
- data/lib/fog/dns/parsers/aws/get_hosted_zone.rb +3 -3
- data/lib/fog/dns/parsers/aws/list_hosted_zones.rb +4 -4
- data/lib/fog/dns/parsers/aws/list_resource_record_sets.rb +4 -4
- data/lib/fog/dns/parsers/bluebox/create_record.rb +2 -2
- data/lib/fog/dns/parsers/bluebox/create_zone.rb +2 -2
- data/lib/fog/dns/parsers/bluebox/get_record.rb +1 -1
- data/lib/fog/dns/parsers/bluebox/get_records.rb +1 -1
- data/lib/fog/dns/parsers/bluebox/get_zone.rb +2 -2
- data/lib/fog/dns/parsers/bluebox/get_zones.rb +2 -2
- data/lib/fog/dns/parsers/slicehost/create_record.rb +2 -2
- data/lib/fog/dns/parsers/slicehost/create_zone.rb +2 -2
- data/lib/fog/dns/parsers/slicehost/get_record.rb +2 -2
- data/lib/fog/dns/parsers/slicehost/get_records.rb +2 -2
- data/lib/fog/dns/parsers/slicehost/get_zone.rb +2 -2
- data/lib/fog/dns/parsers/slicehost/get_zones.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/count_hosts.rb +1 -1
- data/lib/fog/dns/parsers/zerigo/count_zones.rb +1 -1
- data/lib/fog/dns/parsers/zerigo/create_host.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/create_zone.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/find_hosts.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/get_host.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/get_zone.rb +4 -4
- data/lib/fog/dns/parsers/zerigo/get_zone_stats.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/list_hosts.rb +2 -2
- data/lib/fog/dns/parsers/zerigo/list_zones.rb +2 -2
- data/lib/fog/providers.rb +1 -0
- data/lib/fog/providers/aws.rb +5 -1
- data/lib/fog/providers/storm_on_demand.rb +12 -0
- data/lib/fog/storage/models/aws/files.rb +17 -0
- data/lib/fog/storage/models/google/files.rb +17 -0
- data/lib/fog/storage/models/rackspace/files.rb +17 -0
- data/lib/fog/storage/parsers/aws/access_control_list.rb +4 -4
- data/lib/fog/storage/parsers/aws/complete_multipart_upload.rb +1 -1
- data/lib/fog/storage/parsers/aws/copy_object.rb +2 -2
- data/lib/fog/storage/parsers/aws/get_bucket.rb +10 -10
- data/lib/fog/storage/parsers/aws/get_bucket_location.rb +1 -1
- data/lib/fog/storage/parsers/aws/get_bucket_logging.rb +5 -5
- data/lib/fog/storage/parsers/aws/get_bucket_object_versions.rb +8 -8
- data/lib/fog/storage/parsers/aws/get_bucket_versioning.rb +1 -1
- data/lib/fog/storage/parsers/aws/get_bucket_website.rb +2 -2
- data/lib/fog/storage/parsers/aws/get_request_payment.rb +1 -1
- data/lib/fog/storage/parsers/aws/get_service.rb +3 -3
- data/lib/fog/storage/parsers/aws/initiate_multipart_upload.rb +1 -1
- data/lib/fog/storage/parsers/aws/list_multipart_uploads.rb +7 -7
- data/lib/fog/storage/parsers/aws/list_parts.rb +7 -7
- data/lib/fog/storage/parsers/google/access_control_list.rb +3 -3
- data/lib/fog/storage/parsers/google/copy_object.rb +2 -2
- data/lib/fog/storage/parsers/google/get_bucket.rb +10 -10
- data/lib/fog/storage/parsers/google/get_bucket_logging.rb +5 -5
- data/lib/fog/storage/parsers/google/get_bucket_object_versions.rb +9 -9
- data/lib/fog/storage/parsers/google/get_bucket_versioning.rb +1 -1
- data/lib/fog/storage/parsers/google/get_request_payment.rb +1 -1
- data/lib/fog/storage/parsers/google/get_service.rb +3 -3
- data/lib/fog/storage/requests/aws/get_object.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_catalog.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_internet_services.rb +7 -7
- data/lib/fog/terremark/parsers/shared/get_network_ips.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_node_services.rb +3 -3
- data/lib/fog/terremark/parsers/shared/get_organization.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_public_ips.rb +2 -2
- data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_vdc.rb +6 -6
- data/lib/fog/terremark/parsers/shared/internet_service.rb +7 -7
- data/lib/fog/terremark/parsers/shared/network.rb +1 -1
- data/lib/fog/terremark/parsers/shared/node_service.rb +3 -3
- data/lib/fog/terremark/parsers/shared/public_ip.rb +2 -2
- data/lib/fog/terremark/parsers/shared/vapp.rb +7 -7
- data/spec/ecloud/spec_helper.rb +1 -1
- data/tests/aws/requests/cloud_formation/stack_tests.rb +2 -0
- data/tests/aws/requests/elb/helper.rb +44 -0
- data/tests/aws/requests/elb/load_balancer_tests.rb +82 -0
- data/tests/aws/requests/elb/model_tests.rb +187 -0
- data/tests/aws/requests/iam/helper.rb +41 -0
- data/tests/aws/requests/iam/login_profile_tests.rb +1 -1
- data/tests/aws/requests/iam/server_certificate_tests.rb +36 -0
- data/tests/aws/requests/rds/instance_tests.rb +63 -66
- data/tests/aws/requests/simpledb/attributes_tests.rb +4 -4
- data/tests/aws/signed_params_tests.rb +3 -0
- data/tests/compute/helper.rb +2 -2
- data/tests/compute/models/aws/address_tests.rb +2 -2
- data/tests/compute/models/aws/security_group_tests.rb +12 -0
- data/tests/compute/models/aws/server_tests.rb +8 -1
- data/tests/compute/models/aws/snapshot_tests.rb +2 -2
- data/tests/compute/models/aws/volume_tests.rb +3 -3
- data/tests/compute/requests/aws/address_tests.rb +1 -1
- data/tests/compute/requests/aws/instance_tests.rb +1 -1
- data/tests/compute/requests/aws/key_pair_tests.rb +5 -1
- data/tests/compute/requests/aws/snapshot_tests.rb +1 -1
- data/tests/compute/requests/aws/tag_tests.rb +1 -1
- data/tests/compute/requests/aws/volume_tests.rb +3 -3
- data/tests/compute/requests/bluebox/block_tests.rb +14 -13
- data/tests/compute/requests/brightbox/helper.rb +1 -2
- data/tests/compute/requests/storm_on_demand/server_tests.rb +64 -0
- data/tests/compute/requests/voxel/image_tests.rb +30 -24
- data/tests/compute/requests/voxel/server_tests.rb +1 -1
- data/tests/dns/requests/aws/dns_tests.rb +1 -1
- data/tests/helper.rb +1 -1
- data/tests/storage/requests/aws/multipart_upload_tests.rb +1 -1
- data/tests/storage/requests/google/bucket_tests.rb +0 -1
- data/tests/storage/requests/rackspace/object_tests.rb +1 -0
- metadata +125 -66
- data/docs/_posts/2011-01-01-start.markdown +0 -21
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
layout: default
|
3
|
-
title:
|
3
|
+
title: DNS
|
4
4
|
---
|
5
5
|
|
6
6
|
The power and flexibility of the cloud are amazing. But sometimes it can be a pain to chase your resources around and keep everything up to date. This is especially true of keeping track of addresses for DNS, but thankfully more and more API driven options are available, allowing you to automate your DNS to keep up with your hardware changes.
|
@@ -18,9 +18,9 @@ For this first example we will use Zerigo (see below for how to use other provid
|
|
18
18
|
|
19
19
|
# create a connection to the service
|
20
20
|
dns = Fog::DNS.new({
|
21
|
-
:provider
|
22
|
-
:zerigo_email
|
23
|
-
:zerigo_token
|
21
|
+
:provider => 'Zerigo',
|
22
|
+
:zerigo_email => ZERIGO_EMAIL,
|
23
|
+
:zerigo_token => ZERIGO_TOKEN
|
24
24
|
}
|
25
25
|
|
26
26
|
## Getting in the Zone
|
@@ -28,8 +28,8 @@ For this first example we will use Zerigo (see below for how to use other provid
|
|
28
28
|
The first thing you need to do to prepare for your DNS excursion is create a zone for your domain. The zone will contain all of the more specific records that you will create later. You will just need to specify the domain, which should be your url without the 'http' or 'www' parts, and an email address. Then you can create the zone with your DNS connection:<!--more-->
|
29
29
|
|
30
30
|
zone = @dns.zones.create(
|
31
|
-
:domain
|
32
|
-
:email
|
31
|
+
:domain => 'example.com',
|
32
|
+
:email => 'admin@example.com'
|
33
33
|
)
|
34
34
|
|
35
35
|
Now that you have a zone you will need to update your registrar to let them know what DNS servers are responsible for your domain. You can ask the zone what values to use:
|
@@ -41,25 +41,25 @@ Now that you have a zone you will need to update your registrar to let them know
|
|
41
41
|
With your new zone in hand you can add records as needed. First and foremost you will probably want the 'www' version of your site to point to whatever your ip might be:
|
42
42
|
|
43
43
|
record = @zone.records.create(
|
44
|
-
:ip
|
45
|
-
:name
|
46
|
-
:type
|
44
|
+
:ip => '1.2.3.4',
|
45
|
+
:name => 'example.com',
|
46
|
+
:type => 'A'
|
47
47
|
)
|
48
48
|
|
49
49
|
Adding other records is similarly easy, for instance if we want 'www.example.com' to go to the same place, we can use a cname record:
|
50
50
|
|
51
51
|
record = @zone.records.create(
|
52
|
-
:ip
|
53
|
-
:name
|
54
|
-
:type
|
52
|
+
:ip => 'example.com',
|
53
|
+
:name => 'www',
|
54
|
+
:type => 'CNAME'
|
55
55
|
)
|
56
56
|
|
57
57
|
Or, similarly you might want to have your blog elsewhere:
|
58
58
|
|
59
59
|
record = @zone.records.create(
|
60
|
-
:ip
|
61
|
-
:name
|
62
|
-
:type
|
60
|
+
:ip => '4.3.2.1',
|
61
|
+
:name => 'blog.example.com',
|
62
|
+
:type => 'A'
|
63
63
|
)
|
64
64
|
|
65
65
|
You can add more specifics if you need to, but reasonable defaults make it just that easy. You can also add any other kind of DNS record you might need for mail or other purposes, you can find a nice overview of record options and types <a href="http://en.wikipedia.org/wiki/Domain_Name_System#DNS_resource_records">on Wikipedia</a>.
|
@@ -69,9 +69,9 @@ You can add more specifics if you need to, but reasonable defaults make it just
|
|
69
69
|
If you already have an account with another service you can just as easily use this same code with different credentials. fog currently supports <a href="http://aws.amazon.com/route53/">AWS Route 53</a>, <a href="http://bluebox.net">Blue Box</a>, <a href="http://dnsimple.com">DNSimple</a>, <a href="http://www.linode.com">Linode</a>, <a href="http://www.slicehost.com">Slicehost</a> and <a href="http://www.zerigo.com/managed-dns">Zerigo</a>; so you can have your pick. As an example you can connect to AWS instead of Zerigo:
|
70
70
|
|
71
71
|
dns = Fog::DNS.new(
|
72
|
-
:provider
|
73
|
-
:aws_access_key_id
|
74
|
-
:aws_secret_access_key
|
72
|
+
:provider => 'AWS',
|
73
|
+
:aws_access_key_id => AWS_ACCESS_KEY_ID,
|
74
|
+
:aws_secret_access_key => AWS_SECRET_ACCESS_KEY
|
75
75
|
)
|
76
76
|
|
77
77
|
## Go Forth and Resolve
|
data/docs/index.markdown
CHANGED
@@ -28,7 +28,7 @@ Now type 'fog' to try stuff, confident that fog will let you know what to do. He
|
|
28
28
|
|
29
29
|
## Go forth and conquer
|
30
30
|
|
31
|
-
Play around and use the console to explore or check out the [getting started guide](
|
31
|
+
Play around and use the console to explore or check out the [getting started guide](/about/getting_started.html) for more details. Once you are reading to start scripting fog, here is a quick hint on how to make connections without the command line thing to help you.
|
32
32
|
|
33
33
|
# create a compute connection
|
34
34
|
compute = Fog::Compute.new(:provider => 'AWS', :aws_access_key_id => ACCESS_KEY_ID, :aws_secret_access_key => SECRET_ACCESS_KEY)
|
@@ -60,13 +60,14 @@ Wonder how you can get a lovely fog shirt? Look no further!
|
|
60
60
|
|
61
61
|
Enjoy, and let me know what I can do to continue improving fog!
|
62
62
|
|
63
|
+
* Work through the [fog tutorial](https://github.com/downloads/geemus/learn_fog/learn_fog.tar.gz)
|
63
64
|
* Stay up to date by following [@fog](http://twitter.com/fog) and/or [@geemus](http://twitter.com/geemus) on Twitter.
|
64
65
|
* Get and give help on the [#ruby-fog](irc://irc.freenode.net/ruby-fog) irc channel on Freenode
|
65
66
|
* Follow release notes and discussions on the [mailing list](http://groups.google.com/group/ruby-fog)
|
66
67
|
* Report bugs or find tasks to help with in the [issues](http://github.com/geemus/fog/issues)
|
67
|
-
* Learn about [contributing](
|
68
|
-
* See where fog is used and let the world know how you use it [in the wild](
|
69
|
-
* Check out blog posts and other mentions in the [press](
|
68
|
+
* Learn about [contributing](/about/contributing.html)
|
69
|
+
* See where fog is used and let the world know how you use it [in the wild](/about/users.html)
|
70
|
+
* Check out blog posts and other mentions in the [press](/about/press.html)
|
70
71
|
|
71
72
|
## Copyright
|
72
73
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
layout: default
|
3
|
-
title:
|
3
|
+
title: Storage
|
4
4
|
---
|
5
5
|
|
6
6
|
Having Ruby experience makes you hirable; but how can you stand out? You need to demonstrate your abilities. What better way than using Ruby and "the cloud" to store and serve your resume!
|
@@ -34,15 +34,15 @@ First, create a connection with your new account:
|
|
34
34
|
|
35
35
|
# create a connection
|
36
36
|
connection = Fog::Storage.new(
|
37
|
-
:provider
|
38
|
-
:aws_secret_access_key
|
39
|
-
:aws_access_key_id
|
37
|
+
:provider => 'AWS',
|
38
|
+
:aws_secret_access_key => YOUR_SECRET_ACCESS_KEY,
|
39
|
+
:aws_access_key_id => YOUR_SECRET_ACCESS_KEY_ID
|
40
40
|
)
|
41
41
|
|
42
42
|
# First, a place to contain the glorious details
|
43
43
|
directory = connection.directories.create(
|
44
|
-
:key
|
45
|
-
:public
|
44
|
+
:key => "fog-demo-#{Time.now.to_i}", # globally unique name
|
45
|
+
:public => true
|
46
46
|
)
|
47
47
|
|
48
48
|
# list directories
|
@@ -50,9 +50,9 @@ First, create a connection with your new account:
|
|
50
50
|
|
51
51
|
# upload that resume
|
52
52
|
file = directory.files.create(
|
53
|
-
:key
|
54
|
-
:body
|
55
|
-
:public
|
53
|
+
:key => 'resume.html',
|
54
|
+
:body => File.open("/path/to/my/resume.html"),
|
55
|
+
:public => true
|
56
56
|
)
|
57
57
|
|
58
58
|
If you are anything like me, you will continually tweak your resume. Pushing updates is easy:
|
@@ -73,12 +73,50 @@ directory = connection.directories.get("proclamations1234567890")
|
|
73
73
|
|
74
74
|
# also, create(attributes) is just new(attributes).save, so you can also do:
|
75
75
|
file = directory.files.new(
|
76
|
-
:key
|
77
|
-
:body
|
78
|
-
:public
|
76
|
+
:key => 'resume.html',
|
77
|
+
:body => 'improvements',
|
78
|
+
:public => true
|
79
79
|
)
|
80
80
|
file.save
|
81
81
|
|
82
|
+
## Backing up your files
|
83
|
+
|
84
|
+
Now you've got a bunch of files in S3: your resume, some code samples,
|
85
|
+
and maybe some pictures of your cat doing funny stuff. Since this is
|
86
|
+
all of vital importance, you need to back it up.
|
87
|
+
|
88
|
+
# copy each file to local disk
|
89
|
+
directory.files.each do |s3_file|
|
90
|
+
File.open(s3_file.key, 'w') do |local_file|
|
91
|
+
local_file.write(s3_file.body)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
One caveat: it's way more efficient to do this:
|
96
|
+
|
97
|
+
# do two things per file
|
98
|
+
directory.files.each do |file|
|
99
|
+
do_one_thing(file)
|
100
|
+
do_another_thing(file)
|
101
|
+
end
|
102
|
+
|
103
|
+
than it is to do this:
|
104
|
+
|
105
|
+
# do two things per file
|
106
|
+
directory.files.each do |file|
|
107
|
+
do_one_thing(file)
|
108
|
+
end.each do |file|
|
109
|
+
do_another_thing(file)
|
110
|
+
end
|
111
|
+
|
112
|
+
The reason is that the list of files might be large. Really
|
113
|
+
large. Eat-all-your-RAM-and-ask-for-more large. Therefore, every time
|
114
|
+
you say `files.each`, fog makes a fresh set of API calls to Amazon to
|
115
|
+
list the available files (Amazon's API returns a page at a time, so
|
116
|
+
fog works a page at a time in order to keep its memory requirements sane).
|
117
|
+
|
118
|
+
## Sending it out
|
119
|
+
|
82
120
|
Alright, so you (eventually) become satisfied enough to send it off, what is the URL endpoint to your resume?
|
83
121
|
|
84
122
|
puts file.public_url
|
@@ -92,9 +130,9 @@ More clouds? How much extra stuff will you have to do for these services!?! Hard
|
|
92
130
|
Sign up <a href="http://gs-signup-redirect.appspot.com/">here</a> and get your credentials <a href="https://sandbox.google.com/storage/m/">here</a>.
|
93
131
|
|
94
132
|
connection = Fog::Storage.new(
|
95
|
-
:provider
|
96
|
-
:google_storage_secret_access_key
|
97
|
-
:google_storage_access_key_id
|
133
|
+
:provider => 'Google',
|
134
|
+
:google_storage_secret_access_key => YOUR_SECRET_ACCESS_KEY,
|
135
|
+
:google_storage_access_key_id => YOUR_SECRET_ACCESS_KEY_ID
|
98
136
|
)
|
99
137
|
|
100
138
|
## Rackspace CloudFiles
|
@@ -102,20 +140,20 @@ Sign up <a href="http://gs-signup-redirect.appspot.com/">here</a> and get your c
|
|
102
140
|
Rackspace has <a href="http://www.rackspacecloud.com/cloud_hosting_products/files">Cloud Files</a> and you can sign up <a href="https://www.rackspacecloud.com/signup">here</a> and get your credentials <a href="https://manage.rackspacecloud.com/APIAccess.do">here</a>.
|
103
141
|
|
104
142
|
connection = Fog::Storage.new(
|
105
|
-
:provider
|
106
|
-
:rackspace_username
|
107
|
-
:rackspace_api_key
|
143
|
+
:provider => 'Rackspace',
|
144
|
+
:rackspace_username => RACKSPACE_USERNAME,
|
145
|
+
:rackspace_api_key => RACKSPACE_API_KEY
|
108
146
|
)
|
109
147
|
|
110
|
-
Then create, save, destroy as per fog-for-AWS. The `:public
|
148
|
+
Then create, save, destroy as per fog-for-AWS. The `:public => true` option when creating directories (see above) is important for Rackspace; your folder and files won't be shared to Rackspace's CDN and hence your users without it. Similarly the `:public => true` on files is important for AWS and Google or they will be private.
|
111
149
|
|
112
150
|
## Local Storage
|
113
151
|
|
114
152
|
While you are working out the kinks you might not want to do everything live though, ditto for while you are running tests, so you have a couple options to try before you buy. First, you can use a local provider to store things in a directory on your machine.
|
115
153
|
|
116
154
|
connection = Fog::Storage.new(
|
117
|
-
:provider
|
118
|
-
:local_root
|
155
|
+
:provider => 'Local',
|
156
|
+
:local_root => '~/fog'
|
119
157
|
)
|
120
158
|
|
121
159
|
## Mocking out Cloud Storage
|
data/fog.gemspec
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
|
-
s.rubygems_version = '1.3.5'
|
5
4
|
|
6
5
|
## Leave these as is they will be modified for you by the rake gemspec task.
|
7
6
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
7
|
## the sub! line in the Rakefile
|
9
8
|
s.name = 'fog'
|
10
|
-
s.version = '0.
|
11
|
-
s.date = '2011-
|
9
|
+
s.version = '0.8.0'
|
10
|
+
s.date = '2011-05-12'
|
12
11
|
s.rubyforge_project = 'fog'
|
13
12
|
|
14
13
|
## Make sure your summary is short. The description may be as long
|
@@ -23,17 +22,12 @@ Gem::Specification.new do |s|
|
|
23
22
|
s.email = 'geemus@gmail.com'
|
24
23
|
s.homepage = 'http://github.com/geemus/fog'
|
25
24
|
|
26
|
-
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
27
|
-
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
28
|
-
s.require_paths = %w[lib]
|
29
|
-
|
30
25
|
## This sections is only necessary if you have C extensions.
|
31
26
|
# s.require_paths << 'ext'
|
32
27
|
# s.extensions = %w[ext/extconf.rb]
|
33
28
|
|
34
29
|
## If your gem includes any executables, list them here.
|
35
30
|
s.executables = ["fog"]
|
36
|
-
s.default_executable = 'fog'
|
37
31
|
|
38
32
|
## Specify any RDoc options here. You'll want to add your README and
|
39
33
|
## LICENSE files to the extra_rdoc_files list.
|
@@ -43,7 +37,7 @@ Gem::Specification.new do |s|
|
|
43
37
|
## List your runtime dependencies here. Runtime dependencies are those
|
44
38
|
## that are needed for an end user to actually USE your code.
|
45
39
|
s.add_dependency('builder')
|
46
|
-
s.add_dependency('excon', '
|
40
|
+
s.add_dependency('excon', '~>0.6.1')
|
47
41
|
s.add_dependency('formatador', '>=0.1.3')
|
48
42
|
s.add_dependency('json')
|
49
43
|
s.add_dependency('mime-types')
|
data/lib/fog.rb
CHANGED
data/lib/fog/aws/elb.rb
CHANGED
@@ -2,18 +2,37 @@ module Fog
|
|
2
2
|
module AWS
|
3
3
|
class ELB < Fog::Service
|
4
4
|
|
5
|
+
class IdentifierTaken < Fog::Errors::Error; end
|
6
|
+
class InvalidInstance < Fog::Errors::Error; end
|
7
|
+
|
5
8
|
requires :aws_access_key_id, :aws_secret_access_key
|
6
9
|
recognizes :region, :host, :path, :port, :scheme, :persistent
|
7
10
|
|
8
11
|
request_path 'fog/aws/requests/elb'
|
12
|
+
request :configure_health_check
|
13
|
+
request :create_app_cookie_stickiness_policy
|
14
|
+
request :create_lb_cookie_stickiness_policy
|
9
15
|
request :create_load_balancer
|
16
|
+
request :create_load_balancer_listeners
|
10
17
|
request :delete_load_balancer
|
18
|
+
request :delete_load_balancer_listeners
|
19
|
+
request :delete_load_balancer_policy
|
11
20
|
request :deregister_instances_from_load_balancer
|
12
21
|
request :describe_instance_health
|
13
22
|
request :describe_load_balancers
|
14
23
|
request :disable_availability_zones_for_load_balancer
|
15
24
|
request :enable_availability_zones_for_load_balancer
|
16
25
|
request :register_instances_with_load_balancer
|
26
|
+
#request :set_load_balancer_listener_ssl_certificate
|
27
|
+
request :set_load_balancer_policies_of_listener
|
28
|
+
|
29
|
+
model_path 'fog/aws/models/elb'
|
30
|
+
model :load_balancer
|
31
|
+
collection :load_balancers
|
32
|
+
model :policy
|
33
|
+
collection :policies
|
34
|
+
model :listener
|
35
|
+
collection :listeners
|
17
36
|
|
18
37
|
class Mock
|
19
38
|
|
@@ -89,22 +108,37 @@ module Fog
|
|
89
108
|
:path => @path,
|
90
109
|
:port => @port,
|
91
110
|
:version => '2010-07-01'
|
92
|
-
|
111
|
+
}
|
93
112
|
)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
113
|
+
begin
|
114
|
+
response = @connection.request({
|
115
|
+
:body => body,
|
116
|
+
:expects => 200,
|
117
|
+
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
118
|
+
:idempotent => idempotent,
|
119
|
+
:host => @host,
|
120
|
+
:method => 'POST',
|
121
|
+
:parser => parser
|
122
|
+
})
|
123
|
+
rescue Excon::Errors::HTTPStatusError => error
|
124
|
+
if match = error.message.match(/<Code>(.*)<\/Code>/m)
|
125
|
+
case match[1]
|
126
|
+
when 'LoadBalancerNotFound'
|
127
|
+
raise Fog::AWS::ELB::NotFound
|
128
|
+
when 'DuplicateLoadBalancerName'
|
129
|
+
raise Fog::AWS::ELB::IdentifierTaken
|
130
|
+
when 'InvalidInstance'
|
131
|
+
raise Fog::AWS::ELB::InvalidInstance
|
132
|
+
else
|
133
|
+
raise
|
134
|
+
end
|
135
|
+
else
|
136
|
+
raise
|
137
|
+
end
|
138
|
+
end
|
104
139
|
|
105
140
|
response
|
106
141
|
end
|
107
|
-
|
108
142
|
end
|
109
143
|
end
|
110
144
|
end
|
data/lib/fog/aws/iam.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
module Fog
|
3
|
+
module AWS
|
4
|
+
class ELB
|
5
|
+
class Listener < Fog::Model
|
6
|
+
|
7
|
+
attribute :policy_names, :aliases => 'PolicyNames'
|
8
|
+
attribute :instance_port, :aliases => 'InstancePort'
|
9
|
+
attribute :lb_port, :aliases => 'LoadBalancerPort'
|
10
|
+
attribute :protocol, :aliases => 'Protocol'
|
11
|
+
attribute :ssl_id, :aliases => 'SSLCertificateId'
|
12
|
+
|
13
|
+
def save
|
14
|
+
requires :load_balancer, :instance_port, :lb_port, :protocol
|
15
|
+
connection.create_load_balancer_listeners(load_balancer.id, [to_params])
|
16
|
+
reload
|
17
|
+
end
|
18
|
+
|
19
|
+
def destroy
|
20
|
+
requires :load_balancer, :lb_port
|
21
|
+
connection.delete_load_balancer_listeners(load_balancer.id, [lb_port])
|
22
|
+
reload
|
23
|
+
end
|
24
|
+
|
25
|
+
# Return the policy associated with this load balancer
|
26
|
+
def policy
|
27
|
+
load_balancer.policies.get(policy_names.first)
|
28
|
+
end
|
29
|
+
|
30
|
+
def reload
|
31
|
+
load_balancer.reload
|
32
|
+
end
|
33
|
+
|
34
|
+
def load_balancer
|
35
|
+
collection.load_balancer
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_params
|
39
|
+
{
|
40
|
+
'InstancePort' => instance_port,
|
41
|
+
'LoadBalancerPort' => lb_port,
|
42
|
+
'Protocol' => protocol,
|
43
|
+
'SSLCertificateId' => ssl_id
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'fog/aws/models/elb/listener'
|
2
|
+
module Fog
|
3
|
+
module AWS
|
4
|
+
class ELB
|
5
|
+
class Listeners < Fog::Collection
|
6
|
+
|
7
|
+
model Fog::AWS::ELB::Listener
|
8
|
+
|
9
|
+
attr_accessor :data, :load_balancer
|
10
|
+
|
11
|
+
def all
|
12
|
+
load(munged_data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(lb_port)
|
16
|
+
all.detect{|listener| listener.lb_port == lb_port}
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
# Munge an array of ListernerDescription hashes like:
|
21
|
+
# {'Listener' => listener, 'PolicyNames' => []}
|
22
|
+
# to an array of listeners withi a PolicyNames key
|
23
|
+
def munged_data
|
24
|
+
data.map {|description|
|
25
|
+
description['Listener'].merge('PolicyNames' => description['PolicyNames'])
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|