fog 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.irbrc +87 -0
- data/Rakefile +3 -3
- data/bin/fog +1 -3
- data/docs/_layouts/default.html +2 -2
- data/docs/cdn/index.markdown +2 -2
- data/docs/compute/index.markdown +2 -2
- data/docs/dns/index.markdown +2 -2
- data/docs/public/js/libs/dd_belatedpng.js +289 -13
- data/docs/public/js/libs/dd_belatedpng.min.js +13 -0
- data/docs/public/js/libs/modernizr-1.6.js +892 -0
- data/docs/public/js/profiling/yahoo-profiling.js +1028 -0
- data/docs/storage/index.markdown +2 -2
- data/fog.gemspec +10 -4
- data/lib/fog.rb +4 -1
- data/lib/fog/aws.rb +46 -5
- data/lib/fog/aws/auto_scaling.rb +26 -11
- data/lib/fog/aws/beanstalk.rb +28 -16
- data/lib/fog/aws/cdn.rb +25 -9
- data/lib/fog/aws/cloud_formation.rb +18 -7
- data/lib/fog/aws/cloud_watch.rb +18 -8
- data/lib/fog/aws/compute.rb +52 -10
- data/lib/fog/aws/credential_fetcher.rb +64 -0
- data/lib/fog/aws/dns.rb +31 -11
- data/lib/fog/aws/dynamodb.rb +32 -18
- data/lib/fog/aws/elasticache.rb +18 -5
- data/lib/fog/aws/elb.rb +30 -10
- data/lib/fog/aws/elb/policy_types.rb +432 -1
- data/lib/fog/aws/emr.rb +20 -20
- data/lib/fog/aws/iam.rb +25 -2
- data/lib/fog/aws/models/beanstalk/environment.rb +16 -0
- data/lib/fog/aws/models/beanstalk/template.rb +16 -0
- data/lib/fog/aws/models/compute/address.rb +4 -0
- data/lib/fog/aws/models/compute/dhcp_option.rb +68 -0
- data/lib/fog/aws/models/compute/dhcp_options.rb +91 -0
- data/lib/fog/aws/models/compute/flavors.rb +10 -1
- data/lib/fog/aws/models/compute/internet_gateway.rb +81 -0
- data/lib/fog/aws/models/compute/internet_gateways.rb +91 -0
- data/lib/fog/aws/models/compute/network_interface.rb +70 -0
- data/lib/fog/aws/models/compute/network_interfaces.rb +136 -0
- data/lib/fog/aws/models/compute/security_group.rb +75 -17
- data/lib/fog/aws/models/compute/server.rb +16 -18
- data/lib/fog/aws/models/compute/servers.rb +1 -1
- data/lib/fog/aws/models/compute/spot_request.rb +20 -0
- data/lib/fog/aws/models/compute/spot_requests.rb +4 -4
- data/lib/fog/aws/models/compute/volume.rb +13 -0
- data/lib/fog/aws/models/dns/record.rb +12 -6
- data/lib/fog/aws/models/dns/records.rb +84 -12
- data/lib/fog/aws/models/dns/zones.rb +1 -1
- data/lib/fog/aws/models/elb/load_balancer.rb +36 -4
- data/lib/fog/aws/models/elb/load_balancers.rb +14 -4
- data/lib/fog/aws/models/iam/access_key.rb +38 -0
- data/lib/fog/aws/models/iam/access_keys.rb +36 -0
- data/lib/fog/aws/models/iam/policies.rb +44 -0
- data/lib/fog/aws/models/iam/policy.rb +39 -0
- data/lib/fog/aws/models/iam/user.rb +40 -0
- data/lib/fog/aws/models/iam/users.rb +27 -0
- data/lib/fog/aws/models/storage/directory.rb +34 -27
- data/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/fog/aws/models/storage/files.rb +5 -0
- data/lib/fog/aws/parsers/auto_scaling/put_notification_configuration.rb +27 -0
- data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +12 -3
- data/lib/fog/aws/parsers/compute/associate_dhcp_options.rb +24 -0
- data/lib/fog/aws/parsers/compute/attach_internet_gateway.rb +24 -0
- data/lib/fog/aws/parsers/compute/attach_network_interface.rb +18 -0
- data/lib/fog/aws/parsers/compute/create_dhcp_options.rb +75 -0
- data/lib/fog/aws/parsers/compute/create_internet_gateway.rb +65 -0
- data/lib/fog/aws/parsers/compute/create_network_interface.rb +28 -0
- data/lib/fog/aws/parsers/compute/delete_dhcp_options.rb +24 -0
- data/lib/fog/aws/parsers/compute/delete_internet_gateway.rb +24 -0
- data/lib/fog/aws/parsers/compute/delete_network_interface.rb +24 -0
- data/lib/fog/aws/parsers/compute/describe_dhcp_options.rb +75 -0
- data/lib/fog/aws/parsers/compute/describe_instance_status.rb +32 -62
- data/lib/fog/aws/parsers/compute/describe_instances.rb +26 -8
- data/lib/fog/aws/parsers/compute/describe_internet_gateways.rb +65 -0
- data/lib/fog/aws/parsers/compute/describe_network_interface_attribute.rb +79 -0
- data/lib/fog/aws/parsers/compute/describe_network_interfaces.rb +43 -0
- data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_volume_status.rb +62 -45
- data/lib/fog/aws/parsers/compute/describe_volumes.rb +0 -2
- data/lib/fog/aws/parsers/compute/detach_internet_gateway.rb +24 -0
- data/lib/fog/aws/parsers/compute/detach_network_interface.rb +24 -0
- data/lib/fog/aws/parsers/compute/network_interface_parser.rb +89 -0
- data/lib/fog/aws/parsers/dns/list_resource_record_sets.rb +2 -2
- data/lib/fog/aws/parsers/elb/apply_security_groups_to_load_balancer.rb +26 -0
- data/lib/fog/aws/parsers/elb/attach_load_balancer_to_subnets.rb +26 -0
- data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +18 -2
- data/lib/fog/aws/parsers/elb/detach_load_balancer_from_subnets.rb +26 -0
- data/lib/fog/aws/parsers/iam/base_instance_profile.rb +79 -0
- data/lib/fog/aws/parsers/iam/get_role_policy.rb +32 -0
- data/lib/fog/aws/parsers/iam/get_user_policy.rb +9 -3
- data/lib/fog/aws/parsers/iam/instance_profile.rb +34 -0
- data/lib/fog/aws/parsers/iam/list_instance_profiles.rb +34 -0
- data/lib/fog/aws/parsers/iam/list_roles.rb +31 -0
- data/lib/fog/aws/parsers/iam/role_parser.rb +53 -0
- data/lib/fog/aws/parsers/iam/single_role.rb +29 -0
- data/lib/fog/aws/rds.rb +23 -11
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +4 -3
- data/lib/fog/aws/requests/auto_scaling/delete_notification_configuration.rb +47 -0
- data/lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb +51 -0
- data/lib/fog/aws/requests/beanstalk/create_configuration_template.rb +3 -0
- data/lib/fog/aws/requests/compute/associate_dhcp_options.rb +57 -0
- data/lib/fog/aws/requests/compute/attach_internet_gateway.rb +56 -0
- data/lib/fog/aws/requests/compute/attach_network_interface.rb +57 -0
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +2 -2
- data/lib/fog/aws/requests/compute/create_dhcp_options.rb +75 -0
- data/lib/fog/aws/requests/compute/create_internet_gateway.rb +51 -0
- data/lib/fog/aws/requests/compute/create_network_interface.rb +118 -0
- data/lib/fog/aws/requests/compute/delete_dhcp_options.rb +50 -0
- data/lib/fog/aws/requests/compute/delete_internet_gateway.rb +48 -0
- data/lib/fog/aws/requests/compute/delete_network_interface.rb +52 -0
- data/lib/fog/aws/requests/compute/describe_dhcp_options.rb +62 -0
- data/lib/fog/aws/requests/compute/describe_instance_status.rb +11 -1
- data/lib/fog/aws/requests/compute/describe_instances.rb +3 -0
- data/lib/fog/aws/requests/compute/describe_internet_gateways.rb +61 -0
- data/lib/fog/aws/requests/compute/describe_network_interface_attribute.rb +67 -0
- data/lib/fog/aws/requests/compute/describe_network_interfaces.rb +85 -0
- data/lib/fog/aws/requests/compute/describe_volume_status.rb +3 -8
- data/lib/fog/aws/requests/compute/detach_internet_gateway.rb +56 -0
- data/lib/fog/aws/requests/compute/detach_network_interface.rb +49 -0
- data/lib/fog/aws/requests/compute/modify_network_interface_attribute.rb +90 -0
- data/lib/fog/aws/requests/compute/register_image.rb +3 -3
- data/lib/fog/aws/requests/compute/release_address.rb +10 -2
- data/lib/fog/aws/requests/compute/reset_network_interface_attribute.rb +56 -0
- data/lib/fog/aws/requests/compute/run_instances.rb +1 -1
- data/lib/fog/aws/requests/compute/start_instances.rb +27 -0
- data/lib/fog/aws/requests/compute/stop_instances.rb +27 -0
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +109 -15
- data/lib/fog/aws/requests/dns/create_hosted_zone.rb +46 -1
- data/lib/fog/aws/requests/dns/get_hosted_zone.rb +24 -1
- data/lib/fog/aws/requests/dns/list_hosted_zones.rb +45 -0
- data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +4 -2
- data/lib/fog/aws/requests/dynamodb/batch_get_item.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/batch_write_item.rb +35 -0
- data/lib/fog/aws/requests/dynamodb/create_table.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/delete_item.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/delete_table.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/describe_table.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/get_item.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/list_tables.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/put_item.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/query.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/scan.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/update_item.rb +1 -1
- data/lib/fog/aws/requests/dynamodb/update_table.rb +1 -1
- data/lib/fog/aws/requests/elb/apply_security_groups_to_load_balancer.rb +61 -0
- data/lib/fog/aws/requests/elb/attach_load_balancer_to_subnets.rb +61 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +8 -3
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +35 -5
- data/lib/fog/aws/requests/elb/detach_load_balancer_from_subnets.rb +61 -0
- data/lib/fog/aws/requests/iam/add_role_to_instance_profile.rb +35 -0
- data/lib/fog/aws/requests/iam/create_instance_profile.rb +46 -0
- data/lib/fog/aws/requests/iam/create_role.rb +56 -0
- data/lib/fog/aws/requests/iam/delete_instance_profile.rb +32 -0
- data/lib/fog/aws/requests/iam/delete_role.rb +32 -0
- data/lib/fog/aws/requests/iam/delete_role_policy.rb +35 -0
- data/lib/fog/aws/requests/iam/get_group.rb +18 -0
- data/lib/fog/aws/requests/iam/get_instance_profile.rb +42 -0
- data/lib/fog/aws/requests/iam/get_role.rb +38 -0
- data/lib/fog/aws/requests/iam/get_role_policy.rb +36 -0
- data/lib/fog/aws/requests/iam/get_user.rb +23 -3
- data/lib/fog/aws/requests/iam/get_user_policy.rb +17 -0
- data/lib/fog/aws/requests/iam/list_instance_profiles.rb +50 -0
- data/lib/fog/aws/requests/iam/list_instance_profiles_for_role.rb +51 -0
- data/lib/fog/aws/requests/iam/list_role_policies.rb +39 -0
- data/lib/fog/aws/requests/iam/list_roles.rb +43 -0
- data/lib/fog/aws/requests/iam/put_group_policy.rb +1 -1
- data/lib/fog/aws/requests/iam/put_role_policy.rb +36 -0
- data/lib/fog/aws/requests/iam/put_user_policy.rb +1 -1
- data/lib/fog/aws/requests/iam/remove_role_from_instance_profile.rb +36 -0
- data/lib/fog/aws/requests/storage/get_bucket_policy.rb +1 -1
- data/lib/fog/aws/requests/storage/get_object_http_url.rb +2 -1
- data/lib/fog/aws/requests/storage/get_object_https_url.rb +1 -18
- data/lib/fog/aws/requests/storage/get_object_url.rb +29 -8
- data/lib/fog/aws/requests/storage/post_object_hidden_fields.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_policy.rb +1 -1
- data/lib/fog/aws/requests/storage/put_object_url.rb +22 -28
- data/lib/fog/aws/requests/sts/get_federation_token.rb +1 -1
- data/lib/fog/aws/ses.rb +21 -8
- data/lib/fog/aws/simpledb.rb +22 -9
- data/lib/fog/aws/sns.rb +18 -7
- data/lib/fog/aws/sqs.rb +20 -11
- data/lib/fog/aws/storage.rb +51 -18
- data/lib/fog/aws/sts.rb +1 -2
- data/lib/fog/bare_metal_cloud.rb +1 -1
- data/lib/fog/bare_metal_cloud/compute.rb +1 -1
- data/lib/fog/bin.rb +2 -1
- data/lib/fog/bin/aws.rb +2 -0
- data/lib/fog/bin/hp.rb +38 -0
- data/lib/fog/bin/openstack.rb +6 -1
- data/lib/fog/bin/xenserver.rb +31 -0
- data/lib/fog/bluebox.rb +1 -1
- data/lib/fog/bluebox/compute.rb +2 -3
- data/lib/fog/bluebox/dns.rb +2 -2
- data/lib/fog/bluebox/models/compute/server.rb +1 -1
- data/lib/fog/brightbox.rb +1 -1
- data/lib/fog/brightbox/compute.rb +6 -8
- data/lib/fog/brightbox/models/compute/server.rb +2 -1
- data/lib/fog/cdn.rb +3 -0
- data/lib/fog/clodo/compute.rb +1 -3
- data/lib/fog/clodo/models/compute/server.rb +1 -1
- data/lib/fog/clodo/requests/compute/create_server.rb +1 -1
- data/lib/fog/clodo/requests/compute/delete_ip_address.rb +1 -1
- data/lib/fog/clodo/requests/compute/move_ip_address.rb +1 -1
- data/lib/fog/clodo/requests/compute/server_action.rb +1 -1
- data/lib/fog/cloudstack.rb +13 -1
- data/lib/fog/cloudstack/compute.rb +238 -61
- data/lib/fog/cloudstack/models/compute/address.rb +17 -0
- data/lib/fog/cloudstack/models/compute/flavor.rb +33 -0
- data/lib/fog/cloudstack/models/compute/flavors.rb +28 -0
- data/lib/fog/cloudstack/models/compute/image.rb +72 -0
- data/lib/fog/cloudstack/models/compute/images.rb +32 -0
- data/lib/fog/cloudstack/models/compute/job.rb +29 -0
- data/lib/fog/cloudstack/models/compute/jobs.rb +28 -0
- data/lib/fog/cloudstack/models/compute/server.rb +92 -0
- data/lib/fog/cloudstack/models/compute/servers.rb +34 -0
- data/lib/fog/cloudstack/models/compute/volume.rb +119 -0
- data/lib/fog/cloudstack/models/compute/volumes.rb +28 -0
- data/lib/fog/cloudstack/models/compute/zone.rb +39 -0
- data/lib/fog/cloudstack/models/compute/zones.rb +33 -0
- data/lib/fog/cloudstack/requests/compute/attach_volume.rb +57 -10
- data/lib/fog/cloudstack/requests/compute/create_volume.rb +43 -0
- data/lib/fog/cloudstack/requests/compute/delete_template.rb +20 -0
- data/lib/fog/cloudstack/requests/compute/delete_volume.rb +24 -4
- data/lib/fog/cloudstack/requests/compute/deploy_virtual_machine.rb +110 -14
- data/lib/fog/cloudstack/requests/compute/destroy_virtual_machine.rb +12 -3
- data/lib/fog/cloudstack/requests/compute/detach_volume.rb +47 -6
- data/lib/fog/cloudstack/requests/compute/list_async_jobs.rb +17 -5
- data/lib/fog/cloudstack/requests/compute/list_capabilities.rb +1 -1
- data/lib/fog/cloudstack/requests/compute/list_service_offerings.rb +27 -5
- data/lib/fog/cloudstack/requests/compute/list_templates.rb +20 -5
- data/lib/fog/cloudstack/requests/compute/list_virtual_machines.rb +11 -5
- data/lib/fog/cloudstack/requests/compute/list_volumes.rb +23 -5
- data/lib/fog/cloudstack/requests/compute/list_zones.rb +18 -4
- data/lib/fog/cloudstack/requests/compute/reboot_virtual_machine.rb +11 -0
- data/lib/fog/compute.rb +6 -4
- data/lib/fog/compute/models/server.rb +19 -4
- data/lib/fog/core/collection.rb +4 -5
- data/lib/fog/core/credentials.rb +5 -3
- data/lib/fog/core/current_machine.rb +1 -5
- data/lib/fog/core/errors.rb +6 -3
- data/lib/fog/core/json.rb +27 -1
- data/lib/fog/core/model.rb +1 -2
- data/lib/fog/core/scp.rb +11 -3
- data/lib/fog/core/service.rb +29 -8
- data/lib/fog/core/ssh.rb +18 -5
- data/lib/fog/dns.rb +0 -4
- data/lib/fog/dnsimple.rb +1 -1
- data/lib/fog/dnsimple/dns.rb +2 -4
- data/lib/fog/dnsimple/requests/dns/create_domain.rb +1 -1
- data/lib/fog/dnsimple/requests/dns/create_record.rb +1 -1
- data/lib/fog/dnsimple/requests/dns/update_record.rb +1 -1
- data/lib/fog/dnsmadeeasy.rb +1 -1
- data/lib/fog/dnsmadeeasy/dns.rb +4 -5
- data/lib/fog/dnsmadeeasy/requests/dns/create_record.rb +1 -1
- data/lib/fog/dnsmadeeasy/requests/dns/create_secondary.rb +1 -1
- data/lib/fog/dnsmadeeasy/requests/dns/update_record.rb +1 -1
- data/lib/fog/dnsmadeeasy/requests/dns/update_secondary.rb +1 -1
- data/lib/fog/dynect.rb +1 -1
- data/lib/fog/dynect/dns.rb +3 -5
- data/lib/fog/dynect/requests/dns/delete_record.rb +1 -0
- data/lib/fog/dynect/requests/dns/get_node_list.rb +1 -0
- data/lib/fog/dynect/requests/dns/get_record.rb +1 -0
- data/lib/fog/dynect/requests/dns/get_zone.rb +1 -0
- data/lib/fog/dynect/requests/dns/post_record.rb +1 -1
- data/lib/fog/dynect/requests/dns/post_session.rb +2 -1
- data/lib/fog/dynect/requests/dns/post_zone.rb +1 -1
- data/lib/fog/dynect/requests/dns/put_zone.rb +1 -1
- data/lib/fog/ecloud/collection.rb +26 -0
- data/lib/fog/ecloud/compute.rb +341 -1135
- data/lib/fog/ecloud/generate_collection.rb +130 -0
- data/lib/fog/ecloud/ipaddr.rb +5 -0
- data/lib/fog/ecloud/mock_data_classes.rb +768 -0
- data/lib/fog/ecloud/model.rb +22 -0
- data/lib/fog/ecloud/models/compute/admin_organization.rb +39 -0
- data/lib/fog/ecloud/models/compute/admin_organizations.rb +27 -0
- data/lib/fog/ecloud/models/compute/api_key.rb +21 -0
- data/lib/fog/ecloud/models/compute/api_keys.rb +27 -0
- data/lib/fog/ecloud/models/compute/association.rb +23 -0
- data/lib/fog/ecloud/models/compute/associations.rb +35 -0
- data/lib/fog/ecloud/models/compute/authentication_level.rb +22 -0
- data/lib/fog/ecloud/models/compute/authentication_levels.rb +27 -0
- data/lib/fog/ecloud/models/compute/backup_internet_service.rb +22 -33
- data/lib/fog/ecloud/models/compute/backup_internet_services.rb +20 -11
- data/lib/fog/ecloud/models/compute/catalog.rb +17 -5
- data/lib/fog/ecloud/models/compute/catalog_configuration.rb +23 -0
- data/lib/fog/ecloud/models/compute/catalog_configurations.rb +27 -0
- data/lib/fog/ecloud/models/compute/catalog_item.rb +12 -17
- data/lib/fog/ecloud/models/compute/compute_pool.rb +59 -0
- data/lib/fog/ecloud/models/compute/compute_pools.rb +34 -0
- data/lib/fog/ecloud/models/compute/cpu_usage_detail.rb +17 -0
- data/lib/fog/ecloud/models/compute/cpu_usage_detail_summary.rb +27 -0
- data/lib/fog/ecloud/models/compute/environment.rb +105 -0
- data/lib/fog/ecloud/models/compute/environments.rb +40 -0
- data/lib/fog/ecloud/models/compute/firewall_acl.rb +14 -11
- data/lib/fog/ecloud/models/compute/firewall_acls.rb +7 -10
- data/lib/fog/ecloud/models/compute/group.rb +39 -0
- data/lib/fog/ecloud/models/compute/groups.rb +28 -0
- data/lib/fog/ecloud/models/compute/guest_process.rb +15 -0
- data/lib/fog/ecloud/models/compute/guest_processes.rb +27 -0
- data/lib/fog/ecloud/models/compute/hardware_configuration.rb +18 -0
- data/lib/fog/ecloud/models/compute/hardware_configurations.rb +27 -0
- data/lib/fog/ecloud/models/compute/internet_service.rb +47 -73
- data/lib/fog/ecloud/models/compute/internet_services.rb +23 -10
- data/lib/fog/ecloud/models/compute/ip_address.rb +25 -0
- data/lib/fog/ecloud/models/compute/ip_addresses.rb +27 -0
- data/lib/fog/ecloud/models/compute/layout.rb +20 -0
- data/lib/fog/ecloud/models/compute/layouts.rb +27 -0
- data/lib/fog/ecloud/models/compute/location.rb +23 -0
- data/lib/fog/ecloud/models/compute/locations.rb +31 -0
- data/lib/fog/ecloud/models/compute/login_banner.rb +16 -0
- data/lib/fog/ecloud/models/compute/login_banners.rb +27 -0
- data/lib/fog/ecloud/models/compute/memory_usage_detail.rb +16 -0
- data/lib/fog/ecloud/models/compute/memory_usage_detail_summary.rb +27 -0
- data/lib/fog/ecloud/models/compute/monitor.rb +46 -0
- data/lib/fog/ecloud/models/compute/monitors.rb +31 -0
- data/lib/fog/ecloud/models/compute/network.rb +16 -55
- data/lib/fog/ecloud/models/compute/networks.rb +5 -10
- data/lib/fog/ecloud/models/compute/node.rb +22 -26
- data/lib/fog/ecloud/models/compute/nodes.rb +19 -6
- data/lib/fog/ecloud/models/compute/operating_system.rb +17 -0
- data/lib/fog/ecloud/models/compute/operating_system_families.rb +27 -0
- data/lib/fog/ecloud/models/compute/operating_system_family.rb +21 -0
- data/lib/fog/ecloud/models/compute/operating_systems.rb +26 -0
- data/lib/fog/ecloud/models/compute/organization.rb +79 -0
- data/lib/fog/ecloud/models/compute/organizations.rb +39 -0
- data/lib/fog/ecloud/models/compute/password_complexity_rule.rb +49 -0
- data/lib/fog/ecloud/models/compute/password_complexity_rules.rb +27 -0
- data/lib/fog/ecloud/models/compute/physical_device.rb +22 -0
- data/lib/fog/ecloud/models/compute/physical_devices.rb +27 -0
- data/lib/fog/ecloud/models/compute/public_ip.rb +14 -10
- data/lib/fog/ecloud/models/compute/public_ips.rb +8 -11
- data/lib/fog/ecloud/models/compute/rnat.rb +27 -0
- data/lib/fog/ecloud/models/compute/rnats.rb +27 -0
- data/lib/fog/ecloud/models/compute/role.rb +24 -0
- data/lib/fog/ecloud/models/compute/roles.rb +37 -0
- data/lib/fog/ecloud/models/compute/row.rb +53 -0
- data/lib/fog/ecloud/models/compute/rows.rb +37 -0
- data/lib/fog/ecloud/models/compute/server.rb +170 -132
- data/lib/fog/ecloud/models/compute/server_configuration_option.rb +17 -0
- data/lib/fog/ecloud/models/compute/server_configuration_options.rb +27 -0
- data/lib/fog/ecloud/models/compute/servers.rb +38 -28
- data/lib/fog/ecloud/models/compute/ssh_key.rb +20 -0
- data/lib/fog/ecloud/models/compute/ssh_keys.rb +27 -0
- data/lib/fog/ecloud/models/compute/storage_usage_detail.rb +16 -0
- data/lib/fog/ecloud/models/compute/storage_usage_detail_summary.rb +27 -0
- data/lib/fog/ecloud/models/compute/support_ticket.rb +29 -0
- data/lib/fog/ecloud/models/compute/support_tickets.rb +27 -0
- data/lib/fog/ecloud/models/compute/tag.rb +13 -0
- data/lib/fog/ecloud/models/compute/tags.rb +27 -0
- data/lib/fog/ecloud/models/compute/task.rb +10 -11
- data/lib/fog/ecloud/models/compute/tasks.rb +8 -8
- data/lib/fog/ecloud/models/compute/template.rb +24 -0
- data/lib/fog/ecloud/models/compute/templates.rb +40 -0
- data/lib/fog/ecloud/models/compute/trusted_network_group.rb +33 -0
- data/lib/fog/ecloud/models/compute/trusted_network_groups.rb +28 -0
- data/lib/fog/ecloud/models/compute/user.rb +35 -0
- data/lib/fog/ecloud/models/compute/users.rb +27 -0
- data/lib/fog/ecloud/requests/compute/admin_disable_support_access.rb +9 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_authentication_levels.rb +34 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_login_banner.rb +32 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_password_complexity_rules.rb +74 -0
- data/lib/fog/ecloud/requests/compute/admin_enable_support_access.rb +9 -0
- data/lib/fog/ecloud/requests/compute/backup_internet_service_create.rb +47 -0
- data/lib/fog/ecloud/requests/compute/backup_internet_service_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb +47 -0
- data/lib/fog/ecloud/requests/compute/compute_pool_edit.rb +37 -0
- data/lib/fog/ecloud/requests/compute/firewall_acls_create.rb +79 -0
- data/lib/fog/ecloud/requests/compute/firewall_acls_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_admin_organization.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_admin_organizations.rb +11 -0
- data/lib/fog/ecloud/requests/compute/{get_task_list.rb → get_api_key.rb} +1 -1
- data/lib/fog/ecloud/requests/compute/{get_vapp_template.rb → get_api_keys.rb} +1 -1
- data/lib/fog/ecloud/requests/compute/get_association.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_associations.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_authentication_level.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_authentication_levels.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_backup_internet_service.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_backup_internet_services.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_catalog.rb +0 -33
- data/lib/fog/ecloud/requests/compute/get_catalog_configuration.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_catalog_configurations.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_catalog_item.rb +0 -36
- data/lib/fog/ecloud/requests/compute/get_compute_pool.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_compute_pools.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_cpu_usage_detail.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_cpu_usage_detail_summary.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_environment.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_environments.rb +0 -0
- data/lib/fog/ecloud/requests/compute/get_group.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_groups.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_guest_process.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_guest_processes.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_hardware_configuration.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_hardware_configurations.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_internet_service.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_internet_services.rb +0 -71
- data/lib/fog/ecloud/requests/compute/get_ip_address.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_ip_addresses.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_layout.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_layouts.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_location.rb +12 -0
- data/lib/fog/ecloud/requests/compute/get_locations.rb +12 -0
- data/lib/fog/ecloud/requests/compute/get_login_banner.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_login_banners.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_memory_usage_detail.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_memory_usage_detail_summary.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_monitor.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_monitors.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_network.rb +1 -34
- data/lib/fog/ecloud/requests/compute/get_network_summary.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_networks.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_node.rb +0 -29
- data/lib/fog/ecloud/requests/compute/get_nodes.rb +0 -30
- data/lib/fog/ecloud/requests/compute/get_operating_system.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_operating_system_families.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_operating_system_family.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_organization.rb +0 -38
- data/lib/fog/ecloud/requests/compute/get_organizations.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_password_complexity_rule.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_password_complexity_rules.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_physical_device.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_physical_devices.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_process.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_processes.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_public_ip.rb +0 -23
- data/lib/fog/ecloud/requests/compute/get_public_ips.rb +0 -27
- data/lib/fog/ecloud/requests/compute/get_rnat.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_rnats.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_role.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_roles.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_row.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_rows.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_server.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_server_configuration_option.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_server_configuration_options.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_servers.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_ssh_key.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_ssh_keys.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_storage_usage_detail.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_storage_usage_detail_summary.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_support_ticket.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_support_tickets.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_tag.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_tags.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_tasks.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_template.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_templates.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_trusted_network_group.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_trusted_network_groups.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_user.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_users.rb +11 -0
- data/lib/fog/ecloud/requests/compute/groups_create.rb +31 -0
- data/lib/fog/ecloud/requests/compute/groups_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/groups_edit.rb +29 -0
- data/lib/fog/ecloud/requests/compute/groups_movedown.rb +11 -0
- data/lib/fog/ecloud/requests/compute/groups_moveup.rb +11 -0
- data/lib/fog/ecloud/requests/compute/internet_service_create.rb +67 -0
- data/lib/fog/ecloud/requests/compute/internet_service_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/internet_service_edit.rb +60 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_default.rb +11 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_ecv.rb +40 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_http.rb +44 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_loopback.rb +11 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_ping.rb +35 -0
- data/lib/fog/ecloud/requests/compute/monitors_disable.rb +11 -0
- data/lib/fog/ecloud/requests/compute/monitors_edit_ecv.rb +40 -0
- data/lib/fog/ecloud/requests/compute/monitors_edit_http.rb +44 -0
- data/lib/fog/ecloud/requests/compute/monitors_edit_ping.rb +35 -0
- data/lib/fog/ecloud/requests/compute/monitors_enable.rb +11 -0
- data/lib/fog/ecloud/requests/compute/node_service_create.rb +45 -0
- data/lib/fog/ecloud/requests/compute/node_service_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/node_service_edit.rb +41 -0
- data/lib/fog/ecloud/requests/compute/power_off.rb +0 -12
- data/lib/fog/ecloud/requests/compute/power_on.rb +0 -12
- data/lib/fog/ecloud/requests/compute/power_shutdown.rb +1 -1
- data/lib/fog/ecloud/requests/compute/public_ip_activate.rb +11 -0
- data/lib/fog/ecloud/requests/compute/rnat_associations_create_device.rb +32 -0
- data/lib/fog/ecloud/requests/compute/rnat_associations_delete.rb +9 -0
- data/lib/fog/ecloud/requests/compute/rnat_associations_edit_network.rb +31 -0
- data/lib/fog/ecloud/requests/compute/rows_create.rb +29 -0
- data/lib/fog/ecloud/requests/compute/rows_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/rows_edit.rb +29 -0
- data/lib/fog/ecloud/requests/compute/rows_movedown.rb +11 -0
- data/lib/fog/ecloud/requests/compute/rows_moveup.rb +11 -0
- data/lib/fog/ecloud/requests/compute/trusted_network_groups_create.rb +53 -0
- data/lib/fog/ecloud/requests/compute/trusted_network_groups_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/trusted_network_groups_edit.rb +53 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_copy.rb +118 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_copy_identical.rb +45 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_create_from_template.rb +125 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_delete.rb +11 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit.rb +47 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit_hardware_configuration.rb +53 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_import.rb +67 -0
- data/lib/fog/glesys/compute.rb +2 -2
- data/lib/fog/glesys/models/compute/server.rb +5 -0
- data/lib/fog/glesys/models/compute/servers.rb +14 -8
- data/lib/fog/glesys/requests/compute/reboot.rb +14 -0
- data/lib/fog/go_grid.rb +1 -1
- data/lib/fog/go_grid/compute.rb +2 -3
- data/lib/fog/go_grid/models/compute/server.rb +2 -2
- data/lib/fog/google.rb +1 -1
- data/lib/fog/google/storage.rb +3 -3
- data/lib/fog/hp.rb +234 -0
- data/lib/fog/hp/README_HP.rdoc +60 -0
- data/lib/fog/hp/cdn.rb +131 -0
- data/lib/fog/hp/compute.rb +182 -0
- data/lib/fog/hp/models/compute/address.rb +71 -0
- data/lib/fog/hp/models/compute/addresses.rb +29 -0
- data/lib/fog/hp/models/compute/flavor.rb +24 -0
- data/lib/fog/hp/models/compute/flavors.rb +28 -0
- data/lib/fog/hp/models/compute/image.rb +37 -0
- data/lib/fog/hp/models/compute/images.rb +34 -0
- data/lib/fog/hp/models/compute/key_pair.rb +59 -0
- data/lib/fog/hp/models/compute/key_pairs.rb +31 -0
- data/lib/fog/hp/models/compute/security_group.rb +50 -0
- data/lib/fog/hp/models/compute/security_groups.rb +29 -0
- data/lib/fog/hp/models/compute/server.rb +225 -0
- data/lib/fog/{slicehost → hp}/models/compute/servers.rb +6 -8
- data/lib/fog/hp/models/storage/directories.rb +50 -0
- data/lib/fog/hp/models/storage/directory.rb +160 -0
- data/lib/fog/hp/models/storage/file.rb +87 -0
- data/lib/fog/hp/models/storage/files.rb +103 -0
- data/lib/fog/hp/requests/cdn/delete_container.rb +38 -0
- data/lib/fog/hp/requests/cdn/get_containers.rb +44 -0
- data/lib/fog/hp/requests/cdn/head_container.rb +50 -0
- data/lib/fog/hp/requests/cdn/post_container.rb +52 -0
- data/lib/fog/hp/requests/cdn/put_container.rb +53 -0
- data/lib/fog/hp/requests/compute/allocate_address.rb +49 -0
- data/lib/fog/hp/requests/compute/associate_address.rb +42 -0
- data/lib/fog/hp/requests/compute/change_password_server.rb +33 -0
- data/lib/fog/hp/requests/compute/confirm_resized_server.rb +34 -0
- data/lib/fog/hp/requests/compute/create_image.rb +63 -0
- data/lib/fog/hp/requests/compute/create_key_pair.rb +81 -0
- data/lib/fog/hp/requests/compute/create_security_group.rb +83 -0
- data/lib/fog/hp/requests/compute/create_security_group_rule.rb +75 -0
- data/lib/fog/hp/requests/compute/create_server.rb +140 -0
- data/lib/fog/hp/requests/compute/delete_image.rb +45 -0
- data/lib/fog/hp/requests/compute/delete_key_pair.rb +39 -0
- data/lib/fog/hp/requests/compute/delete_security_group.rb +41 -0
- data/lib/fog/hp/requests/compute/delete_security_group_rule.rb +49 -0
- data/lib/fog/hp/requests/compute/delete_server.rb +43 -0
- data/lib/fog/hp/requests/compute/disassociate_address.rb +39 -0
- data/lib/fog/hp/requests/compute/get_address.rb +45 -0
- data/lib/fog/hp/requests/compute/get_flavor_details.rb +51 -0
- data/lib/fog/hp/requests/compute/get_image_details.rb +43 -0
- data/lib/fog/hp/requests/compute/get_security_group.rb +57 -0
- data/lib/fog/hp/requests/compute/get_server_details.rb +52 -0
- data/lib/fog/hp/requests/compute/list_addresses.rb +41 -0
- data/lib/fog/hp/requests/compute/list_flavors.rb +44 -0
- data/lib/fog/hp/requests/compute/list_flavors_detail.rb +46 -0
- data/lib/fog/hp/requests/compute/list_images.rb +40 -0
- data/lib/fog/hp/requests/compute/list_images_detail.rb +49 -0
- data/lib/fog/hp/requests/compute/list_key_pairs.rb +44 -0
- data/lib/fog/hp/requests/compute/list_security_groups.rb +54 -0
- data/lib/fog/hp/requests/compute/list_server_addresses.rb +42 -0
- data/lib/fog/hp/requests/compute/list_server_private_addresses.rb +58 -0
- data/lib/fog/hp/requests/compute/list_server_public_addresses.rb +58 -0
- data/lib/fog/hp/requests/compute/list_servers.rb +41 -0
- data/lib/fog/hp/requests/compute/list_servers_detail.rb +56 -0
- data/lib/fog/hp/requests/compute/reboot_server.rb +34 -0
- data/lib/fog/hp/requests/compute/rebuild_server.rb +32 -0
- data/lib/fog/hp/requests/compute/release_address.rb +39 -0
- data/lib/fog/hp/requests/compute/resize_server.rb +39 -0
- data/lib/fog/hp/requests/compute/revert_resized_server.rb +35 -0
- data/lib/fog/hp/requests/compute/server_action.rb +25 -0
- data/lib/fog/hp/requests/compute/update_server.rb +42 -0
- data/lib/fog/hp/requests/storage/delete_container.rb +43 -0
- data/lib/fog/hp/requests/storage/delete_object.rb +44 -0
- data/lib/fog/hp/requests/storage/get_container.rb +92 -0
- data/lib/fog/hp/requests/storage/get_containers.rb +71 -0
- data/lib/fog/hp/requests/storage/get_object.rb +77 -0
- data/lib/fog/hp/requests/storage/head_container.rb +40 -0
- data/lib/fog/hp/requests/storage/head_containers.rb +37 -0
- data/lib/fog/hp/requests/storage/head_object.rb +35 -0
- data/lib/fog/hp/requests/storage/put_container.rb +48 -0
- data/lib/fog/hp/requests/storage/put_object.rb +94 -0
- data/lib/fog/hp/storage.rb +201 -0
- data/lib/fog/ibm.rb +2 -3
- data/lib/fog/ibm/compute.rb +1 -1
- data/lib/fog/ibm/models/compute/server.rb +2 -2
- data/lib/fog/ibm/storage.rb +1 -1
- data/lib/fog/identity.rb +24 -0
- data/lib/fog/image.rb +24 -0
- data/lib/fog/joyent/compute.rb +23 -8
- data/lib/fog/joyent/models/compute/keys.rb +2 -2
- data/lib/fog/joyent/models/compute/server.rb +1 -2
- data/lib/fog/joyent/requests/compute/list_datacenters.rb +17 -0
- data/lib/fog/libvirt.rb +1 -1
- data/lib/fog/libvirt/compute.rb +56 -28
- data/lib/fog/libvirt/models/compute/interface.rb +5 -25
- data/lib/fog/libvirt/models/compute/interfaces.rb +7 -45
- data/lib/fog/libvirt/models/compute/network.rb +3 -34
- data/lib/fog/libvirt/models/compute/networks.rb +6 -43
- data/lib/fog/libvirt/models/compute/nic.rb +54 -0
- data/lib/fog/libvirt/models/compute/nics.rb +16 -0
- data/lib/fog/libvirt/models/compute/node.rb +5 -16
- data/lib/fog/libvirt/models/compute/nodes.rb +9 -24
- data/lib/fog/libvirt/models/compute/pool.rb +26 -138
- data/lib/fog/libvirt/models/compute/pools.rb +6 -42
- data/lib/fog/libvirt/models/compute/server.rb +206 -308
- data/lib/fog/libvirt/models/compute/servers.rb +8 -63
- data/lib/fog/libvirt/models/compute/templates/server.xml.erb +17 -21
- data/lib/fog/libvirt/models/compute/templates/volume.xml.erb +2 -2
- data/lib/fog/libvirt/models/compute/{uri.rb → util/uri.rb} +1 -2
- data/lib/fog/libvirt/models/compute/util/util.rb +33 -0
- data/lib/fog/libvirt/models/compute/volume.rb +54 -122
- data/lib/fog/libvirt/models/compute/volumes.rb +2 -65
- data/lib/fog/libvirt/requests/compute/create_domain.rb +17 -0
- data/lib/fog/libvirt/requests/compute/create_volume.rb +17 -0
- data/lib/fog/libvirt/requests/compute/define_domain.rb +17 -0
- data/lib/fog/libvirt/requests/compute/define_pool.rb +17 -0
- data/lib/fog/libvirt/requests/compute/destroy_interface.rb +18 -0
- data/lib/fog/libvirt/requests/compute/destroy_network.rb +17 -0
- data/lib/fog/libvirt/requests/compute/get_node_info.rb +39 -0
- data/lib/fog/libvirt/requests/compute/list_domains.rb +106 -0
- data/lib/fog/libvirt/requests/compute/list_interfaces.rb +59 -0
- data/lib/fog/libvirt/requests/compute/list_networks.rb +58 -0
- data/lib/fog/libvirt/requests/compute/list_pool_volumes.rb +21 -0
- data/lib/fog/libvirt/requests/compute/list_pools.rb +72 -0
- data/lib/fog/libvirt/requests/compute/list_volumes.rb +89 -0
- data/lib/fog/libvirt/requests/compute/mock_files/domain.xml +40 -0
- data/lib/fog/libvirt/requests/compute/pool_action.rb +19 -0
- data/lib/fog/libvirt/requests/compute/update_display.rb +31 -0
- data/lib/fog/libvirt/requests/compute/vm_action.rb +19 -0
- data/lib/fog/libvirt/requests/compute/volume_action.rb +18 -0
- data/lib/fog/linode.rb +1 -1
- data/lib/fog/linode/compute.rb +2 -3
- data/lib/fog/linode/dns.rb +2 -3
- data/lib/fog/linode/requests/compute/avail_datacenters.rb +20 -0
- data/lib/fog/linode/requests/compute/avail_distributions.rb +38 -1
- data/lib/fog/linode/requests/compute/avail_kernels.rb +36 -1
- data/lib/fog/linode/requests/compute/avail_linodeplans.rb +37 -2
- data/lib/fog/linode/requests/compute/avail_stackscripts.rb +44 -0
- data/lib/fog/linode/requests/compute/linode_boot.rb +13 -0
- data/lib/fog/linode/requests/compute/linode_config_create.rb +13 -0
- data/lib/fog/linode/requests/compute/linode_config_list.rb +51 -0
- data/lib/fog/linode/requests/compute/linode_create.rb +15 -2
- data/lib/fog/linode/requests/compute/linode_delete.rb +13 -0
- data/lib/fog/linode/requests/compute/linode_disk_create.rb +14 -0
- data/lib/fog/linode/requests/compute/linode_disk_createfromdistribution.rb +14 -0
- data/lib/fog/linode/requests/compute/linode_disk_createfromstackscript.rb +1 -1
- data/lib/fog/linode/requests/compute/linode_disk_delete.rb +14 -0
- data/lib/fog/linode/requests/compute/linode_disk_list.rb +40 -1
- data/lib/fog/linode/requests/compute/linode_ip_list.rb +38 -0
- data/lib/fog/linode/requests/compute/linode_list.rb +53 -0
- data/lib/fog/linode/requests/compute/linode_reboot.rb +14 -1
- data/lib/fog/linode/requests/compute/linode_shutdown.rb +13 -0
- data/lib/fog/linode/requests/compute/linode_update.rb +13 -0
- data/lib/fog/local.rb +1 -1
- data/lib/fog/local/storage.rb +1 -1
- data/lib/fog/ninefold.rb +1 -1
- data/lib/fog/ninefold/compute.rb +4 -8
- data/lib/fog/ninefold/storage.rb +3 -3
- data/lib/fog/openstack.rb +90 -38
- data/lib/fog/openstack/compute.rb +223 -64
- data/lib/fog/openstack/identity.rb +226 -0
- data/lib/fog/openstack/image.rb +203 -0
- data/lib/fog/openstack/models/compute/address.rb +71 -0
- data/lib/fog/openstack/models/compute/addresses.rb +33 -0
- data/lib/fog/openstack/models/compute/flavor.rb +24 -4
- data/lib/fog/openstack/models/compute/host.rb +28 -0
- data/lib/fog/openstack/models/compute/hosts.rb +32 -0
- data/lib/fog/openstack/models/compute/key_pair.rb +60 -0
- data/lib/fog/openstack/models/compute/key_pairs.rb +31 -0
- data/lib/fog/openstack/models/compute/metadata.rb +5 -5
- data/lib/fog/openstack/models/compute/{meta.rb → metadatum.rb} +1 -1
- data/lib/fog/openstack/models/compute/network.rb +13 -0
- data/lib/fog/openstack/models/compute/networks.rb +29 -0
- data/lib/fog/openstack/models/compute/security_group.rb +44 -0
- data/lib/fog/openstack/models/compute/security_groups.rb +27 -0
- data/lib/fog/openstack/models/compute/server.rb +82 -5
- data/lib/fog/openstack/models/compute/snapshot.rb +43 -0
- data/lib/fog/openstack/models/compute/snapshots.rb +26 -0
- data/lib/fog/openstack/models/compute/tenant.rb +24 -0
- data/lib/fog/openstack/models/compute/tenants.rb +20 -0
- data/lib/fog/openstack/models/compute/volume.rb +58 -0
- data/lib/fog/openstack/models/compute/volumes.rb +26 -0
- data/lib/fog/openstack/models/identity/role.rb +50 -0
- data/lib/fog/openstack/models/identity/roles.rb +21 -0
- data/lib/fog/openstack/models/identity/tenant.rb +62 -0
- data/lib/fog/openstack/models/identity/tenants.rb +27 -0
- data/lib/fog/openstack/models/identity/user.rb +64 -0
- data/lib/fog/openstack/models/identity/users.rb +30 -0
- data/lib/fog/openstack/models/image/image.rb +85 -0
- data/lib/fog/openstack/models/image/images.rb +60 -0
- data/lib/fog/openstack/models/volume/volume.rb +46 -0
- data/lib/fog/openstack/models/volume/volumes.rb +27 -0
- data/lib/fog/openstack/requests/compute/add_fixed_ip.rb +29 -0
- data/lib/fog/openstack/requests/compute/allocate_address.rb +42 -0
- data/lib/fog/openstack/requests/compute/associate_address.rb +27 -0
- data/lib/fog/openstack/requests/compute/attach_volume.rb +28 -0
- data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +41 -0
- data/lib/fog/openstack/requests/compute/{change_password_server.rb → change_server_password.rb} +2 -2
- data/lib/fog/openstack/requests/compute/{confirm_resized_server.rb → confirm_resize_server.rb} +2 -2
- data/lib/fog/openstack/requests/compute/create_flavor.rb +82 -0
- data/lib/fog/openstack/requests/compute/create_image.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_key_pair.rb +49 -0
- data/lib/fog/openstack/requests/compute/create_security_group.rb +47 -0
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +56 -0
- data/lib/fog/openstack/requests/compute/create_server.rb +16 -14
- data/lib/fog/openstack/requests/compute/create_volume.rb +54 -0
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +32 -0
- data/lib/fog/openstack/requests/compute/delete_flavor.rb +28 -0
- data/lib/fog/openstack/requests/compute/delete_key_pair.rb +31 -0
- data/lib/fog/openstack/requests/compute/{delete_meta.rb → delete_metadata.rb} +2 -2
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +31 -0
- data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +31 -0
- data/lib/fog/openstack/requests/compute/delete_snapshot.rb +26 -0
- data/lib/fog/openstack/requests/compute/delete_volume.rb +26 -0
- data/lib/fog/openstack/requests/compute/detach_volume.rb +21 -0
- data/lib/fog/openstack/requests/compute/disassociate_address.rb +27 -0
- data/lib/fog/openstack/requests/compute/get_address.rb +41 -0
- data/lib/fog/openstack/requests/compute/get_console_output.rb +28 -0
- data/lib/fog/openstack/requests/compute/get_host_details.rb +74 -0
- data/lib/fog/openstack/requests/compute/{get_meta.rb → get_metadata.rb} +2 -2
- data/lib/fog/openstack/requests/compute/get_quota.rb +42 -0
- data/lib/fog/openstack/requests/compute/get_quota_defaults.rb +42 -0
- data/lib/fog/openstack/requests/compute/get_security_group.rb +49 -0
- data/lib/fog/openstack/requests/compute/get_server_volumes.rb +23 -0
- data/lib/fog/openstack/requests/compute/get_snapshot_details.rb +39 -0
- data/lib/fog/openstack/requests/compute/get_usage.rb +53 -0
- data/lib/fog/openstack/requests/compute/get_vnc_console.rb +40 -0
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +42 -0
- data/lib/fog/openstack/requests/compute/list_address_pools.rb +23 -0
- data/lib/fog/openstack/requests/compute/list_all_addresses.rb +64 -0
- data/lib/fog/openstack/requests/compute/list_hosts.rb +32 -0
- data/lib/fog/openstack/requests/compute/list_key_pairs.rb +39 -0
- data/lib/fog/openstack/requests/compute/list_private_addresses.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_public_addresses.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +74 -0
- data/lib/fog/openstack/requests/compute/list_servers.rb +6 -2
- data/lib/fog/openstack/requests/compute/list_servers_detail.rb +6 -2
- data/lib/fog/openstack/requests/compute/list_snapshots.rb +32 -0
- data/lib/fog/openstack/requests/compute/list_tenants.rb +43 -0
- data/lib/fog/openstack/requests/compute/list_usages.rb +43 -0
- data/lib/fog/openstack/requests/compute/list_volumes.rb +53 -0
- data/lib/fog/openstack/requests/compute/live_migrate_server.rb +31 -0
- data/lib/fog/openstack/requests/compute/migrate_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/pause_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/release_address.rb +22 -0
- data/lib/fog/openstack/requests/compute/remove_fixed_ip.rb +29 -0
- data/lib/fog/openstack/requests/compute/rescue_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/resume_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/{revert_resized_server.rb → revert_resize_server.rb} +0 -0
- data/lib/fog/openstack/requests/compute/server_action.rb +2 -2
- data/lib/fog/openstack/requests/compute/server_actions.rb +27 -0
- data/lib/fog/openstack/requests/compute/server_diagnostics.rb +25 -0
- data/lib/fog/openstack/requests/compute/set_metadata.rb +1 -1
- data/lib/fog/openstack/requests/compute/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/compute/suspend_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/unpause_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/update_metadata.rb +1 -1
- data/lib/fog/openstack/requests/compute/update_quota.rb +45 -0
- data/lib/fog/openstack/requests/compute/update_server.rb +1 -1
- data/lib/fog/openstack/requests/identity/add_user_to_tenant.rb +29 -0
- data/lib/fog/openstack/requests/identity/check_token.rb +23 -0
- data/lib/fog/openstack/requests/identity/create_role.rb +37 -0
- data/lib/fog/openstack/requests/identity/create_tenant.rb +34 -0
- data/lib/fog/openstack/requests/identity/create_user.rb +47 -0
- data/lib/fog/openstack/requests/identity/create_user_role.rb +26 -0
- data/lib/fog/openstack/requests/identity/delete_role.rb +32 -0
- data/lib/fog/openstack/requests/identity/delete_tenant.rb +31 -0
- data/lib/fog/openstack/requests/identity/delete_user.rb +32 -0
- data/lib/fog/openstack/requests/identity/delete_user_role.rb +26 -0
- data/lib/fog/openstack/requests/identity/get_role.rb +28 -0
- data/lib/fog/openstack/requests/identity/get_tenant.rb +31 -0
- data/lib/fog/openstack/requests/identity/get_tenants_by_id.rb +23 -0
- data/lib/fog/openstack/requests/identity/get_tenants_by_name.rb +23 -0
- data/lib/fog/openstack/requests/identity/get_user_by_id.rb +34 -0
- data/lib/fog/openstack/requests/identity/get_user_by_name.rb +23 -0
- data/lib/fog/openstack/requests/identity/list_endpoints_for_token.rb +23 -0
- data/lib/fog/openstack/requests/identity/list_roles.rb +29 -0
- data/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +24 -0
- data/lib/fog/openstack/requests/identity/list_tenants.rb +44 -0
- data/lib/fog/openstack/requests/identity/list_user_global_roles.rb +22 -0
- data/lib/fog/openstack/requests/identity/list_users.rb +25 -0
- data/lib/fog/openstack/requests/identity/remove_user_from_tenant.rb +20 -0
- data/lib/fog/openstack/requests/identity/update_tenant.rb +30 -0
- data/lib/fog/openstack/requests/identity/update_user.rb +36 -0
- data/lib/fog/openstack/requests/identity/validate_token.rb +23 -0
- data/lib/fog/openstack/requests/image/add_member_to_image.rb +23 -0
- data/lib/fog/openstack/requests/image/create_image.rb +77 -0
- data/lib/fog/openstack/requests/image/delete_image.rb +27 -0
- data/lib/fog/openstack/requests/image/get_image.rb +45 -0
- data/lib/fog/openstack/requests/image/get_image_by_id.rb +32 -0
- data/lib/fog/openstack/requests/image/get_image_members.rb +29 -0
- data/lib/fog/openstack/requests/image/get_shared_images.rb +29 -0
- data/lib/fog/openstack/requests/image/list_public_images.rb +32 -0
- data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +52 -0
- data/lib/fog/openstack/requests/image/remove_member_from_image.rb +23 -0
- data/lib/fog/openstack/requests/image/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/image/update_image.rb +65 -0
- data/lib/fog/openstack/requests/volume/create_volume.rb +54 -0
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +32 -0
- data/lib/fog/openstack/requests/volume/delete_snapshot.rb +26 -0
- data/lib/fog/openstack/requests/volume/delete_volume.rb +26 -0
- data/lib/fog/openstack/requests/volume/get_snapshot_details.rb +39 -0
- data/lib/fog/openstack/requests/volume/get_volume_details.rb +42 -0
- data/lib/fog/openstack/requests/volume/list_snapshots.rb +32 -0
- data/lib/fog/openstack/requests/volume/list_volumes.rb +55 -0
- data/lib/fog/openstack/requests/volume/set_tenant.rb +21 -0
- data/lib/fog/openstack/volume.rb +204 -0
- data/lib/fog/ovirt/compute.rb +15 -6
- data/lib/fog/ovirt/models/compute/server.rb +18 -0
- data/lib/fog/ovirt/models/compute/template.rb +8 -1
- data/lib/fog/ovirt/models/compute/volume.rb +35 -0
- data/lib/fog/ovirt/models/compute/volumes.rb +32 -0
- data/lib/fog/ovirt/requests/compute/add_volume.rb +23 -0
- data/lib/fog/ovirt/requests/compute/destroy_volume.rb +25 -0
- data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +20 -0
- data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +20 -0
- data/lib/fog/ovirt/requests/compute/mock_files/vm.xml +0 -2
- data/lib/fog/ovirt/requests/compute/mock_files/volumes.xml +40 -0
- data/lib/fog/ovirt/requests/compute/storage_domains.rb +2 -2
- data/lib/fog/providers.rb +2 -1
- data/lib/fog/rackspace.rb +2 -2
- data/lib/fog/rackspace/cdn.rb +2 -3
- data/lib/fog/rackspace/compute.rb +111 -7
- data/lib/fog/rackspace/dns.rb +2 -3
- data/lib/fog/rackspace/load_balancers.rb +2 -3
- data/lib/fog/rackspace/models/compute/images.rb +3 -1
- data/lib/fog/rackspace/models/compute/server.rb +2 -2
- data/lib/fog/rackspace/models/load_balancers/load_balancer.rb +8 -1
- data/lib/fog/rackspace/models/storage/file.rb +2 -1
- data/lib/fog/rackspace/models/storage/files.rb +1 -1
- data/lib/fog/rackspace/requests/compute/create_image.rb +1 -1
- data/lib/fog/rackspace/requests/compute/create_server.rb +1 -1
- data/lib/fog/rackspace/requests/compute/get_server_details.rb +1 -1
- data/lib/fog/rackspace/requests/compute/server_action.rb +1 -1
- data/lib/fog/rackspace/requests/compute/update_server.rb +1 -1
- data/lib/fog/rackspace/requests/dns/add_records.rb +1 -1
- data/lib/fog/rackspace/requests/dns/create_domains.rb +1 -1
- data/lib/fog/rackspace/requests/dns/modify_domain.rb +1 -1
- data/lib/fog/rackspace/requests/dns/modify_record.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/create_access_rule.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb +5 -2
- data/lib/fog/rackspace/requests/load_balancers/create_node.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/create_virtual_ip.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/set_connection_logging.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/set_connection_throttling.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/set_error_page.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/set_monitor.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/set_session_persistence.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/update_load_balancer.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/update_node.rb +1 -1
- data/lib/fog/rackspace/storage.rb +37 -11
- data/lib/fog/storage.rb +3 -0
- data/lib/fog/storm_on_demand.rb +1 -1
- data/lib/fog/storm_on_demand/compute.rb +2 -3
- data/lib/fog/storm_on_demand/requests/compute/add_balancer_node.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/clone_server.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/create_server.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/delete_server.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/get_server.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/get_stats.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/list_balancers.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/list_configs.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/list_images.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/list_private_ips.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/list_servers.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/list_templates.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/reboot_server.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/remove_balancer_node.rb +1 -1
- data/lib/fog/storm_on_demand/requests/compute/resize_server.rb +1 -1
- data/lib/fog/terremark.rb +1 -1
- data/lib/fog/terremark/shared.rb +1 -1
- data/lib/fog/vcloud.rb +1 -1
- data/lib/fog/vcloud/compute.rb +2 -2
- data/lib/fog/vcloud/requests/compute/configure_vm.rb +1 -139
- data/lib/fog/virtual_box.rb +1 -1
- data/lib/fog/virtual_box/compute.rb +1 -1
- data/lib/fog/virtual_box/models/compute/server.rb +2 -2
- data/lib/fog/vmfusion.rb +1 -1
- data/lib/fog/vmfusion/compute.rb +1 -1
- data/lib/fog/volume.rb +25 -0
- data/lib/fog/voxel.rb +1 -1
- data/lib/fog/voxel/compute.rb +1 -1
- data/lib/fog/vsphere/compute.rb +6 -3
- data/lib/fog/vsphere/models/compute/server.rb +31 -1
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +16 -5
- data/lib/fog/vsphere/requests/compute/vm_config_vnc.rb +47 -0
- data/lib/fog/xenserver.rb +56 -0
- data/lib/fog/xenserver/compute.rb +122 -0
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +28 -0
- data/lib/fog/xenserver/models/compute/host.rb +46 -0
- data/lib/fog/xenserver/models/compute/hosts.rb +29 -0
- data/lib/fog/xenserver/models/compute/network.rb +58 -0
- data/lib/fog/xenserver/models/compute/networks.rb +33 -0
- data/lib/fog/xenserver/models/compute/pbd.rb +33 -0
- data/lib/fog/xenserver/models/compute/pbds.rb +33 -0
- data/lib/fog/xenserver/models/compute/pif.rb +46 -0
- data/lib/fog/xenserver/models/compute/pifs.rb +33 -0
- data/lib/fog/xenserver/models/compute/pool.rb +40 -0
- data/lib/fog/xenserver/models/compute/pools.rb +33 -0
- data/lib/fog/xenserver/models/compute/server.rb +211 -0
- data/lib/fog/xenserver/models/compute/servers.rb +63 -0
- data/lib/fog/xenserver/models/compute/storage_repositories.rb +31 -0
- data/lib/fog/xenserver/models/compute/storage_repository.rb +47 -0
- data/lib/fog/xenserver/models/compute/vbd.rb +90 -0
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +27 -0
- data/lib/fog/xenserver/models/compute/vbds.rb +33 -0
- data/lib/fog/xenserver/models/compute/vdi.rb +102 -0
- data/lib/fog/xenserver/models/compute/vdis.rb +29 -0
- data/lib/fog/xenserver/models/compute/vif.rb +51 -0
- data/lib/fog/xenserver/models/compute/vifs.rb +29 -0
- data/lib/fog/xenserver/parser.rb +36 -0
- data/lib/fog/xenserver/parsers/get_hosts.rb +19 -0
- data/lib/fog/xenserver/parsers/get_networks.rb +19 -0
- data/lib/fog/xenserver/parsers/get_pools.rb +19 -0
- data/lib/fog/xenserver/parsers/get_records.rb +19 -0
- data/lib/fog/xenserver/parsers/get_storage_repositories.rb +19 -0
- data/lib/fog/xenserver/parsers/get_vbds.rb +19 -0
- data/lib/fog/xenserver/parsers/get_vifs.rb +19 -0
- data/lib/fog/xenserver/parsers/get_vms.rb +20 -0
- data/lib/fog/xenserver/requests/compute/clone_server.rb +31 -0
- data/lib/fog/xenserver/requests/compute/create_server.rb +126 -0
- data/lib/fog/xenserver/requests/compute/create_vbd.rb +40 -0
- data/lib/fog/xenserver/requests/compute/create_vdi.rb +33 -0
- data/lib/fog/xenserver/requests/compute/create_vif.rb +57 -0
- data/lib/fog/xenserver/requests/compute/destroy_server.rb +22 -0
- data/lib/fog/xenserver/requests/compute/destroy_vdi.rb +22 -0
- data/lib/fog/xenserver/requests/compute/destroy_vif.rb +22 -0
- data/lib/fog/xenserver/requests/compute/eject_vbd.rb +22 -0
- data/lib/fog/xenserver/requests/compute/get_record.rb +29 -0
- data/lib/fog/xenserver/requests/compute/get_records.rb +30 -0
- data/lib/fog/xenserver/requests/compute/insert_vbd.rb +22 -0
- data/lib/fog/xenserver/requests/compute/provision_server.rb +21 -0
- data/lib/fog/xenserver/requests/compute/reboot_server.rb +23 -0
- data/lib/fog/xenserver/requests/compute/scan_sr.rb +22 -0
- data/lib/fog/xenserver/requests/compute/set_affinity.rb +25 -0
- data/lib/fog/xenserver/requests/compute/set_attribute.rb +25 -0
- data/lib/fog/xenserver/requests/compute/shutdown_server.rb +23 -0
- data/lib/fog/xenserver/requests/compute/start_server.rb +23 -0
- data/lib/fog/xenserver/requests/compute/start_vm.rb +25 -0
- data/lib/fog/xenserver/requests/compute/unplug_vbd.rb +30 -0
- data/lib/fog/xenserver/utilities.rb +8 -0
- data/lib/fog/zerigo.rb +1 -1
- data/lib/fog/zerigo/dns.rb +1 -1
- data/spec/core/current_machine_spec.rb +14 -4
- data/spec/spec_helper.rb +1 -1
- data/tests/aws/credentials_tests.rb +57 -0
- data/tests/aws/models/compute/address_tests.rb +7 -0
- data/tests/aws/models/compute/dhcp_option_tests.rb +4 -0
- data/tests/aws/models/compute/dhcp_options_tests.rb +4 -0
- data/tests/aws/models/compute/internet_gateway_tests.rb +3 -0
- data/tests/aws/models/compute/internet_gateways_tests.rb +4 -0
- data/tests/aws/models/compute/network_interfaces_test.rb +12 -0
- data/tests/aws/models/compute/security_group_tests.rb +14 -0
- data/tests/aws/models/compute/volume_tests.rb +5 -1
- data/tests/aws/models/elb/model_tests.rb +36 -2
- data/tests/aws/models/iam/access_keys_tests.rb +53 -0
- data/tests/aws/models/iam/policies_tests.rb +56 -0
- data/tests/aws/models/iam/users_tests.rb +54 -0
- data/tests/aws/models/storage/url_tests.rb +22 -0
- data/tests/aws/requests/compute/dhcp_options_tests.rb +40 -0
- data/tests/aws/requests/compute/internet_gateway_tests.rb +44 -0
- data/tests/aws/requests/compute/network_interface_tests.rb +175 -0
- data/tests/aws/requests/compute/security_group_tests.rb +5 -4
- data/tests/aws/requests/compute/volume_tests.rb +34 -5
- data/tests/aws/requests/dns/dns_tests.rb +1 -1
- data/tests/aws/requests/dynamodb/item_tests.rb +20 -0
- data/tests/aws/requests/elb/helper.rb +1 -0
- data/tests/aws/requests/elb/load_balancer_tests.rb +2 -2
- data/tests/aws/requests/iam/role_tests.rb +168 -0
- data/tests/aws/requests/iam/user_policy_tests.rb +10 -0
- data/tests/aws/requests/iam/user_tests.rb +4 -0
- data/tests/aws/requests/sns/subscription_tests.rb +2 -2
- data/tests/aws/requests/storage/object_tests.rb +5 -0
- data/tests/brightbox/requests/compute/helper.rb +23 -3
- data/tests/cloudstack/requests/virtual_machine_tests.rb +10 -10
- data/tests/compute/helper.rb +37 -8
- data/tests/compute/models/flavors_tests.rb +1 -1
- data/tests/compute/models/server_tests.rb +1 -1
- data/tests/compute/models/servers_tests.rb +2 -1
- data/tests/dns/helper.rb +0 -3
- data/tests/glesys/requests/compute/helper.rb +7 -2
- data/tests/helper.rb +9 -1
- data/tests/helpers/mock_helper.rb +11 -4
- data/tests/helpers/succeeds_helper.rb +2 -3
- data/tests/hp/models/compute/address_tests.rb +18 -0
- data/tests/hp/models/compute/addresses_tests.rb +5 -0
- data/tests/hp/models/compute/key_pair_tests.rb +27 -0
- data/tests/hp/models/compute/key_pairs_tests.rb +5 -0
- data/tests/hp/models/compute/security_group_tests.rb +36 -0
- data/tests/hp/models/compute/security_groups_tests.rb +5 -0
- data/tests/hp/requests/cdn/container_tests.rb +56 -0
- data/tests/hp/requests/compute/address_tests.rb +72 -0
- data/tests/hp/requests/compute/flavor_tests.rb +45 -0
- data/tests/hp/requests/compute/image_tests.rb +79 -0
- data/tests/hp/requests/compute/key_pair_tests.rb +65 -0
- data/tests/hp/requests/compute/security_group_rule_tests.rb +54 -0
- data/tests/hp/requests/compute/security_group_tests.rb +64 -0
- data/tests/hp/requests/compute/server_address_tests.rb +45 -0
- data/tests/hp/requests/compute/server_tests.rb +127 -0
- data/tests/hp/requests/storage/container_tests.rb +78 -0
- data/tests/hp/requests/storage/object_tests.rb +81 -0
- data/tests/libvirt/compute_tests.rb +17 -0
- data/tests/libvirt/models/compute/interface_tests.rb +27 -0
- data/tests/libvirt/models/compute/interfaces_tests.rb +14 -0
- data/tests/libvirt/models/compute/network_tests.rb +27 -0
- data/tests/libvirt/models/compute/networks_tests.rb +13 -0
- data/tests/libvirt/models/compute/nic_tests.rb +31 -0
- data/tests/libvirt/models/compute/nics_tests.rb +10 -0
- data/tests/libvirt/models/compute/pool_tests.rb +27 -0
- data/tests/libvirt/models/compute/pools_tests.rb +13 -0
- data/tests/libvirt/models/compute/server_tests.rb +58 -0
- data/tests/libvirt/models/compute/servers_tests.rb +14 -0
- data/tests/libvirt/models/compute/volume_tests.rb +30 -0
- data/tests/libvirt/models/compute/volumes_tests.rb +14 -0
- data/tests/libvirt/requests/compute/create_domain_tests.rb +21 -0
- data/tests/libvirt/requests/compute/define_domain_tests.rb +11 -0
- data/tests/libvirt/requests/compute/update_display.rb +13 -0
- data/tests/openstack/models/identity/role_tests.rb +27 -0
- data/tests/openstack/models/identity/roles_tests.rb +19 -0
- data/tests/openstack/models/identity/tenant_tests.rb +24 -0
- data/tests/openstack/models/identity/tenants_tests.rb +26 -0
- data/tests/openstack/models/identity/user_tests.rb +46 -0
- data/tests/openstack/models/identity/users_tests.rb +33 -0
- data/tests/openstack/models/image/image_tests.rb +35 -0
- data/tests/openstack/models/image/images_tests.rb +14 -0
- data/tests/openstack/requests/compute/address_tests.rb +49 -0
- data/tests/openstack/requests/compute/flavor_tests.rb +18 -5
- data/tests/openstack/requests/compute/keypair_tests.rb +30 -0
- data/tests/openstack/requests/compute/quota_tests.rb +44 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +51 -0
- data/tests/openstack/requests/compute/tenant_tests.rb +19 -0
- data/tests/openstack/requests/compute/volume_tests.rb +39 -0
- data/tests/openstack/requests/identity/role_tests.rb +41 -0
- data/tests/openstack/requests/identity/tenant_tests.rb +53 -0
- data/tests/openstack/requests/identity/user_tests.rb +29 -0
- data/tests/openstack/requests/image/image_tests.rb +98 -0
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +1 -1
- data/tests/rackspace/helper.rb +1 -1
- data/tests/rackspace/models/load_balancers/access_list_tests.rb +1 -1
- data/tests/rackspace/models/load_balancers/access_lists_tests.rb +1 -1
- data/tests/rackspace/models/load_balancers/load_balancer_tests.rb +13 -1
- data/tests/rackspace/models/load_balancers/load_balancers_tests.rb +1 -1
- data/tests/rackspace/models/load_balancers/node_tests.rb +1 -1
- data/tests/rackspace/models/load_balancers/nodes_tests.rb +1 -1
- data/tests/rackspace/requests/load_balancers/helper.rb +10 -2
- data/tests/rackspace/requests/load_balancers/load_balancer_tests.rb +13 -4
- data/tests/rackspace/requests/load_balancers/node_tests.rb +5 -5
- data/tests/storage/helper.rb +3 -0
- data/tests/vsphere/requests/compute/vm_config_vnc_tests.rb +19 -0
- data/tests/xenserver/README +21 -0
- data/tests/xenserver/compute_tests.rb +52 -0
- data/tests/xenserver/helper.rb +36 -0
- data/tests/xenserver/models/compute/host_tests.rb +68 -0
- data/tests/xenserver/models/compute/hosts_tests.rb +22 -0
- data/tests/xenserver/models/compute/network_tests.rb +67 -0
- data/tests/xenserver/models/compute/networks_tests.rb +22 -0
- data/tests/xenserver/models/compute/pbd_tests.rb +44 -0
- data/tests/xenserver/models/compute/pbds_tests.rb +22 -0
- data/tests/xenserver/models/compute/pif_tests.rb +58 -0
- data/tests/xenserver/models/compute/pifs_tests.rb +22 -0
- data/tests/xenserver/models/compute/pool_tests.rb +50 -0
- data/tests/xenserver/models/compute/pools_tests.rb +30 -0
- data/tests/xenserver/models/compute/server_tests.rb +167 -0
- data/tests/xenserver/models/compute/servers_tests.rb +88 -0
- data/tests/xenserver/models/compute/storage_repositories_tests.rb +30 -0
- data/tests/xenserver/models/compute/storage_repository_tests.rb +63 -0
- data/tests/xenserver/models/compute/vbd_tests.rb +115 -0
- data/tests/xenserver/models/compute/vbds_tests.rb +22 -0
- data/tests/xenserver/models/compute/vif_tests.rb +53 -0
- data/tests/xenserver/models/compute/vifs_tests.rb +22 -0
- data/tests/xenserver/requests/compute/clone_server_tests.rb +32 -0
- data/tests/xenserver/requests/compute/create_server_tests.rb +129 -0
- data/tests/xenserver/requests/compute/create_vdi_tests.rb +80 -0
- data/tests/xenserver/requests/compute/create_vif_tests.rb +88 -0
- data/tests/xenserver/requests/compute/destroy_vdi_tests.rb +25 -0
- data/tests/xenserver/requests/compute/get_record_tests.rb +15 -0
- data/tests/xenserver/requests/compute/set_attribute_tests.rb +66 -0
- data/tests/xenserver/xenserver_tests.rb +34 -0
- metadata +938 -232
- data/lib/fog/bin/slicehost.rb +0 -36
- data/lib/fog/brightbox/requests/compute/resize_server.rb +0 -19
- data/lib/fog/ecloud/models/compute/ip.rb +0 -49
- data/lib/fog/ecloud/models/compute/ips.rb +0 -32
- data/lib/fog/ecloud/models/compute/vdc.rb +0 -81
- data/lib/fog/ecloud/models/compute/vdcs.rb +0 -40
- data/lib/fog/ecloud/requests/compute/add_backup_internet_service.rb +0 -109
- data/lib/fog/ecloud/requests/compute/add_internet_service.rb +0 -149
- data/lib/fog/ecloud/requests/compute/add_node.rb +0 -62
- data/lib/fog/ecloud/requests/compute/clone_vapp.rb +0 -40
- data/lib/fog/ecloud/requests/compute/configure_internet_service.rb +0 -112
- data/lib/fog/ecloud/requests/compute/configure_network.rb +0 -44
- data/lib/fog/ecloud/requests/compute/configure_network_ip.rb +0 -66
- data/lib/fog/ecloud/requests/compute/configure_node.rb +0 -56
- data/lib/fog/ecloud/requests/compute/configure_vapp.rb +0 -144
- data/lib/fog/ecloud/requests/compute/delete_internet_service.rb +0 -22
- data/lib/fog/ecloud/requests/compute/delete_node.rb +0 -22
- data/lib/fog/ecloud/requests/compute/delete_vapp.rb +0 -29
- data/lib/fog/ecloud/requests/compute/get_customization_options.rb +0 -22
- data/lib/fog/ecloud/requests/compute/get_network_extensions.rb +0 -33
- data/lib/fog/ecloud/requests/compute/get_network_ip.rb +0 -43
- data/lib/fog/ecloud/requests/compute/get_network_ips.rb +0 -35
- data/lib/fog/ecloud/requests/compute/get_vapp.rb +0 -99
- data/lib/fog/ecloud/requests/compute/get_vdc.rb +0 -84
- data/lib/fog/ecloud/requests/compute/get_versions.rb +0 -37
- data/lib/fog/ecloud/requests/compute/instantiate_vapp_template.rb +0 -142
- data/lib/fog/ecloud/requests/compute/login.rb +0 -48
- data/lib/fog/libvirt/models/compute/util.rb +0 -24
- data/lib/fog/openstack/requests/compute/update_meta.rb +0 -45
- data/lib/fog/slicehost.rb +0 -12
- data/lib/fog/slicehost/compute.rb +0 -104
- data/lib/fog/slicehost/dns.rb +0 -101
- data/lib/fog/slicehost/models/compute/flavor.rb +0 -45
- data/lib/fog/slicehost/models/compute/flavors.rb +0 -28
- data/lib/fog/slicehost/models/compute/image.rb +0 -17
- data/lib/fog/slicehost/models/compute/images.rb +0 -27
- data/lib/fog/slicehost/models/compute/server.rb +0 -113
- data/lib/fog/slicehost/models/dns/record.rb +0 -73
- data/lib/fog/slicehost/models/dns/records.rb +0 -36
- data/lib/fog/slicehost/models/dns/zone.rb +0 -69
- data/lib/fog/slicehost/models/dns/zones.rb +0 -28
- data/lib/fog/slicehost/parsers/compute/create_slice.rb +0 -31
- data/lib/fog/slicehost/parsers/compute/get_backups.rb +0 -32
- data/lib/fog/slicehost/parsers/compute/get_flavor.rb +0 -26
- data/lib/fog/slicehost/parsers/compute/get_flavors.rb +0 -30
- data/lib/fog/slicehost/parsers/compute/get_image.rb +0 -26
- data/lib/fog/slicehost/parsers/compute/get_images.rb +0 -30
- data/lib/fog/slicehost/parsers/compute/get_slice.rb +0 -31
- data/lib/fog/slicehost/parsers/compute/get_slices.rb +0 -35
- data/lib/fog/slicehost/parsers/dns/create_record.rb +0 -32
- data/lib/fog/slicehost/parsers/dns/create_zone.rb +0 -26
- data/lib/fog/slicehost/parsers/dns/get_record.rb +0 -38
- data/lib/fog/slicehost/parsers/dns/get_records.rb +0 -38
- data/lib/fog/slicehost/parsers/dns/get_zone.rb +0 -26
- data/lib/fog/slicehost/parsers/dns/get_zones.rb +0 -30
- data/lib/fog/slicehost/requests/compute/create_slice.rb +0 -41
- data/lib/fog/slicehost/requests/compute/delete_slice.rb +0 -23
- data/lib/fog/slicehost/requests/compute/get_backups.rb +0 -29
- data/lib/fog/slicehost/requests/compute/get_flavor.rb +0 -32
- data/lib/fog/slicehost/requests/compute/get_flavors.rb +0 -29
- data/lib/fog/slicehost/requests/compute/get_image.rb +0 -30
- data/lib/fog/slicehost/requests/compute/get_images.rb +0 -27
- data/lib/fog/slicehost/requests/compute/get_slice.rb +0 -38
- data/lib/fog/slicehost/requests/compute/get_slices.rb +0 -35
- data/lib/fog/slicehost/requests/compute/reboot_slice.rb +0 -36
- data/lib/fog/slicehost/requests/dns/create_record.rb +0 -52
- data/lib/fog/slicehost/requests/dns/create_zone.rb +0 -46
- data/lib/fog/slicehost/requests/dns/delete_record.rb +0 -23
- data/lib/fog/slicehost/requests/dns/delete_zone.rb +0 -23
- data/lib/fog/slicehost/requests/dns/get_record.rb +0 -32
- data/lib/fog/slicehost/requests/dns/get_records.rb +0 -32
- data/lib/fog/slicehost/requests/dns/get_zone.rb +0 -32
- data/lib/fog/slicehost/requests/dns/get_zones.rb +0 -30
- data/lib/fog/slicehost/requests/dns/update_record.rb +0 -43
- data/spec/ecloud/bin_spec.rb +0 -28
- data/spec/ecloud/models/backup_internet_service_spec.rb +0 -48
- data/spec/ecloud/models/backup_internet_services_spec.rb +0 -28
- data/spec/ecloud/models/internet_service_spec.rb +0 -104
- data/spec/ecloud/models/internet_services_spec.rb +0 -29
- data/spec/ecloud/models/ip_spec.rb +0 -33
- data/spec/ecloud/models/ips_spec.rb +0 -28
- data/spec/ecloud/models/network_spec.rb +0 -71
- data/spec/ecloud/models/networks_spec.rb +0 -27
- data/spec/ecloud/models/node_spec.rb +0 -38
- data/spec/ecloud/models/nodes_spec.rb +0 -28
- data/spec/ecloud/models/public_ip_spec.rb +0 -36
- data/spec/ecloud/models/public_ips_spec.rb +0 -27
- data/spec/ecloud/models/server_spec.rb +0 -62
- data/spec/ecloud/models/vdc_spec.rb +0 -63
- data/spec/ecloud/models/vdcs_spec.rb +0 -28
- data/spec/ecloud/requests/add_backup_internet_service_spec.rb +0 -60
- data/spec/ecloud/requests/add_internet_service_spec.rb +0 -65
- data/spec/ecloud/requests/add_node_spec.rb +0 -56
- data/spec/ecloud/requests/configure_internet_service_spec.rb +0 -61
- data/spec/ecloud/requests/configure_network_ip_spec.rb +0 -55
- data/spec/ecloud/requests/configure_node_spec.rb +0 -52
- data/spec/ecloud/requests/configure_vapp_spec.rb +0 -71
- data/spec/ecloud/requests/delete_internet_service_spec.rb +0 -34
- data/spec/ecloud/requests/delete_node_spec.rb +0 -30
- data/spec/ecloud/requests/delete_vapp_spec.rb +0 -92
- data/spec/ecloud/requests/get_catalog_item_spec.rb +0 -62
- data/spec/ecloud/requests/get_catalog_spec.rb +0 -44
- data/spec/ecloud/requests/get_customization_options_spec.rb +0 -39
- data/spec/ecloud/requests/get_internet_services_spec.rb +0 -150
- data/spec/ecloud/requests/get_network_ip_spec.rb +0 -40
- data/spec/ecloud/requests/get_network_ips_spec.rb +0 -58
- data/spec/ecloud/requests/get_network_spec.rb +0 -49
- data/spec/ecloud/requests/get_node_spec.rb +0 -41
- data/spec/ecloud/requests/get_nodes_spec.rb +0 -58
- data/spec/ecloud/requests/get_organization_spec.rb +0 -52
- data/spec/ecloud/requests/get_public_ip_spec.rb +0 -38
- data/spec/ecloud/requests/get_public_ips_spec.rb +0 -52
- data/spec/ecloud/requests/get_vapp_spec.rb +0 -125
- data/spec/ecloud/requests/get_vdc_spec.rb +0 -112
- data/spec/ecloud/requests/get_versions_spec.rb +0 -57
- data/spec/ecloud/requests/instantiate_vapp_template_spec.rb +0 -95
- data/spec/ecloud/requests/login_spec.rb +0 -10
- data/spec/ecloud/requests/power_off_spec.rb +0 -34
- data/spec/ecloud/requests/power_on_spec.rb +0 -34
- data/spec/ecloud/spec_helper.rb +0 -387
- data/spec/ecloud/vcloud_spec.rb +0 -18
- data/tests/slicehost/requests/compute/backup_tests.rb +0 -18
- data/tests/slicehost/requests/compute/flavor_tests.rb +0 -33
- data/tests/slicehost/requests/compute/image_tests.rb +0 -31
- data/tests/slicehost/requests/compute/slice_tests.rb +0 -75
- data/tests/slicehost/requests/dns/dns_tests.rb +0 -314
data/lib/fog/core/service.rb
CHANGED
@@ -9,6 +9,12 @@ module Fog
|
|
9
9
|
class Error < Fog::Errors::Error; end
|
10
10
|
class NotFound < Fog::Errors::NotFound; end
|
11
11
|
|
12
|
+
module NoLeakInspector
|
13
|
+
def inspect
|
14
|
+
"#<#{self.class}:#{self.object_id} #{(self.instance_variables - service.secrets).map {|iv| [iv, self.instance_variable_get(iv).inspect].join('=')}.join(' ')}>"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
module Collections
|
13
19
|
|
14
20
|
def collections
|
@@ -47,14 +53,8 @@ module Fog
|
|
47
53
|
end
|
48
54
|
|
49
55
|
def new(options={})
|
50
|
-
|
51
|
-
|
52
|
-
default_credentials = Fog.credentials.reject {|key, value| !(recognized | requirements).include?(key)}
|
53
|
-
options = default_credentials.merge(options)
|
54
|
-
rescue LoadError
|
55
|
-
# if there are no configured credentials, do nothing
|
56
|
-
end
|
57
|
-
|
56
|
+
options = Fog.symbolize_credentials(options)
|
57
|
+
options = fetch_credentials(options).merge(options)
|
58
58
|
validate_options(options)
|
59
59
|
coerce_options(options)
|
60
60
|
setup_requirements
|
@@ -64,10 +64,21 @@ module Fog
|
|
64
64
|
service::Mock.new(options)
|
65
65
|
else
|
66
66
|
service::Real.send(:include, service::Collections)
|
67
|
+
service::Real.send(:include, service::NoLeakInspector)
|
67
68
|
service::Real.new(options)
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
72
|
+
def fetch_credentials(options)
|
73
|
+
# attempt to load credentials from config file
|
74
|
+
begin
|
75
|
+
default_credentials = Fog.credentials.reject {|key, value| !(recognized | requirements).include?(key)}
|
76
|
+
rescue LoadError
|
77
|
+
# if there are no configured credentials, do nothing
|
78
|
+
{}
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
71
82
|
def setup_requirements
|
72
83
|
if superclass.respond_to?(:setup_requirements)
|
73
84
|
superclass.setup_requirements
|
@@ -159,6 +170,16 @@ module Fog
|
|
159
170
|
@requests ||= []
|
160
171
|
end
|
161
172
|
|
173
|
+
def secrets(*args)
|
174
|
+
if args.empty?
|
175
|
+
@secrets ||= []
|
176
|
+
else
|
177
|
+
args.inject(secrets) do |secrets, secret|
|
178
|
+
secrets << "@#{secret}".to_sym
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
162
183
|
def requires(*args)
|
163
184
|
requirements.concat(args)
|
164
185
|
end
|
data/lib/fog/core/ssh.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'delegate'
|
2
|
+
|
1
3
|
module Fog
|
2
4
|
module SSH
|
3
5
|
|
@@ -13,18 +15,22 @@ module Fog
|
|
13
15
|
|
14
16
|
def self.data
|
15
17
|
@data ||= Hash.new do |hash, key|
|
16
|
-
hash[key] =
|
18
|
+
hash[key] = []
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
22
|
+
def self.reset
|
23
|
+
@data= nil
|
24
|
+
end
|
25
|
+
|
20
26
|
def initialize(address, username, options)
|
21
27
|
@address = address
|
22
28
|
@username = username
|
23
29
|
@options = options
|
24
30
|
end
|
25
31
|
|
26
|
-
def run(commands)
|
27
|
-
|
32
|
+
def run(commands, &blk)
|
33
|
+
self.class.data[@address] << {:commands => commands, :username => @username, :options => @options}
|
28
34
|
end
|
29
35
|
|
30
36
|
end
|
@@ -45,7 +51,7 @@ module Fog
|
|
45
51
|
@options = { :paranoid => false }.merge(options)
|
46
52
|
end
|
47
53
|
|
48
|
-
def run(commands)
|
54
|
+
def run(commands, &blk)
|
49
55
|
commands = [*commands]
|
50
56
|
results = []
|
51
57
|
begin
|
@@ -61,11 +67,13 @@ module Fog
|
|
61
67
|
|
62
68
|
channel.on_data do |ch, data|
|
63
69
|
result.stdout << data
|
70
|
+
yield [data, ''] if blk
|
64
71
|
end
|
65
72
|
|
66
73
|
channel.on_extended_data do |ch, type, data|
|
67
74
|
next unless type == 1
|
68
75
|
result.stderr << data
|
76
|
+
yield ['', data] if blk
|
69
77
|
end
|
70
78
|
|
71
79
|
channel.on_request('exit-status') do |ch, data|
|
@@ -96,7 +104,12 @@ module Fog
|
|
96
104
|
attr_accessor :command, :stderr, :stdout, :status
|
97
105
|
|
98
106
|
def display_stdout
|
99
|
-
|
107
|
+
data = stdout.split("\r\n")
|
108
|
+
if data.is_a?(String)
|
109
|
+
Formatador.display_line(data)
|
110
|
+
elsif data.is_a?(Array)
|
111
|
+
Formatador.display_lines(data)
|
112
|
+
end
|
100
113
|
end
|
101
114
|
|
102
115
|
def display_stderr
|
data/lib/fog/dns.rb
CHANGED
@@ -26,10 +26,6 @@ module Fog
|
|
26
26
|
when :linode
|
27
27
|
require 'fog/linode/dns'
|
28
28
|
Fog::DNS::Linode.new(attributes)
|
29
|
-
when :slicehost
|
30
|
-
warn "[DEPRECATION] `slicehost` is deprecated. Please use `racksace` instead."
|
31
|
-
require 'fog/slicehost/dns'
|
32
|
-
Fog::DNS::Slicehost.new(attributes)
|
33
29
|
when :zerigo
|
34
30
|
require 'fog/zerigo/dns'
|
35
31
|
Fog::DNS::Zerigo.new(attributes)
|
data/lib/fog/dnsimple.rb
CHANGED
data/lib/fog/dnsimple/dns.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'fog/dnsimple'
|
2
2
|
require 'fog/dns'
|
3
3
|
|
4
4
|
module Fog
|
@@ -55,8 +55,6 @@ module Fog
|
|
55
55
|
class Real
|
56
56
|
|
57
57
|
def initialize(options={})
|
58
|
-
require 'multi_json'
|
59
|
-
|
60
58
|
@dnsimple_email = options[:dnsimple_email]
|
61
59
|
@dnsimple_password = options[:dnsimple_password]
|
62
60
|
@connection_options = options[:connection_options] || {}
|
@@ -87,7 +85,7 @@ module Fog
|
|
87
85
|
response = @connection.request(params.merge!({:host => @host}))
|
88
86
|
|
89
87
|
unless response.body.empty?
|
90
|
-
response.body =
|
88
|
+
response.body = Fog::JSON.decode(response.body)
|
91
89
|
end
|
92
90
|
response
|
93
91
|
end
|
data/lib/fog/dnsmadeeasy.rb
CHANGED
data/lib/fog/dnsmadeeasy/dns.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'fog/dnsmadeeasy'
|
2
2
|
require 'fog/dns'
|
3
3
|
|
4
4
|
module Fog
|
@@ -80,13 +80,12 @@ module Fog
|
|
80
80
|
# * dns object with connection to aws.
|
81
81
|
def initialize(options={})
|
82
82
|
require 'fog/core/parser'
|
83
|
-
require 'multi_json'
|
84
83
|
|
85
84
|
@dnsmadeeasy_api_key = options[:dnsmadeeasy_api_key]
|
86
85
|
@dnsmadeeasy_secret_key = options[:dnsmadeeasy_secret_key]
|
87
86
|
@connection_options = options[:connection_options] || {}
|
88
87
|
@host = options[:host] || 'api.dnsmadeeasy.com'
|
89
|
-
@persistent = options
|
88
|
+
@persistent = options.fetch(:persistent, true)
|
90
89
|
@port = options[:port] || 80 #443 Not yet
|
91
90
|
@scheme = options[:scheme] || 'http' #'https Not yet
|
92
91
|
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
@@ -119,7 +118,7 @@ module Fog
|
|
119
118
|
end
|
120
119
|
|
121
120
|
unless response.body.empty?
|
122
|
-
response.body =
|
121
|
+
response.body = Fog::JSON.decode(response.body)
|
123
122
|
end
|
124
123
|
|
125
124
|
response
|
@@ -128,7 +127,7 @@ module Fog
|
|
128
127
|
|
129
128
|
def signature(params)
|
130
129
|
string_to_sign = params[:headers]['x-dnsme-requestDate']
|
131
|
-
|
130
|
+
OpenSSL::HMAC.hexdigest('sha1', @dnsmadeeasy_secret_key, string_to_sign)
|
132
131
|
end
|
133
132
|
end
|
134
133
|
end
|
data/lib/fog/dynect.rb
CHANGED
data/lib/fog/dynect/dns.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'fog/dynect'
|
2
2
|
require 'fog/dns'
|
3
3
|
|
4
4
|
module Fog
|
@@ -60,8 +60,6 @@ module Fog
|
|
60
60
|
|
61
61
|
class Real
|
62
62
|
def initialize(options={})
|
63
|
-
require 'multi_json'
|
64
|
-
|
65
63
|
@dynect_customer = options[:dynect_customer]
|
66
64
|
@dynect_username = options[:dynect_username]
|
67
65
|
@dynect_password = options[:dynect_password]
|
@@ -70,7 +68,7 @@ module Fog
|
|
70
68
|
@host = "api2.dynect.net"
|
71
69
|
@port = options[:port] || 443
|
72
70
|
@path = options[:path] || '/REST'
|
73
|
-
@persistent = options[:persistent] ||
|
71
|
+
@persistent = options[:persistent] || false
|
74
72
|
@scheme = options[:scheme] || 'https'
|
75
73
|
@version = options[:version] || '2.3.1'
|
76
74
|
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
@@ -95,7 +93,7 @@ module Fog
|
|
95
93
|
if response.status == 307
|
96
94
|
response = poll_job(response)
|
97
95
|
elsif !response.body.empty?
|
98
|
-
response.body =
|
96
|
+
response.body = Fog::JSON.decode(response.body)
|
99
97
|
end
|
100
98
|
|
101
99
|
response
|
@@ -15,7 +15,7 @@ module Fog
|
|
15
15
|
def post_record(type, zone, fqdn, rdata, options = {})
|
16
16
|
options.merge!('rdata' => rdata)
|
17
17
|
request(
|
18
|
-
:body =>
|
18
|
+
:body => Fog::JSON.encode(options),
|
19
19
|
:expects => 200,
|
20
20
|
:method => :post,
|
21
21
|
:path => ["#{type.to_s.upcase}Record", zone, fqdn].join('/')
|
@@ -6,9 +6,10 @@ module Fog
|
|
6
6
|
def post_session
|
7
7
|
request(
|
8
8
|
:expects => 200,
|
9
|
+
:idempotent => true,
|
9
10
|
:method => :post,
|
10
11
|
:path => "Session",
|
11
|
-
:body =>
|
12
|
+
:body => Fog::JSON.encode({
|
12
13
|
:customer_name => @dynect_customer,
|
13
14
|
:user_name => @dynect_username,
|
14
15
|
:password => @dynect_password
|
@@ -13,7 +13,7 @@ module Fog
|
|
13
13
|
# * serial_style<~String> - style of serial number, in ['day', 'epoch', 'increment', 'minute']. Defaults to increment
|
14
14
|
|
15
15
|
def post_zone(rname, ttl, zone, options = {})
|
16
|
-
body =
|
16
|
+
body = Fog::JSON.encode({
|
17
17
|
:rname => rname,
|
18
18
|
:token => auth_token,
|
19
19
|
:ttl => ttl
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Ecloud
|
3
|
+
class Collection < Fog::Collection
|
4
|
+
|
5
|
+
def load(objects)
|
6
|
+
objects = [ objects ] if objects.is_a?(Hash)
|
7
|
+
super
|
8
|
+
end
|
9
|
+
|
10
|
+
def check_href!(opts = {})
|
11
|
+
unless href
|
12
|
+
opts = { :parent => opts } if opts.is_a?(String)
|
13
|
+
msg = ":href missing, call with a :href pointing to #{if opts[:message]
|
14
|
+
opts[:message]
|
15
|
+
elsif opts[:parent]
|
16
|
+
"the #{opts[:parent]} whos #{self.class.to_s.split('::').last.downcase} you want to enumerate"
|
17
|
+
else
|
18
|
+
"the resource"
|
19
|
+
end}"
|
20
|
+
raise Fog::Errors::Error.new(msg)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/fog/ecloud/compute.rb
CHANGED
@@ -1,800 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require 'ipaddr'
|
3
|
-
|
4
|
-
class IPAddr
|
5
|
-
def mask
|
6
|
-
_to_string(@mask_addr)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
module Fog
|
11
|
-
module Ecloud
|
12
|
-
class Collection < Fog::Collection
|
13
|
-
|
14
|
-
def load(objects)
|
15
|
-
objects = [ objects ] if objects.is_a?(Hash)
|
16
|
-
super
|
17
|
-
end
|
18
|
-
|
19
|
-
def check_href!(opts = {})
|
20
|
-
unless href
|
21
|
-
opts = { :parent => opts } if opts.is_a?(String)
|
22
|
-
msg = ":href missing, call with a :href pointing to #{if opts[:message]
|
23
|
-
opts[:message]
|
24
|
-
elsif opts[:parent]
|
25
|
-
"the #{opts[:parent]} whos #{self.class.to_s.split('::').last.downcase} you want to enumerate"
|
26
|
-
else
|
27
|
-
"the resource"
|
28
|
-
end}"
|
29
|
-
raise Fog::Errors::Error.new(msg)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
module Fog
|
38
|
-
module Ecloud
|
39
|
-
module MockDataClasses
|
40
|
-
class Base < Hash
|
41
|
-
def self.base_url=(url)
|
42
|
-
@base_url = url
|
43
|
-
end
|
44
|
-
|
45
|
-
self.base_url = "http://vcloud.example.com"
|
46
|
-
|
47
|
-
def self.base_url
|
48
|
-
@base_url
|
49
|
-
end
|
50
|
-
|
51
|
-
def first
|
52
|
-
raise "Don't do this"
|
53
|
-
end
|
54
|
-
|
55
|
-
def last
|
56
|
-
raise "Don't do this"
|
57
|
-
end
|
58
|
-
|
59
|
-
def initialize(data = {}, parent = nil)
|
60
|
-
@parent = parent
|
61
|
-
|
62
|
-
replace(data)
|
63
|
-
end
|
64
|
-
|
65
|
-
def _parent
|
66
|
-
@parent
|
67
|
-
end
|
68
|
-
|
69
|
-
def base_url
|
70
|
-
Base.base_url
|
71
|
-
end
|
72
|
-
|
73
|
-
def href
|
74
|
-
[base_url, self.class.name.split("::").last, object_id].join("/")
|
75
|
-
end
|
76
|
-
|
77
|
-
def inspect
|
78
|
-
"<#{self.class.name} #{object_id} data=#{super}>"
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
class MockData < Base
|
83
|
-
def versions
|
84
|
-
@versions ||= []
|
85
|
-
end
|
86
|
-
|
87
|
-
def organizations
|
88
|
-
@organizations ||= []
|
89
|
-
end
|
90
|
-
|
91
|
-
def organization_from_href(href)
|
92
|
-
find_href_in(href, organizations)
|
93
|
-
end
|
94
|
-
|
95
|
-
def all_vdcs
|
96
|
-
organizations.map(&:vdcs).flatten
|
97
|
-
end
|
98
|
-
|
99
|
-
def vdc_from_href(href)
|
100
|
-
find_href_in(href, all_vdcs)
|
101
|
-
end
|
102
|
-
|
103
|
-
def all_catalogs
|
104
|
-
all_vdcs.map(&:catalog).flatten
|
105
|
-
end
|
106
|
-
|
107
|
-
def catalog_from_href(href)
|
108
|
-
find_href_in(href, all_catalogs)
|
109
|
-
end
|
110
|
-
|
111
|
-
def all_catalog_items
|
112
|
-
all_catalogs.map(&:items).flatten
|
113
|
-
end
|
114
|
-
|
115
|
-
def catalog_item_from_href(href)
|
116
|
-
find_href_in(href, all_catalog_items)
|
117
|
-
end
|
118
|
-
|
119
|
-
def all_virtual_machines
|
120
|
-
all_vdcs.map(&:virtual_machines).flatten
|
121
|
-
end
|
122
|
-
|
123
|
-
def virtual_machine_from_href(href)
|
124
|
-
find_href_prefixed_in(href, all_virtual_machines)
|
125
|
-
end
|
126
|
-
|
127
|
-
|
128
|
-
def all_networks
|
129
|
-
all_vdcs.map(&:networks).flatten
|
130
|
-
end
|
131
|
-
|
132
|
-
def network_from_href(href)
|
133
|
-
find_href_in(href, all_networks)
|
134
|
-
end
|
135
|
-
|
136
|
-
def all_network_extensions
|
137
|
-
all_networks.map(&:extensions).flatten
|
138
|
-
end
|
139
|
-
|
140
|
-
def network_extension_from_href(href)
|
141
|
-
find_href_in(href, all_network_extensions)
|
142
|
-
end
|
143
|
-
|
144
|
-
def all_vdc_internet_service_collections
|
145
|
-
all_vdcs.map(&:internet_service_collection).flatten
|
146
|
-
end
|
147
|
-
|
148
|
-
def vdc_internet_service_collection_from_href(href)
|
149
|
-
find_href_in(href, all_vdc_internet_service_collections)
|
150
|
-
end
|
151
|
-
|
152
|
-
def all_backup_internet_services
|
153
|
-
all_vdc_internet_service_collections.map(&:backup_internet_services).flatten
|
154
|
-
end
|
155
|
-
|
156
|
-
def backup_internet_service_from_href(href)
|
157
|
-
find_href_in(href, all_backup_internet_services)
|
158
|
-
end
|
159
|
-
|
160
|
-
def all_public_ip_collections
|
161
|
-
all_vdcs.map {|v| v.public_ip_collection }.flatten
|
162
|
-
end
|
163
|
-
|
164
|
-
def public_ip_collection_from_href(href)
|
165
|
-
find_href_in(href, all_public_ip_collections)
|
166
|
-
end
|
167
|
-
|
168
|
-
def all_public_ips
|
169
|
-
all_public_ip_collections.map(&:items).flatten
|
170
|
-
end
|
171
|
-
|
172
|
-
def public_ip_from_href(href)
|
173
|
-
find_href_in(href, all_public_ips)
|
174
|
-
end
|
175
|
-
|
176
|
-
def all_public_ip_internet_service_collections
|
177
|
-
all_public_ips.map(&:internet_service_collection).flatten
|
178
|
-
end
|
179
|
-
|
180
|
-
def public_ip_internet_service_collection_from_href(href)
|
181
|
-
find_href_in(href, all_public_ip_internet_service_collections)
|
182
|
-
end
|
183
|
-
|
184
|
-
def all_public_ip_internet_services
|
185
|
-
all_public_ip_internet_service_collections.map(&:items).flatten
|
186
|
-
end
|
187
|
-
|
188
|
-
def public_ip_internet_service_from_href(href)
|
189
|
-
find_href_in(href, all_public_ip_internet_services)
|
190
|
-
end
|
191
|
-
|
192
|
-
def all_public_ip_internet_service_node_collections
|
193
|
-
all_public_ip_internet_services.map(&:node_collection).flatten
|
194
|
-
end
|
195
|
-
|
196
|
-
def public_ip_internet_service_node_collection_from_href(href)
|
197
|
-
find_href_in(href, all_public_ip_internet_service_node_collections)
|
198
|
-
end
|
199
|
-
|
200
|
-
def all_public_ip_internet_service_nodes
|
201
|
-
all_public_ip_internet_service_node_collections.map(&:items).flatten
|
202
|
-
end
|
203
|
-
|
204
|
-
def public_ip_internet_service_node_from_href(href)
|
205
|
-
find_href_in(href, all_public_ip_internet_service_nodes)
|
206
|
-
end
|
207
|
-
|
208
|
-
def all_network_ip_collections
|
209
|
-
all_networks.map(&:ip_collection)
|
210
|
-
end
|
211
|
-
|
212
|
-
def network_ip_collection_from_href(href)
|
213
|
-
find_href_in(href, all_network_ip_collections)
|
214
|
-
end
|
215
|
-
|
216
|
-
def all_network_ips
|
217
|
-
all_network_ip_collections.map {|c| c.items.values }.flatten
|
218
|
-
end
|
219
|
-
|
220
|
-
def network_ip_from_href(href)
|
221
|
-
find_href_in(href, all_network_ips)
|
222
|
-
end
|
223
|
-
|
224
|
-
private
|
225
|
-
|
226
|
-
def find_href_in(href, objects)
|
227
|
-
objects.detect {|o| o.href == href }
|
228
|
-
end
|
229
|
-
|
230
|
-
def find_href_prefixed_in(href, objects)
|
231
|
-
objects.detect {|o| href =~ %r{^#{o.href}($|/)} }
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
235
|
-
class MockVersion < Base
|
236
|
-
def version
|
237
|
-
self[:version]
|
238
|
-
end
|
239
|
-
|
240
|
-
def supported
|
241
|
-
!!self[:supported]
|
242
|
-
end
|
243
|
-
|
244
|
-
def login_url
|
245
|
-
href
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
class MockOrganization < Base
|
250
|
-
def name
|
251
|
-
self[:name]
|
252
|
-
end
|
253
|
-
|
254
|
-
def vdcs
|
255
|
-
@vdcs ||= []
|
256
|
-
end
|
257
|
-
end
|
258
|
-
|
259
|
-
class MockVdc < Base
|
260
|
-
def name
|
261
|
-
self[:name]
|
262
|
-
end
|
263
|
-
|
264
|
-
def storage_allocated
|
265
|
-
self[:storage_allocated] || 200
|
266
|
-
end
|
267
|
-
|
268
|
-
def storage_used
|
269
|
-
self[:storage_used] || 105
|
270
|
-
end
|
271
|
-
|
272
|
-
def cpu_allocated
|
273
|
-
self[:cpu_allocated] || 10000
|
274
|
-
end
|
275
|
-
|
276
|
-
def memory_allocated
|
277
|
-
self[:memory_allocated] || 20480
|
278
|
-
end
|
279
|
-
|
280
|
-
def catalog
|
281
|
-
@catalog ||= MockCatalog.new({}, self)
|
282
|
-
end
|
283
|
-
|
284
|
-
def networks
|
285
|
-
@networks ||= []
|
286
|
-
end
|
287
|
-
|
288
|
-
def virtual_machines
|
289
|
-
@virtual_machines ||= []
|
290
|
-
end
|
291
|
-
|
292
|
-
def task_list
|
293
|
-
@task_list ||= MockTaskList.new({}, self)
|
294
|
-
end
|
295
|
-
|
296
|
-
# for TM eCloud, should probably be subclassed
|
297
|
-
def public_ip_collection
|
298
|
-
@public_ip_collection ||= MockPublicIps.new({}, self)
|
299
|
-
end
|
300
|
-
|
301
|
-
def internet_service_collection
|
302
|
-
@internet_service_collection ||= MockVdcInternetServices.new({}, self)
|
303
|
-
end
|
304
|
-
|
305
|
-
def firewall_acls
|
306
|
-
@firewall_acls ||= MockFirewallAcls.new({}, self)
|
307
|
-
end
|
308
|
-
end
|
309
|
-
|
310
|
-
class MockTaskList < Base
|
311
|
-
def name
|
312
|
-
self[:name] || "Tasks List"
|
313
|
-
end
|
314
|
-
end
|
315
|
-
|
316
|
-
class MockCatalog < Base
|
317
|
-
def name
|
318
|
-
self[:name] || "Catalog"
|
319
|
-
end
|
320
|
-
|
321
|
-
def items
|
322
|
-
@items ||= []
|
323
|
-
end
|
324
|
-
end
|
325
|
-
|
326
|
-
class MockCatalogItem < Base
|
327
|
-
def name
|
328
|
-
self[:name]
|
329
|
-
end
|
330
|
-
|
331
|
-
def disks
|
332
|
-
@disks ||= MockVirtualMachineDisks.new(self)
|
333
|
-
end
|
334
|
-
|
335
|
-
def customization
|
336
|
-
@customization ||= MockCatalogItemCustomization.new({}, self)
|
337
|
-
end
|
338
|
-
|
339
|
-
def vapp_template
|
340
|
-
@vapp_template ||= MockCatalogItemVappTemplate.new({ :name => name }, self)
|
341
|
-
end
|
342
|
-
end
|
343
|
-
|
344
|
-
class MockCatalogItemCustomization < Base
|
345
|
-
def name
|
346
|
-
self[:name] || "Customization Options"
|
347
|
-
end
|
348
|
-
end
|
349
|
-
|
350
|
-
class MockCatalogItemVappTemplate < Base
|
351
|
-
def name
|
352
|
-
self[:name]
|
353
|
-
end
|
354
|
-
end
|
355
|
-
|
356
|
-
class MockNetwork < Base
|
357
|
-
def name
|
358
|
-
self[:name] || subnet
|
359
|
-
end
|
360
|
-
|
361
|
-
def subnet
|
362
|
-
self[:subnet]
|
363
|
-
end
|
364
|
-
|
365
|
-
def gateway
|
366
|
-
self[:gateway] || subnet_ips[1]
|
367
|
-
end
|
368
|
-
|
369
|
-
def netmask
|
370
|
-
self[:netmask] || subnet_ipaddr.mask
|
371
|
-
end
|
372
|
-
|
373
|
-
def dns
|
374
|
-
"8.8.8.8"
|
375
|
-
end
|
376
|
-
|
377
|
-
def features
|
378
|
-
[
|
379
|
-
{ :type => :FenceMode, :value => "isolated" }
|
380
|
-
]
|
381
|
-
end
|
382
|
-
|
383
|
-
def ip_collection
|
384
|
-
@ip_collection ||= MockNetworkIps.new({}, self)
|
385
|
-
end
|
386
|
-
|
387
|
-
def extensions
|
388
|
-
@extensions ||= MockNetworkExtensions.new({}, self)
|
389
|
-
end
|
390
|
-
|
391
|
-
def random_ip
|
392
|
-
usable_subnet_ips[rand(usable_subnet_ips.length)]
|
393
|
-
end
|
394
|
-
|
395
|
-
# for TM eCloud. should probably be a subclass
|
396
|
-
def rnat
|
397
|
-
self[:rnat]
|
398
|
-
end
|
399
|
-
|
400
|
-
def usable_subnet_ips
|
401
|
-
subnet_ips[3..-2]
|
402
|
-
end
|
403
|
-
|
404
|
-
def address
|
405
|
-
subnet_ips.first
|
406
|
-
end
|
407
|
-
|
408
|
-
def broadcast
|
409
|
-
subnet_ips.last
|
410
|
-
end
|
411
|
-
|
412
|
-
private
|
413
|
-
|
414
|
-
def subnet_ipaddr
|
415
|
-
@ipaddr ||= IPAddr.new(subnet)
|
416
|
-
end
|
417
|
-
|
418
|
-
def subnet_ips
|
419
|
-
subnet_ipaddr.to_range.to_a.map(&:to_s)
|
420
|
-
end
|
421
|
-
end
|
422
|
-
|
423
|
-
class MockNetworkIps < Base
|
424
|
-
def items
|
425
|
-
@items ||= _parent.usable_subnet_ips.inject({}) do |out, subnet_ip|
|
426
|
-
out.update(subnet_ip => MockNetworkIp.new({ :ip => subnet_ip }, self))
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
def ordered_ips
|
431
|
-
items.values.sort_by {|i| i.ip.split(".").map(&:to_i) }
|
432
|
-
end
|
433
|
-
|
434
|
-
def name
|
435
|
-
"IP Addresses"
|
436
|
-
end
|
437
|
-
end
|
438
|
-
|
439
|
-
class MockNetworkIp < Base
|
440
|
-
def name
|
441
|
-
self[:name] || ip
|
442
|
-
end
|
443
|
-
|
444
|
-
def ip
|
445
|
-
self[:ip]
|
446
|
-
end
|
447
|
-
|
448
|
-
def used_by
|
449
|
-
self[:used_by] || _parent._parent._parent.virtual_machines.detect {|v| v.ip == ip }
|
450
|
-
end
|
451
|
-
|
452
|
-
def status
|
453
|
-
if used_by
|
454
|
-
"Assigned"
|
455
|
-
else
|
456
|
-
"Available"
|
457
|
-
end
|
458
|
-
end
|
459
|
-
|
460
|
-
def rnat
|
461
|
-
self[:rnat] || _parent._parent.rnat
|
462
|
-
end
|
463
|
-
|
464
|
-
def rnat_set?
|
465
|
-
!!self[:rnat]
|
466
|
-
end
|
467
|
-
end
|
468
|
-
|
469
|
-
class MockNetworkExtensions < Base
|
470
|
-
def name
|
471
|
-
_parent.name
|
472
|
-
end
|
473
|
-
|
474
|
-
def gateway
|
475
|
-
_parent.gateway
|
476
|
-
end
|
477
|
-
|
478
|
-
def broadcast
|
479
|
-
_parent.broadcast
|
480
|
-
end
|
481
|
-
|
482
|
-
def address
|
483
|
-
_parent.address
|
484
|
-
end
|
485
|
-
|
486
|
-
def rnat
|
487
|
-
_parent.rnat
|
488
|
-
end
|
489
|
-
|
490
|
-
def type
|
491
|
-
self[:type] || "DMZ"
|
492
|
-
end
|
493
|
-
|
494
|
-
def vlan
|
495
|
-
object_id.to_s
|
496
|
-
end
|
497
|
-
|
498
|
-
def friendly_name
|
499
|
-
"#{name} (#{type}_#{object_id})"
|
500
|
-
end
|
501
|
-
end
|
502
|
-
|
503
|
-
class MockVirtualMachine < Base
|
504
|
-
def name
|
505
|
-
self[:name]
|
506
|
-
end
|
507
|
-
|
508
|
-
def ip
|
509
|
-
self[:ip]
|
510
|
-
end
|
511
|
-
|
512
|
-
def cpus
|
513
|
-
self[:cpus] || 1
|
514
|
-
end
|
515
|
-
|
516
|
-
def memory
|
517
|
-
self[:memory] || 1024
|
518
|
-
end
|
519
|
-
|
520
|
-
def disks
|
521
|
-
@disks ||= MockVirtualMachineDisks.new(self)
|
522
|
-
end
|
523
|
-
|
524
|
-
def status
|
525
|
-
self[:status] || 2
|
526
|
-
end
|
527
|
-
|
528
|
-
def power_off!
|
529
|
-
self[:status] = 2
|
530
|
-
end
|
531
|
-
|
532
|
-
def power_on!
|
533
|
-
self[:status] = 4
|
534
|
-
end
|
535
|
-
|
536
|
-
def size
|
537
|
-
disks.inject(0) {|s, d| s + d.vcloud_size }
|
538
|
-
end
|
539
|
-
|
540
|
-
def network_ip
|
541
|
-
if network = _parent.networks.detect {|n| n.ip_collection.items[ip] }
|
542
|
-
network.ip_collection.items[ip]
|
543
|
-
end
|
544
|
-
end
|
545
|
-
|
546
|
-
# from fog ecloud server's _compose_vapp_data
|
547
|
-
def to_configure_vapp_hash
|
548
|
-
{
|
549
|
-
:name => name,
|
550
|
-
:cpus => cpus,
|
551
|
-
:memory => memory,
|
552
|
-
:disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }
|
553
|
-
}
|
554
|
-
end
|
555
|
-
|
556
|
-
def href(purpose = :base)
|
557
|
-
case purpose
|
558
|
-
when :base
|
559
|
-
super()
|
560
|
-
when :power_on
|
561
|
-
super() + "/power/action/powerOn"
|
562
|
-
when :power_off
|
563
|
-
super() + "/power/action/powerOff"
|
564
|
-
end
|
565
|
-
end
|
566
|
-
end
|
567
|
-
|
568
|
-
class MockVirtualMachineDisks < Array
|
569
|
-
def initialize(parent = nil)
|
570
|
-
@parent = parent
|
571
|
-
end
|
572
|
-
|
573
|
-
def _parent
|
574
|
-
@parent
|
575
|
-
end
|
576
|
-
|
577
|
-
def <<(disk)
|
578
|
-
next_address = 0
|
579
|
-
disk_with_max_address = max {|a, b| a[:address] <=> b[:address] }
|
580
|
-
disk_with_max_address && next_address = disk_with_max_address.address + 1
|
581
|
-
disk[:address] ||= next_address
|
582
|
-
|
583
|
-
super(disk)
|
584
|
-
|
585
|
-
if (addresses = map {|d| d.address }).uniq.size != size
|
586
|
-
raise "Duplicate disk address in: #{addresses.inspect} (#{size})"
|
587
|
-
end
|
588
|
-
|
589
|
-
sort! {|a, b| a.address <=> b.address }
|
590
|
-
self
|
591
|
-
end
|
592
|
-
|
593
|
-
def at_address(address)
|
594
|
-
detect {|d| d.address == address }
|
595
|
-
end
|
596
|
-
end
|
597
|
-
|
598
|
-
class MockVirtualMachineDisk < Base
|
599
|
-
def size
|
600
|
-
self[:size].to_i
|
601
|
-
end
|
602
|
-
|
603
|
-
def vcloud_size
|
604
|
-
# kilobytes
|
605
|
-
size * 1024
|
606
|
-
end
|
607
|
-
|
608
|
-
def address
|
609
|
-
self[:address].to_i
|
610
|
-
end
|
611
|
-
end
|
612
|
-
|
613
|
-
# for Terremark eCloud
|
614
|
-
|
615
|
-
class MockVdcInternetServices < Base
|
616
|
-
def href
|
617
|
-
_parent.href + "/internetServices"
|
618
|
-
end
|
619
|
-
|
620
|
-
def name
|
621
|
-
"Internet Services"
|
622
|
-
end
|
623
|
-
|
624
|
-
def items
|
625
|
-
public_ip_internet_services + backup_internet_services
|
626
|
-
end
|
627
|
-
|
628
|
-
def public_ip_internet_services
|
629
|
-
_parent.public_ip_collection.items.inject([]) do |services, public_ip|
|
630
|
-
services + public_ip.internet_service_collection.items
|
631
|
-
end
|
632
|
-
end
|
633
|
-
|
634
|
-
def backup_internet_services
|
635
|
-
@backup_internet_services ||= []
|
636
|
-
end
|
637
|
-
end
|
638
|
-
|
639
|
-
class MockBackupInternetService < Base
|
640
|
-
def name
|
641
|
-
self[:name] || "Backup Internet Service #{object_id}"
|
642
|
-
end
|
643
|
-
|
644
|
-
def protocol
|
645
|
-
self[:protocol]
|
646
|
-
end
|
647
|
-
|
648
|
-
def port
|
649
|
-
0
|
650
|
-
end
|
651
|
-
|
652
|
-
def enabled
|
653
|
-
self[:enabled].to_s.downcase != "false"
|
654
|
-
end
|
655
|
-
|
656
|
-
def timeout
|
657
|
-
self[:timeout] || 2
|
658
|
-
end
|
659
|
-
|
660
|
-
def description
|
661
|
-
self[:description] || "Description for Backup Service #{name}"
|
662
|
-
end
|
663
|
-
|
664
|
-
def redirect_url
|
665
|
-
nil
|
666
|
-
end
|
667
|
-
|
668
|
-
def node_collection
|
669
|
-
@node_collection ||= MockPublicIpInternetServiceNodes.new({}, self)
|
670
|
-
end
|
671
|
-
end
|
672
|
-
|
673
|
-
class MockFirewallAcls < Base
|
674
|
-
def name
|
675
|
-
"Firewall Access List"
|
676
|
-
end
|
677
|
-
end
|
678
|
-
|
679
|
-
class MockPublicIps < Base
|
680
|
-
def name
|
681
|
-
self[:name] || "Public IPs"
|
682
|
-
end
|
683
|
-
|
684
|
-
def items
|
685
|
-
@items ||= []
|
686
|
-
end
|
687
|
-
end
|
688
|
-
|
689
|
-
class MockPublicIp < Base
|
690
|
-
def name
|
691
|
-
self[:name]
|
692
|
-
end
|
693
|
-
|
694
|
-
def internet_service_collection
|
695
|
-
@internet_service_collection ||= MockPublicIpInternetServices.new({}, self)
|
696
|
-
end
|
697
|
-
end
|
698
|
-
|
699
|
-
class MockPublicIpInternetServices < Base
|
700
|
-
def href
|
701
|
-
_parent.href + "/internetServices"
|
702
|
-
end
|
703
|
-
|
704
|
-
def items
|
705
|
-
@items ||= []
|
706
|
-
end
|
707
|
-
end
|
708
|
-
|
709
|
-
class MockPublicIpInternetService < Base
|
710
|
-
def name
|
711
|
-
self[:name] || "Public IP Service #{object_id}"
|
712
|
-
end
|
713
|
-
|
714
|
-
def description
|
715
|
-
self[:description] || "Description for Public IP Service #{name}"
|
716
|
-
end
|
717
|
-
|
718
|
-
def protocol
|
719
|
-
self[:protocol]
|
720
|
-
end
|
721
|
-
|
722
|
-
def port
|
723
|
-
self[:port]
|
724
|
-
end
|
725
|
-
|
726
|
-
def enabled
|
727
|
-
!!self[:enabled]
|
728
|
-
end
|
729
|
-
|
730
|
-
def redirect_url
|
731
|
-
self[:redirect_url]
|
732
|
-
end
|
733
|
-
|
734
|
-
def timeout
|
735
|
-
self[:timeout] || 2
|
736
|
-
end
|
737
|
-
|
738
|
-
def node_collection
|
739
|
-
@node_collection ||= MockPublicIpInternetServiceNodes.new({}, self)
|
740
|
-
end
|
741
|
-
|
742
|
-
def monitor
|
743
|
-
nil
|
744
|
-
end
|
745
|
-
|
746
|
-
def backup_service
|
747
|
-
self[:backup_service]
|
748
|
-
end
|
749
|
-
end
|
750
|
-
|
751
|
-
class MockPublicIpInternetServiceNodes < Base
|
752
|
-
def href
|
753
|
-
_parent.href + "/nodeServices"
|
754
|
-
end
|
755
|
-
|
756
|
-
def items
|
757
|
-
@items ||= [].tap do |node_array|
|
758
|
-
node_array.instance_variable_set("@default_port", _parent.port)
|
759
|
-
|
760
|
-
def node_array.<<(node)
|
761
|
-
node[:port] ||= @default_port
|
762
|
-
super
|
763
|
-
end
|
764
|
-
end
|
765
|
-
end
|
766
|
-
end
|
767
|
-
|
768
|
-
class MockPublicIpInternetServiceNode < Base
|
769
|
-
def ip_address
|
770
|
-
self[:ip_address]
|
771
|
-
end
|
772
|
-
|
773
|
-
def name
|
774
|
-
self[:name] || "Public IP Service Node #{object_id}"
|
775
|
-
end
|
776
|
-
|
777
|
-
def description
|
778
|
-
self[:description] || "Description for Public IP Service Node #{name}"
|
779
|
-
end
|
780
|
-
|
781
|
-
def port
|
782
|
-
self[:port]
|
783
|
-
end
|
784
|
-
|
785
|
-
def enabled
|
786
|
-
self[:enabled].to_s.downcase != "false"
|
787
|
-
end
|
788
|
-
|
789
|
-
def enabled=(new_value)
|
790
|
-
self[:enabled] = new_value
|
791
|
-
end
|
792
|
-
end
|
793
|
-
end
|
794
|
-
end
|
795
|
-
end
|
796
|
-
|
797
|
-
|
1
|
+
require 'fog/ecloud/collection'
|
798
2
|
module Fog
|
799
3
|
module Ecloud
|
800
4
|
class Model < Fog::Model
|
@@ -817,78 +21,239 @@ module Fog
|
|
817
21
|
end
|
818
22
|
end
|
819
23
|
end
|
820
|
-
|
821
24
|
module Fog
|
822
25
|
module Compute
|
26
|
+
|
27
|
+
|
823
28
|
class Ecloud < Fog::Service
|
824
29
|
|
825
|
-
|
30
|
+
API_URL = "https://services.enterprisecloud.terremark.com"
|
31
|
+
attr_reader :authentication_method, :version
|
826
32
|
|
827
|
-
|
828
|
-
|
33
|
+
#### Credentials
|
34
|
+
#requires
|
35
|
+
recognizes :ecloud_username, :ecloud_password, :ecloud_version, :ecloud_access_key, :ecloud_private_key, :ecloud_authentication_method
|
829
36
|
|
37
|
+
#### Models
|
830
38
|
model_path 'fog/ecloud/models/compute'
|
831
|
-
model :
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
39
|
+
model :organization
|
40
|
+
collection :organizations
|
41
|
+
model :location
|
42
|
+
collection :locations
|
43
|
+
model :catalog_item
|
44
|
+
collection :catalog
|
45
|
+
model :catalog_configuration
|
46
|
+
collection :catalog_configurations
|
47
|
+
model :environment
|
48
|
+
collection :environments
|
49
|
+
model :task
|
50
|
+
collection :tasks
|
51
|
+
model :compute_pool
|
52
|
+
collection :compute_pools
|
53
|
+
model :server
|
54
|
+
collection :servers
|
55
|
+
model :hardware_configuration
|
56
|
+
collection :hardware_configurations
|
57
|
+
model :server_configuration_option
|
58
|
+
collection :server_configuration_options
|
59
|
+
model :guest_process
|
60
|
+
collection :guest_processes
|
61
|
+
model :layout
|
62
|
+
collection :layouts
|
63
|
+
model :row
|
64
|
+
collection :rows
|
65
|
+
model :group
|
66
|
+
collection :groups
|
67
|
+
model :internet_service
|
68
|
+
collection :internet_services
|
69
|
+
model :node
|
70
|
+
collection :nodes
|
71
|
+
model :monitor
|
72
|
+
collection :monitors
|
73
|
+
model :cpu_usage_detail
|
74
|
+
collection :cpu_usage_detail_summary
|
75
|
+
model :memory_usage_detail
|
76
|
+
collection :memory_usage_detail_summary
|
77
|
+
model :storage_usage_detail
|
78
|
+
collection :storage_usage_detail_summary
|
79
|
+
model :operating_system_family
|
80
|
+
collection :operating_system_families
|
81
|
+
model :operating_system
|
82
|
+
collection :operating_systems
|
83
|
+
model :template
|
84
|
+
collection :templates
|
85
|
+
model :firewall_acl
|
86
|
+
collection :firewall_acls
|
87
|
+
model :network
|
88
|
+
collection :networks
|
89
|
+
model :ip_address
|
90
|
+
collection :ip_addresses
|
91
|
+
model :physical_device
|
92
|
+
collection :physical_devices
|
93
|
+
model :public_ip
|
94
|
+
collection :public_ips
|
95
|
+
model :trusted_network_group
|
96
|
+
collection :trusted_network_groups
|
97
|
+
model :backup_internet_service
|
98
|
+
collection :backup_internet_services
|
99
|
+
model :rnat
|
100
|
+
collection :rnats
|
101
|
+
model :association
|
102
|
+
collection :associations
|
103
|
+
model :tag
|
104
|
+
collection :tags
|
105
|
+
model :admin_organization
|
106
|
+
collection :admin_organizations
|
107
|
+
model :ssh_key
|
108
|
+
collection :ssh_keys
|
109
|
+
model :password_complexity_rule
|
110
|
+
collection :password_complexity_rules
|
111
|
+
model :authentication_level
|
112
|
+
collection :authentication_levels
|
113
|
+
model :login_banner
|
114
|
+
collection :login_banners
|
115
|
+
model :user
|
116
|
+
collection :users
|
117
|
+
model :role
|
118
|
+
collection :roles
|
119
|
+
model :ssh_key
|
120
|
+
collection :ssh_keys
|
121
|
+
model :support_ticket
|
122
|
+
collection :support_tickets
|
123
|
+
|
124
|
+
#### Requests
|
854
125
|
request_path 'fog/ecloud/requests/compute'
|
855
|
-
request :add_internet_service
|
856
|
-
request :add_backup_internet_service
|
857
|
-
request :add_node
|
858
|
-
request :clone_vapp
|
859
|
-
request :configure_internet_service
|
860
|
-
request :configure_network
|
861
|
-
request :configure_network_ip
|
862
|
-
request :configure_node
|
863
|
-
request :configure_vapp
|
864
|
-
request :delete_internet_service
|
865
|
-
request :delete_node
|
866
|
-
request :delete_vapp
|
867
|
-
request :get_catalog
|
868
|
-
request :get_catalog_item
|
869
|
-
request :get_customization_options
|
870
|
-
request :get_firewall_acls
|
871
|
-
request :get_firewall_acl
|
872
|
-
request :get_internet_services
|
873
|
-
request :get_network
|
874
|
-
request :get_network_ip
|
875
|
-
request :get_network_ips
|
876
|
-
request :get_network_extensions
|
877
126
|
request :get_organization
|
878
|
-
request :
|
879
|
-
request :
|
127
|
+
request :get_organizations
|
128
|
+
request :get_location
|
129
|
+
request :get_locations
|
130
|
+
request :get_environment
|
131
|
+
request :get_task
|
132
|
+
request :get_tasks
|
133
|
+
request :get_compute_pool
|
134
|
+
request :get_compute_pools
|
135
|
+
request :get_server
|
136
|
+
request :get_servers
|
137
|
+
request :get_network
|
138
|
+
request :get_networks
|
139
|
+
request :get_physical_device
|
140
|
+
request :get_physical_devices
|
141
|
+
request :get_layout
|
142
|
+
request :get_layouts
|
143
|
+
request :get_row
|
144
|
+
request :get_rows
|
145
|
+
request :get_group
|
146
|
+
request :get_groups
|
880
147
|
request :get_public_ip
|
881
148
|
request :get_public_ips
|
882
|
-
request :
|
883
|
-
request :
|
884
|
-
request :
|
885
|
-
request :
|
886
|
-
request :
|
887
|
-
request :
|
888
|
-
request :
|
889
|
-
request :
|
890
|
-
request :
|
149
|
+
request :get_network_summary
|
150
|
+
request :get_internet_service
|
151
|
+
request :get_internet_services
|
152
|
+
request :get_node
|
153
|
+
request :get_nodes
|
154
|
+
request :get_firewall_acl
|
155
|
+
request :get_firewall_acls
|
156
|
+
request :get_trusted_network_group
|
157
|
+
request :get_trusted_network_groups
|
158
|
+
request :get_catalog
|
159
|
+
request :get_catalog_item
|
160
|
+
request :get_tag
|
161
|
+
request :get_tags
|
162
|
+
request :get_hardware_configuration
|
163
|
+
request :get_hardware_configurations
|
164
|
+
request :get_server_configuration_option
|
165
|
+
request :get_server_configuration_options
|
166
|
+
request :get_guest_process
|
167
|
+
request :get_guest_processes
|
168
|
+
request :get_cpu_usage_detail
|
169
|
+
request :get_cpu_usage_detail_summary
|
170
|
+
request :get_memory_usage_detail
|
171
|
+
request :get_memory_usage_detail_summary
|
172
|
+
request :get_storage_usage_detail
|
173
|
+
request :get_storage_usage_detail_summary
|
174
|
+
request :get_operating_system_family
|
175
|
+
request :get_operating_system_families
|
176
|
+
request :get_operating_system
|
177
|
+
request :get_template
|
178
|
+
request :get_templates
|
179
|
+
request :get_monitor
|
180
|
+
request :get_monitors
|
181
|
+
request :get_backup_internet_service
|
182
|
+
request :get_backup_internet_services
|
183
|
+
request :get_rnat
|
184
|
+
request :get_rnats
|
185
|
+
request :get_association
|
186
|
+
request :get_associations
|
187
|
+
request :get_admin_organization
|
188
|
+
request :get_admin_organizations
|
189
|
+
request :get_ssh_key
|
190
|
+
request :get_ssh_keys
|
191
|
+
request :get_password_complexity_rule
|
192
|
+
request :get_password_complexity_rules
|
193
|
+
request :get_authentication_level
|
194
|
+
request :get_authentication_levels
|
195
|
+
request :get_login_banner
|
196
|
+
request :get_login_banners
|
197
|
+
request :get_user
|
198
|
+
request :get_users
|
199
|
+
request :get_role
|
200
|
+
request :get_roles
|
201
|
+
request :get_api_key
|
202
|
+
request :get_api_keys
|
203
|
+
request :get_support_ticket
|
204
|
+
request :get_support_tickets
|
205
|
+
request :get_ip_address
|
206
|
+
request :get_ip_addresses
|
207
|
+
request :get_catalog_configuration
|
208
|
+
request :get_catalog_configurations
|
209
|
+
request :compute_pool_edit
|
210
|
+
request :virtual_machine_create_from_template
|
211
|
+
request :virtual_machine_import
|
212
|
+
request :virtual_machine_copy
|
213
|
+
request :virtual_machine_copy_identical
|
214
|
+
request :virtual_machine_edit
|
215
|
+
request :virtual_machine_edit_hardware_configuration
|
216
|
+
request :virtual_machine_delete
|
217
|
+
request :internet_service_create
|
218
|
+
request :internet_service_edit
|
219
|
+
request :internet_service_delete
|
220
|
+
request :backup_internet_service_create
|
221
|
+
request :backup_internet_service_edit
|
222
|
+
request :backup_internet_service_delete
|
223
|
+
request :node_service_create
|
224
|
+
request :node_service_delete
|
225
|
+
request :node_service_edit
|
226
|
+
request :monitors_create_default
|
227
|
+
request :monitors_create_ping
|
228
|
+
request :monitors_create_http
|
229
|
+
request :monitors_create_ecv
|
230
|
+
request :monitors_create_loopback
|
231
|
+
request :monitors_edit_ping
|
232
|
+
request :monitors_edit_http
|
233
|
+
request :monitors_edit_ecv
|
234
|
+
request :monitors_enable
|
235
|
+
request :monitors_disable
|
236
|
+
request :rnat_associations_edit_network
|
237
|
+
request :rnat_associations_create_device
|
238
|
+
request :rnat_associations_delete
|
239
|
+
request :rows_create
|
240
|
+
request :rows_edit
|
241
|
+
request :rows_moveup
|
242
|
+
request :rows_movedown
|
243
|
+
request :rows_delete
|
244
|
+
request :groups_create
|
245
|
+
request :groups_edit
|
246
|
+
request :groups_moveup
|
247
|
+
request :groups_movedown
|
248
|
+
request :groups_delete
|
249
|
+
request :trusted_network_groups_create
|
250
|
+
request :trusted_network_groups_edit
|
251
|
+
request :trusted_network_groups_delete
|
252
|
+
request :firewall_acls_create
|
253
|
+
request :firewall_acls_delete
|
254
|
+
request :public_ip_activate
|
891
255
|
request :power_on
|
256
|
+
request :power_off
|
892
257
|
request :power_reset
|
893
258
|
request :power_shutdown
|
894
259
|
|
@@ -915,13 +280,12 @@ module Fog
|
|
915
280
|
# login handles the auth, but we just need the Set-Cookie
|
916
281
|
# header from that call.
|
917
282
|
def do_login
|
918
|
-
@login_results =
|
919
|
-
@cookie = @login_results.headers['Set-Cookie']
|
283
|
+
@login_results = get_organizations
|
920
284
|
end
|
921
285
|
|
922
286
|
def ecloud_xmlns
|
923
287
|
{
|
924
|
-
"xmlns" => "urn:tmrk:eCloudExtensions-2.
|
288
|
+
"xmlns" => "urn:tmrk:eCloudExtensions-2.8",
|
925
289
|
"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance"
|
926
290
|
}
|
927
291
|
end
|
@@ -944,178 +308,53 @@ module Fog
|
|
944
308
|
"xmlns:xsd" => "http://www.w3.org/2001/XMLSchema" }
|
945
309
|
end
|
946
310
|
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
include Fog::Ecloud::MockDataClasses
|
952
|
-
|
953
|
-
def self.base_url
|
954
|
-
"https://fakey.com/api/v0.8b-ext2.6"
|
311
|
+
def validate_data(required_opts = [], options = {})
|
312
|
+
unless required_opts.all? { |opt| options.has_key?(opt) }
|
313
|
+
raise ArgumentError.new("Required data missing: #{(required_opts - options.keys).map(&:inspect).join(", ")}")
|
314
|
+
end
|
955
315
|
end
|
956
316
|
|
957
|
-
|
958
|
-
@mock_data ||= MockData.new.tap do |vcloud_mock_data|
|
959
|
-
vcloud_mock_data.versions.clear
|
960
|
-
vcloud_mock_data.versions << MockVersion.new(:version => "v0.8b-ext2.6", :supported => true)
|
961
|
-
|
962
|
-
vcloud_mock_data.organizations << MockOrganization.new(:name => "Boom Inc.").tap do |mock_organization|
|
963
|
-
mock_organization.vdcs << MockVdc.new(:name => "Boomstick").tap do |mock_vdc|
|
964
|
-
mock_vdc.catalog.items << MockCatalogItem.new(:name => "Item 0").tap do |mock_catalog_item|
|
965
|
-
mock_catalog_item.disks << MockVirtualMachineDisk.new(:size => 25 * 1024)
|
966
|
-
end
|
967
|
-
mock_vdc.catalog.items << MockCatalogItem.new(:name => "Item 1").tap do |mock_catalog_item|
|
968
|
-
mock_catalog_item.disks << MockVirtualMachineDisk.new(:size => 25 * 1024)
|
969
|
-
end
|
970
|
-
mock_vdc.catalog.items << MockCatalogItem.new(:name => "Item 2").tap do |mock_catalog_item|
|
971
|
-
mock_catalog_item.disks << MockVirtualMachineDisk.new(:size => 25 * 1024)
|
972
|
-
end
|
973
|
-
|
974
|
-
mock_vdc.networks << MockNetwork.new({ :subnet => "1.2.3.0/24" }, mock_vdc)
|
975
|
-
mock_vdc.networks << MockNetwork.new({ :subnet => "4.5.6.0/24" }, mock_vdc)
|
976
|
-
|
977
|
-
mock_vdc.virtual_machines << MockVirtualMachine.new({ :name => "Broom 1", :ip => "1.2.3.3" }, mock_vdc)
|
978
|
-
mock_vdc.virtual_machines << MockVirtualMachine.new({ :name => "Broom 2", :ip => "1.2.3.4" }, mock_vdc)
|
979
|
-
mock_vdc.virtual_machines << MockVirtualMachine.new({ :name => "Email!", :ip => "1.2.3.10" }, mock_vdc)
|
980
|
-
end
|
981
|
-
|
982
|
-
mock_organization.vdcs << MockVdc.new(:name => "Rock-n-Roll", :storage_allocated => 150, :storage_used => 40, :cpu_allocated => 1000, :memory_allocated => 2048).tap do |mock_vdc|
|
983
|
-
mock_vdc.networks << MockNetwork.new({ :subnet => "7.8.9.0/24" }, mock_vdc)
|
984
|
-
|
985
|
-
mock_vdc.virtual_machines << MockVirtualMachine.new({ :name => "Master Blaster", :ip => "7.8.9.10" }, mock_vdc)
|
986
|
-
end
|
987
|
-
end
|
988
|
-
|
989
|
-
vcloud_mock_data.organizations.detect {|o| o.name == "Boom Inc." }.tap do |mock_organization|
|
990
|
-
mock_organization.vdcs.detect {|v| v.name == "Boomstick" }.tap do |mock_vdc|
|
991
|
-
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.1.2.3").tap do |mock_public_ip|
|
992
|
-
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
993
|
-
:protocol => "HTTP",
|
994
|
-
:port => 80,
|
995
|
-
:name => "Web Site",
|
996
|
-
:description => "Web Servers",
|
997
|
-
:redirect_url => "http://fakey.com"
|
998
|
-
}, mock_public_ip.internet_service_collection
|
999
|
-
).tap do |mock_public_ip_service|
|
1000
|
-
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({:ip_address => "1.2.3.5", :name => "Test Node 1", :description => "web 1"}, mock_public_ip_service.node_collection)
|
1001
|
-
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({:ip_address => "1.2.3.6", :name => "Test Node 2", :description => "web 2"}, mock_public_ip_service.node_collection)
|
1002
|
-
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({:ip_address => "1.2.3.7", :name => "Test Node 3", :description => "web 3"}, mock_public_ip_service.node_collection)
|
1003
|
-
end
|
1004
|
-
|
1005
|
-
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
1006
|
-
:protocol => "TCP",
|
1007
|
-
:port => 7000,
|
1008
|
-
:name => "An SSH Map",
|
1009
|
-
:description => "SSH 1"
|
1010
|
-
}, mock_public_ip.internet_service_collection
|
1011
|
-
).tap do |mock_public_ip_service|
|
1012
|
-
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({ :ip_address => "1.2.3.5", :port => 22, :name => "SSH", :description => "web ssh" }, mock_public_ip_service.node_collection)
|
1013
|
-
end
|
1014
|
-
end
|
1015
|
-
|
1016
|
-
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.1.2.4").tap do |mock_public_ip|
|
1017
|
-
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
1018
|
-
:protocol => "HTTP",
|
1019
|
-
:port => 80,
|
1020
|
-
:name => "Web Site",
|
1021
|
-
:description => "Web Servers",
|
1022
|
-
:redirect_url => "http://fakey.com"
|
1023
|
-
}, mock_public_ip.internet_service_collection
|
1024
|
-
)
|
1025
|
-
|
1026
|
-
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
1027
|
-
:protocol => "TCP",
|
1028
|
-
:port => 7000,
|
1029
|
-
:name => "An SSH Map",
|
1030
|
-
:description => "SSH 2"
|
1031
|
-
}, mock_public_ip.internet_service_collection
|
1032
|
-
)
|
1033
|
-
end
|
1034
|
-
|
1035
|
-
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.1.9.7")
|
1036
|
-
|
1037
|
-
mock_vdc.internet_service_collection.backup_internet_services << MockBackupInternetService.new({ :port => 10000, :protocol => "TCP"}, self)
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
mock_organization.vdcs.detect {|v| v.name == "Rock-n-Roll" }.tap do |mock_vdc|
|
1041
|
-
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.99.99.99")
|
1042
|
-
end
|
1043
|
-
end
|
317
|
+
end
|
1044
318
|
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
end
|
1050
|
-
vdc.virtual_machines.each do |virtual_machine|
|
1051
|
-
virtual_machine.disks << MockVirtualMachineDisk.new(:size => 25 * 1024)
|
1052
|
-
virtual_machine.disks << MockVirtualMachineDisk.new(:size => 50 * 1024)
|
1053
|
-
end
|
1054
|
-
end
|
1055
|
-
end
|
319
|
+
class Mock
|
320
|
+
def self.data
|
321
|
+
@data ||= Hash.new do |hash, key|
|
322
|
+
hash[key] = {}
|
1056
323
|
end
|
1057
324
|
end
|
1058
325
|
|
1059
326
|
def self.reset
|
1060
|
-
@
|
1061
|
-
end
|
1062
|
-
|
1063
|
-
def self.data_reset
|
1064
|
-
Fog::Logger.deprecation("#{self} => #data_reset is deprecated, use #reset instead [light_black](#{caller.first})[/]")
|
1065
|
-
self.reset
|
1066
|
-
end
|
1067
|
-
|
1068
|
-
def initialize(options = {})
|
1069
|
-
require 'builder'
|
1070
|
-
require 'fog/core/parser'
|
1071
|
-
|
1072
|
-
@versions_uri = URI.parse('https://vcloud.fakey.com/api/versions')
|
327
|
+
@data = nil
|
1073
328
|
end
|
1074
329
|
|
1075
|
-
def
|
1076
|
-
|
330
|
+
def initialize(options={})
|
331
|
+
@ecloud_api_key = options[:ecloud]
|
1077
332
|
end
|
1078
333
|
|
1079
|
-
def
|
1080
|
-
|
334
|
+
def data
|
335
|
+
self.class.data[@ecloud_api_key]
|
1081
336
|
end
|
1082
337
|
|
1083
|
-
def
|
1084
|
-
|
1085
|
-
|
1086
|
-
#Parse the response body into a hash
|
1087
|
-
if mock_data.empty?
|
1088
|
-
response.body = mock_data
|
1089
|
-
else
|
1090
|
-
document = Fog::ToHashDocument.new
|
1091
|
-
parser = Nokogiri::XML::SAX::PushParser.new(document)
|
1092
|
-
parser << mock_data
|
1093
|
-
parser.finish
|
1094
|
-
response.body = document.body
|
1095
|
-
end
|
1096
|
-
|
1097
|
-
response.status = status
|
1098
|
-
response.headers = mock_headers
|
1099
|
-
response
|
338
|
+
def reset_data
|
339
|
+
self.class.data.delete(@ecloud_api_key)
|
1100
340
|
end
|
1101
|
-
|
1102
341
|
end
|
1103
342
|
|
343
|
+
|
1104
344
|
class Real
|
1105
345
|
include Shared
|
1106
346
|
|
1107
347
|
class << self
|
1108
|
-
|
1109
348
|
def basic_request(*args)
|
1110
349
|
self.class_eval <<-EOS, __FILE__,__LINE__
|
1111
350
|
def #{args[0]}(uri)
|
1112
351
|
request({
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
352
|
+
:expects => #{args[1] || 200},
|
353
|
+
:method => '#{args[2] || 'GET'}',
|
354
|
+
:headers => #{args[3] ? args[3].inspect : '{}'},
|
355
|
+
:body => '#{args[4] ? args[4] : ''}',
|
356
|
+
:parse => true,
|
357
|
+
:uri => uri })
|
1119
358
|
end
|
1120
359
|
EOS
|
1121
360
|
end
|
@@ -1124,142 +363,56 @@ module Fog
|
|
1124
363
|
self.class_eval <<-EOS, __FILE__,__LINE__
|
1125
364
|
def #{args[0]}(uri)
|
1126
365
|
unauthenticated_request({
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
366
|
+
:expects => #{args[1] || 200},
|
367
|
+
:method => '#{args[2] || 'GET'}',
|
368
|
+
:headers => #{args[3] ? args[3].inspect : '{}'},
|
369
|
+
:parse => true,
|
370
|
+
:uri => uri })
|
1132
371
|
end
|
1133
372
|
EOS
|
1134
373
|
end
|
1135
|
-
|
1136
374
|
end
|
1137
375
|
|
376
|
+
|
1138
377
|
def initialize(options = {})
|
1139
378
|
require 'builder'
|
1140
379
|
require 'fog/core/parser'
|
1141
|
-
|
1142
|
-
@
|
1143
|
-
@
|
1144
|
-
@
|
1145
|
-
@version
|
1146
|
-
@
|
1147
|
-
@
|
1148
|
-
@
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
end
|
1156
|
-
case @login_results.body[:Org]
|
1157
|
-
when Array
|
1158
|
-
@login_results.body[:Org].first[:href]
|
1159
|
-
when Hash
|
1160
|
-
@login_results.body[:Org][:href]
|
1161
|
-
else
|
1162
|
-
nil
|
380
|
+
@connections = {}
|
381
|
+
@connection_options = options[:connection_options] || {}
|
382
|
+
@host = options[:ecloud_host] || API_URL
|
383
|
+
@persistent = options[:persistent] || false
|
384
|
+
@version = options[:ecloud_version] || "2012-03-01"
|
385
|
+
@authentication_method = options[:ecloud_authentication_method] || :cloud_api_auth
|
386
|
+
@access_key = options[:ecloud_access_key]
|
387
|
+
@private_key = options[:ecloud_private_key]
|
388
|
+
if @private_key.nil? || @authentication_method == :basic_auth
|
389
|
+
@authentication_method = :basic_auth
|
390
|
+
@username = options[:ecloud_username]
|
391
|
+
@password = options[:ecloud_password]
|
392
|
+
if @username.nil? || @password.nil?
|
393
|
+
raise RuntimeError, "No credentials (cloud auth, or basic auth) passed!"
|
1163
394
|
end
|
395
|
+
else
|
396
|
+
@hmac = Fog::HMAC.new("sha256", @private_key)
|
1164
397
|
end
|
1165
398
|
end
|
1166
399
|
|
1167
|
-
def
|
1168
|
-
|
400
|
+
def default_organization_uri
|
401
|
+
"/cloudapi/ecloud/organizations/"
|
1169
402
|
end
|
1170
403
|
|
1171
|
-
# If the cookie isn't set, do a get_organizations call to set it
|
1172
|
-
# and try the request.
|
1173
|
-
# If we get an Unauthorized error, we assume the token expired, re-auth and try again
|
1174
404
|
def request(params)
|
1175
|
-
unless @cookie
|
1176
|
-
do_login
|
1177
|
-
end
|
1178
405
|
begin
|
1179
406
|
do_request(params)
|
1180
407
|
rescue Excon::Errors::Unauthorized => e
|
1181
|
-
|
1182
|
-
do_request(params)
|
1183
|
-
end
|
1184
|
-
end
|
1185
|
-
|
1186
|
-
def supporting_versions
|
1187
|
-
["v0.8b-ext2.6", "0.8b-ext2.6", "v0.8b-ext2.8" , "0.8b-ext2.8"]
|
1188
|
-
end
|
1189
|
-
|
1190
|
-
private
|
1191
|
-
|
1192
|
-
def ensure_parsed(uri)
|
1193
|
-
if uri.is_a?(String)
|
1194
|
-
URI.parse(uri)
|
1195
|
-
else
|
1196
|
-
uri
|
408
|
+
raise RuntimeError, "Invalid authentication data: #{e}"
|
1197
409
|
end
|
1198
410
|
end
|
1199
411
|
|
1200
|
-
def supported_version_numbers
|
1201
|
-
case supported_versions
|
1202
|
-
when Array
|
1203
|
-
supported_versions.map { |version| version[:Version] }
|
1204
|
-
when Hash
|
1205
|
-
[ supported_versions[:Version] ]
|
1206
|
-
end
|
1207
|
-
end
|
1208
|
-
|
1209
|
-
def get_login_uri
|
1210
|
-
check_versions
|
1211
|
-
URI.parse case supported_versions
|
1212
|
-
when Array
|
1213
|
-
supported_versions.detect {|version| version[:Version] == @version }[:LoginUrl]
|
1214
|
-
when Hash
|
1215
|
-
supported_versions[:LoginUrl]
|
1216
|
-
end
|
1217
|
-
end
|
1218
|
-
|
1219
|
-
# If we don't support any versions the service does, then raise an error.
|
1220
|
-
# If the @version that super selected isn't in our supported list, then select one that is.
|
1221
|
-
def check_versions
|
1222
|
-
if @version
|
1223
|
-
unless supported_version_numbers.include?(@version.to_s)
|
1224
|
-
raise UnsupportedVersion.new("#{@version} is not supported by the server.")
|
1225
|
-
end
|
1226
|
-
unless supporting_versions.include?(@version.to_s)
|
1227
|
-
raise UnsupportedVersion.new("#{@version} is not supported by #{self.class}")
|
1228
|
-
end
|
1229
|
-
else
|
1230
|
-
unless @version = (supported_version_numbers & supporting_versions).sort.first
|
1231
|
-
raise UnsupportedVersion.new("\nService @ #{@versions_uri} supports: #{supported_version_numbers.join(', ')}\n" +
|
1232
|
-
"#{self.class} supports: #{supporting_versions.join(', ')}")
|
1233
|
-
end
|
1234
|
-
end
|
1235
|
-
end
|
1236
|
-
|
1237
|
-
# Don't need to set the cookie for these or retry them if the cookie timed out
|
1238
|
-
def unauthenticated_request(params)
|
1239
|
-
do_request(params)
|
1240
|
-
end
|
1241
|
-
|
1242
|
-
# Use this to set the Authorization header for login
|
1243
|
-
def authorization_header
|
1244
|
-
"Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}"
|
1245
|
-
end
|
1246
|
-
|
1247
|
-
def login_uri
|
1248
|
-
@login_uri ||= get_login_uri
|
1249
|
-
end
|
1250
|
-
|
1251
|
-
# login handles the auth, but we just need the Set-Cookie
|
1252
|
-
# header from that call.
|
1253
|
-
def do_login
|
1254
|
-
@login_results = login
|
1255
|
-
@cookie = @login_results.headers['Set-Cookie']
|
1256
|
-
end
|
1257
|
-
|
1258
|
-
# Actually do the request
|
1259
412
|
def do_request(params)
|
1260
413
|
# Convert the uri to a URI if it's a string.
|
1261
414
|
if params[:uri].is_a?(String)
|
1262
|
-
params[:uri] = URI.parse(params[:uri])
|
415
|
+
params[:uri] = URI.parse(@host + params[:uri])
|
1263
416
|
end
|
1264
417
|
host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ":#{params[:uri].port}" : ''}"
|
1265
418
|
|
@@ -1268,24 +421,17 @@ module Fog
|
|
1268
421
|
@connections[host_url] ||= Fog::Connection.new(host_url, @persistent, @connection_options)
|
1269
422
|
|
1270
423
|
# Set headers to an empty hash if none are set.
|
1271
|
-
headers = params
|
1272
|
-
|
1273
|
-
# Add our auth cookie to the headers
|
1274
|
-
if @cookie
|
1275
|
-
headers.merge!('Cookie' => @cookie)
|
1276
|
-
end
|
424
|
+
headers = set_extra_headers_for(params) || set_extra_headers_for({})
|
1277
425
|
|
1278
426
|
# Make the request
|
1279
|
-
|
1280
|
-
|
1281
|
-
:
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
})
|
427
|
+
options = {:expects => params[:expects] || 200, :method => params[:method] || 'GET', :path => params[:uri].path + "#{"?#{params[:uri].query}" if params[:uri].query}", :headers => headers}
|
428
|
+
unless params[:body].empty?
|
429
|
+
options.merge!({:body => params[:body]})
|
430
|
+
end
|
431
|
+
#puts options[:body].inspect
|
432
|
+
response = @connections[host_url].request(options)
|
1286
433
|
|
1287
434
|
# Parse the response body into a hash
|
1288
|
-
#puts response.body
|
1289
435
|
unless response.body.empty?
|
1290
436
|
if params[:parse]
|
1291
437
|
document = Fog::ToHashDocument.new
|
@@ -1296,12 +442,72 @@ module Fog
|
|
1296
442
|
response.body = document.body
|
1297
443
|
end
|
1298
444
|
end
|
1299
|
-
|
1300
445
|
response
|
1301
446
|
end
|
1302
447
|
|
448
|
+
private
|
449
|
+
|
450
|
+
# if Authorization and x-tmrk-authorization are used, the x-tmrk-authorization takes precendence.
|
451
|
+
def set_extra_headers_for(params)
|
452
|
+
maor_headers = {
|
453
|
+
'x-tmrk-version' => @version,
|
454
|
+
'Date' => Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S GMT"),
|
455
|
+
}
|
456
|
+
params[:headers].merge!(maor_headers)
|
457
|
+
if params[:method]=="POST" || params[:method]=="PUT"
|
458
|
+
params[:headers].merge!({"Content-Type" => 'application/xml'})
|
459
|
+
params[:headers].merge!({"Accept" => 'application/xml'})
|
460
|
+
end
|
461
|
+
unless params[:body].empty?
|
462
|
+
params[:headers].merge!({"x-tmrk-contenthash" => "Sha256 #{Base64.encode64(Digest::SHA2.digest(params[:body].to_s)).chomp}"})
|
463
|
+
end
|
464
|
+
if @authentication_method == :basic_auth
|
465
|
+
params[:headers].merge!({'Authorization' => "Basic #{Base64.encode64(@username+":"+@password).delete("\r\n")}"})
|
466
|
+
elsif @authentication_method == :cloud_api_auth
|
467
|
+
signature = cloud_api_signature(params)
|
468
|
+
params[:headers].merge!({
|
469
|
+
"x-tmrk-authorization" => %{CloudApi AccessKey="#{@access_key}" SignatureType="HmacSha256" Signature="#{signature}"}
|
470
|
+
})
|
471
|
+
end
|
472
|
+
params[:headers]
|
473
|
+
end
|
474
|
+
|
475
|
+
def cloud_api_signature(params)
|
476
|
+
verb = params[:method].upcase
|
477
|
+
headers = params[:headers]
|
478
|
+
path = params[:uri].path
|
479
|
+
canonicalized_headers = canonicalize_headers(headers)
|
480
|
+
canonicalized_resource = canonicalize_resource(path)
|
481
|
+
string = [ verb,
|
482
|
+
headers['Content-Length'].to_s,
|
483
|
+
headers['Content-Type'].to_s,
|
484
|
+
headers['Date'].to_s,
|
485
|
+
canonicalized_headers,
|
486
|
+
canonicalized_resource + "\n"
|
487
|
+
].join("\n")
|
488
|
+
Base64.encode64(@hmac.sign(string)).chomp
|
489
|
+
end
|
490
|
+
|
491
|
+
|
492
|
+
# section 5.6.3.2 in the ~1000 page pdf spec
|
493
|
+
def canonicalize_headers(headers)
|
494
|
+
tmp = headers.inject({}) {|ret, h| ret[h.first.downcase] = h.last if h.first.match(/^x-tmrk/i) ; ret }
|
495
|
+
tmp.reject! {|k,v| k == "x-tmrk-authorization" }
|
496
|
+
tmp = tmp.sort.map{|e| "#{e.first}:#{e.last}" }.join("\n")
|
497
|
+
tmp
|
498
|
+
end
|
499
|
+
|
500
|
+
# section 5.6.3.3 in the ~1000 page pdf spec
|
501
|
+
def canonicalize_resource(path)
|
502
|
+
uri, query_string = path.split("?")
|
503
|
+
return uri if query_string.nil?
|
504
|
+
query_string_pairs = query_string.split("&").sort.map{|e| e.split("=") }
|
505
|
+
tm_query_string = query_string_pairs.map{|x| "#{x.first.downcase}:#{x.last}" }.join("\n")
|
506
|
+
"#{uri.downcase}\n#{tm_query_string}\n"
|
507
|
+
end
|
1303
508
|
end
|
1304
509
|
|
510
|
+
|
1305
511
|
end
|
1306
512
|
end
|
1307
513
|
end
|