fog-maestrodev 1.7.0.20121114190951 → 1.8.0.20130109172219
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -2
- data/README.md +48 -37
- data/RELEASE.md +39 -0
- data/Rakefile +48 -312
- data/bin/fog +4 -0
- data/changelog.txt +153 -0
- data/docs/storage/aws.markdown +21 -0
- data/fog.gemspec +3 -3
- data/lib/fog.rb +0 -5
- data/lib/fog/atmos/models/storage/directories.rb +2 -2
- data/lib/fog/atmos/models/storage/directory.rb +11 -11
- data/lib/fog/atmos/models/storage/file.rb +8 -8
- data/lib/fog/atmos/models/storage/files.rb +3 -3
- data/lib/fog/aws.rb +1 -0
- data/lib/fog/aws/auto_scaling.rb +1 -1
- data/lib/fog/aws/cloud_watch.rb +1 -1
- data/lib/fog/aws/compute.rb +4 -2
- data/lib/fog/aws/dynamodb.rb +30 -64
- data/lib/fog/aws/elb.rb +1 -1
- data/lib/fog/aws/glacier.rb +1 -1
- data/lib/fog/aws/iam.rb +1 -0
- data/lib/fog/aws/models/auto_scaling/activities.rb +2 -2
- data/lib/fog/aws/models/auto_scaling/activity.rb +1 -1
- data/lib/fog/aws/models/auto_scaling/configuration.rb +2 -2
- data/lib/fog/aws/models/auto_scaling/configurations.rb +2 -2
- data/lib/fog/aws/models/auto_scaling/group.rb +13 -13
- data/lib/fog/aws/models/auto_scaling/groups.rb +2 -2
- data/lib/fog/aws/models/auto_scaling/instance.rb +5 -5
- data/lib/fog/aws/models/auto_scaling/instances.rb +2 -2
- data/lib/fog/aws/models/auto_scaling/policies.rb +2 -2
- data/lib/fog/aws/models/auto_scaling/policy.rb +2 -2
- data/lib/fog/aws/models/beanstalk/application.rb +7 -7
- data/lib/fog/aws/models/beanstalk/applications.rb +2 -2
- data/lib/fog/aws/models/beanstalk/environment.rb +10 -10
- data/lib/fog/aws/models/beanstalk/environments.rb +2 -2
- data/lib/fog/aws/models/beanstalk/events.rb +1 -1
- data/lib/fog/aws/models/beanstalk/template.rb +5 -5
- data/lib/fog/aws/models/beanstalk/templates.rb +3 -3
- data/lib/fog/aws/models/beanstalk/version.rb +6 -6
- data/lib/fog/aws/models/beanstalk/versions.rb +2 -2
- data/lib/fog/aws/models/cdn/distribution.rb +4 -4
- data/lib/fog/aws/models/cdn/distributions.rb +2 -2
- data/lib/fog/aws/models/cdn/invalidation.rb +2 -2
- data/lib/fog/aws/models/cdn/invalidations.rb +2 -2
- data/lib/fog/aws/models/cdn/streaming_distribution.rb +3 -3
- data/lib/fog/aws/models/cdn/streaming_distributions.rb +2 -2
- data/lib/fog/aws/models/cloud_watch/alarm.rb +2 -2
- data/lib/fog/aws/models/cloud_watch/alarm_data.rb +9 -9
- data/lib/fog/aws/models/cloud_watch/alarm_datum.rb +3 -3
- data/lib/fog/aws/models/cloud_watch/alarm_histories.rb +1 -1
- data/lib/fog/aws/models/cloud_watch/alarms.rb +7 -7
- data/lib/fog/aws/models/cloud_watch/metric_statistic.rb +2 -2
- data/lib/fog/aws/models/cloud_watch/metric_statistics.rb +3 -3
- data/lib/fog/aws/models/cloud_watch/metrics.rb +27 -7
- data/lib/fog/aws/models/compute/address.rb +9 -9
- data/lib/fog/aws/models/compute/addresses.rb +2 -2
- data/lib/fog/aws/models/compute/dhcp_option.rb +3 -3
- data/lib/fog/aws/models/compute/dhcp_options.rb +2 -2
- data/lib/fog/aws/models/compute/flavors.rb +1 -1
- data/lib/fog/aws/models/compute/image.rb +2 -2
- data/lib/fog/aws/models/compute/images.rb +5 -5
- data/lib/fog/aws/models/compute/internet_gateway.rb +4 -4
- data/lib/fog/aws/models/compute/internet_gateways.rb +2 -2
- data/lib/fog/aws/models/compute/key_pair.rb +4 -4
- data/lib/fog/aws/models/compute/key_pairs.rb +2 -2
- data/lib/fog/aws/models/compute/network_interface.rb +3 -3
- data/lib/fog/aws/models/compute/network_interfaces.rb +2 -2
- data/lib/fog/aws/models/compute/security_group.rb +7 -7
- data/lib/fog/aws/models/compute/security_groups.rb +3 -3
- data/lib/fog/aws/models/compute/server.rb +22 -16
- data/lib/fog/aws/models/compute/servers.rb +6 -6
- data/lib/fog/aws/models/compute/snapshot.rb +4 -4
- data/lib/fog/aws/models/compute/snapshots.rb +3 -3
- data/lib/fog/aws/models/compute/spot_request.rb +18 -8
- data/lib/fog/aws/models/compute/spot_requests.rb +11 -11
- data/lib/fog/aws/models/compute/subnet.rb +3 -3
- data/lib/fog/aws/models/compute/subnets.rb +2 -2
- data/lib/fog/aws/models/compute/tag.rb +2 -2
- data/lib/fog/aws/models/compute/tags.rb +3 -3
- data/lib/fog/aws/models/compute/volume.rb +12 -13
- data/lib/fog/aws/models/compute/volumes.rb +2 -2
- data/lib/fog/aws/models/compute/vpc.rb +2 -2
- data/lib/fog/aws/models/compute/vpcs.rb +2 -2
- data/lib/fog/aws/models/dns/record.rb +4 -4
- data/lib/fog/aws/models/dns/records.rb +3 -3
- data/lib/fog/aws/models/dns/zone.rb +3 -3
- data/lib/fog/aws/models/dns/zones.rb +2 -2
- data/lib/fog/aws/models/elasticache/cluster.rb +2 -2
- data/lib/fog/aws/models/elasticache/clusters.rb +2 -2
- data/lib/fog/aws/models/elasticache/parameter_group.rb +2 -2
- data/lib/fog/aws/models/elasticache/parameter_groups.rb +2 -2
- data/lib/fog/aws/models/elasticache/security_group.rb +4 -4
- data/lib/fog/aws/models/elasticache/security_groups.rb +2 -2
- data/lib/fog/aws/models/elb/listener.rb +2 -2
- data/lib/fog/aws/models/elb/load_balancer.rb +19 -19
- data/lib/fog/aws/models/elb/load_balancers.rb +2 -2
- data/lib/fog/aws/models/elb/policy.rb +3 -3
- data/lib/fog/aws/models/glacier/archive.rb +7 -7
- data/lib/fog/aws/models/glacier/job.rb +2 -2
- data/lib/fog/aws/models/glacier/jobs.rb +3 -3
- data/lib/fog/aws/models/glacier/vault.rb +7 -7
- data/lib/fog/aws/models/glacier/vaults.rb +2 -2
- data/lib/fog/aws/models/iam/access_key.rb +8 -8
- data/lib/fog/aws/models/iam/access_keys.rb +7 -7
- data/lib/fog/aws/models/iam/policies.rb +10 -10
- data/lib/fog/aws/models/iam/policy.rb +8 -8
- data/lib/fog/aws/models/iam/user.rb +10 -10
- data/lib/fog/aws/models/iam/users.rb +2 -2
- data/lib/fog/aws/models/rds/parameter.rb +2 -2
- data/lib/fog/aws/models/rds/parameter_group.rb +10 -10
- data/lib/fog/aws/models/rds/parameter_groups.rb +3 -3
- data/lib/fog/aws/models/rds/parameters.rb +2 -2
- data/lib/fog/aws/models/rds/security_group.rb +4 -4
- data/lib/fog/aws/models/rds/security_groups.rb +2 -2
- data/lib/fog/aws/models/rds/server.rb +10 -10
- data/lib/fog/aws/models/rds/servers.rb +3 -3
- data/lib/fog/aws/models/rds/snapshot.rb +3 -3
- data/lib/fog/aws/models/rds/snapshots.rb +3 -3
- data/lib/fog/aws/models/rds/subnet_groups.rb +2 -2
- data/lib/fog/aws/models/storage/directories.rb +2 -2
- data/lib/fog/aws/models/storage/directory.rb +13 -13
- data/lib/fog/aws/models/storage/file.rb +106 -14
- data/lib/fog/aws/models/storage/files.rb +5 -5
- data/lib/fog/aws/models/storage/version.rb +2 -2
- data/lib/fog/aws/models/storage/versions.rb +3 -3
- data/lib/fog/aws/parsers/compute/copy_snapshot.rb +22 -0
- data/lib/fog/aws/parsers/compute/describe_instances.rb +3 -1
- data/lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb +1 -1
- data/lib/fog/aws/parsers/compute/spot_instance_requests.rb +5 -3
- data/lib/fog/aws/parsers/storage/cors_configuration.rb +41 -0
- data/lib/fog/aws/parsers/storage/delete_multiple_objects.rb +50 -0
- data/lib/fog/aws/rds.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/resume_processes.rb +10 -1
- data/lib/fog/aws/requests/auto_scaling/suspend_processes.rb +7 -2
- data/lib/fog/aws/requests/cloud_watch/list_metrics.rb +27 -0
- data/lib/fog/aws/requests/compute/copy_snapshot.rb +58 -0
- data/lib/fog/aws/requests/compute/describe_availability_zones.rb +3 -0
- data/lib/fog/aws/requests/compute/describe_reserved_instances_offerings.rb +11 -8
- data/lib/fog/aws/requests/compute/modify_volume_attribute.rb +51 -0
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +1 -0
- data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +5 -7
- data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +12 -16
- data/lib/fog/aws/requests/storage/copy_object.rb +19 -20
- data/lib/fog/aws/requests/storage/cors_utils.rb +41 -0
- data/lib/fog/aws/requests/storage/delete_bucket.rb +4 -7
- data/lib/fog/aws/requests/storage/delete_bucket_cors.rb +29 -0
- data/lib/fog/aws/requests/storage/delete_bucket_lifecycle.rb +4 -7
- data/lib/fog/aws/requests/storage/delete_bucket_policy.rb +5 -8
- data/lib/fog/aws/requests/storage/delete_bucket_website.rb +4 -7
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +167 -0
- data/lib/fog/aws/requests/storage/delete_object.rb +5 -8
- data/lib/fog/aws/requests/storage/get_bucket.rb +25 -28
- data/lib/fog/aws/requests/storage/get_bucket_acl.rb +15 -18
- data/lib/fog/aws/requests/storage/get_bucket_cors.rb +65 -0
- data/lib/fog/aws/requests/storage/get_bucket_lifecycle.rb +9 -12
- data/lib/fog/aws/requests/storage/get_bucket_location.rb +5 -8
- data/lib/fog/aws/requests/storage/get_bucket_logging.rb +15 -18
- data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +37 -43
- data/lib/fog/aws/requests/storage/get_bucket_policy.rb +4 -7
- data/lib/fog/aws/requests/storage/get_bucket_versioning.rb +6 -9
- data/lib/fog/aws/requests/storage/get_bucket_website.rb +9 -11
- data/lib/fog/aws/requests/storage/get_object.rb +17 -20
- data/lib/fog/aws/requests/storage/get_object_acl.rb +18 -21
- data/lib/fog/aws/requests/storage/get_object_http_url.rb +6 -9
- data/lib/fog/aws/requests/storage/get_object_https_url.rb +6 -9
- data/lib/fog/aws/requests/storage/get_object_torrent.rb +15 -18
- data/lib/fog/aws/requests/storage/get_object_url.rb +7 -10
- data/lib/fog/aws/requests/storage/get_request_payment.rb +5 -8
- data/lib/fog/aws/requests/storage/get_service.rb +9 -11
- data/lib/fog/aws/requests/storage/head_object.rb +21 -21
- data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +18 -19
- data/lib/fog/aws/requests/storage/put_bucket_cors.rb +51 -0
- data/lib/fog/aws/signaturev4.rb +1 -1
- data/lib/fog/aws/sqs.rb +1 -1
- data/lib/fog/aws/storage.rb +10 -1
- data/lib/fog/bluebox/models/compute/flavors.rb +2 -2
- data/lib/fog/bluebox/models/compute/image.rb +8 -8
- data/lib/fog/bluebox/models/compute/images.rb +2 -2
- data/lib/fog/bluebox/models/compute/locations.rb +2 -2
- data/lib/fog/bluebox/models/compute/server.rb +10 -10
- data/lib/fog/bluebox/models/compute/servers.rb +2 -2
- data/lib/fog/bluebox/models/dns/record.rb +3 -3
- data/lib/fog/bluebox/models/dns/records.rb +2 -2
- data/lib/fog/bluebox/models/dns/zone.rb +3 -3
- data/lib/fog/bluebox/models/dns/zones.rb +2 -2
- data/lib/fog/bluebox/requests/compute/create_block.rb +3 -5
- data/lib/fog/brightbox/compute.rb +284 -82
- data/lib/fog/brightbox/models/compute/account.rb +9 -3
- data/lib/fog/brightbox/models/compute/accounts.rb +3 -3
- data/lib/fog/brightbox/models/compute/api_client.rb +4 -4
- data/lib/fog/brightbox/models/compute/api_clients.rb +2 -2
- data/lib/fog/brightbox/models/compute/application.rb +2 -2
- data/lib/fog/brightbox/models/compute/applications.rb +3 -3
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +4 -3
- data/lib/fog/brightbox/models/compute/cloud_ips.rb +4 -4
- data/lib/fog/brightbox/models/compute/firewall_policies.rb +3 -3
- data/lib/fog/brightbox/models/compute/firewall_policy.rb +5 -5
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +3 -3
- data/lib/fog/brightbox/models/compute/firewall_rules.rb +2 -2
- data/lib/fog/brightbox/models/compute/flavors.rb +3 -3
- data/lib/fog/brightbox/models/compute/image.rb +3 -3
- data/lib/fog/brightbox/models/compute/images.rb +2 -2
- data/lib/fog/brightbox/models/compute/load_balancer.rb +3 -3
- data/lib/fog/brightbox/models/compute/load_balancers.rb +2 -2
- data/lib/fog/brightbox/models/compute/server.rb +25 -18
- data/lib/fog/brightbox/models/compute/server_group.rb +6 -6
- data/lib/fog/brightbox/models/compute/server_groups.rb +3 -3
- data/lib/fog/brightbox/models/compute/servers.rb +35 -3
- data/lib/fog/brightbox/models/compute/user.rb +1 -1
- data/lib/fog/brightbox/models/compute/users.rb +3 -3
- data/lib/fog/brightbox/models/compute/zones.rb +3 -3
- data/lib/fog/brightbox/oauth2.rb +164 -0
- data/lib/fog/brightbox/requests/compute/activate_console_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +12 -3
- data/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +12 -3
- data/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +10 -12
- data/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +12 -3
- data/lib/fog/brightbox/requests/compute/create_api_client.rb +12 -3
- data/lib/fog/brightbox/requests/compute/create_application.rb +12 -3
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +12 -2
- data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +14 -3
- data/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +18 -3
- data/lib/fog/brightbox/requests/compute/create_image.rb +19 -3
- data/lib/fog/brightbox/requests/compute/create_load_balancer.rb +15 -3
- data/lib/fog/brightbox/requests/compute/create_server.rb +18 -3
- data/lib/fog/brightbox/requests/compute/create_server_group.rb +12 -3
- data/lib/fog/brightbox/requests/compute/destroy_api_client.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_application.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_firewall_policy.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_firewall_rule.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_image.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_load_balancer.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/destroy_server_group.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_account.rb +8 -16
- data/lib/fog/brightbox/requests/compute/get_api_client.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_application.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +2 -4
- data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_image.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_interface.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_load_balancer.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +2 -6
- data/lib/fog/brightbox/requests/compute/get_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_server_group.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_server_type.rb +10 -3
- data/lib/fog/brightbox/requests/compute/get_user.rb +8 -16
- data/lib/fog/brightbox/requests/compute/get_zone.rb +10 -3
- data/lib/fog/brightbox/requests/compute/list_accounts.rb +7 -3
- data/lib/fog/brightbox/requests/compute/list_api_clients.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_applications.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_images.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_load_balancers.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_server_groups.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_server_types.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_servers.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_users.rb +9 -3
- data/lib/fog/brightbox/requests/compute/list_zones.rb +9 -3
- data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +12 -3
- data/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +11 -13
- data/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +12 -3
- data/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +12 -3
- data/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +12 -3
- data/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +10 -11
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +22 -3
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +18 -0
- data/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +14 -2
- data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +10 -3
- data/lib/fog/brightbox/requests/compute/shutdown_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/snapshot_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/start_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/stop_server.rb +10 -3
- data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +10 -3
- data/lib/fog/brightbox/requests/compute/update_account.rb +33 -35
- data/lib/fog/brightbox/requests/compute/update_api_client.rb +13 -3
- data/lib/fog/brightbox/requests/compute/update_application.rb +13 -3
- data/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +14 -3
- data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +17 -2
- data/lib/fog/brightbox/requests/compute/update_image.rb +18 -3
- data/lib/fog/brightbox/requests/compute/update_load_balancer.rb +16 -3
- data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +13 -20
- data/lib/fog/brightbox/requests/compute/update_server.rb +13 -3
- data/lib/fog/brightbox/requests/compute/update_server_group.rb +13 -3
- data/lib/fog/brightbox/requests/compute/update_user.rb +16 -3
- data/lib/fog/clodo/models/compute/images.rb +2 -2
- data/lib/fog/clodo/models/compute/server.rb +7 -7
- data/lib/fog/clodo/models/compute/servers.rb +2 -2
- data/lib/fog/cloudstack/models/compute/flavors.rb +2 -2
- data/lib/fog/cloudstack/models/compute/image.rb +2 -2
- data/lib/fog/cloudstack/models/compute/images.rb +2 -2
- data/lib/fog/cloudstack/models/compute/job.rb +2 -2
- data/lib/fog/cloudstack/models/compute/jobs.rb +2 -2
- data/lib/fog/cloudstack/models/compute/security_group.rb +3 -3
- data/lib/fog/cloudstack/models/compute/security_group_rule.rb +5 -5
- data/lib/fog/cloudstack/models/compute/security_group_rules.rb +1 -1
- data/lib/fog/cloudstack/models/compute/security_groups.rb +2 -2
- data/lib/fog/cloudstack/models/compute/server.rb +14 -12
- data/lib/fog/cloudstack/models/compute/servers.rb +2 -2
- data/lib/fog/cloudstack/models/compute/volume.rb +8 -8
- data/lib/fog/cloudstack/models/compute/volumes.rb +2 -2
- data/lib/fog/cloudstack/models/compute/zone.rb +1 -1
- data/lib/fog/cloudstack/models/compute/zones.rb +2 -2
- data/lib/fog/compute.rb +2 -1
- data/lib/fog/core.rb +1 -0
- data/lib/fog/core/attributes.rb +19 -2
- data/lib/fog/core/collection.rb +17 -6
- data/lib/fog/core/connection.rb +1 -0
- data/lib/fog/core/deprecated_connection_accessors.rb +41 -0
- data/lib/fog/core/errors.rb +2 -0
- data/lib/fog/core/json.rb +4 -16
- data/lib/fog/core/model.rb +11 -1
- data/lib/fog/core/service.rb +1 -1
- data/lib/fog/core/wait_for.rb +1 -1
- data/lib/fog/dnsimple/models/dns/record.rb +4 -4
- data/lib/fog/dnsimple/models/dns/records.rb +2 -2
- data/lib/fog/dnsimple/models/dns/zone.rb +3 -3
- data/lib/fog/dnsimple/models/dns/zones.rb +2 -2
- data/lib/fog/dnsmadeeasy/models/dns/record.rb +5 -5
- data/lib/fog/dnsmadeeasy/models/dns/records.rb +2 -2
- data/lib/fog/dnsmadeeasy/models/dns/zone.rb +3 -3
- data/lib/fog/dnsmadeeasy/models/dns/zones.rb +2 -2
- data/lib/fog/dynect/models/dns/record.rb +3 -3
- data/lib/fog/dynect/models/dns/records.rb +2 -2
- data/lib/fog/dynect/models/dns/zone.rb +4 -4
- data/lib/fog/dynect/models/dns/zones.rb +2 -2
- data/lib/fog/ecloud.rb +19 -5
- data/lib/fog/ecloud/compute.rb +663 -351
- data/lib/fog/ecloud/generate_collection.rb +3 -3
- data/lib/fog/ecloud/models/compute/admin_organization.rb +14 -10
- data/lib/fog/ecloud/models/compute/admin_organizations.rb +1 -6
- data/lib/fog/ecloud/models/compute/api_keys.rb +2 -2
- data/lib/fog/ecloud/models/compute/association.rb +3 -3
- data/lib/fog/ecloud/models/compute/associations.rb +2 -2
- data/lib/fog/ecloud/models/compute/authentication_levels.rb +2 -2
- data/lib/fog/ecloud/models/compute/backup_internet_service.rb +7 -7
- data/lib/fog/ecloud/models/compute/backup_internet_services.rb +3 -3
- data/lib/fog/ecloud/models/compute/catalog.rb +2 -2
- data/lib/fog/ecloud/models/compute/catalog_configurations.rb +2 -2
- data/lib/fog/ecloud/models/compute/catalog_item.rb +1 -1
- data/lib/fog/ecloud/models/compute/compute_pool.rb +27 -15
- data/lib/fog/ecloud/models/compute/compute_pools.rb +2 -2
- data/lib/fog/ecloud/models/compute/cpu_usage_detail_summary.rb +2 -2
- data/lib/fog/ecloud/models/compute/detached_disk.rb +27 -0
- data/lib/fog/ecloud/models/compute/detached_disks.rb +31 -0
- data/lib/fog/ecloud/models/compute/environment.rb +27 -20
- data/lib/fog/ecloud/models/compute/environments.rb +2 -2
- data/lib/fog/ecloud/models/compute/firewall_acl.rb +1 -1
- data/lib/fog/ecloud/models/compute/firewall_acls.rb +2 -2
- data/lib/fog/ecloud/models/compute/group.rb +8 -6
- data/lib/fog/ecloud/models/compute/groups.rb +17 -6
- data/lib/fog/ecloud/models/compute/guest_processes.rb +2 -2
- data/lib/fog/ecloud/models/compute/hardware_configuration.rb +4 -4
- data/lib/fog/ecloud/models/compute/hardware_configurations.rb +2 -2
- data/lib/fog/ecloud/models/compute/internet_service.rb +35 -29
- data/lib/fog/ecloud/models/compute/internet_services.rb +11 -8
- data/lib/fog/ecloud/models/compute/ip_address.rb +17 -3
- data/lib/fog/ecloud/models/compute/ip_addresses.rb +7 -2
- data/lib/fog/ecloud/models/compute/layout.rb +1 -1
- data/lib/fog/ecloud/models/compute/layouts.rb +2 -2
- data/lib/fog/ecloud/models/compute/location.rb +1 -1
- data/lib/fog/ecloud/models/compute/locations.rb +2 -2
- data/lib/fog/ecloud/models/compute/login_banners.rb +2 -2
- data/lib/fog/ecloud/models/compute/memory_usage_detail_summary.rb +2 -2
- data/lib/fog/ecloud/models/compute/monitor.rb +4 -4
- data/lib/fog/ecloud/models/compute/monitors.rb +2 -2
- data/lib/fog/ecloud/models/compute/network.rb +22 -12
- data/lib/fog/ecloud/models/compute/networks.rb +9 -5
- data/lib/fog/ecloud/models/compute/node.rb +12 -6
- data/lib/fog/ecloud/models/compute/nodes.rb +7 -4
- data/lib/fog/ecloud/models/compute/operating_system_families.rb +2 -2
- data/lib/fog/ecloud/models/compute/operating_system_family.rb +1 -1
- data/lib/fog/ecloud/models/compute/operating_systems.rb +1 -1
- data/lib/fog/ecloud/models/compute/organization.rb +17 -17
- data/lib/fog/ecloud/models/compute/organizations.rb +3 -3
- data/lib/fog/ecloud/models/compute/password_complexity_rules.rb +2 -2
- data/lib/fog/ecloud/models/compute/physical_devices.rb +2 -2
- data/lib/fog/ecloud/models/compute/public_ip.rb +2 -2
- data/lib/fog/ecloud/models/compute/public_ips.rb +8 -5
- data/lib/fog/ecloud/models/compute/rnat.rb +2 -2
- data/lib/fog/ecloud/models/compute/rnats.rb +2 -2
- data/lib/fog/ecloud/models/compute/roles.rb +2 -2
- data/lib/fog/ecloud/models/compute/row.rb +10 -7
- data/lib/fog/ecloud/models/compute/rows.rb +9 -6
- data/lib/fog/ecloud/models/compute/server.rb +139 -93
- data/lib/fog/ecloud/models/compute/server_configuration_options.rb +2 -2
- data/lib/fog/ecloud/models/compute/servers.rb +18 -15
- data/lib/fog/ecloud/models/compute/ssh_key.rb +1 -1
- data/lib/fog/ecloud/models/compute/ssh_keys.rb +2 -2
- data/lib/fog/ecloud/models/compute/storage_usage_detail_summary.rb +2 -2
- data/lib/fog/ecloud/models/compute/support_tickets.rb +2 -2
- data/lib/fog/ecloud/models/compute/tags.rb +2 -2
- data/lib/fog/ecloud/models/compute/task.rb +3 -0
- data/lib/fog/ecloud/models/compute/tasks.rb +3 -3
- data/lib/fog/ecloud/models/compute/template.rb +8 -9
- data/lib/fog/ecloud/models/compute/templates.rb +2 -2
- data/lib/fog/ecloud/models/compute/trusted_network_group.rb +5 -5
- data/lib/fog/ecloud/models/compute/trusted_network_groups.rb +2 -2
- data/lib/fog/ecloud/models/compute/user.rb +2 -2
- data/lib/fog/ecloud/models/compute/users.rb +2 -2
- data/lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb +32 -0
- data/lib/fog/ecloud/models/compute/virtual_machine_assigned_ips.rb +27 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_authentication_levels.rb +1 -2
- data/lib/fog/ecloud/requests/compute/get_admin_organization.rb +14 -0
- data/lib/fog/ecloud/requests/compute/get_compute_pool.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_compute_pools.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_detached_disk.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_detached_disks.rb +33 -0
- data/lib/fog/ecloud/requests/compute/get_environment.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_group.rb +8 -1
- data/lib/fog/ecloud/requests/compute/get_groups.rb +8 -1
- data/lib/fog/ecloud/requests/compute/get_hardware_configuration.rb +19 -0
- data/lib/fog/ecloud/requests/compute/get_hardware_configurations.rb +4 -0
- data/lib/fog/ecloud/requests/compute/get_internet_service.rb +12 -0
- data/lib/fog/ecloud/requests/compute/get_internet_services.rb +8 -0
- data/lib/fog/ecloud/requests/compute/get_ip_address.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_layout.rb +8 -1
- data/lib/fog/ecloud/requests/compute/get_layouts.rb +8 -1
- data/lib/fog/ecloud/requests/compute/get_network.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_networks.rb +20 -0
- data/lib/fog/ecloud/requests/compute/get_node.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_nodes.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_operating_system.rb +14 -0
- data/lib/fog/ecloud/requests/compute/get_operating_system_families.rb +20 -0
- data/lib/fog/ecloud/requests/compute/get_organization.rb +14 -0
- data/lib/fog/ecloud/requests/compute/get_organizations.rb +14 -2
- data/lib/fog/ecloud/requests/compute/get_public_ip.rb +11 -1
- data/lib/fog/ecloud/requests/compute/get_public_ips.rb +22 -0
- data/lib/fog/ecloud/requests/compute/get_row.rb +8 -1
- data/lib/fog/ecloud/requests/compute/get_rows.rb +2 -1
- data/lib/fog/ecloud/requests/compute/get_server.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_servers.rb +32 -1
- data/lib/fog/ecloud/requests/compute/get_ssh_key.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_ssh_keys.rb +20 -0
- data/lib/fog/ecloud/requests/compute/get_task.rb +4 -2
- data/lib/fog/ecloud/requests/compute/get_template.rb +11 -0
- data/lib/fog/ecloud/requests/compute/get_templates.rb +38 -0
- data/lib/fog/ecloud/requests/compute/get_virtual_machine_assigned_ips.rb +44 -0
- data/lib/fog/ecloud/requests/compute/groups_delete.rb +16 -1
- data/lib/fog/ecloud/requests/compute/internet_service_create.rb +36 -1
- data/lib/fog/ecloud/requests/compute/internet_service_delete.rb +23 -0
- data/lib/fog/ecloud/requests/compute/node_service_create.rb +49 -1
- data/lib/fog/ecloud/requests/compute/node_service_delete.rb +24 -0
- data/lib/fog/ecloud/requests/compute/rows_delete.rb +11 -1
- data/lib/fog/ecloud/requests/compute/virtual_machine_attach_disk.rb +62 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_create_from_template.rb +136 -16
- data/lib/fog/ecloud/requests/compute/virtual_machine_delete.rb +36 -1
- data/lib/fog/ecloud/requests/compute/virtual_machine_detach_disk.rb +71 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit_assigned_ips.rb +82 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit_hardware_configuration.rb +27 -3
- data/lib/fog/ecloud/requests/compute/virtual_machine_import.rb +120 -6
- data/lib/fog/glesys/models/compute/ip.rb +7 -7
- data/lib/fog/glesys/models/compute/ips.rb +7 -7
- data/lib/fog/glesys/models/compute/server.rb +6 -6
- data/lib/fog/glesys/models/compute/servers.rb +4 -4
- data/lib/fog/glesys/models/compute/template.rb +1 -1
- data/lib/fog/glesys/models/compute/templates.rb +2 -2
- data/lib/fog/go_grid/models/compute/image.rb +3 -3
- data/lib/fog/go_grid/models/compute/images.rb +2 -2
- data/lib/fog/go_grid/models/compute/password.rb +5 -5
- data/lib/fog/go_grid/models/compute/passwords.rb +3 -3
- data/lib/fog/go_grid/models/compute/server.rb +4 -4
- data/lib/fog/go_grid/models/compute/servers.rb +2 -2
- data/lib/fog/google/models/storage/directories.rb +2 -2
- data/lib/fog/google/models/storage/directory.rb +4 -4
- data/lib/fog/google/models/storage/file.rb +5 -5
- data/lib/fog/google/models/storage/files.rb +4 -4
- data/lib/fog/google/storage.rb +13 -2
- data/lib/fog/hp.rb +6 -3
- data/lib/fog/hp/models/compute/address.rb +8 -8
- data/lib/fog/hp/models/compute/addresses.rb +2 -2
- data/lib/fog/hp/models/compute/flavors.rb +2 -2
- data/lib/fog/hp/models/compute/image.rb +2 -2
- data/lib/fog/hp/models/compute/images.rb +2 -2
- data/lib/fog/hp/models/compute/key_pair.rb +3 -3
- data/lib/fog/hp/models/compute/key_pairs.rb +2 -2
- data/lib/fog/hp/models/compute/security_group.rb +4 -4
- data/lib/fog/hp/models/compute/security_groups.rb +3 -3
- data/lib/fog/hp/models/compute/server.rb +15 -15
- data/lib/fog/hp/models/compute/servers.rb +2 -2
- data/lib/fog/hp/models/storage/directories.rb +3 -3
- data/lib/fog/hp/models/storage/directory.rb +18 -18
- data/lib/fog/hp/models/storage/file.rb +4 -4
- data/lib/fog/hp/models/storage/files.rb +2 -2
- data/lib/fog/ibm/models/compute/address.rb +2 -2
- data/lib/fog/ibm/models/compute/addresses.rb +2 -2
- data/lib/fog/ibm/models/compute/image.rb +3 -3
- data/lib/fog/ibm/models/compute/images.rb +2 -2
- data/lib/fog/ibm/models/compute/key.rb +2 -2
- data/lib/fog/ibm/models/compute/keys.rb +3 -3
- data/lib/fog/ibm/models/compute/locations.rb +2 -2
- data/lib/fog/ibm/models/compute/server.rb +12 -12
- data/lib/fog/ibm/models/compute/servers.rb +2 -2
- data/lib/fog/ibm/models/compute/vlans.rb +2 -2
- data/lib/fog/ibm/models/storage/offerings.rb +1 -1
- data/lib/fog/ibm/models/storage/volume.rb +5 -5
- data/lib/fog/ibm/models/storage/volumes.rb +2 -2
- data/lib/fog/joyent/models/compute/flavors.rb +2 -2
- data/lib/fog/joyent/models/compute/images.rb +2 -2
- data/lib/fog/joyent/models/compute/key.rb +1 -1
- data/lib/fog/joyent/models/compute/keys.rb +3 -3
- data/lib/fog/joyent/models/compute/server.rb +13 -13
- data/lib/fog/joyent/models/compute/servers.rb +3 -3
- data/lib/fog/joyent/models/compute/snapshot.rb +4 -4
- data/lib/fog/joyent/models/compute/snapshots.rb +3 -3
- data/lib/fog/libvirt/compute.rb +6 -1
- data/lib/fog/libvirt/models/compute/interface.rb +1 -1
- data/lib/fog/libvirt/models/compute/interfaces.rb +1 -1
- data/lib/fog/libvirt/models/compute/network.rb +1 -1
- data/lib/fog/libvirt/models/compute/networks.rb +1 -1
- data/lib/fog/libvirt/models/compute/nic.rb +2 -2
- data/lib/fog/libvirt/models/compute/nodes.rb +1 -1
- data/lib/fog/libvirt/models/compute/pool.rb +7 -7
- data/lib/fog/libvirt/models/compute/pools.rb +1 -1
- data/lib/fog/libvirt/models/compute/server.rb +29 -28
- data/lib/fog/libvirt/models/compute/servers.rb +2 -2
- data/lib/fog/libvirt/models/compute/volume.rb +5 -5
- data/lib/fog/libvirt/models/compute/volumes.rb +1 -1
- data/lib/fog/libvirt/requests/compute/list_domains.rb +2 -2
- data/lib/fog/linode/models/compute/data_centers.rb +2 -2
- data/lib/fog/linode/models/compute/disk.rb +7 -7
- data/lib/fog/linode/models/compute/disks.rb +2 -2
- data/lib/fog/linode/models/compute/flavors.rb +2 -2
- data/lib/fog/linode/models/compute/images.rb +2 -2
- data/lib/fog/linode/models/compute/ip.rb +3 -3
- data/lib/fog/linode/models/compute/ips.rb +2 -2
- data/lib/fog/linode/models/compute/kernels.rb +2 -2
- data/lib/fog/linode/models/compute/server.rb +13 -13
- data/lib/fog/linode/models/compute/servers.rb +2 -2
- data/lib/fog/linode/models/compute/stack_scripts.rb +3 -3
- data/lib/fog/linode/models/dns/record.rb +6 -6
- data/lib/fog/linode/models/dns/records.rb +2 -2
- data/lib/fog/linode/models/dns/zone.rb +6 -6
- data/lib/fog/linode/models/dns/zones.rb +2 -2
- data/lib/fog/local/models/storage/directories.rb +3 -3
- data/lib/fog/local/models/storage/directory.rb +2 -2
- data/lib/fog/local/models/storage/file.rb +6 -6
- data/lib/fog/local/models/storage/files.rb +2 -2
- data/lib/fog/ninefold/models/compute/address.rb +5 -5
- data/lib/fog/ninefold/models/compute/addresses.rb +2 -2
- data/lib/fog/ninefold/models/compute/flavors.rb +2 -2
- data/lib/fog/ninefold/models/compute/images.rb +2 -2
- data/lib/fog/ninefold/models/compute/ip_forwarding_rule.rb +3 -3
- data/lib/fog/ninefold/models/compute/ip_forwarding_rules.rb +2 -2
- data/lib/fog/ninefold/models/compute/server.rb +9 -9
- data/lib/fog/ninefold/models/compute/servers.rb +2 -2
- data/lib/fog/openstack.rb +89 -65
- data/lib/fog/openstack/README.identity.md +69 -0
- data/lib/fog/openstack/compute.rb +71 -41
- data/lib/fog/openstack/identity.rb +43 -22
- data/lib/fog/openstack/image.rb +11 -5
- data/lib/fog/openstack/models/compute/address.rb +8 -8
- data/lib/fog/openstack/models/compute/addresses.rb +3 -3
- data/lib/fog/openstack/models/compute/flavor.rb +9 -4
- data/lib/fog/openstack/models/compute/flavors.rb +2 -2
- data/lib/fog/openstack/models/compute/host.rb +3 -2
- data/lib/fog/openstack/models/compute/hosts.rb +2 -2
- data/lib/fog/openstack/models/compute/image.rb +4 -3
- data/lib/fog/openstack/models/compute/images.rb +2 -2
- data/lib/fog/openstack/models/compute/key_pair.rb +3 -3
- data/lib/fog/openstack/models/compute/key_pairs.rb +1 -1
- data/lib/fog/openstack/models/compute/metadata.rb +4 -4
- data/lib/fog/openstack/models/compute/metadatum.rb +2 -2
- data/lib/fog/openstack/models/compute/security_group.rb +5 -5
- data/lib/fog/openstack/models/compute/security_groups.rb +2 -2
- data/lib/fog/openstack/models/compute/server.rb +41 -27
- data/lib/fog/openstack/models/compute/servers.rb +2 -2
- data/lib/fog/openstack/models/compute/snapshot.rb +4 -3
- data/lib/fog/openstack/models/compute/snapshots.rb +2 -2
- data/lib/fog/openstack/models/compute/tenant.rb +1 -1
- data/lib/fog/openstack/models/compute/tenants.rb +7 -3
- data/lib/fog/openstack/models/compute/volume.rb +6 -5
- data/lib/fog/openstack/models/compute/volumes.rb +2 -2
- data/lib/fog/openstack/models/identity/ec2_credential.rb +44 -0
- data/lib/fog/openstack/models/identity/ec2_credentials.rb +53 -0
- data/lib/fog/openstack/models/identity/role.rb +4 -4
- data/lib/fog/openstack/models/identity/roles.rb +2 -2
- data/lib/fog/openstack/models/identity/tenant.rb +7 -7
- data/lib/fog/openstack/models/identity/tenants.rb +3 -3
- data/lib/fog/openstack/models/identity/user.rb +12 -6
- data/lib/fog/openstack/models/identity/users.rb +4 -5
- data/lib/fog/openstack/models/image/image.rb +10 -9
- data/lib/fog/openstack/models/image/images.rb +6 -6
- data/lib/fog/openstack/models/network/network.rb +6 -5
- data/lib/fog/openstack/models/network/networks.rb +3 -3
- data/lib/fog/openstack/models/network/port.rb +6 -5
- data/lib/fog/openstack/models/network/ports.rb +3 -3
- data/lib/fog/openstack/models/network/subnet.rb +6 -5
- data/lib/fog/openstack/models/network/subnets.rb +3 -3
- data/lib/fog/openstack/models/volume/volume.rb +4 -3
- data/lib/fog/openstack/models/volume/volumes.rb +2 -2
- data/lib/fog/openstack/network.rb +5 -3
- data/lib/fog/openstack/requests/compute/create_flavor.rb +4 -1
- data/lib/fog/openstack/requests/compute/create_security_group.rb +3 -2
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -0
- data/lib/fog/openstack/requests/compute/create_server.rb +54 -7
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +2 -0
- data/lib/fog/openstack/requests/compute/get_limits.rb +93 -0
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +17 -41
- data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -0
- data/lib/fog/openstack/requests/compute/release_address.rb +13 -1
- data/lib/fog/openstack/requests/compute/reset_server_state.rb +24 -0
- data/lib/fog/openstack/requests/identity/add_user_to_tenant.rb +7 -2
- data/lib/fog/openstack/requests/identity/create_ec2_credential.rb +58 -0
- data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_tenant.rb +1 -3
- data/lib/fog/openstack/requests/identity/delete_ec2_credential.rb +44 -0
- data/lib/fog/openstack/requests/identity/get_ec2_credential.rb +49 -0
- data/lib/fog/openstack/requests/identity/get_user_by_name.rb +8 -0
- data/lib/fog/openstack/requests/identity/list_ec2_credentials.rb +44 -0
- data/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +7 -1
- data/lib/fog/openstack/requests/identity/list_users.rb +10 -1
- data/lib/fog/openstack/requests/identity/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/identity/update_tenant.rb +1 -3
- data/lib/fog/openstack/requests/image/create_image.rb +3 -1
- data/lib/fog/openstack/volume.rb +6 -3
- data/lib/fog/ovirt/models/compute/cluster.rb +1 -1
- data/lib/fog/ovirt/models/compute/clusters.rb +2 -2
- data/lib/fog/ovirt/models/compute/interfaces.rb +3 -3
- data/lib/fog/ovirt/models/compute/server.rb +15 -15
- data/lib/fog/ovirt/models/compute/servers.rb +2 -2
- data/lib/fog/ovirt/models/compute/template.rb +5 -5
- data/lib/fog/ovirt/models/compute/templates.rb +2 -2
- data/lib/fog/ovirt/models/compute/volumes.rb +3 -3
- data/lib/fog/rackspace.rb +20 -11
- data/lib/fog/rackspace/block_storage.rb +1 -0
- data/lib/fog/rackspace/compute_v2.rb +10 -0
- data/lib/fog/rackspace/load_balancers.rb +2 -0
- data/lib/fog/rackspace/models/block_storage/snapshot.rb +3 -2
- data/lib/fog/rackspace/models/block_storage/snapshots.rb +2 -2
- data/lib/fog/rackspace/models/block_storage/volume.rb +9 -3
- data/lib/fog/rackspace/models/block_storage/volume_types.rb +3 -3
- data/lib/fog/rackspace/models/block_storage/volumes.rb +2 -2
- data/lib/fog/rackspace/models/compute/flavors.rb +2 -2
- data/lib/fog/rackspace/models/compute/image.rb +3 -3
- data/lib/fog/rackspace/models/compute/images.rb +2 -2
- data/lib/fog/rackspace/models/compute/server.rb +7 -7
- data/lib/fog/rackspace/models/compute/servers.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/attachment.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/attachments.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/flavors.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/image.rb +9 -0
- data/lib/fog/rackspace/models/compute_v2/images.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/server.rb +47 -14
- data/lib/fog/rackspace/models/compute_v2/servers.rb +10 -2
- data/lib/fog/rackspace/models/databases/database.rb +2 -2
- data/lib/fog/rackspace/models/databases/databases.rb +1 -1
- data/lib/fog/rackspace/models/databases/flavors.rb +2 -2
- data/lib/fog/rackspace/models/databases/instance.rb +10 -10
- data/lib/fog/rackspace/models/databases/instances.rb +2 -2
- data/lib/fog/rackspace/models/databases/user.rb +2 -2
- data/lib/fog/rackspace/models/databases/users.rb +1 -1
- data/lib/fog/rackspace/models/dns/callback.rb +1 -1
- data/lib/fog/rackspace/models/dns/record.rb +23 -5
- data/lib/fog/rackspace/models/dns/records.rb +2 -2
- data/lib/fog/rackspace/models/dns/zone.rb +5 -5
- data/lib/fog/rackspace/models/dns/zones.rb +2 -2
- data/lib/fog/rackspace/models/identity/credentials.rb +1 -1
- data/lib/fog/rackspace/models/identity/roles.rb +1 -1
- data/lib/fog/rackspace/models/identity/tenants.rb +1 -1
- data/lib/fog/rackspace/models/identity/user.rb +6 -6
- data/lib/fog/rackspace/models/identity/users.rb +3 -3
- data/lib/fog/rackspace/models/load_balancers/access_rule.rb +4 -4
- data/lib/fog/rackspace/models/load_balancers/access_rules.rb +1 -1
- data/lib/fog/rackspace/models/load_balancers/load_balancer.rb +45 -27
- data/lib/fog/rackspace/models/load_balancers/load_balancers.rb +2 -2
- data/lib/fog/rackspace/models/load_balancers/node.rb +4 -4
- data/lib/fog/rackspace/models/load_balancers/nodes.rb +2 -2
- data/lib/fog/rackspace/models/load_balancers/virtual_ip.rb +3 -3
- data/lib/fog/rackspace/models/load_balancers/virtual_ips.rb +1 -1
- data/lib/fog/rackspace/models/storage/directories.rb +2 -2
- data/lib/fog/rackspace/models/storage/directory.rb +12 -12
- data/lib/fog/rackspace/models/storage/file.rb +71 -5
- data/lib/fog/rackspace/models/storage/files.rb +2 -2
- data/lib/fog/rackspace/requests/compute_v2/create_image.rb +41 -0
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +3 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_image.rb +31 -0
- data/lib/fog/rackspace/requests/compute_v2/list_addresses.rb +34 -0
- data/lib/fog/rackspace/requests/compute_v2/list_addresses_by_network.rb +36 -0
- data/lib/fog/rackspace/requests/dns/add_records.rb +5 -1
- data/lib/fog/rackspace/requests/load_balancers/get_content_caching.rb +15 -0
- data/lib/fog/rackspace/requests/load_balancers/set_content_caching.rb +21 -0
- data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +1 -1
- data/lib/fog/serverlove/models/compute/image.rb +11 -11
- data/lib/fog/serverlove/models/compute/images.rb +2 -2
- data/lib/fog/serverlove/models/compute/server.rb +10 -10
- data/lib/fog/serverlove/models/compute/servers.rb +2 -2
- data/lib/fog/storm_on_demand/models/compute/balancer.rb +7 -7
- data/lib/fog/storm_on_demand/models/compute/balancers.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/configs.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/images.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/private_ips.rb +2 -2
- data/lib/fog/storm_on_demand/models/compute/server.rb +5 -5
- data/lib/fog/storm_on_demand/models/compute/servers.rb +2 -2
- data/lib/fog/storm_on_demand/models/compute/stats.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/templates.rb +1 -1
- data/lib/fog/terremark/models/shared/address.rb +1 -1
- data/lib/fog/terremark/models/shared/addresses.rb +5 -5
- data/lib/fog/terremark/models/shared/images.rb +5 -5
- data/lib/fog/terremark/models/shared/internetservice.rb +6 -6
- data/lib/fog/terremark/models/shared/internetservices.rb +5 -5
- data/lib/fog/terremark/models/shared/network.rb +1 -1
- data/lib/fog/terremark/models/shared/networks.rb +6 -6
- data/lib/fog/terremark/models/shared/nodeservice.rb +3 -3
- data/lib/fog/terremark/models/shared/nodeservices.rb +4 -4
- data/lib/fog/terremark/models/shared/server.rb +17 -17
- data/lib/fog/terremark/models/shared/servers.rb +6 -6
- data/lib/fog/terremark/models/shared/task.rb +4 -4
- data/lib/fog/terremark/models/shared/tasks.rb +5 -5
- data/lib/fog/terremark/models/shared/vdc.rb +4 -4
- data/lib/fog/terremark/models/shared/vdcs.rb +5 -5
- data/lib/fog/terremark/parser.rb +1 -1
- data/lib/fog/terremark/shared.rb +1 -1
- data/lib/fog/vcloud/compute.rb +4 -4
- data/lib/fog/vcloud/models/compute/catalog.rb +1 -1
- data/lib/fog/vcloud/models/compute/catalog_item.rb +1 -1
- data/lib/fog/vcloud/models/compute/catalog_items.rb +4 -4
- data/lib/fog/vcloud/models/compute/catalogs.rb +3 -3
- data/lib/fog/vcloud/models/compute/ip.rb +1 -1
- data/lib/fog/vcloud/models/compute/ips.rb +3 -3
- data/lib/fog/vcloud/models/compute/network.rb +1 -1
- data/lib/fog/vcloud/models/compute/networks.rb +6 -6
- data/lib/fog/vcloud/models/compute/organization.rb +4 -4
- data/lib/fog/vcloud/models/compute/organizations.rb +4 -4
- data/lib/fog/vcloud/models/compute/server.rb +13 -13
- data/lib/fog/vcloud/models/compute/servers.rb +4 -4
- data/lib/fog/vcloud/models/compute/tasks.rb +3 -3
- data/lib/fog/vcloud/models/compute/vapp.rb +2 -2
- data/lib/fog/vcloud/models/compute/vapps.rb +2 -2
- data/lib/fog/vcloud/models/compute/vdc.rb +2 -2
- data/lib/fog/vcloud/models/compute/vdcs.rb +3 -3
- data/lib/fog/version.rb +3 -0
- data/lib/fog/virtual_box/compute.rb +11 -5
- data/lib/fog/virtual_box/models/compute/medium.rb +2 -2
- data/lib/fog/virtual_box/models/compute/mediums.rb +4 -4
- data/lib/fog/virtual_box/models/compute/nat_engine.rb +2 -2
- data/lib/fog/virtual_box/models/compute/network_adapter.rb +1 -1
- data/lib/fog/virtual_box/models/compute/network_adapters.rb +1 -1
- data/lib/fog/virtual_box/models/compute/server.rb +5 -5
- data/lib/fog/virtual_box/models/compute/servers.rb +2 -2
- data/lib/fog/vmfusion/compute.rb +6 -1
- data/lib/fog/vmfusion/models/compute/server.rb +1 -1
- data/lib/fog/voxel/models/compute/images.rb +2 -2
- data/lib/fog/voxel/models/compute/server.rb +6 -6
- data/lib/fog/voxel/models/compute/servers.rb +2 -2
- data/lib/fog/vsphere/compute.rb +78 -9
- data/lib/fog/vsphere/models/compute/cluster.rb +31 -0
- data/lib/fog/vsphere/models/compute/clusters.rb +26 -0
- data/lib/fog/vsphere/models/compute/datacenter.rb +39 -0
- data/lib/fog/vsphere/models/compute/datacenters.rb +23 -0
- data/lib/fog/vsphere/models/compute/datastore.rb +24 -0
- data/lib/fog/vsphere/models/compute/datastores.rb +25 -0
- data/lib/fog/vsphere/models/compute/folder.rb +28 -0
- data/lib/fog/vsphere/models/compute/folders.rb +27 -0
- data/lib/fog/vsphere/models/compute/interface.rb +39 -0
- data/lib/fog/vsphere/models/compute/interfaces.rb +33 -0
- data/lib/fog/vsphere/models/compute/network.rb +21 -0
- data/lib/fog/vsphere/models/compute/networks.rb +25 -0
- data/lib/fog/vsphere/models/compute/resource_pool.rb +23 -0
- data/lib/fog/vsphere/models/compute/resource_pools.rb +26 -0
- data/lib/fog/vsphere/models/compute/server.rb +106 -29
- data/lib/fog/vsphere/models/compute/servers.rb +16 -20
- data/lib/fog/vsphere/models/compute/template.rb +13 -0
- data/lib/fog/vsphere/models/compute/templates.rb +23 -0
- data/lib/fog/vsphere/models/compute/volume.rb +45 -0
- data/lib/fog/vsphere/models/compute/volumes.rb +33 -0
- data/lib/fog/vsphere/requests/compute/create_folder.rb +22 -0
- data/lib/fog/vsphere/requests/compute/create_vm.rb +114 -0
- data/lib/fog/vsphere/requests/compute/get_cluster.rb +25 -0
- data/lib/fog/vsphere/requests/compute/get_datacenter.rb +29 -0
- data/lib/fog/vsphere/requests/compute/get_datastore.rb +25 -0
- data/lib/fog/vsphere/requests/compute/get_folder.rb +73 -0
- data/lib/fog/vsphere/requests/compute/get_network.rb +25 -0
- data/lib/fog/vsphere/requests/compute/get_resource_pool.rb +26 -0
- data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +62 -0
- data/lib/fog/vsphere/requests/compute/list_clusters.rb +37 -0
- data/lib/fog/vsphere/requests/compute/list_datacenters.rb +34 -0
- data/lib/fog/vsphere/requests/compute/list_datastores.rb +40 -0
- data/lib/fog/vsphere/requests/compute/list_folders.rb +45 -0
- data/lib/fog/vsphere/requests/compute/list_networks.rb +38 -0
- data/lib/fog/vsphere/requests/compute/list_resource_pools.rb +39 -0
- data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +132 -166
- data/lib/fog/vsphere/requests/compute/list_vm_interfaces.rb +52 -0
- data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +51 -0
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +134 -67
- data/lib/fog/vsphere/requests/compute/vm_destroy.rb +1 -8
- data/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb +1 -2
- data/lib/fog/xenserver.rb +26 -2
- data/lib/fog/xenserver/compute.rb +8 -0
- data/lib/fog/xenserver/examples/README.md +11 -0
- data/lib/fog/xenserver/examples/chage_default_storage_repository.md +99 -0
- data/lib/fog/xenserver/examples/creating_servers.md +168 -0
- data/lib/fog/xenserver/examples/getting_started.md +163 -0
- data/lib/fog/xenserver/examples/storage_repositories.md +94 -0
- data/lib/fog/xenserver/models/compute/host.rb +75 -8
- data/lib/fog/xenserver/models/compute/host_metrics.rb +29 -0
- data/lib/fog/xenserver/models/compute/hosts.rb +8 -8
- data/lib/fog/xenserver/models/compute/network.rb +11 -11
- data/lib/fog/xenserver/models/compute/networks.rb +3 -3
- data/lib/fog/xenserver/models/compute/pbd.rb +11 -6
- data/lib/fog/xenserver/models/compute/pbds.rb +3 -3
- data/lib/fog/xenserver/models/compute/pif.rb +9 -9
- data/lib/fog/xenserver/models/compute/pifs.rb +3 -3
- data/lib/fog/xenserver/models/compute/pool.rb +30 -8
- data/lib/fog/xenserver/models/compute/pools.rb +3 -3
- data/lib/fog/xenserver/models/compute/server.rb +29 -29
- data/lib/fog/xenserver/models/compute/servers.rb +8 -8
- data/lib/fog/xenserver/models/compute/storage_repositories.rb +2 -2
- data/lib/fog/xenserver/models/compute/storage_repository.rb +52 -9
- data/lib/fog/xenserver/models/compute/vbd.rb +16 -16
- data/lib/fog/xenserver/models/compute/vbds.rb +3 -3
- data/lib/fog/xenserver/models/compute/vdi.rb +17 -17
- data/lib/fog/xenserver/models/compute/vdis.rb +3 -3
- data/lib/fog/xenserver/models/compute/vif.rb +10 -10
- data/lib/fog/xenserver/models/compute/vifs.rb +3 -3
- data/lib/fog/xenserver/requests/compute/create_sr.rb +72 -0
- data/lib/fog/xenserver/requests/compute/destroy_sr.rb +30 -0
- data/lib/fog/xenserver/requests/compute/disable_host.rb +29 -0
- data/lib/fog/xenserver/requests/compute/enable_host.rb +28 -0
- data/lib/fog/xenserver/requests/compute/reboot_host.rb +23 -0
- data/lib/fog/xenserver/requests/compute/shutdown_host.rb +23 -0
- data/lib/fog/xenserver/requests/compute/unplug_pbd.rb +25 -0
- data/lib/fog/zerigo/models/dns/record.rb +4 -4
- data/lib/fog/zerigo/models/dns/records.rb +2 -2
- data/lib/fog/zerigo/models/dns/zone.rb +6 -6
- data/lib/fog/zerigo/models/dns/zones.rb +2 -2
- data/lib/tasks/changelog_task.rb +98 -0
- data/lib/tasks/test_task.rb +46 -0
- data/tests/aws/models/cloud_watch/metrics_tests.rb +16 -1
- data/tests/aws/models/iam/users_tests.rb +16 -2
- data/tests/aws/requests/auto_scaling/model_tests.rb +1 -3
- data/tests/aws/requests/auto_scaling/notification_configuration_tests.rb +1 -0
- data/tests/aws/requests/auto_scaling/tag_tests.rb +1 -0
- data/tests/aws/requests/compute/instance_tests.rb +2 -0
- data/tests/aws/requests/compute/snapshot_tests.rb +19 -0
- data/tests/aws/requests/compute/spot_instance_tests.rb +4 -2
- data/tests/aws/requests/compute/volume_tests.rb +8 -0
- data/tests/aws/requests/storage/bucket_tests.rb +14 -0
- data/tests/aws/requests/storage/cors_utils_tests.rb +108 -0
- data/tests/aws/requests/storage/object_tests.rb +18 -1
- data/tests/aws/requests/storage/versioning_tests.rb +70 -0
- data/tests/brightbox/compute_tests.rb +96 -4
- data/tests/brightbox/models/compute/account_tests.rb +17 -0
- data/tests/brightbox/models/compute/server_tests.rb +21 -0
- data/tests/brightbox/oauth2_tests.rb +103 -0
- data/tests/brightbox/requests/compute/account_tests.rb +9 -2
- data/tests/brightbox/requests/compute/firewall_policy_tests.rb +33 -0
- data/tests/brightbox/requests/compute/firewall_rule_tests.rb +43 -0
- data/tests/brightbox/requests/compute/helper.rb +33 -30
- data/tests/brightbox/requests/compute/interface_tests.rb +18 -4
- data/tests/compute/helper.rb +28 -6
- data/tests/compute/models/flavors_tests.rb +4 -2
- data/tests/compute/models/server_tests.rb +5 -1
- data/tests/compute/models/servers_tests.rb +5 -2
- data/tests/core/wait_for_tests.rb +13 -0
- data/tests/dns/models/record_tests.rb +17 -3
- data/tests/ecloud/compute/models/admin_organization_tests.rb +16 -0
- data/tests/ecloud/compute/models/compute_pool_tests.rb +17 -0
- data/tests/ecloud/compute/models/detached_disk_tests.rb +26 -0
- data/tests/ecloud/compute/models/environment_tests.rb +23 -0
- data/tests/ecloud/compute/models/internet_service_tests.rb +28 -0
- data/tests/ecloud/compute/models/ip_address_tests.rb +19 -0
- data/tests/ecloud/compute/models/network_tests.rb +17 -0
- data/tests/ecloud/compute/models/operating_system_families_tests.rb +13 -0
- data/tests/ecloud/compute/models/operating_system_tests.rb +22 -0
- data/tests/ecloud/compute/models/organization_tests.rb +21 -0
- data/tests/ecloud/compute/models/public_ip_tests.rb +19 -0
- data/tests/ecloud/compute/models/server_tests.rb +143 -0
- data/tests/ecloud/compute/models/ssh_key_tests.rb +19 -0
- data/tests/ecloud/compute/models/template_tests.rb +20 -0
- data/tests/openstack/authenticate_tests.rb +142 -0
- data/tests/openstack/models/compute/server_tests.rb +45 -0
- data/tests/openstack/models/identity/ec2_credential_tests.rb +41 -0
- data/tests/openstack/models/identity/ec2_credentials_tests.rb +58 -0
- data/tests/openstack/models/identity/tenant_tests.rb +6 -0
- data/tests/openstack/requests/compute/address_tests.rb +20 -19
- data/tests/openstack/requests/compute/flavor_tests.rb +4 -2
- data/tests/openstack/requests/compute/helper.rb +20 -0
- data/tests/openstack/requests/compute/limit_tests.rb +60 -0
- data/tests/openstack/requests/compute/quota_tests.rb +18 -3
- data/tests/openstack/requests/compute/security_group_tests.rb +11 -3
- data/tests/openstack/requests/compute/server_tests.rb +29 -14
- data/tests/openstack/requests/identity/ec2_credentials_tests.rb +41 -0
- data/tests/openstack/requests/identity/role_tests.rb +0 -1
- data/tests/openstack/requests/identity/user_tests.rb +8 -0
- data/tests/rackspace/models/block_storage/snapshot_tests.rb +18 -11
- data/tests/rackspace/models/block_storage/volume_tests.rb +13 -7
- data/tests/rackspace/models/compute_v2/image_tests.rb +28 -0
- data/tests/rackspace/models/compute_v2/server_tests.rb +15 -0
- data/tests/rackspace/models/compute_v2/servers_tests.rb +6 -0
- data/tests/rackspace/models/load_balancers/load_balancer_tests.rb +17 -0
- data/tests/rackspace/models/storage/file_tests.rb +178 -0
- data/tests/rackspace/requests/compute/address_tests.rb +11 -9
- data/tests/rackspace/requests/compute/flavor_tests.rb +6 -5
- data/tests/rackspace/requests/compute/image_tests.rb +12 -10
- data/tests/rackspace/requests/compute/resize_tests.rb +8 -6
- data/tests/rackspace/requests/compute/server_tests.rb +19 -17
- data/tests/rackspace/requests/compute_v2/address_tests.rb +43 -0
- data/tests/rackspace/requests/compute_v2/image_tests.rb +38 -10
- data/tests/rackspace/requests/dns/helper.rb +12 -26
- data/tests/rackspace/requests/dns/records_tests.rb +2 -2
- data/tests/rackspace/requests/load_balancers/content_caching_tests.rb +25 -0
- data/tests/rackspace/requests/load_balancers/helper.rb +5 -1
- data/tests/vsphere/compute_tests.rb +3 -3
- data/tests/vsphere/models/compute/server_tests.rb +1 -2
- data/tests/vsphere/requests/compute/list_virtual_machines_tests.rb +5 -13
- data/tests/vsphere/requests/compute/vm_clone_tests.rb +6 -4
- data/tests/xenserver/models/compute/host_metrics_tests.rb +48 -0
- data/tests/xenserver/models/compute/host_tests.rb +20 -1
- data/tests/xenserver/models/compute/pbd_tests.rb +33 -1
- data/tests/xenserver/models/compute/pool_tests.rb +7 -1
- data/tests/xenserver/models/compute/storage_repository_tests.rb +52 -1
- data/tests/xenserver/requests/compute/create_sr_tests.rb +54 -0
- data/tests/xenserver/requests/compute/destroy_sr_tests.rb +46 -0
- data/tests/xenserver/requests/compute/disable_host_tests.rb +16 -0
- data/tests/xenserver/requests/compute/enable_host_tests.rb +16 -0
- data/tests/xenserver/requests/compute/unplug_pbd_tests.rb +48 -0
- metadata +312 -89
- data/docs/_config.yml +0 -39
- data/docs/_layouts/default.html +0 -111
- data/docs/about/contributing.markdown +0 -228
- data/docs/about/getting_started.markdown +0 -108
- data/docs/about/press.markdown +0 -52
- data/docs/about/structure.markdown +0 -78
- data/docs/about/users.markdown +0 -34
- data/docs/cdn/index.markdown +0 -148
- data/docs/compute/index.markdown +0 -122
- data/docs/dns/index.markdown +0 -79
- data/docs/index.markdown +0 -88
- data/docs/public/crossdomain.xml +0 -25
- data/docs/public/css/fog.css +0 -142
- data/docs/public/css/handheld.css +0 -8
- data/docs/public/css/style.css +0 -129
- data/docs/public/images/.gitignore +0 -3
- data/docs/public/images/engineyard.png +0 -0
- data/docs/public/images/fog.png +0 -0
- data/docs/public/js/libs/dd_belatedpng.js +0 -289
- data/docs/public/js/libs/dd_belatedpng.min.js +0 -13
- data/docs/public/js/libs/jquery-1.4.2.js +0 -6240
- data/docs/public/js/libs/jquery-1.4.2.min.js +0 -154
- data/docs/public/js/libs/modernizr-1.6.js +0 -892
- data/docs/public/js/libs/modernizr-1.6.min.js +0 -30
- data/docs/public/js/mylibs/.gitignore +0 -3
- data/docs/public/js/plugins.js +0 -34
- data/docs/public/js/profiling/config.js +0 -59
- data/docs/public/js/profiling/yahoo-profiling.css +0 -7
- data/docs/public/js/profiling/yahoo-profiling.js +0 -1028
- data/docs/public/js/profiling/yahoo-profiling.min.js +0 -39
- data/docs/public/js/script.js +0 -26
- data/docs/public/robots.txt +0 -5
- data/docs/storage/index.markdown +0 -204
- data/lib/fog/ecloud/requests/compute/get_admin_organizations.rb +0 -11
- data/lib/fog/ecloud/requests/compute/get_ip_addresses.rb +0 -11
- data/lib/fog/ecloud/requests/compute/get_operating_system_family.rb +0 -11
- data/lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb +0 -40
- data/lib/fog/vsphere/requests/compute/datacenters.rb +0 -34
- data/lib/fog/vsphere/requests/compute/find_vm_by_ref.rb +0 -41
- data/lib/fog/vsphere/requests/compute/vm_create.rb +0 -97
- data/tests/vsphere/requests/compute/find_vm_by_ref_tests.rb +0 -26
- data/tests/vsphere/requests/compute/vm_create_tests.rb +0 -20
@@ -10,12 +10,12 @@ module Fog
|
|
10
10
|
model Fog::Compute::Bluebox::Flavor
|
11
11
|
|
12
12
|
def all
|
13
|
-
data =
|
13
|
+
data = service.get_products.body
|
14
14
|
load(data)
|
15
15
|
end
|
16
16
|
|
17
17
|
def get(product_id)
|
18
|
-
response =
|
18
|
+
response = service.get_product(product_id)
|
19
19
|
new(response.body)
|
20
20
|
rescue Fog::Compute::Bluebox::NotFound
|
21
21
|
nil
|
@@ -7,26 +7,26 @@ module Fog
|
|
7
7
|
class Image < Fog::Model
|
8
8
|
|
9
9
|
identity :id
|
10
|
-
|
10
|
+
|
11
11
|
attribute :block_id
|
12
12
|
attribute :description
|
13
13
|
attribute :public
|
14
14
|
attribute :created_at, :aliases => 'created'
|
15
|
-
|
15
|
+
|
16
16
|
def save
|
17
17
|
requires :block_id
|
18
|
-
|
19
|
-
data =
|
18
|
+
|
19
|
+
data = service.create_template(block_id, attributes)
|
20
20
|
true
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def destroy
|
24
24
|
requires :id
|
25
|
-
|
26
|
-
data =
|
25
|
+
|
26
|
+
data = service.destroy_template(id)
|
27
27
|
true
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -10,12 +10,12 @@ module Fog
|
|
10
10
|
model Fog::Compute::Bluebox::Image
|
11
11
|
|
12
12
|
def all
|
13
|
-
data =
|
13
|
+
data = service.get_templates.body
|
14
14
|
load(data)
|
15
15
|
end
|
16
16
|
|
17
17
|
def get(template_id)
|
18
|
-
response =
|
18
|
+
response = service.get_template(template_id)
|
19
19
|
new(response.body)
|
20
20
|
rescue Fog::Compute::Bluebox::NotFound
|
21
21
|
nil
|
@@ -10,12 +10,12 @@ module Fog
|
|
10
10
|
model Fog::Compute::Bluebox::Location
|
11
11
|
|
12
12
|
def all
|
13
|
-
data =
|
13
|
+
data = service.get_locations.body
|
14
14
|
load(data)
|
15
15
|
end
|
16
16
|
|
17
17
|
def get(location_id)
|
18
|
-
response =
|
18
|
+
response = service.get_location(location_id)
|
19
19
|
new(response.body)
|
20
20
|
rescue Fog::Compute::Bluebox::NotFound
|
21
21
|
nil
|
@@ -33,23 +33,23 @@ module Fog
|
|
33
33
|
|
34
34
|
def destroy
|
35
35
|
requires :id
|
36
|
-
|
36
|
+
service.destroy_block(id)
|
37
37
|
true
|
38
38
|
end
|
39
39
|
|
40
40
|
def flavor
|
41
41
|
requires :flavor_id
|
42
|
-
|
42
|
+
service.flavors.get(flavor_id)
|
43
43
|
end
|
44
44
|
|
45
45
|
def image
|
46
46
|
requires :image_id
|
47
|
-
|
47
|
+
service.images.get(image_id)
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def location
|
51
51
|
requires :location_id
|
52
|
-
|
52
|
+
service.locations.get(location_id)
|
53
53
|
end
|
54
54
|
|
55
55
|
def private_ip_address
|
@@ -66,16 +66,16 @@ module Fog
|
|
66
66
|
|
67
67
|
def reboot(type = 'SOFT')
|
68
68
|
requires :id
|
69
|
-
|
69
|
+
service.reboot_block(id, type)
|
70
70
|
true
|
71
71
|
end
|
72
72
|
|
73
73
|
def save
|
74
|
-
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if
|
74
|
+
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
|
75
75
|
requires :flavor_id, :image_id, :location_id
|
76
76
|
options = {}
|
77
77
|
|
78
|
-
|
78
|
+
unless persisted? # new record
|
79
79
|
raise(ArgumentError, "password or public_key is required for this operation") if !password && !public_key
|
80
80
|
options['ssh_public_key'] = public_key if public_key
|
81
81
|
options['password'] = password if @password
|
@@ -88,10 +88,10 @@ module Fog
|
|
88
88
|
elsif @lb_applications
|
89
89
|
options['lb_applications'] = lb_applications
|
90
90
|
end
|
91
|
-
|
91
|
+
|
92
92
|
options['username'] = username
|
93
93
|
options['hostname'] = hostname if @hostname
|
94
|
-
data =
|
94
|
+
data = service.create_block(flavor_id, image_id, location_id, options)
|
95
95
|
merge_attributes(data.body)
|
96
96
|
true
|
97
97
|
end
|
@@ -10,7 +10,7 @@ module Fog
|
|
10
10
|
model Fog::Compute::Bluebox::Server
|
11
11
|
|
12
12
|
def all
|
13
|
-
data =
|
13
|
+
data = service.get_blocks.body
|
14
14
|
load(data)
|
15
15
|
end
|
16
16
|
|
@@ -22,7 +22,7 @@ module Fog
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def get(server_id)
|
25
|
-
if server_id && server =
|
25
|
+
if server_id && server = service.get_block(server_id).body
|
26
26
|
new(server)
|
27
27
|
end
|
28
28
|
rescue Fog::Compute::Bluebox::NotFound
|
@@ -23,7 +23,7 @@ module Fog
|
|
23
23
|
|
24
24
|
def destroy
|
25
25
|
requires :identity
|
26
|
-
|
26
|
+
service.delete_record(@zone.identity, identity)
|
27
27
|
true
|
28
28
|
end
|
29
29
|
|
@@ -34,9 +34,9 @@ module Fog
|
|
34
34
|
def save
|
35
35
|
requires :zone, :type, :name, :value
|
36
36
|
data = unless identity
|
37
|
-
|
37
|
+
service.create_record(zone.identity, type, name, value)
|
38
38
|
else
|
39
|
-
|
39
|
+
service.update_record(zone.identity, identity, {:type => type, :name => name, :content => value})
|
40
40
|
end
|
41
41
|
merge_attributes(data.body)
|
42
42
|
true
|
@@ -13,12 +13,12 @@ module Fog
|
|
13
13
|
|
14
14
|
def all
|
15
15
|
requires :zone
|
16
|
-
data =
|
16
|
+
data = service.get_records(zone.identity).body['records']
|
17
17
|
load(data)
|
18
18
|
end
|
19
19
|
|
20
20
|
def get(record_id)
|
21
|
-
data =
|
21
|
+
data = service.get_record(zone.identity, record_id).body
|
22
22
|
new(data)
|
23
23
|
rescue Fog::Service::NotFound
|
24
24
|
nil
|
@@ -31,7 +31,7 @@ module Fog
|
|
31
31
|
@records ||= begin
|
32
32
|
Fog::DNS::Bluebox::Records.new(
|
33
33
|
:zone => self,
|
34
|
-
:
|
34
|
+
:service => service
|
35
35
|
)
|
36
36
|
end
|
37
37
|
end
|
@@ -46,7 +46,7 @@ module Fog
|
|
46
46
|
|
47
47
|
def destroy
|
48
48
|
requires :identity
|
49
|
-
|
49
|
+
service.delete_zone(identity)
|
50
50
|
true
|
51
51
|
end
|
52
52
|
|
@@ -54,7 +54,7 @@ module Fog
|
|
54
54
|
requires :domain, :ttl
|
55
55
|
options = attributes.dup
|
56
56
|
options[:name] = options.delete(:domain)
|
57
|
-
data = identity.nil? ?
|
57
|
+
data = identity.nil? ? service.create_zone(options) : service.update_zone(identity, options)
|
58
58
|
merge_attributes(data.body)
|
59
59
|
true
|
60
60
|
end
|
@@ -10,12 +10,12 @@ module Fog
|
|
10
10
|
model Fog::DNS::Bluebox::Zone
|
11
11
|
|
12
12
|
def all
|
13
|
-
data =
|
13
|
+
data = service.get_zones.body['zones']
|
14
14
|
load(data)
|
15
15
|
end
|
16
16
|
|
17
17
|
def get(zone_id)
|
18
|
-
data =
|
18
|
+
data = service.get_zone(zone_id).body
|
19
19
|
new(data)
|
20
20
|
rescue Fog::Service::NotFound
|
21
21
|
nil
|
@@ -12,7 +12,7 @@ module Fog
|
|
12
12
|
# * options<~Hash>:
|
13
13
|
# * password<~String> - Password for block
|
14
14
|
# or
|
15
|
-
# *
|
15
|
+
# * ssh_public_key<~String> - SSH public key
|
16
16
|
# * username<~String> - Defaults to deploy
|
17
17
|
#
|
18
18
|
# ==== Returns
|
@@ -20,7 +20,7 @@ module Fog
|
|
20
20
|
# * body<~Hash>:
|
21
21
|
def create_block(product_id, template_id, location_id, options = {})
|
22
22
|
|
23
|
-
unless options.has_key?('password') || options.has_key?('
|
23
|
+
unless options.has_key?('password') || options.has_key?('ssh_public_key')
|
24
24
|
raise ArgumentError, 'Either password or public_key must be supplied'
|
25
25
|
end
|
26
26
|
|
@@ -30,14 +30,12 @@ module Fog
|
|
30
30
|
'location' => location_id
|
31
31
|
}
|
32
32
|
|
33
|
-
body = URI.encode options.map {|k,v| "#{k}=#{v}"}.join('&')
|
34
|
-
|
35
33
|
request(
|
36
34
|
:expects => 200,
|
37
35
|
:method => 'POST',
|
38
36
|
:path => '/api/blocks.json',
|
39
37
|
:query => query,
|
40
|
-
:body =>
|
38
|
+
:body => options.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v)}"}.join('&')
|
41
39
|
)
|
42
40
|
end
|
43
41
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fog/brightbox'
|
2
2
|
require 'fog/compute'
|
3
|
+
require 'fog/brightbox/oauth2'
|
3
4
|
|
4
5
|
module Fog
|
5
6
|
module Compute
|
@@ -16,6 +17,12 @@ module Fog
|
|
16
17
|
# User credentials (still requires client details)
|
17
18
|
recognizes :brightbox_username, :brightbox_password, :brightbox_account
|
18
19
|
|
20
|
+
# Cached tokens
|
21
|
+
recognizes :brightbox_access_token, :brightbox_refresh_token
|
22
|
+
|
23
|
+
# Automatic token management
|
24
|
+
recognizes :brightbox_token_management
|
25
|
+
|
19
26
|
# Excon connection settings
|
20
27
|
recognizes :persistent
|
21
28
|
|
@@ -106,6 +113,7 @@ module Fog
|
|
106
113
|
request :remove_nodes_load_balancer
|
107
114
|
request :remove_servers_server_group
|
108
115
|
request :reset_ftp_password_account
|
116
|
+
request :reset_ftp_password_scoped_account
|
109
117
|
request :reset_secret_api_client
|
110
118
|
request :reset_secret_application
|
111
119
|
request :shutdown_server
|
@@ -126,6 +134,137 @@ module Fog
|
|
126
134
|
request :update_user
|
127
135
|
|
128
136
|
module Shared
|
137
|
+
include Fog::Brightbox::OAuth2
|
138
|
+
|
139
|
+
# Creates a new instance of the Brightbox Compute service
|
140
|
+
#
|
141
|
+
# @note If you create service using just a refresh token when it
|
142
|
+
# expires the service will no longer be able to authenticate.
|
143
|
+
#
|
144
|
+
# @param [Hash] options
|
145
|
+
# @option options [String] :brightbox_api_url Override the default (or configured) API endpoint
|
146
|
+
# @option options [String] :brightbox_auth_url Override the default (or configured) API authentication endpoint
|
147
|
+
# @option options [String] :brightbox_client_id Client identifier to authenticate with (overrides configured)
|
148
|
+
# @option options [String] :brightbox_secret Client secret to authenticate with (overrides configured)
|
149
|
+
# @option options [String] :brightbox_username Email or user identifier for user based authentication
|
150
|
+
# @option options [String] :brightbox_password Password for user based authentication
|
151
|
+
# @option options [String] :brightbox_account Account identifier to scope this connection to
|
152
|
+
# @option options [String] :connection_options Settings to pass to underlying {Fog::Connection}
|
153
|
+
# @option options [Boolean] :persistent Sets a persistent HTTP {Fog::Connection}
|
154
|
+
# @option options [String] :brightbox_access_token Sets the OAuth access token to use rather than requesting a new token
|
155
|
+
# @option options [String] :brightbox_refresh_token Sets the refresh token to use when requesting a newer access token
|
156
|
+
# @option options [String] :brightbox_token_management Overide the existing behaviour to request access tokens if expired (default is `true`)
|
157
|
+
#
|
158
|
+
def initialize(options)
|
159
|
+
# Currently authentication and api endpoints are the same but may change
|
160
|
+
@auth_url = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL
|
161
|
+
@auth_connection = Fog::Connection.new(@auth_url)
|
162
|
+
|
163
|
+
@api_url = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL
|
164
|
+
@connection_options = options[:connection_options] || {}
|
165
|
+
@persistent = options[:persistent] || false
|
166
|
+
@connection = Fog::Connection.new(@api_url, @persistent, @connection_options)
|
167
|
+
|
168
|
+
# Authentication options
|
169
|
+
client_id = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id]
|
170
|
+
client_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
|
171
|
+
|
172
|
+
username = options[:brightbox_username] || Fog.credentials[:brightbox_username]
|
173
|
+
password = options[:brightbox_password] || Fog.credentials[:brightbox_password]
|
174
|
+
@configured_account = options[:brightbox_account] || Fog.credentials[:brightbox_account]
|
175
|
+
# Request account can be changed at anytime and changes behaviour of future requests
|
176
|
+
@scoped_account = @configured_account
|
177
|
+
|
178
|
+
credential_options = {:username => username, :password => password}
|
179
|
+
@credentials = CredentialSet.new(client_id, client_secret, credential_options)
|
180
|
+
|
181
|
+
# If existing tokens have been cached, allow continued use of them in the service
|
182
|
+
@credentials.update_tokens(options[:brightbox_access_token], options[:brightbox_refresh_token])
|
183
|
+
|
184
|
+
@token_management = options.fetch(:brightbox_token_management, true)
|
185
|
+
end
|
186
|
+
|
187
|
+
# Sets the scoped account for future requests
|
188
|
+
# @param [String] scoped_account Identifier of the account to scope request to
|
189
|
+
def scoped_account=(scoped_account)
|
190
|
+
@scoped_account = scoped_account
|
191
|
+
end
|
192
|
+
|
193
|
+
# This returns the account identifier that the request should be scoped by
|
194
|
+
# based on the options passed to the request and current configuration
|
195
|
+
#
|
196
|
+
# @param [String] options_account Any identifier passed into the request
|
197
|
+
#
|
198
|
+
# @return [String, nil] The account identifier to scope the request to or nil
|
199
|
+
def scoped_account(options_account = nil)
|
200
|
+
[options_account, @scoped_account].compact.first
|
201
|
+
end
|
202
|
+
|
203
|
+
# Resets the scoped account back to intially configured one
|
204
|
+
def scoped_account_reset
|
205
|
+
@scoped_account = @configured_account
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the scoped account being used for requests
|
209
|
+
#
|
210
|
+
# * For API clients this is the owning account
|
211
|
+
# * For User applications this is the account specified by either +account_id+
|
212
|
+
# option on the service or the +brightbox_account+ setting in your configuration
|
213
|
+
#
|
214
|
+
# @return [Fog::Compute::Brightbox::Account]
|
215
|
+
#
|
216
|
+
def account
|
217
|
+
account_data = get_scoped_account.merge(:service => self)
|
218
|
+
Fog::Compute::Brightbox::Account.new(account_data)
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns true if authentication is being performed as a user
|
222
|
+
# @return [Boolean]
|
223
|
+
def authenticating_as_user?
|
224
|
+
@credentials.user_details?
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns true if an access token is set
|
228
|
+
# @return [Boolean]
|
229
|
+
def access_token_available?
|
230
|
+
!! @credentials.access_token
|
231
|
+
end
|
232
|
+
|
233
|
+
# Returns the current access token or nil
|
234
|
+
# @return [String,nil]
|
235
|
+
def access_token
|
236
|
+
@credentials.access_token
|
237
|
+
end
|
238
|
+
|
239
|
+
# Returns the current refresh token or nil
|
240
|
+
# @return [String,nil]
|
241
|
+
def refresh_token
|
242
|
+
@credentials.refresh_token
|
243
|
+
end
|
244
|
+
|
245
|
+
# Requests a new access token
|
246
|
+
#
|
247
|
+
# @return [String] New access token
|
248
|
+
def get_access_token
|
249
|
+
begin
|
250
|
+
get_access_token!
|
251
|
+
rescue Excon::Errors::Unauthorized, Excon::Errors::BadRequest
|
252
|
+
@credentials.update_tokens(nil, nil)
|
253
|
+
end
|
254
|
+
@credentials.access_token
|
255
|
+
end
|
256
|
+
|
257
|
+
# Requests a new access token and raises if there is a problem
|
258
|
+
#
|
259
|
+
# @return [String] New access token
|
260
|
+
# @raise [Excon::Errors::BadRequest] The credentials are expired or incorrect
|
261
|
+
#
|
262
|
+
def get_access_token!
|
263
|
+
response = request_access_token(@auth_connection, @credentials)
|
264
|
+
update_credentials_from_response(@credentials, response)
|
265
|
+
@credentials.access_token
|
266
|
+
end
|
267
|
+
|
129
268
|
# Returns an identifier for the default image for use
|
130
269
|
#
|
131
270
|
# Currently tries to find the latest version Ubuntu LTS (i686) widening
|
@@ -139,120 +278,183 @@ module Fog
|
|
139
278
|
return @default_image_id unless @default_image_id.nil?
|
140
279
|
@default_image_id = Fog.credentials[:brightbox_default_image] || select_default_image
|
141
280
|
end
|
281
|
+
|
282
|
+
private
|
283
|
+
|
284
|
+
# This makes a request of the API based on the configured setting for
|
285
|
+
# token management.
|
286
|
+
#
|
287
|
+
# @param [Hash] options Excon compatible options
|
288
|
+
# @see https://github.com/geemus/excon/blob/master/lib/excon/connection.rb
|
289
|
+
#
|
290
|
+
# @return [Hash] Data of response body
|
291
|
+
#
|
292
|
+
def make_request(options)
|
293
|
+
if @token_management
|
294
|
+
managed_token_request(options)
|
295
|
+
else
|
296
|
+
authenticated_request(options)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
# This request checks for access tokens and will ask for a new one if
|
301
|
+
# it receives Unauthorized from the API before repeating the request
|
302
|
+
#
|
303
|
+
# @param [Hash] options Excon compatible options
|
304
|
+
#
|
305
|
+
# @return [Excon::Response]
|
306
|
+
def managed_token_request(options)
|
307
|
+
begin
|
308
|
+
get_access_token unless access_token_available?
|
309
|
+
response = authenticated_request(options)
|
310
|
+
rescue Excon::Errors::Unauthorized
|
311
|
+
get_access_token
|
312
|
+
response = authenticated_request(options)
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
# This request makes an authenticated request of the API using currently
|
317
|
+
# setup credentials.
|
318
|
+
#
|
319
|
+
# @param [Hash] options Excon compatible options
|
320
|
+
#
|
321
|
+
# @see https://github.com/geemus/excon/blob/master/lib/excon/connection.rb
|
322
|
+
#
|
323
|
+
# @return [Excon::Response]
|
324
|
+
def authenticated_request(options)
|
325
|
+
headers = options[:headers] || {}
|
326
|
+
headers.merge!("Authorization" => "OAuth #{@credentials.access_token}", "Content-Type" => "application/json")
|
327
|
+
options[:headers] = headers
|
328
|
+
# TODO This is just a wrapper around a call to Excon::Connection#request
|
329
|
+
# so can be extracted from Compute by passing in the connection,
|
330
|
+
# credentials and options
|
331
|
+
@connection.request(options)
|
332
|
+
end
|
142
333
|
end
|
143
334
|
|
335
|
+
# The Mock Service allows you to run a fake instance of the Service
|
336
|
+
# which makes no real connections.
|
337
|
+
#
|
338
|
+
# @todo Implement
|
339
|
+
#
|
144
340
|
class Mock
|
145
341
|
include Shared
|
146
342
|
|
147
|
-
def
|
148
|
-
|
149
|
-
@brightbox_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
|
343
|
+
def request(method, path, expected_responses, parameters = {})
|
344
|
+
_request
|
150
345
|
end
|
151
346
|
|
152
|
-
def
|
153
|
-
|
347
|
+
def request_access_token(connection, credentials)
|
348
|
+
_request
|
154
349
|
end
|
155
350
|
|
156
351
|
private
|
352
|
+
|
353
|
+
def _request
|
354
|
+
raise Fog::Errors::MockNotImplemented
|
355
|
+
end
|
356
|
+
|
157
357
|
def select_default_image
|
158
358
|
"img-mockd"
|
159
359
|
end
|
160
360
|
end
|
161
361
|
|
362
|
+
# The Real Service actually makes real connections to the Brightbox
|
363
|
+
# service.
|
364
|
+
#
|
162
365
|
class Real
|
163
366
|
include Shared
|
164
367
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
368
|
+
# Makes an API request to the given path using passed options or those
|
369
|
+
# set with the service setup
|
370
|
+
#
|
371
|
+
# @todo Standard Fog behaviour is to return the Excon::Response but
|
372
|
+
# this was unintentionally changed to be the Hash version of the
|
373
|
+
# data in the body. This loses access to some details and should
|
374
|
+
# be corrected in a backwards compatible manner
|
375
|
+
#
|
376
|
+
# @overload request(params)
|
377
|
+
# @param [Hash] params Excon compatible options
|
378
|
+
# @option params [String] :body text to be sent over a socket
|
379
|
+
# @option params [Hash<Symbol, String>] :headers The default headers to supply in a request
|
380
|
+
# @option params [String] :host The destination host's reachable DNS name or IP, in the form of a String
|
381
|
+
# @option params [String] :path appears after 'scheme://host:port/'
|
382
|
+
# @option params [Fixnum] :port The port on which to connect, to the destination host
|
383
|
+
# @option params [Hash] :query appended to the 'scheme://host:port/path/' in the form of '?key=value'
|
384
|
+
# @option params [String] :scheme The protocol; 'https' causes OpenSSL to be used
|
385
|
+
# @return [Excon::Response]
|
386
|
+
# @see https://github.com/geemus/excon/blob/master/lib/excon/connection.rb
|
387
|
+
#
|
388
|
+
# @overload request(method, path, expected_responses, params = {})
|
389
|
+
# @param [String] method HTTP method to use for the request
|
390
|
+
# @param [String] path The absolute path for the request
|
391
|
+
# @param [Array<Fixnum>] expected_responses HTTP response codes that have been successful
|
392
|
+
# @param [Hash] params Keys and values for JSON
|
393
|
+
# @option params [String] :account_id The scoping account if required
|
394
|
+
# @deprecated #request with multiple arguments is deprecated
|
395
|
+
# since it is inconsistent with original fog version.
|
396
|
+
# @return [Hash]
|
397
|
+
def request(*args)
|
398
|
+
if args.size == 1
|
399
|
+
authenticated_request(*args)
|
400
|
+
else
|
401
|
+
Fog::Logger.deprecation("#request with multiple parameters is deprecated, use #wrapped_request instead [light_black](#{caller.first})[/]")
|
402
|
+
wrapped_request(*args)
|
403
|
+
end
|
188
404
|
end
|
189
405
|
|
190
|
-
#
|
406
|
+
# Makes a request but with seperated arguments and parses the response to a hash
|
191
407
|
#
|
192
|
-
#
|
193
|
-
# User Apps:: This is the account specified by either +account_id+
|
194
|
-
# option on a connection or the +brightbox_account+
|
195
|
-
# setting in your configuration
|
408
|
+
# @note #wrapped_request is the non-standard form of request introduced by mistake
|
196
409
|
#
|
197
|
-
#
|
410
|
+
# @param [String] method HTTP method to use for the request
|
411
|
+
# @param [String] path The absolute path for the request
|
412
|
+
# @param [Array<Fixnum>] expected_responses HTTP response codes that have been successful
|
413
|
+
# @param [Hash] parameters Keys and values for JSON
|
414
|
+
# @option parameters [String] :account_id The scoping account if required
|
198
415
|
#
|
199
|
-
#
|
200
|
-
|
201
|
-
|
202
|
-
Fog::Compute::Brightbox::Account.new(get_scoped_account)
|
416
|
+
# @return [Hash]
|
417
|
+
def wrapped_request(method, path, expected_responses, parameters = {})
|
418
|
+
_wrapped_request(method, path, expected_responses, parameters)
|
203
419
|
end
|
204
420
|
|
205
421
|
private
|
206
|
-
def get_oauth_token(options = {})
|
207
|
-
auth_url = options[:brightbox_auth_url] || @auth_url
|
208
|
-
|
209
|
-
connection = Fog::Connection.new(auth_url)
|
210
|
-
authentication_body_hash = if @brightbox_username && @brightbox_password
|
211
|
-
{
|
212
|
-
'client_id' => @brightbox_client_id,
|
213
|
-
'grant_type' => 'password',
|
214
|
-
'username' => @brightbox_username,
|
215
|
-
'password' => @brightbox_password
|
216
|
-
}
|
217
|
-
else
|
218
|
-
{'client_id' => @brightbox_client_id, 'grant_type' => 'none'}
|
219
|
-
end
|
220
|
-
@authentication_body = Fog::JSON.encode(authentication_body_hash)
|
221
|
-
|
222
|
-
response = connection.request({
|
223
|
-
:path => "/token",
|
224
|
-
:expects => 200,
|
225
|
-
:headers => {
|
226
|
-
'Authorization' => "Basic " + Base64.encode64("#{@brightbox_client_id}:#{@brightbox_secret}").chomp,
|
227
|
-
'Content-Type' => 'application/json'
|
228
|
-
},
|
229
|
-
:method => 'POST',
|
230
|
-
:body => @authentication_body
|
231
|
-
})
|
232
|
-
@oauth_token = Fog::JSON.decode(response.body)["access_token"]
|
233
|
-
return @oauth_token
|
234
|
-
end
|
235
422
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
423
|
+
# Wrapped request is the non-standard form of request introduced by mistake
|
424
|
+
#
|
425
|
+
# @param [String] method HTTP method to use for the request
|
426
|
+
# @param [String] path The absolute path for the request
|
427
|
+
# @param [Array<Fixnum>] expected_responses HTTP response codes that have been successful
|
428
|
+
# @param [Hash] parameters Keys and values for JSON
|
429
|
+
# @option parameters [String] :account_id The scoping account if required
|
430
|
+
#
|
431
|
+
# @return [Hash]
|
432
|
+
def _wrapped_request(method, path, expected_responses, parameters = {})
|
433
|
+
request_options = {
|
434
|
+
:method => method.to_s.upcase,
|
435
|
+
:path => path,
|
436
|
+
:expects => expected_responses
|
437
|
+
}
|
438
|
+
|
439
|
+
# Select the account to scope for this request
|
440
|
+
account = scoped_account(parameters.fetch(:account_id, nil))
|
441
|
+
if account
|
442
|
+
request_options[:query] = { :account_id => account }
|
243
443
|
end
|
444
|
+
|
445
|
+
request_options[:body] = Fog::JSON.encode(parameters) unless parameters.empty?
|
446
|
+
|
447
|
+
response = make_request(request_options)
|
448
|
+
|
449
|
+
# FIXME We should revert to returning the Excon::Request after a suitable
|
450
|
+
# configuration option is in place to switch back to this incorrect behaviour
|
244
451
|
unless response.body.empty?
|
245
|
-
|
452
|
+
Fog::JSON.decode(response.body)
|
453
|
+
else
|
454
|
+
response
|
246
455
|
end
|
247
456
|
end
|
248
457
|
|
249
|
-
def authenticated_request(options)
|
250
|
-
headers = options[:headers] || {}
|
251
|
-
headers.merge!("Authorization" => "OAuth #{@oauth_token}", "Content-Type" => "application/json")
|
252
|
-
options[:headers] = headers
|
253
|
-
@connection.request(options)
|
254
|
-
end
|
255
|
-
|
256
458
|
# Queries the API and tries to select the most suitable official Image
|
257
459
|
# to use if the user chooses not to select their own.
|
258
460
|
def select_default_image
|