fog 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/README.rdoc +1 -1
- data/Rakefile +3 -16
- data/changelog.txt +401 -2
- data/docs/_layouts/default.html +1 -1
- data/docs/index.markdown +2 -2
- data/docs/storage/index.markdown +4 -4
- data/fog.gemspec +7 -4
- data/lib/fog.rb +1 -1
- data/lib/fog/aws.rb +32 -6
- data/lib/fog/aws/auto_scaling.rb +1 -18
- data/lib/fog/aws/beanstalk.rb +140 -0
- data/lib/fog/aws/cloud_formation.rb +1 -18
- data/lib/fog/aws/cloud_watch.rb +2 -19
- data/lib/fog/aws/compute.rb +16 -21
- data/lib/fog/aws/dns.rb +2 -2
- data/lib/fog/aws/dynamodb.rb +162 -0
- data/lib/fog/aws/elasticache.rb +1 -14
- data/lib/fog/aws/elb.rb +34 -26
- data/lib/fog/aws/elb/policy_types.rb +35 -0
- data/lib/fog/aws/emr.rb +5 -4
- data/lib/fog/aws/iam.rb +16 -1
- data/lib/fog/aws/models/auto_scaling/activity.rb +1 -1
- data/lib/fog/aws/models/auto_scaling/group.rb +2 -2
- data/lib/fog/aws/models/beanstalk/application.rb +62 -0
- data/lib/fog/aws/models/beanstalk/applications.rb +25 -0
- data/lib/fog/aws/models/beanstalk/environment.rb +129 -0
- data/lib/fog/aws/models/beanstalk/environments.rb +29 -0
- data/lib/fog/aws/models/beanstalk/event.rb +20 -0
- data/lib/fog/aws/models/beanstalk/events.rb +19 -0
- data/lib/fog/aws/models/beanstalk/template.rb +62 -0
- data/lib/fog/aws/models/beanstalk/templates.rb +70 -0
- data/lib/fog/aws/models/beanstalk/version.rb +79 -0
- data/lib/fog/aws/models/beanstalk/versions.rb +31 -0
- data/lib/fog/aws/models/compute/address.rb +7 -4
- data/lib/fog/aws/models/compute/addresses.rb +2 -2
- data/lib/fog/aws/models/compute/flavors.rb +1 -1
- data/lib/fog/aws/models/compute/key_pairs.rb +2 -2
- data/lib/fog/aws/models/compute/security_group.rb +2 -2
- data/lib/fog/aws/models/compute/security_groups.rb +30 -5
- data/lib/fog/aws/models/compute/server.rb +2 -0
- data/lib/fog/aws/models/compute/servers.rb +2 -2
- data/lib/fog/aws/models/compute/subnet.rb +58 -0
- data/lib/fog/aws/models/compute/subnets.rb +99 -0
- data/lib/fog/aws/models/compute/volumes.rb +3 -3
- data/lib/fog/aws/models/compute/vpc.rb +63 -0
- data/lib/fog/aws/models/compute/vpcs.rb +93 -0
- data/lib/fog/aws/models/dns/record.rb +37 -23
- data/lib/fog/aws/models/elasticache/cluster.rb +1 -1
- data/lib/fog/aws/models/elb/listener.rb +9 -7
- data/lib/fog/aws/models/storage/directory.rb +22 -1
- data/lib/fog/aws/models/storage/file.rb +58 -7
- data/lib/fog/aws/models/storage/version.rb +36 -0
- data/lib/fog/aws/models/storage/versions.rb +38 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_scheduled_actions.rb +3 -3
- data/lib/fog/aws/parsers/beanstalk/check_dns_availability.rb +19 -0
- data/lib/fog/aws/parsers/beanstalk/create_application.rb +24 -0
- data/lib/fog/aws/parsers/beanstalk/create_application_version.rb +26 -0
- data/lib/fog/aws/parsers/beanstalk/create_configuration_template.rb +29 -0
- data/lib/fog/aws/parsers/beanstalk/create_environment.rb +37 -0
- data/lib/fog/aws/parsers/beanstalk/create_storage_location.rb +18 -0
- data/lib/fog/aws/parsers/beanstalk/describe_application_versions.rb +26 -0
- data/lib/fog/aws/parsers/beanstalk/describe_applications.rb +24 -0
- data/lib/fog/aws/parsers/beanstalk/describe_configuration_options.rb +32 -0
- data/lib/fog/aws/parsers/beanstalk/describe_configuration_settings.rb +30 -0
- data/lib/fog/aws/parsers/beanstalk/describe_environment_resources.rb +26 -0
- data/lib/fog/aws/parsers/beanstalk/describe_environments.rb +38 -0
- data/lib/fog/aws/parsers/beanstalk/describe_events.rb +27 -0
- data/lib/fog/aws/parsers/beanstalk/empty.rb +27 -0
- data/lib/fog/aws/parsers/beanstalk/list_available_solution_stacks.rb +21 -0
- data/lib/fog/aws/parsers/beanstalk/parser.rb +93 -0
- data/lib/fog/aws/parsers/beanstalk/retrieve_environment_info.rb +22 -0
- data/lib/fog/aws/parsers/beanstalk/terminate_environment.rb +37 -0
- data/lib/fog/aws/parsers/beanstalk/update_application.rb +24 -0
- data/lib/fog/aws/parsers/beanstalk/update_application_version.rb +26 -0
- data/lib/fog/aws/parsers/beanstalk/update_configuration_template.rb +29 -0
- data/lib/fog/aws/parsers/beanstalk/update_environment.rb +37 -0
- data/lib/fog/aws/parsers/beanstalk/validate_configuration_settings.rb +22 -0
- data/lib/fog/aws/parsers/compute/allocate_address.rb +1 -1
- data/lib/fog/aws/parsers/compute/associate_address.rb +25 -0
- data/lib/fog/aws/parsers/compute/create_subnet.rb +51 -0
- data/lib/fog/aws/parsers/compute/create_vpc.rb +51 -0
- data/lib/fog/aws/parsers/compute/delete_subnet.rb +24 -0
- data/lib/fog/aws/parsers/compute/delete_vpc.rb +24 -0
- data/lib/fog/aws/parsers/compute/describe_addresses.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_images.rb +20 -13
- data/lib/fog/aws/parsers/compute/describe_instance_status.rb +62 -29
- data/lib/fog/aws/parsers/compute/describe_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +4 -4
- data/lib/fog/aws/parsers/compute/describe_subnets.rb +49 -0
- data/lib/fog/aws/parsers/compute/describe_volume_status.rb +70 -0
- data/lib/fog/aws/parsers/compute/describe_vpcs.rb +49 -0
- data/lib/fog/aws/parsers/dns/list_resource_record_sets.rb +15 -7
- data/lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb +64 -0
- data/lib/fog/aws/parsers/elb/describe_load_balancer_policy_types.rb +70 -0
- data/lib/fog/aws/parsers/sns/confirm_subscription.rb +1 -1
- data/lib/fog/aws/parsers/sns/create_topic.rb +1 -1
- data/lib/fog/aws/parsers/sns/list_subscriptions.rb +2 -2
- data/lib/fog/aws/parsers/sns/list_topics.rb +1 -1
- data/lib/fog/aws/parsers/sns/subscribe.rb +1 -1
- data/lib/fog/aws/parsers/storage/get_bucket_lifecycle.rb +32 -0
- data/lib/fog/aws/parsers/storage/get_bucket_object_versions.rb +1 -1
- data/lib/fog/aws/parsers/storage/get_bucket_versioning.rb +1 -1
- data/lib/fog/aws/parsers/sts/get_session_token.rb +1 -1
- data/lib/fog/aws/rds.rb +19 -21
- data/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb +10 -1
- data/lib/fog/aws/requests/auto_scaling/describe_launch_configurations.rb +16 -7
- data/lib/fog/aws/requests/auto_scaling/describe_scheduled_actions.rb +5 -0
- data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +13 -3
- data/lib/fog/aws/requests/beanstalk/check_dns_availability.rb +27 -0
- data/lib/fog/aws/requests/beanstalk/create_application.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/create_application_version.rb +41 -0
- data/lib/fog/aws/requests/beanstalk/create_configuration_template.rb +44 -0
- data/lib/fog/aws/requests/beanstalk/create_environment.rb +50 -0
- data/lib/fog/aws/requests/beanstalk/create_storage_location.rb +27 -0
- data/lib/fog/aws/requests/beanstalk/delete_application.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/delete_application_version.rb +36 -0
- data/lib/fog/aws/requests/beanstalk/delete_configuration_template.rb +34 -0
- data/lib/fog/aws/requests/beanstalk/delete_environment_configuration.rb +34 -0
- data/lib/fog/aws/requests/beanstalk/describe_application_versions.rb +34 -0
- data/lib/fog/aws/requests/beanstalk/describe_applications.rb +30 -0
- data/lib/fog/aws/requests/beanstalk/describe_configuration_options.rb +40 -0
- data/lib/fog/aws/requests/beanstalk/describe_configuration_settings.rb +31 -0
- data/lib/fog/aws/requests/beanstalk/describe_environment_resources.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/describe_environments.rb +40 -0
- data/lib/fog/aws/requests/beanstalk/describe_events.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/list_available_solution_stacks.rb +27 -0
- data/lib/fog/aws/requests/beanstalk/rebuild_environment.rb +30 -0
- data/lib/fog/aws/requests/beanstalk/request_environment_info.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/restart_app_server.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/retrieve_environment_info.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/swap_environment_cnames.rb +29 -0
- data/lib/fog/aws/requests/beanstalk/terminate_environment.rb +31 -0
- data/lib/fog/aws/requests/beanstalk/update_application.rb +30 -0
- data/lib/fog/aws/requests/beanstalk/update_application_version.rb +30 -0
- data/lib/fog/aws/requests/beanstalk/update_configuration_template.rb +36 -0
- data/lib/fog/aws/requests/beanstalk/update_environment.rb +42 -0
- data/lib/fog/aws/requests/beanstalk/validate_configuration_settings.rb +33 -0
- data/lib/fog/aws/requests/compute/allocate_address.rb +11 -4
- data/lib/fog/aws/requests/compute/associate_address.rb +44 -17
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +15 -17
- data/lib/fog/aws/requests/compute/create_security_group.rb +8 -4
- data/lib/fog/aws/requests/compute/create_subnet.rb +79 -0
- data/lib/fog/aws/requests/compute/create_tags.rb +3 -2
- data/lib/fog/aws/requests/compute/create_vpc.rb +71 -0
- data/lib/fog/aws/requests/compute/delete_security_group.rb +22 -4
- data/lib/fog/aws/requests/compute/delete_subnet.rb +49 -0
- data/lib/fog/aws/requests/compute/delete_vpc.rb +52 -0
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -0
- data/lib/fog/aws/requests/compute/describe_subnets.rb +66 -0
- data/lib/fog/aws/requests/compute/describe_volume_status.rb +50 -0
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +62 -0
- data/lib/fog/aws/requests/compute/detach_volume.rb +13 -8
- data/lib/fog/aws/requests/compute/disassociate_address.rb +7 -5
- data/lib/fog/aws/requests/compute/request_spot_instances.rb +5 -1
- data/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +11 -13
- data/lib/fog/aws/requests/compute/run_instances.rb +5 -1
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +43 -28
- data/lib/fog/aws/requests/dns/create_hosted_zone.rb +9 -9
- data/lib/fog/aws/requests/dns/delete_hosted_zone.rb +7 -7
- data/lib/fog/aws/requests/dns/get_change.rb +5 -5
- data/lib/fog/aws/requests/dns/get_hosted_zone.rb +8 -8
- data/lib/fog/aws/requests/dns/list_hosted_zones.rb +15 -15
- data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +23 -20
- data/lib/fog/aws/requests/dynamodb/batch_get_item.rb +43 -0
- data/lib/fog/aws/requests/dynamodb/create_table.rb +55 -0
- data/lib/fog/aws/requests/dynamodb/delete_item.rb +45 -0
- data/lib/fog/aws/requests/dynamodb/delete_table.rb +42 -0
- data/lib/fog/aws/requests/dynamodb/describe_table.rb +44 -0
- data/lib/fog/aws/requests/dynamodb/get_item.rb +43 -0
- data/lib/fog/aws/requests/dynamodb/list_tables.rb +29 -0
- data/lib/fog/aws/requests/dynamodb/put_item.rb +41 -0
- data/lib/fog/aws/requests/dynamodb/query.rb +44 -0
- data/lib/fog/aws/requests/dynamodb/scan.rb +45 -0
- data/lib/fog/aws/requests/dynamodb/update_item.rb +49 -0
- data/lib/fog/aws/requests/dynamodb/update_table.rb +46 -0
- data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +2 -2
- data/lib/fog/aws/requests/elasticache/modify_cache_cluster.rb +2 -2
- data/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb +2 -0
- data/lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb +3 -1
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +7 -2
- data/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +10 -1
- data/lib/fog/aws/requests/elb/create_load_balancer_policy.rb +79 -0
- data/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_load_balancer_policies.rb +71 -0
- data/lib/fog/aws/requests/elb/describe_load_balancer_policy_types.rb +68 -0
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +5 -1
- data/lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb +1 -1
- data/lib/fog/aws/requests/emr/run_job_flow.rb +9 -7
- data/lib/fog/aws/requests/iam/add_user_to_group.rb +24 -0
- data/lib/fog/aws/requests/iam/create_access_key.rb +24 -0
- data/lib/fog/aws/requests/iam/create_group.rb +21 -0
- data/lib/fog/aws/requests/iam/create_user.rb +21 -0
- data/lib/fog/aws/requests/iam/delete_access_key.rb +17 -0
- data/lib/fog/aws/requests/iam/delete_group.rb +19 -0
- data/lib/fog/aws/requests/iam/delete_user.rb +17 -0
- data/lib/fog/aws/requests/iam/delete_user_policy.rb +16 -0
- data/lib/fog/aws/requests/iam/list_access_keys.rb +21 -0
- data/lib/fog/aws/requests/iam/list_groups.rb +18 -0
- data/lib/fog/aws/requests/iam/list_groups_for_user.rb +24 -0
- data/lib/fog/aws/requests/iam/list_user_policies.rb +18 -0
- data/lib/fog/aws/requests/iam/list_users.rb +17 -0
- data/lib/fog/aws/requests/iam/put_user_policy.rb +18 -0
- data/lib/fog/aws/requests/iam/remove_user_from_group.rb +19 -0
- data/lib/fog/aws/requests/iam/upload_server_certificate.rb +4 -1
- data/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +30 -1
- data/lib/fog/aws/requests/rds/create_db_instance.rb +18 -15
- data/lib/fog/aws/requests/rds/create_db_parameter_group.rb +19 -1
- data/lib/fog/aws/requests/rds/create_db_security_group.rb +19 -1
- data/lib/fog/aws/requests/rds/create_db_snapshot.rb +38 -2
- data/lib/fog/aws/requests/rds/delete_db_instance.rb +1 -2
- data/lib/fog/aws/requests/rds/delete_db_parameter_group.rb +11 -1
- data/lib/fog/aws/requests/rds/delete_db_security_group.rb +11 -1
- data/lib/fog/aws/requests/rds/delete_db_snapshot.rb +15 -4
- data/lib/fog/aws/requests/rds/describe_db_instances.rb +25 -9
- data/lib/fog/aws/requests/rds/describe_db_parameter_groups.rb +19 -1
- data/lib/fog/aws/requests/rds/describe_db_parameters.rb +0 -1
- data/lib/fog/aws/requests/rds/describe_db_security_groups.rb +49 -3
- data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +28 -1
- data/lib/fog/aws/requests/rds/modify_db_instance.rb +10 -8
- data/lib/fog/aws/requests/rds/reboot_db_instance.rb +6 -6
- data/lib/fog/aws/requests/rds/revoke_db_security_group_ingress.rb +27 -1
- data/lib/fog/aws/requests/sns/confirm_subscription.rb +1 -1
- data/lib/fog/aws/requests/sns/delete_topic.rb +1 -1
- data/lib/fog/aws/requests/sns/get_topic_attributes.rb +1 -1
- data/lib/fog/aws/requests/sns/list_subscriptions_by_topic.rb +1 -1
- data/lib/fog/aws/requests/sns/publish.rb +1 -1
- data/lib/fog/aws/requests/sns/set_topic_attributes.rb +1 -1
- data/lib/fog/aws/requests/sns/subscribe.rb +1 -1
- data/lib/fog/aws/requests/sns/unsubscribe.rb +1 -1
- data/lib/fog/aws/requests/sqs/change_message_visibility.rb +1 -1
- data/lib/fog/aws/requests/sqs/delete_message.rb +1 -1
- data/lib/fog/aws/requests/sqs/receive_message.rb +13 -14
- data/lib/fog/aws/requests/storage/copy_object.rb +3 -5
- data/lib/fog/aws/requests/storage/delete_bucket_lifecycle.rb +30 -0
- data/lib/fog/aws/requests/storage/delete_object.rb +73 -2
- data/lib/fog/aws/requests/storage/get_bucket.rb +3 -2
- data/lib/fog/aws/requests/storage/get_bucket_lifecycle.rb +41 -0
- data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +95 -2
- data/lib/fog/aws/requests/storage/get_bucket_versioning.rb +32 -0
- data/lib/fog/aws/requests/storage/get_object.rb +42 -12
- data/lib/fog/aws/requests/storage/get_object_http_url.rb +7 -2
- data/lib/fog/aws/requests/storage/get_object_https_url.rb +7 -2
- data/lib/fog/aws/requests/storage/head_object.rb +7 -6
- data/lib/fog/aws/requests/storage/put_bucket_lifecycle.rb +48 -0
- data/lib/fog/aws/requests/storage/put_bucket_versioning.rb +41 -0
- data/lib/fog/aws/requests/storage/put_bucket_website.rb +17 -0
- data/lib/fog/aws/requests/storage/put_object.rb +26 -10
- data/lib/fog/aws/requests/storage/sync_clock.rb +1 -1
- data/lib/fog/aws/requests/sts/get_federation_token.rb +1 -0
- data/lib/fog/aws/requests/sts/get_session_token.rb +1 -0
- data/lib/fog/aws/ses.rb +2 -7
- data/lib/fog/aws/simpledb.rb +1 -18
- data/lib/fog/aws/sns.rb +1 -16
- data/lib/fog/aws/sqs.rb +2 -12
- data/lib/fog/aws/storage.rb +7 -29
- data/lib/fog/{new_servers.rb → bare_metal_cloud.rb} +2 -2
- data/lib/fog/{new_servers → bare_metal_cloud}/compute.rb +14 -14
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/add_server.rb +1 -1
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/cancel_server.rb +1 -1
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/get_server.rb +1 -1
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/list_images.rb +1 -1
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/list_plans.rb +1 -1
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/list_servers.rb +1 -1
- data/lib/fog/{new_servers → bare_metal_cloud}/requests/compute/reboot_server.rb +1 -1
- data/lib/fog/bin.rb +4 -1
- data/lib/fog/bin/aws.rb +9 -1
- data/lib/fog/bin/{new_servers.rb → bare_metal_cloud.rb} +5 -5
- data/lib/fog/bin/cloudstack.rb +30 -0
- data/lib/fog/bin/joyent.rb +31 -0
- data/lib/fog/bin/ovirt.rb +30 -0
- data/lib/fog/bin/voxel.rb +1 -1
- data/lib/fog/bluebox/compute.rb +4 -0
- data/lib/fog/bluebox/models/compute/location.rb +17 -0
- data/lib/fog/bluebox/models/compute/locations.rb +28 -0
- data/lib/fog/bluebox/models/compute/server.rb +12 -5
- data/lib/fog/bluebox/requests/compute/create_block.rb +2 -2
- data/lib/fog/bluebox/requests/compute/get_location.rb +26 -0
- data/lib/fog/bluebox/requests/compute/get_locations.rb +24 -0
- data/lib/fog/brightbox/compute.rb +1 -0
- data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +13 -0
- data/lib/fog/cloudstack.rb +28 -0
- data/lib/fog/cloudstack/compute.rb +254 -0
- data/lib/fog/cloudstack/requests/compute/acquire_ip_address.rb +21 -0
- data/lib/fog/cloudstack/requests/compute/assign_to_load_balancer_rule.rb +25 -0
- data/lib/fog/cloudstack/requests/compute/attach_volume.rb +23 -0
- data/lib/fog/cloudstack/requests/compute/authorize_security_group_ingress.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/change_service_for_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_account.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_domain.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_load_balancer_rule.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_network.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_port_forwarding_rule.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_security_group.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_snapshot.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_snapshot_policy.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_ssh_key_pair.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/create_user.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/create_volume.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_account.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_domain.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_load_balancer_rule.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_port_forwarding_rule.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_security_group.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_snapshot.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_snapshot_policies.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_ssh_key_pair.rb +21 -0
- data/lib/fog/cloudstack/requests/compute/delete_user.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_volume.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/deploy_virtual_machine.rb +33 -0
- data/lib/fog/cloudstack/requests/compute/destroy_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/detach_volume.rb +21 -0
- data/lib/fog/cloudstack/requests/compute/disable_account.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/disable_user.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/enable_account.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/enable_user.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/generate_usage_records.rb +28 -0
- data/lib/fog/cloudstack/requests/compute/get_vm_password.rb +21 -0
- data/lib/fog/cloudstack/requests/compute/list_accounts.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_alerts.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_async_jobs.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_capabilities.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_capacity.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_clusters.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_configurations.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_disk_offerings.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_domain_children.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_domains.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_events.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_external_firewalls.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_external_load_balancers.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_hosts.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_hypervisors.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_instance_groups.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_isos.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_load_balancer_rule_instances.rb +23 -0
- data/lib/fog/cloudstack/requests/compute/list_load_balancer_rules.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/list_network_offerings.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_networks.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_os_categories.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/list_os_types.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/list_pods.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_port_forwarding_rules.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/list_public_ip_addresses.rb +22 -0
- data/lib/fog/cloudstack/requests/compute/list_resource_limits.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_security_groups.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_service_offerings.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_snapshot_policies.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_snapshots.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_ssh_key_pairs.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_storage_pools.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_templates.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_usage_records.rb +28 -0
- data/lib/fog/cloudstack/requests/compute/list_users.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_virtual_machines.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_volumes.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/list_zones.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/migrate_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/query_async_job_result.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/reboot_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/recover_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/register_ssh_key_pair.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/register_user_keys.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/remove_from_load_balancer_rule.rb +25 -0
- data/lib/fog/cloudstack/requests/compute/reset_password_for_virtual_machine.rb +21 -0
- data/lib/fog/cloudstack/requests/compute/revoke_security_group_ingress.rb +21 -0
- data/lib/fog/cloudstack/requests/compute/start_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/stop_virtual_machine.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/update_account.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/update_domain.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/update_resource_count.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/update_user.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/update_virtual_machine.rb +20 -0
- data/lib/fog/compute.rb +17 -3
- data/lib/fog/compute/models/server.rb +11 -0
- data/lib/fog/core.rb +1 -3
- data/lib/fog/core/connection.rb +2 -2
- data/lib/fog/core/errors.rb +8 -2
- data/lib/fog/core/model.rb +8 -0
- data/lib/fog/core/scp.rb +18 -2
- data/lib/fog/dns.rb +1 -0
- data/lib/fog/dnsimple/dns.rb +1 -1
- data/lib/fog/dynect/models/dns/records.rb +2 -2
- data/lib/fog/dynect/requests/dns/get_node_list.rb +2 -1
- data/lib/fog/ecloud/compute.rb +1 -1
- data/lib/fog/ecloud/requests/compute/add_backup_internet_service.rb +1 -1
- data/lib/fog/ecloud/requests/compute/add_internet_service.rb +2 -2
- data/lib/fog/ecloud/requests/compute/add_node.rb +1 -1
- data/lib/fog/ecloud/requests/compute/clone_vapp.rb +1 -1
- data/lib/fog/ecloud/requests/compute/configure_internet_service.rb +1 -1
- data/lib/fog/ecloud/requests/compute/configure_network.rb +1 -1
- data/lib/fog/ecloud/requests/compute/configure_network_ip.rb +1 -1
- data/lib/fog/ecloud/requests/compute/configure_vapp.rb +1 -1
- data/lib/fog/ecloud/requests/compute/instantiate_vapp_template.rb +1 -1
- data/lib/fog/glesys/compute.rb +4 -2
- data/lib/fog/glesys/models/compute/server.rb +14 -14
- data/lib/fog/google/requests/storage/get_object.rb +22 -14
- data/lib/fog/joyent.rb +8 -0
- data/lib/fog/joyent/compute.rb +228 -0
- data/lib/fog/joyent/errors.rb +90 -0
- data/lib/fog/joyent/models/compute/flavor.rb +17 -0
- data/lib/fog/joyent/models/compute/flavors.rb +25 -0
- data/lib/fog/joyent/models/compute/image.rb +18 -0
- data/lib/fog/joyent/models/compute/images.rb +25 -0
- data/lib/fog/joyent/models/compute/key.rb +19 -0
- data/lib/fog/joyent/models/compute/keys.rb +34 -0
- data/lib/fog/joyent/models/compute/server.rb +117 -0
- data/lib/fog/joyent/models/compute/servers.rb +35 -0
- data/lib/fog/joyent/models/compute/snapshot.rb +45 -0
- data/lib/fog/joyent/models/compute/snapshots.rb +37 -0
- data/lib/fog/joyent/requests/compute/add_machine_tags.rb +20 -0
- data/lib/fog/joyent/requests/compute/create_key.rb +56 -0
- data/lib/fog/joyent/requests/compute/create_machine.rb +16 -0
- data/lib/fog/joyent/requests/compute/create_machine_snapshot.rb +18 -0
- data/lib/fog/joyent/requests/compute/delete_all_machine_metadata.rb +16 -0
- data/lib/fog/joyent/requests/compute/delete_all_machine_tags.rb +15 -0
- data/lib/fog/joyent/requests/compute/delete_key.rb +29 -0
- data/lib/fog/joyent/requests/compute/delete_machine.rb +15 -0
- data/lib/fog/joyent/requests/compute/delete_machine_metadata.rb +18 -0
- data/lib/fog/joyent/requests/compute/delete_machine_snapshot.rb +21 -0
- data/lib/fog/joyent/requests/compute/delete_machine_tag.rb +15 -0
- data/lib/fog/joyent/requests/compute/get_dataset.rb +28 -0
- data/lib/fog/joyent/requests/compute/get_key.rb +29 -0
- data/lib/fog/joyent/requests/compute/get_machine.rb +29 -0
- data/lib/fog/joyent/requests/compute/get_machine_metadata.rb +25 -0
- data/lib/fog/joyent/requests/compute/get_machine_snapshot.rb +14 -0
- data/lib/fog/joyent/requests/compute/get_machine_tag.rb +19 -0
- data/lib/fog/joyent/requests/compute/get_package.rb +33 -0
- data/lib/fog/joyent/requests/compute/list_datasets.rb +24 -0
- data/lib/fog/joyent/requests/compute/list_keys.rb +25 -0
- data/lib/fog/joyent/requests/compute/list_machine_snapshots.rb +14 -0
- data/lib/fog/joyent/requests/compute/list_machine_tags.rb +20 -0
- data/lib/fog/joyent/requests/compute/list_machines.rb +25 -0
- data/lib/fog/joyent/requests/compute/list_packages.rb +36 -0
- data/lib/fog/joyent/requests/compute/reboot_machine.rb +15 -0
- data/lib/fog/joyent/requests/compute/resize_machine.rb +13 -0
- data/lib/fog/joyent/requests/compute/start_machine.rb +16 -0
- data/lib/fog/joyent/requests/compute/start_machine_from_snapshot.rb +15 -0
- data/lib/fog/joyent/requests/compute/stop_machine.rb +16 -0
- data/lib/fog/joyent/requests/compute/update_machine_metadata.rb +15 -0
- data/lib/fog/libvirt/compute.rb +5 -3
- data/lib/fog/libvirt/models/compute/server.rb +89 -102
- data/lib/fog/libvirt/models/compute/servers.rb +2 -1
- data/lib/fog/libvirt/models/compute/util.rb +1 -2
- data/lib/fog/local/models/storage/file.rb +8 -1
- data/lib/fog/local/storage.rb +8 -0
- data/lib/fog/ninefold/models/storage/file.rb +8 -0
- data/lib/fog/openstack.rb +9 -7
- data/lib/fog/openstack/compute.rb +0 -2
- data/lib/fog/ovirt.rb +17 -0
- data/lib/fog/ovirt/compute.rb +106 -0
- data/lib/fog/ovirt/models/compute/cluster.rb +24 -0
- data/lib/fog/ovirt/models/compute/clusters.rb +23 -0
- data/lib/fog/ovirt/models/compute/interface.rb +22 -0
- data/lib/fog/ovirt/models/compute/interfaces.rb +32 -0
- data/lib/fog/ovirt/models/compute/server.rb +112 -0
- data/lib/fog/ovirt/models/compute/servers.rb +30 -0
- data/lib/fog/ovirt/models/compute/template.rb +53 -0
- data/lib/fog/ovirt/models/compute/templates.rb +23 -0
- data/lib/fog/ovirt/requests/compute/add_interface.rb +23 -0
- data/lib/fog/ovirt/requests/compute/create_vm.rb +20 -0
- data/lib/fog/ovirt/requests/compute/datacenters.rb +22 -0
- data/lib/fog/ovirt/requests/compute/destroy_interface.rb +25 -0
- data/lib/fog/ovirt/requests/compute/destroy_vm.rb +22 -0
- data/lib/fog/ovirt/requests/compute/get_cluster.rb +18 -0
- data/lib/fog/ovirt/requests/compute/get_template.rb +18 -0
- data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +18 -0
- data/lib/fog/ovirt/requests/compute/list_clusters.rb +20 -0
- data/lib/fog/ovirt/requests/compute/list_networks.rb +17 -0
- data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +20 -0
- data/lib/fog/ovirt/requests/compute/list_templates.rb +20 -0
- data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +20 -0
- data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +20 -0
- data/lib/fog/ovirt/requests/compute/mock_files/cluster.xml +20 -0
- data/lib/fog/ovirt/requests/compute/mock_files/clusters.xml +39 -0
- data/lib/fog/ovirt/requests/compute/mock_files/data_centers.xml +17 -0
- data/lib/fog/ovirt/requests/compute/mock_files/nics.xml +10 -0
- data/lib/fog/ovirt/requests/compute/mock_files/storage_domains.xml +36 -0
- data/lib/fog/ovirt/requests/compute/mock_files/template.xml +39 -0
- data/lib/fog/ovirt/requests/compute/mock_files/templates.xml +110 -0
- data/lib/fog/ovirt/requests/compute/mock_files/vm.xml +54 -0
- data/lib/fog/ovirt/requests/compute/mock_files/vms.xml +152 -0
- data/lib/fog/ovirt/requests/compute/storage_domains.rb +22 -0
- data/lib/fog/ovirt/requests/compute/update_interface.rb +25 -0
- data/lib/fog/ovirt/requests/compute/update_vm.rb +20 -0
- data/lib/fog/ovirt/requests/compute/vm_action.rb +26 -0
- data/lib/fog/providers.rb +4 -1
- data/lib/fog/rackspace/models/compute/flavor.rb +2 -0
- data/lib/fog/rackspace/models/storage/directory.rb +5 -1
- data/lib/fog/rackspace/models/storage/file.rb +7 -0
- data/lib/fog/rackspace/requests/compute/create_image.rb +1 -3
- data/lib/fog/rackspace/requests/storage/copy_object.rb +27 -0
- data/lib/fog/rackspace/requests/storage/get_object.rb +8 -2
- data/lib/fog/rackspace/requests/storage/put_object.rb +6 -5
- data/lib/fog/rackspace/storage.rb +1 -0
- data/lib/fog/storm_on_demand/compute.rb +1 -1
- data/lib/fog/vcloud/compute.rb +85 -30
- data/lib/fog/vcloud/models/compute/catalog.rb +1 -1
- data/lib/fog/vcloud/models/compute/catalog_item.rb +1 -1
- data/lib/fog/vcloud/models/compute/catalogs.rb +2 -4
- data/lib/fog/vcloud/models/compute/ip.rb +2 -2
- data/lib/fog/vcloud/models/compute/network.rb +3 -9
- data/lib/fog/vcloud/models/compute/networks.rb +13 -8
- data/lib/fog/vcloud/models/compute/organization.rb +3 -4
- data/lib/fog/vcloud/models/compute/organizations.rb +7 -4
- data/lib/fog/vcloud/models/compute/server.rb +5 -4
- data/lib/fog/vcloud/models/compute/servers.rb +1 -5
- data/lib/fog/vcloud/models/compute/task.rb +1 -1
- data/lib/fog/vcloud/models/compute/tasks.rb +1 -3
- data/lib/fog/vcloud/models/compute/vapp.rb +6 -4
- data/lib/fog/vcloud/models/compute/vapps.rb +2 -6
- data/lib/fog/vcloud/models/compute/vdc.rb +5 -5
- data/lib/fog/vcloud/models/compute/vdcs.rb +2 -5
- data/lib/fog/vcloud/requests/compute/clone_vapp.rb +1 -1
- data/lib/fog/vcloud/requests/compute/configure_network.rb +1 -1
- data/lib/fog/vcloud/requests/compute/configure_network_ip.rb +1 -1
- data/lib/fog/vcloud/requests/compute/configure_vapp.rb +1 -1
- data/lib/fog/vcloud/requests/compute/configure_vm.rb +1 -1
- data/lib/fog/vcloud/requests/compute/instantiate_vapp_template.rb +1 -1
- data/lib/fog/vcloud/requests/compute/login.rb +8 -4
- data/lib/fog/virtual_box/compute.rb +4 -0
- data/lib/fog/vmfusion/models/compute/server.rb +120 -52
- data/lib/fog/vmfusion/models/compute/servers.rb +11 -7
- data/lib/fog/voxel/compute.rb +1 -1
- data/lib/fog/vsphere/compute.rb +5 -0
- data/lib/fog/vsphere/models/compute/server.rb +25 -0
- data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +1 -1
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +43 -8
- data/lib/fog/vsphere/requests/compute/vm_create.rb +97 -0
- data/lib/fog/vsphere/requests/compute/vm_migrate.rb +37 -0
- data/lib/fog/vsphere/requests/compute/vm_reconfig_cpus.rb +23 -0
- data/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb +25 -0
- data/lib/fog/vsphere/requests/compute/vm_reconfig_memory.rb +23 -0
- data/lib/fog/zerigo/models/dns/record.rb +7 -5
- data/lib/fog/zerigo/parsers/dns/create_host.rb +3 -1
- data/lib/fog/zerigo/parsers/dns/find_hosts.rb +3 -1
- data/lib/fog/zerigo/parsers/dns/get_host.rb +3 -1
- data/lib/fog/zerigo/parsers/dns/get_zone.rb +3 -1
- data/lib/fog/zerigo/parsers/dns/list_hosts.rb +3 -1
- data/lib/fog/zerigo/requests/dns/update_host.rb +2 -2
- data/spec/ecloud/spec_helper.rb +1 -1
- data/tests/aws/models/beanstalk/application_tests.rb +70 -0
- data/tests/aws/models/beanstalk/applications_tests.rb +7 -0
- data/tests/aws/models/beanstalk/environment_tests.rb +132 -0
- data/tests/aws/models/beanstalk/environments_tests.rb +34 -0
- data/tests/aws/models/beanstalk/template_tests.rb +47 -0
- data/tests/aws/models/beanstalk/templates_tests.rb +62 -0
- data/tests/aws/models/beanstalk/version_tests.rb +66 -0
- data/tests/aws/models/beanstalk/versions_tests.rb +61 -0
- data/tests/aws/models/compute/subnet_tests.rb +5 -0
- data/tests/aws/models/compute/subnets_tests.rb +6 -0
- data/tests/aws/models/compute/vpc_tests.rb +4 -0
- data/tests/aws/models/compute/vpcs_tests.rb +6 -0
- data/tests/aws/models/dns/record_tests.rb +23 -0
- data/tests/aws/models/dns/records_tests.rb +23 -0
- data/tests/aws/models/dns/zone_tests.rb +4 -0
- data/tests/aws/models/dns/zones_tests.rb +4 -0
- data/tests/aws/models/elb/model_tests.rb +11 -7
- data/tests/aws/models/rds/security_group_tests.rb +6 -3
- data/tests/aws/models/rds/security_groups_tests.rb +1 -2
- data/tests/aws/models/rds/server_tests.rb +5 -3
- data/tests/aws/models/rds/servers_tests.rb +1 -3
- data/tests/aws/models/rds/snapshot_tests.rb +1 -3
- data/tests/aws/models/rds/snapshots_tests.rb +1 -3
- data/tests/aws/models/storage/directory_tests.rb +51 -0
- data/tests/aws/models/storage/file_tests.rb +80 -0
- data/tests/aws/models/storage/files_tests.rb +56 -0
- data/tests/aws/models/storage/version_tests.rb +52 -0
- data/tests/aws/models/storage/versions_tests.rb +56 -0
- data/tests/aws/requests/auto_scaling/helper.rb +2 -2
- data/tests/aws/requests/beanstalk/application_tests.rb +140 -0
- data/tests/aws/requests/beanstalk/solution_stack_tests.rb +22 -0
- data/tests/aws/requests/compute/address_tests.rb +7 -5
- data/tests/aws/requests/compute/instance_tests.rb +16 -2
- data/tests/aws/requests/compute/security_group_tests.rb +77 -4
- data/tests/aws/requests/compute/subnet_tests.rb +36 -0
- data/tests/aws/requests/compute/volume_tests.rb +4 -0
- data/tests/aws/requests/compute/vpc_tests.rb +34 -0
- data/tests/aws/requests/dns/dns_tests.rb +106 -99
- data/tests/aws/requests/dns/helper.rb +21 -0
- data/tests/aws/requests/dynamodb/item_tests.rb +117 -0
- data/tests/aws/requests/dynamodb/table_tests.rb +99 -0
- data/tests/aws/requests/elb/helper.rb +33 -0
- data/tests/aws/requests/elb/listener_tests.rb +18 -4
- data/tests/aws/requests/elb/policy_tests.rb +13 -0
- data/tests/aws/requests/iam/access_key_tests.rb +2 -7
- data/tests/aws/requests/iam/group_tests.rb +1 -4
- data/tests/aws/requests/iam/helper.rb +19 -0
- data/tests/aws/requests/iam/server_certificate_tests.rb +5 -0
- data/tests/aws/requests/iam/user_policy_tests.rb +4 -11
- data/tests/aws/requests/iam/user_tests.rb +19 -12
- data/tests/aws/requests/rds/helper.rb +45 -11
- data/tests/aws/requests/rds/instance_tests.rb +2 -3
- data/tests/aws/requests/rds/parameter_group_tests.rb +1 -7
- data/tests/aws/requests/rds/security_group_tests.rb +101 -0
- data/tests/aws/requests/storage/bucket_tests.rb +66 -1
- data/tests/aws/requests/storage/versioning_tests.rb +188 -0
- data/tests/bluebox/requests/compute/block_tests.rb +9 -8
- data/tests/bluebox/requests/compute/helper.rb +5 -0
- data/tests/bluebox/requests/compute/location_tests.rb +32 -0
- data/tests/bluebox/requests/compute/product_tests.rb +10 -4
- data/tests/bluebox/requests/compute/template_tests.rb +4 -2
- data/tests/brightbox/requests/compute/account_tests.rb +3 -3
- data/tests/brightbox/requests/compute/api_client_tests.rb +6 -6
- data/tests/brightbox/requests/compute/cloud_ip_tests.rb +7 -7
- data/tests/brightbox/requests/compute/helper.rb +33 -8
- data/tests/brightbox/requests/compute/image_tests.rb +2 -2
- data/tests/brightbox/requests/compute/interface_tests.rb +1 -1
- data/tests/brightbox/requests/compute/load_balancer_tests.rb +9 -9
- data/tests/brightbox/requests/compute/server_group_tests.rb +8 -8
- data/tests/brightbox/requests/compute/server_tests.rb +13 -11
- data/tests/brightbox/requests/compute/server_type_tests.rb +2 -2
- data/tests/brightbox/requests/compute/user_tests.rb +3 -3
- data/tests/brightbox/requests/compute/zone_tests.rb +2 -2
- data/tests/cloudstack/requests/disk_offering_tests.rb +29 -0
- data/tests/cloudstack/requests/os_type_tests.rb +38 -0
- data/tests/cloudstack/requests/security_group_tests.rb +29 -0
- data/tests/cloudstack/requests/service_offering_tests.rb +38 -0
- data/tests/cloudstack/requests/snapshot_tests.rb +32 -0
- data/tests/cloudstack/requests/ssh_key_pair_tests.rb +23 -0
- data/tests/cloudstack/requests/template_tests.rb +53 -0
- data/tests/cloudstack/requests/virtual_machine_tests.rb +71 -0
- data/tests/cloudstack/requests/volume_tests.rb +48 -0
- data/tests/cloudstack/requests/zone_tests.rb +33 -0
- data/tests/cloudstack/signed_params_tests.rb +12 -0
- data/tests/compute/helper.rb +7 -2
- data/tests/glesys/requests/compute/helper.rb +146 -123
- data/tests/glesys/requests/compute/ip_tests.rb +3 -3
- data/tests/glesys/requests/compute/server_tests.rb +50 -12
- data/tests/helper.rb +1 -1
- data/tests/helpers/formats_helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +7 -2
- data/tests/joyent/requests/compute/datasets_tests.rb +49 -0
- data/tests/joyent/requests/compute/keys_tests.rb +47 -0
- data/tests/joyent/requests/compute/machines_tests.rb +67 -0
- data/tests/joyent/requests/compute/packages_tests.rb +68 -0
- data/tests/ovirt/compute_tests.rb +24 -0
- data/tests/ovirt/models/compute/cluster_tests.rb +31 -0
- data/tests/ovirt/models/compute/clusters_tests.rb +9 -0
- data/tests/ovirt/models/compute/interface_tests.rb +27 -0
- data/tests/ovirt/models/compute/interfaces_tests.rb +9 -0
- data/tests/ovirt/models/compute/server_tests.rb +51 -0
- data/tests/ovirt/models/compute/servers_tests.rb +14 -0
- data/tests/ovirt/models/compute/template_tests.rb +28 -0
- data/tests/ovirt/models/compute/templates_tests.rb +9 -0
- data/tests/ovirt/requests/compute/create_vm_tests.rb +26 -0
- data/tests/ovirt/requests/compute/destroy_vm_tests.rb +18 -0
- data/tests/ovirt/requests/compute/list_datacenters_tests.rb +13 -0
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +13 -0
- data/tests/ovirt/requests/compute/update_vm_tests.rb +18 -0
- data/tests/vcloud/data/api_+_admin_+_network_+_2 +110 -0
- data/tests/vcloud/data/api_+_network_+_1 +44 -0
- data/tests/vcloud/data/api_+_org_+_ +5 -0
- data/tests/vcloud/data/api_+_org_+_1 +17 -0
- data/tests/vcloud/data/api_+_sessions +8 -0
- data/tests/vcloud/data/api_+_v1.0_+_vApp_+_vapp-1 +1 -1
- data/tests/vcloud/data/api_+_v1.0_+_vApp_+_vm-1 +1 -1
- data/tests/vcloud/data/api_+_v1.0_+_vApp_+_vm-2 +1 -1
- data/tests/vcloud/data/api_+_vApp_+_vapp-1 +369 -0
- data/tests/vcloud/data/api_+_vApp_+_vm-2 +155 -0
- data/tests/vcloud/data/api_+_vdc_+_1 +61 -0
- data/tests/vcloud/models/compute/conn_helper.rb +2 -2
- data/tests/vcloud/models/compute/network_tests.rb +54 -52
- data/tests/vcloud/models/compute/networks_tests.rb +54 -35
- data/tests/vcloud/models/compute/organization_tests.rb +17 -10
- data/tests/vcloud/models/compute/organizations_tests.rb +10 -8
- data/tests/vcloud/models/compute/server_tests.rb +45 -39
- data/tests/vcloud/models/compute/servers_tests.rb +17 -10
- data/tests/vcloud/models/compute/vapp_tests.rb +26 -21
- data/tests/vcloud/models/compute/vapps_tests.rb +13 -11
- data/tests/vcloud/models/compute/vdc_tests.rb +40 -34
- data/tests/vcloud/models/compute/vdcs_tests.rb +17 -10
- data/tests/vsphere/requests/compute/vm_clone_tests.rb +16 -4
- data/tests/vsphere/requests/compute/vm_create_tests.rb +20 -0
- data/tests/vsphere/requests/compute/vm_migrate_tests.rb +16 -0
- data/tests/vsphere/requests/compute/vm_power_on_tests.rb +1 -1
- data/tests/vsphere/requests/compute/vm_reconfig_cpus_tests.rb +19 -0
- data/tests/vsphere/requests/compute/vm_reconfig_hardware_tests.rb +19 -0
- data/tests/vsphere/requests/compute/vm_reconfig_memory_tests.rb +19 -0
- metadata +519 -50
- data/examples/compute_tests.rb +0 -71
- data/examples/dns_tests.rb +0 -78
- data/examples/storage_tests.rb +0 -105
@@ -11,14 +11,12 @@ module Fog
|
|
11
11
|
|
12
12
|
def all
|
13
13
|
org_uri = self.organization_uri || connection.default_organization_uri
|
14
|
-
data = connection.get_organization(org_uri).
|
14
|
+
data = connection.get_organization(org_uri).links.select { |link| link[:type] == "application/vnd.vmware.vcloud.catalog+xml" }
|
15
15
|
load(data)
|
16
16
|
end
|
17
17
|
|
18
18
|
def get(uri)
|
19
|
-
|
20
|
-
new(data.body)
|
21
|
-
end
|
19
|
+
connection.get_catalog(uri)
|
22
20
|
rescue Fog::Errors::NotFound
|
23
21
|
nil
|
24
22
|
end
|
@@ -3,9 +3,9 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Ip < Fog::Vcloud::Model
|
5
5
|
|
6
|
-
ignore_attributes :xmlns_i, :xmlns
|
7
|
-
|
8
6
|
identity :href, :aliases => :Href
|
7
|
+
attribute :links, :aliases => :Link, :type => :array
|
8
|
+
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
9
9
|
|
10
10
|
attribute :name, :aliases => :Name
|
11
11
|
attribute :status, :aliases => :Status
|
@@ -4,8 +4,8 @@ module Fog
|
|
4
4
|
class Network < Fog::Vcloud::Model
|
5
5
|
|
6
6
|
identity :href, :aliases => :Href
|
7
|
-
|
8
|
-
ignore_attributes :xmlns, :
|
7
|
+
attribute :links, :aliases => :Link, :type => :array
|
8
|
+
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
9
9
|
|
10
10
|
attribute :name, :aliases => :Name
|
11
11
|
|
@@ -13,15 +13,9 @@ module Fog
|
|
13
13
|
attribute :configuration, :aliases => :Configuration
|
14
14
|
attribute :provider_info, :aliases => :ProviderInfo
|
15
15
|
|
16
|
-
attribute :links, :aliases => :Link, :type => :array
|
17
|
-
|
18
16
|
def parent_network
|
19
17
|
return nil if configuration[:ParentNetwork].nil?
|
20
|
-
@parent_network ||=
|
21
|
-
:connection => connection,
|
22
|
-
:collection => Fog::Vcloud::Compute::Networks.new(:connection => connection),
|
23
|
-
:href => configuration[:ParentNetwork][:href]
|
24
|
-
)
|
18
|
+
@parent_network ||= connection.get_network(configuration[:ParentNetwork][:href])
|
25
19
|
end
|
26
20
|
end
|
27
21
|
end
|
@@ -17,26 +17,31 @@ module Fog
|
|
17
17
|
data = nil
|
18
18
|
if self.href =~ /\/vdc\//
|
19
19
|
check_href!("Vdc")
|
20
|
-
data = [connection.get_vdc(self.href).
|
20
|
+
data = [connection.get_vdc(self.href).available_networks].flatten.compact.reject{|n| n == '' }
|
21
21
|
elsif self.href =~ /\/org\//
|
22
22
|
check_href!("Org")
|
23
|
-
|
24
|
-
data = links.select{|l| l[:type] == 'application/vnd.vmware.vcloud.network+xml' }
|
23
|
+
data = connection.get_organization(self.href).links.select{|l| l[:type] == network_type_id }
|
25
24
|
elsif self.href =~ /\/vApp\//
|
26
25
|
check_href!("Vapp")
|
27
|
-
data = [(connection.get_vapp(self.href).
|
26
|
+
data = [(connection.get_vapp(self.href).network_configs||{})[:NetworkConfig]].flatten.compact.collect{|n| n[:Configuration][:ParentNetwork] unless n[:Configuration].nil? }.compact
|
28
27
|
end
|
29
28
|
load([*data]) unless data.nil?
|
30
29
|
end
|
31
30
|
|
32
31
|
def get(uri)
|
33
|
-
|
34
|
-
|
35
|
-
end
|
36
|
-
rescue Fog::Errors::NotFound
|
32
|
+
connection.get_network(uri)
|
33
|
+
rescue Fog::Errors::NotFound
|
37
34
|
nil
|
38
35
|
end
|
39
36
|
|
37
|
+
private
|
38
|
+
def network_type_id
|
39
|
+
if connection.version == '1.0'
|
40
|
+
'application/vnd.vmware.vcloud.network+xml'
|
41
|
+
else
|
42
|
+
'application/vnd.vmware.vcloud.orgNetwork+xml'
|
43
|
+
end
|
44
|
+
end
|
40
45
|
end
|
41
46
|
end
|
42
47
|
end
|
@@ -3,15 +3,14 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Organization < Fog::Vcloud::Model
|
5
5
|
|
6
|
-
identity :href
|
7
|
-
|
8
|
-
ignore_attributes :xmlns, :xmlns_xsi, :xmlns_xsd
|
6
|
+
identity :href, :aliases => :Href
|
7
|
+
attribute :links, :aliases => :Link, :type => :array
|
8
|
+
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
9
9
|
|
10
10
|
attribute :name
|
11
11
|
attribute :description, :aliases => :Description
|
12
12
|
attribute :type
|
13
13
|
attribute :full_name, :aliases => :FullName
|
14
|
-
attribute :other_links, :aliases => :Link
|
15
14
|
|
16
15
|
def networks
|
17
16
|
@networks ||= Fog::Vcloud::Compute::Networks.
|
@@ -11,15 +11,18 @@ module Fog
|
|
11
11
|
undef_method :create
|
12
12
|
|
13
13
|
def all
|
14
|
-
|
14
|
+
raw_orgs = if connection.version == '1.0'
|
15
|
+
connection.login
|
16
|
+
else
|
17
|
+
connection.request(connection.basic_request_params("#{connection.base_path_url}/org/"))
|
18
|
+
end
|
19
|
+
data = raw_orgs.body[:Org].select { |org| org[:type] == "application/vnd.vmware.vcloud.org+xml" }
|
15
20
|
data.each { |org| org.delete_if { |key, value| [:rel].include?(key) } }
|
16
21
|
load(data)
|
17
22
|
end
|
18
23
|
|
19
24
|
def get(uri)
|
20
|
-
|
21
|
-
new(data.body)
|
22
|
-
end
|
25
|
+
connection.get_organization(uri)
|
23
26
|
rescue Fog::Errors::NotFound
|
24
27
|
nil
|
25
28
|
end
|
@@ -7,7 +7,7 @@ module Fog
|
|
7
7
|
include Fog::Vcloud::Compute::Helpers::Status
|
8
8
|
|
9
9
|
identity :href, :aliases => :Href
|
10
|
-
|
10
|
+
attribute :links, :aliases => :Link, :type => :array
|
11
11
|
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
12
12
|
|
13
13
|
attribute :type
|
@@ -24,9 +24,10 @@ module Fog
|
|
24
24
|
attribute :guest_customization, :aliases => :GuestCustomizationSection
|
25
25
|
attribute :operating_system, :aliases => :'ovf:OperatingSystemSection'
|
26
26
|
|
27
|
-
attribute :links, :aliases => :Link, :type => :array
|
28
27
|
attribute :tasks, :aliases => :Tasks, :type => :array
|
29
28
|
|
29
|
+
has_up :vapp
|
30
|
+
|
30
31
|
def computer_name
|
31
32
|
load_unless_loaded!
|
32
33
|
self.guest_customization[:ComputerName]
|
@@ -44,7 +45,7 @@ module Fog
|
|
44
45
|
|
45
46
|
def ip_addresses
|
46
47
|
load_unless_loaded!
|
47
|
-
self.network_connections.collect{|n| n[:IpAddress] }
|
48
|
+
[self.network_connections].flatten.collect{|n| n[:IpAddress] }
|
48
49
|
end
|
49
50
|
|
50
51
|
def ready?
|
@@ -262,7 +263,7 @@ module Fog
|
|
262
263
|
end
|
263
264
|
|
264
265
|
def reload_status
|
265
|
-
self.status = connection.get_vapp(href).
|
266
|
+
self.status = connection.get_vapp(href).status
|
266
267
|
end
|
267
268
|
end
|
268
269
|
end
|
@@ -19,11 +19,7 @@ module Fog
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def get(uri)
|
22
|
-
|
23
|
-
# If no tasks returned, set a mock entry to flush on reload
|
24
|
-
data.body[:Tasks] = {} unless data.body[:Tasks]
|
25
|
-
new(data.body)
|
26
|
-
end
|
22
|
+
connection.get_vapp(uri)
|
27
23
|
rescue Fog::Errors::NotFound
|
28
24
|
nil
|
29
25
|
end
|
@@ -6,9 +6,9 @@ module Fog
|
|
6
6
|
|
7
7
|
include Fog::Vcloud::Compute::Helpers::Status
|
8
8
|
|
9
|
-
identity :href
|
10
|
-
|
11
|
-
ignore_attributes :xmlns, :xmlns_xsi, :xmlns_xsd
|
9
|
+
identity :href, :aliases => :Href
|
10
|
+
attribute :links, :aliases => :Link, :type => :array
|
11
|
+
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
12
12
|
|
13
13
|
attribute :name
|
14
14
|
attribute :type
|
@@ -19,7 +19,9 @@ module Fog
|
|
19
19
|
attribute :children, :aliases => :Children, :squash => :Vm
|
20
20
|
attribute :lease_settings, :aliases => :LeaseSettingsSection
|
21
21
|
|
22
|
-
attribute :
|
22
|
+
attribute :network_configs, :aliases => :NetworkConfigSection
|
23
|
+
|
24
|
+
has_up :vdc
|
23
25
|
|
24
26
|
def servers
|
25
27
|
@servers ||= Fog::Vcloud::Compute::Servers.
|
@@ -13,15 +13,11 @@ module Fog
|
|
13
13
|
attribute :href
|
14
14
|
|
15
15
|
def all
|
16
|
-
|
17
|
-
data = resource_entities.select { |re| re[:type] == "application/vnd.vmware.vcloud.vApp+xml" }
|
18
|
-
load(data)
|
16
|
+
load([connection.get_vdc(self.href).resource_entities].flatten.select { |re| re[:type] == "application/vnd.vmware.vcloud.vApp+xml" })
|
19
17
|
end
|
20
18
|
|
21
19
|
def get(uri)
|
22
|
-
|
23
|
-
new(data.body)
|
24
|
-
end
|
20
|
+
connection.get_vapp(uri)
|
25
21
|
rescue Fog::Errors::NotFound
|
26
22
|
nil
|
27
23
|
end
|
@@ -3,9 +3,9 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Vdc < Fog::Vcloud::Model
|
5
5
|
|
6
|
-
identity :href
|
7
|
-
|
8
|
-
ignore_attributes :xmlns, :xmlns_xsi, :xmlns_xsd
|
6
|
+
identity :href, :aliases => :Href
|
7
|
+
attribute :links, :aliases => :Link, :type => :array
|
8
|
+
ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd
|
9
9
|
|
10
10
|
attribute :name
|
11
11
|
attribute :type
|
@@ -18,10 +18,10 @@ module Fog
|
|
18
18
|
attribute :storage_capacity, :aliases => :StorageCapacity
|
19
19
|
attribute :available_networks, :aliases => :AvailableNetworks, :squash => :Network
|
20
20
|
|
21
|
-
attribute :other_links, :aliases => :Link
|
22
|
-
|
23
21
|
attribute :resource_entities, :aliases => :ResourceEntities, :squash => :ResourceEntity
|
24
22
|
|
23
|
+
has_up :organization
|
24
|
+
|
25
25
|
def networks
|
26
26
|
@networks ||= Fog::Vcloud::Compute::Networks.
|
27
27
|
new( :connection => connection,
|
@@ -13,16 +13,13 @@ module Fog
|
|
13
13
|
attribute :href
|
14
14
|
|
15
15
|
def all
|
16
|
-
|
17
|
-
data = links.select { |link| link[:type] == "application/vnd.vmware.vcloud.vdc+xml" }
|
16
|
+
data = connection.get_organization(org_uri).links.select { |link| link[:type] == "application/vnd.vmware.vcloud.vdc+xml" }
|
18
17
|
data.each { |link| link.delete_if { |key, value| [:rel].include?(key) } }
|
19
18
|
load(data)
|
20
19
|
end
|
21
20
|
|
22
21
|
def get(uri)
|
23
|
-
|
24
|
-
new(data.body)
|
25
|
-
end
|
22
|
+
connection.get_vdc(uri)
|
26
23
|
rescue Fog::Errors::NotFound
|
27
24
|
nil
|
28
25
|
end
|
@@ -5,7 +5,7 @@ module Fog
|
|
5
5
|
|
6
6
|
def validate_clone_vapp_options(options)
|
7
7
|
valid_opts = [:name, :poweron]
|
8
|
-
unless valid_opts.all? { |opt| options.
|
8
|
+
unless valid_opts.all? { |opt| options.has_key?(opt) }
|
9
9
|
raise ArgumentError.new("Required data missing: #{(valid_opts - options.keys).map(&:inspect).join(", ")}")
|
10
10
|
end
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Fog
|
|
5
5
|
|
6
6
|
def validate_network_data(network_data, configure=false)
|
7
7
|
valid_opts = [:id, :href, :name, :address, :broadcast, :gateway]
|
8
|
-
unless valid_opts.all? { |opt| network_data.
|
8
|
+
unless valid_opts.all? { |opt| network_data.has_key?(opt) }
|
9
9
|
raise ArgumentError.new("Required data missing: #{(valid_opts - network_data.keys).map(&:inspect).join(", ")}")
|
10
10
|
end
|
11
11
|
end
|
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
|
7
7
|
def validate_network_ip_data(network_ip_data)
|
8
8
|
valid_opts = [:id, :href, :name, :status, :server]
|
9
|
-
unless valid_opts.all? { |opt| network_ip_data.
|
9
|
+
unless valid_opts.all? { |opt| network_ip_data.has_key?(opt) }
|
10
10
|
raise ArgumentError.new("Required data missing: #{(valid_opts - network_ip_data.keys).map(&:inspect).join(", ")}")
|
11
11
|
end
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
|
7
7
|
def validate_vapp_data(vapp_data)
|
8
8
|
valid_opts = [:name, :cpus, :memory, :disks]
|
9
|
-
unless valid_opts.all? { |opt| vapp_data.
|
9
|
+
unless valid_opts.all? { |opt| vapp_data.has_key?(opt) }
|
10
10
|
raise ArgumentError.new("Required Vapp data missing: #{(valid_opts - vapp_data.keys).map(&:inspect).join(", ")}")
|
11
11
|
end
|
12
12
|
end
|
@@ -138,7 +138,7 @@ module Fog
|
|
138
138
|
|
139
139
|
def validate_vm_data(vm_data)
|
140
140
|
valid_opts = [:name, :cpus, :memory, :disks]
|
141
|
-
unless valid_opts.all? { |opt| vm_data.
|
141
|
+
unless valid_opts.all? { |opt| vm_data.has_key?(opt) }
|
142
142
|
raise ArgumentError.new("Required vm data missing: #{(valid_opts - vm_data.keys).map(&:inspect).join(", ")}")
|
143
143
|
end
|
144
144
|
end
|
@@ -7,7 +7,7 @@ module Fog
|
|
7
7
|
def validate_instantiate_vapp_template_options options
|
8
8
|
# :network_uri removed, if not specified will use template network config.
|
9
9
|
valid_opts = [:catalog_item_uri, :name, :vdc_uri]
|
10
|
-
unless valid_opts.all? { |opt| options.
|
10
|
+
unless valid_opts.all? { |opt| options.has_key?(opt) }
|
11
11
|
raise ArgumentError.new("Required data missing: #{(valid_opts - options.keys).map(&:inspect).join(", ")}")
|
12
12
|
end
|
13
13
|
|
@@ -6,14 +6,18 @@ module Fog
|
|
6
6
|
|
7
7
|
|
8
8
|
def login
|
9
|
+
headers = { 'Authorization' => authorization_header }
|
10
|
+
uri = if version == '1.0'
|
11
|
+
"#{base_url}/login"
|
12
|
+
else
|
13
|
+
"#{base_path_url}/sessions"
|
14
|
+
end
|
9
15
|
unauthenticated_request({
|
10
16
|
:expects => 200,
|
11
|
-
:headers =>
|
12
|
-
'Authorization' => authorization_header
|
13
|
-
},
|
17
|
+
:headers => headers,
|
14
18
|
:method => 'POST',
|
15
19
|
:parse => true,
|
16
|
-
:uri =>
|
20
|
+
:uri => uri
|
17
21
|
})
|
18
22
|
end
|
19
23
|
|
@@ -34,6 +34,10 @@ module Fog
|
|
34
34
|
@connection = ::VirtualBox::Global.global.lib.virtualbox
|
35
35
|
end
|
36
36
|
|
37
|
+
def respond_to?(method, *)
|
38
|
+
super or @connection.respond_to? method
|
39
|
+
end
|
40
|
+
|
37
41
|
# hack to provide 'requests'
|
38
42
|
def method_missing(method_sym, *arguments, &block)
|
39
43
|
if @connection.respond_to?(method_sym)
|
@@ -8,150 +8,209 @@ module Fog
|
|
8
8
|
|
9
9
|
identity :name
|
10
10
|
|
11
|
-
attribute :
|
12
|
-
attribute :
|
11
|
+
attribute :ipaddress
|
12
|
+
attribute :power_state
|
13
|
+
attribute :mac_addresses
|
14
|
+
attribute :path
|
13
15
|
|
14
16
|
attr_accessor :password
|
15
17
|
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
# There is currently no documented model of creating VMs from scratch
|
20
|
+
# sans Fusion's wizard.
|
20
21
|
def save
|
21
22
|
raise Fog::Errors::Error.new('Creating a new vm is not yet supported')
|
22
23
|
end
|
23
24
|
|
25
|
+
# Fussion doesn't have the concept of templates so one just clones
|
26
|
+
# regular VMs.
|
24
27
|
def clone(name)
|
25
28
|
requires :raw
|
26
29
|
|
27
|
-
::Fission::VM.clone(@raw.name,name)
|
30
|
+
::Fission::VM.clone(@raw[:fission].name,name)
|
28
31
|
return connection.servers.get(name)
|
29
32
|
end
|
30
33
|
|
31
|
-
|
34
|
+
# Destroy, deletes the VM from the local disk but only hard stops the VM
|
35
|
+
# before doing so if you set :force to true.
|
36
|
+
def destroy(options = { :force => false })
|
32
37
|
requires :raw
|
33
38
|
|
34
|
-
if
|
39
|
+
if ready?
|
35
40
|
if options[:force]
|
36
|
-
|
41
|
+
stop
|
37
42
|
end
|
38
43
|
end
|
39
44
|
|
40
|
-
|
45
|
+
@raw[:fission].delete
|
41
46
|
end
|
42
47
|
|
43
|
-
|
48
|
+
# Start is pretty self explanatory...if you pass :headless as true you
|
49
|
+
# won't get a console on launch.
|
50
|
+
def start(options = { :headless => false })
|
44
51
|
requires :raw
|
45
52
|
|
46
|
-
unless
|
47
|
-
@raw.start
|
53
|
+
unless ready?
|
54
|
+
@raw[:fission].start(:headless => options[:headless])
|
48
55
|
return true
|
49
56
|
else
|
50
57
|
return false
|
51
58
|
end
|
52
59
|
end
|
53
60
|
|
61
|
+
# We're covering a lot of bases here with the different ways one can
|
62
|
+
# stop a VM from running.
|
63
|
+
|
64
|
+
# Stop is a hard stop, like pulling out the power cord.
|
54
65
|
def stop
|
55
66
|
requires :raw
|
56
67
|
|
57
|
-
if
|
58
|
-
@raw.stop
|
68
|
+
if ready?
|
69
|
+
@raw[:fission].stop(:hard => true)
|
59
70
|
return true
|
60
71
|
else
|
61
72
|
return false
|
62
73
|
end
|
63
74
|
end
|
64
75
|
|
65
|
-
|
76
|
+
# Halt and poweroff are just synonyms for stop.
|
77
|
+
def halt
|
78
|
+
stop
|
79
|
+
end
|
80
|
+
|
81
|
+
def poweroff
|
82
|
+
stop
|
83
|
+
end
|
84
|
+
|
85
|
+
# This is a graceful shutdown but Fusion is only capable of a graceful
|
86
|
+
# shutdown if tools are installed. Fusion does the right thing though
|
87
|
+
# and if graceful can't be initiated it just does a hard stop.
|
88
|
+
def shutdown
|
66
89
|
requires :raw
|
67
|
-
if
|
68
|
-
@raw.stop
|
69
|
-
wait_for { state!="running"}
|
70
|
-
@raw.start
|
90
|
+
if ready?
|
91
|
+
@raw[:fission].stop
|
71
92
|
return true
|
72
93
|
else
|
73
94
|
return false
|
74
95
|
end
|
75
96
|
end
|
76
97
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
98
|
+
# Attempt a graceful shutdown, wait for the VM to completely shutdown
|
99
|
+
# and then start it again.
|
100
|
+
def reboot
|
101
|
+
if ready?
|
102
|
+
shutdown
|
103
|
+
wait_for { ! ready? }
|
104
|
+
start
|
81
105
|
return true
|
82
106
|
else
|
83
107
|
return false
|
84
108
|
end
|
109
|
+
end
|
85
110
|
|
111
|
+
# Resuming from suspend is the same thing as start to Fusion.
|
112
|
+
def resume
|
113
|
+
start
|
86
114
|
end
|
87
115
|
|
88
|
-
def
|
116
|
+
def suspend
|
89
117
|
requires :raw
|
90
|
-
|
118
|
+
if ready?
|
119
|
+
@raw[:fission].suspend
|
120
|
+
return true
|
121
|
+
else
|
122
|
+
return false
|
123
|
+
end
|
91
124
|
end
|
92
125
|
|
93
|
-
|
126
|
+
# Fusion VM Metadata.
|
127
|
+
|
128
|
+
# The power state of the VM is commonly going to be three values;
|
129
|
+
# running, not running, or suspended.
|
130
|
+
def power_state
|
94
131
|
requires :raw
|
95
|
-
|
132
|
+
@raw[:fission].state.data
|
96
133
|
end
|
97
134
|
|
98
|
-
def
|
135
|
+
def ready?
|
99
136
|
requires :raw
|
100
|
-
@raw.
|
137
|
+
@raw[:fission].running?.data
|
101
138
|
end
|
102
139
|
|
103
|
-
|
140
|
+
# Path to the VM's vmx file on the local disk.
|
141
|
+
def path
|
104
142
|
requires :raw
|
105
|
-
@raw.
|
143
|
+
@raw[:fission].path
|
106
144
|
end
|
107
145
|
|
108
|
-
|
146
|
+
# We obtain the first ipaddress. This should generally be a safe
|
147
|
+
# assumption for Fusion. Even if an address is provided via NAT,
|
148
|
+
# bridge, or host only it will by accessible from the host machine the
|
149
|
+
# VM resides on.
|
150
|
+
def ipaddress
|
109
151
|
requires :raw
|
110
|
-
@raw
|
152
|
+
ip(@raw[:fission])
|
111
153
|
end
|
112
154
|
|
113
|
-
|
114
|
-
|
155
|
+
# Keeping these three methods around for API compatibility reasons.
|
156
|
+
# Makes the vmfusion provider function similar to cloud providers and
|
157
|
+
# the vsphere provider. Future goal is to add an actual private and
|
158
|
+
# public concept. Needs changes to fission and a determination what is
|
159
|
+
# a public or private address here; bridge, nat, host-only.
|
160
|
+
def public_ip_address
|
161
|
+
ipaddress
|
115
162
|
end
|
116
163
|
|
117
164
|
def private_ip_address
|
118
|
-
|
165
|
+
ipaddress
|
119
166
|
end
|
120
167
|
|
121
|
-
def
|
122
|
-
|
168
|
+
def state
|
169
|
+
power_state
|
170
|
+
end
|
171
|
+
|
172
|
+
# Collecting all mac_addresses the VM has...mostly just because we are
|
173
|
+
# doing the same thing for the vSphere provider.
|
174
|
+
def mac_addresses
|
175
|
+
requires :raw
|
176
|
+
macs(@raw[:fission])
|
123
177
|
end
|
124
178
|
|
179
|
+
# Sets up a conveinent way to SSH into a Fusion VM using credentials
|
180
|
+
# stored in your .fog file.
|
125
181
|
|
126
182
|
def username
|
127
183
|
@username ||= 'root'
|
128
184
|
end
|
129
185
|
|
186
|
+
# Simply spawn an SSH session.
|
130
187
|
def ssh(commands)
|
131
|
-
requires :
|
188
|
+
requires :ipaddress, :username
|
132
189
|
|
133
190
|
#requires :password, :private_key
|
134
191
|
ssh_options={}
|
135
192
|
ssh_options[:password] = password unless password.nil?
|
136
193
|
ssh_options[:key_data] = [private_key] if private_key
|
137
194
|
|
138
|
-
Fog::SSH.new(
|
195
|
+
Fog::SSH.new(ipaddress, @username, ssh_options).run(commands)
|
139
196
|
|
140
197
|
end
|
141
198
|
|
199
|
+
# SCP something to our VM.
|
142
200
|
def scp(local_path, remote_path, upload_options = {})
|
143
|
-
requires :
|
201
|
+
requires :ipaddress, :username
|
144
202
|
|
145
203
|
scp_options = {}
|
146
204
|
scp_options[:password] = password unless self.password.nil?
|
147
205
|
scp_options[:key_data] = [private_key] if self.private_key
|
148
206
|
|
149
|
-
Fog::SCP.new(
|
207
|
+
Fog::SCP.new(ipaddress, username, scp_options).upload(local_path, remote_path, upload_options)
|
150
208
|
end
|
151
209
|
|
152
|
-
# Sets up a new key
|
210
|
+
# Sets up a new SSH key on the VM so one doesn't need to use a password
|
211
|
+
# ever again.
|
153
212
|
def setup(credentials = {})
|
154
|
-
requires :public_key, :
|
213
|
+
requires :public_key, :ipaddress, :username
|
155
214
|
|
156
215
|
credentials[:password] = password unless self.password.nil?
|
157
216
|
credentails[:key_data] = [private_key] if self.private_key
|
@@ -167,7 +226,7 @@ module Fog
|
|
167
226
|
Timeout::timeout(360) do
|
168
227
|
begin
|
169
228
|
Timeout::timeout(8) do
|
170
|
-
Fog::SSH.new(
|
229
|
+
Fog::SSH.new(ipaddress, username, credentials.merge(:timeout => 4)).run('pwd')
|
171
230
|
end
|
172
231
|
rescue Errno::ECONNREFUSED
|
173
232
|
sleep(2)
|
@@ -176,9 +235,11 @@ module Fog
|
|
176
235
|
retry
|
177
236
|
end
|
178
237
|
end
|
179
|
-
Fog::SSH.new(
|
238
|
+
Fog::SSH.new(ipaddress, username, credentials).run(commands)
|
180
239
|
end
|
181
240
|
|
241
|
+
# Just setting local versions of some variables that were going to use
|
242
|
+
# for SSH operations.
|
182
243
|
def private_key_path
|
183
244
|
@private_key_path ||= Fog.credentials[:private_key_path]
|
184
245
|
@private_key_path &&= File.expand_path(@private_key_path)
|
@@ -198,8 +259,13 @@ module Fog
|
|
198
259
|
end
|
199
260
|
|
200
261
|
private
|
201
|
-
def
|
202
|
-
|
262
|
+
def ip(fission)
|
263
|
+
first_int = fission.network_info.data.keys.first
|
264
|
+
fission.network_info.data[first_int]['ip_address']
|
265
|
+
end
|
266
|
+
|
267
|
+
def macs(fission)
|
268
|
+
fission.mac_addresses.data
|
203
269
|
end
|
204
270
|
|
205
271
|
def raw
|
@@ -210,13 +276,15 @@ module Fog
|
|
210
276
|
@raw = new_raw
|
211
277
|
|
212
278
|
raw_attributes = {
|
213
|
-
:name
|
214
|
-
:
|
279
|
+
:name => new_raw[:fission].name,
|
280
|
+
:power_state => new_raw[:state],
|
281
|
+
:ipaddress => ip(new_raw[:fission]),
|
282
|
+
:mac_addresses => macs(new_raw[:fission]),
|
283
|
+
:path => new_raw[:fission].path
|
215
284
|
}
|
216
285
|
|
217
286
|
merge_attributes(raw_attributes)
|
218
287
|
end
|
219
|
-
|
220
288
|
end
|
221
289
|
end
|
222
290
|
end
|