fog 1.18.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +6 -0
- data/CONTRIBUTING.md +22 -0
- data/LICENSE.md +20 -0
- data/README.md +41 -60
- data/Rakefile +2 -0
- data/changelog.txt +262 -0
- data/fog.gemspec +3 -3
- data/lib/fog/aws.rb +9 -7
- data/lib/fog/aws/cloud_watch.rb +0 -1
- data/lib/fog/aws/compute.rb +2 -0
- data/lib/fog/aws/dns.rb +2 -1
- data/lib/fog/aws/elb.rb +2 -0
- data/lib/fog/aws/models/auto_scaling/configuration.rb +4 -0
- data/lib/fog/aws/models/compute/address.rb +6 -5
- data/lib/fog/aws/models/compute/flavors.rb +10 -0
- data/lib/fog/aws/models/compute/spot_request.rb +1 -1
- data/lib/fog/aws/models/compute/subnet.rb +4 -0
- data/lib/fog/aws/models/compute/vpc.rb +5 -0
- data/lib/fog/aws/models/dns/records.rb +1 -3
- data/lib/fog/aws/models/elb/load_balancer.rb +10 -0
- data/lib/fog/aws/models/glacier/vault.rb +1 -1
- data/lib/fog/aws/models/rds/server.rb +5 -2
- data/lib/fog/aws/models/rds/subnet_group.rb +15 -1
- data/lib/fog/aws/models/storage/file.rb +2 -2
- data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +6 -0
- data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +25 -0
- data/lib/fog/aws/parsers/compute/describe_addresses.rb +1 -1
- data/lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb +40 -0
- data/lib/fog/aws/parsers/rds/delete_db_subnet_group.rb +35 -0
- data/lib/fog/aws/rds.rb +3 -3
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +2 -0
- data/lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb +1 -1
- data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +60 -0
- data/lib/fog/aws/requests/compute/create_route.rb +1 -1
- data/lib/fog/aws/requests/compute/describe_images.rb +1 -1
- data/lib/fog/aws/requests/compute/describe_subnets.rb +8 -0
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +8 -0
- data/lib/fog/aws/requests/compute/modify_vpc_attribute.rb +59 -0
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +26 -9
- data/lib/fog/aws/requests/dns/create_hosted_zone.rb +12 -3
- data/lib/fog/aws/requests/dns/delete_hosted_zone.rb +33 -0
- data/lib/fog/aws/requests/dns/get_change.rb +26 -0
- data/lib/fog/aws/requests/dns/get_hosted_zone.rb +1 -1
- data/lib/fog/aws/requests/dns/list_hosted_zones.rb +3 -8
- data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +68 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -0
- data/lib/fog/aws/requests/elb/describe_load_balancer_attributes.rb +54 -0
- data/lib/fog/aws/requests/elb/modify_load_balancer_attributes.rb +59 -0
- data/lib/fog/aws/requests/rds/create_db_instance.rb +7 -1
- data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +7 -1
- data/lib/fog/aws/requests/rds/delete_db_subnet_group.rb +42 -0
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +6 -4
- data/lib/fog/aws/requests/storage/put_bucket.rb +4 -1
- data/lib/fog/aws/sqs.rb +2 -4
- data/lib/fog/aws/storage.rb +14 -1
- data/lib/fog/bluebox/compute.rb +1 -1
- data/lib/fog/brightbox/compute.rb +7 -9
- data/lib/fog/brightbox/compute/image_selector.rb +1 -1
- data/lib/fog/brightbox/compute/shared.rb +8 -10
- data/lib/fog/brightbox/models/compute/api_client.rb +1 -1
- data/lib/fog/brightbox/models/compute/application.rb +1 -4
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +8 -5
- data/lib/fog/brightbox/models/compute/collaboration.rb +0 -2
- data/lib/fog/brightbox/models/compute/collaborations.rb +1 -1
- data/lib/fog/brightbox/models/compute/firewall_policy.rb +2 -4
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +1 -1
- data/lib/fog/brightbox/models/compute/image.rb +1 -3
- data/lib/fog/brightbox/models/compute/load_balancer.rb +11 -8
- data/lib/fog/brightbox/models/compute/server.rb +28 -20
- data/lib/fog/brightbox/models/compute/server_group.rb +9 -11
- data/lib/fog/brightbox/models/compute/zone.rb +1 -1
- data/lib/fog/brightbox/oauth2.rb +3 -3
- data/lib/fog/brightbox/requests/compute/update_server.rb +1 -1
- data/lib/fog/cloudstack.rb +1 -1
- data/lib/fog/compute.rb +2 -2
- data/lib/fog/core.rb +1 -1
- data/lib/fog/core/connection.rb +1 -2
- data/lib/fog/core/errors.rb +3 -3
- data/lib/fog/core/hmac.rb +3 -3
- data/lib/fog/core/mock.rb +9 -2
- data/lib/fog/core/scp.rb +1 -1
- data/lib/fog/core/wait_for.rb +1 -1
- data/lib/fog/core/{timeout.rb → wait_for_defaults.rb} +10 -0
- data/lib/fog/digitalocean/models/compute/server.rb +4 -0
- data/lib/fog/digitalocean/requests/compute/create_server.rb +2 -0
- data/lib/fog/dnsimple/dns.rb +1 -1
- data/lib/fog/dreamhost/dns.rb +2 -4
- data/lib/fog/ecloud/compute.rb +1 -1
- data/lib/fog/ecloud/models/compute/environments.rb +5 -3
- data/lib/fog/google/compute.rb +105 -68
- data/lib/fog/google/examples/create.rb +1 -0
- data/lib/fog/google/models/compute/disk.rb +7 -1
- data/lib/fog/google/models/compute/operation.rb +42 -0
- data/lib/fog/google/models/compute/operations.rb +26 -0
- data/lib/fog/google/models/compute/server.rb +18 -2
- data/lib/fog/google/models/compute/servers.rb +2 -1
- data/lib/fog/google/models/compute/zones.rb +1 -1
- data/lib/fog/google/models/storage/file.rb +1 -1
- data/lib/fog/google/models/storage/files.rb +1 -1
- data/lib/fog/google/requests/compute/delete_disk.rb +22 -2
- data/lib/fog/google/requests/compute/delete_global_operation.rb +29 -0
- data/lib/fog/google/requests/compute/delete_server.rb +13 -9
- data/lib/fog/google/requests/compute/delete_zone_operation.rb +33 -0
- data/lib/fog/google/requests/compute/get_disk.rb +26 -2
- data/lib/fog/google/requests/compute/{delete_operation.rb → get_global_operation.rb} +5 -6
- data/lib/fog/google/requests/compute/get_image.rb +3 -3
- data/lib/fog/google/requests/compute/get_server.rb +1 -0
- data/lib/fog/google/requests/compute/get_zone_operation.rb +58 -0
- data/lib/fog/google/requests/compute/insert_disk.rb +43 -3
- data/lib/fog/google/requests/compute/insert_firewall.rb +2 -1
- data/lib/fog/google/requests/compute/insert_image.rb +2 -2
- data/lib/fog/google/requests/compute/insert_server.rb +64 -35
- data/lib/fog/google/requests/compute/list_disks.rb +8 -2
- data/lib/fog/google/requests/compute/list_images.rb +2 -2
- data/lib/fog/google/requests/compute/list_machine_types.rb +2 -2
- data/lib/fog/google/requests/compute/list_servers.rb +2 -2
- data/lib/fog/google/requests/compute/list_zone_operations.rb +2 -1
- data/lib/fog/google/requests/compute/list_zones.rb +1 -1
- data/lib/fog/google/requests/storage/copy_object.rb +1 -1
- data/lib/fog/hp.rb +1 -1
- data/lib/fog/hp/README.md +57 -0
- data/lib/fog/hp/articles/auth_caching.md +23 -0
- data/lib/fog/hp/docs/connect.md +152 -0
- data/lib/fog/hp/docs/install.md +133 -0
- data/lib/fog/hp/examples/block_storage.md +296 -0
- data/lib/fog/hp/examples/block_storage_v2.md +446 -0
- data/lib/fog/hp/examples/cdn.md +54 -0
- data/lib/fog/hp/examples/compute.md +794 -0
- data/lib/fog/hp/examples/compute_v2.md +848 -0
- data/lib/fog/hp/examples/getting_started_examples.md +30 -0
- data/lib/fog/hp/examples/networking.md +472 -0
- data/lib/fog/hp/examples/object_storage.md +387 -0
- data/lib/fog/json.rb +6 -3
- data/lib/fog/local/models/storage/directories.rb +8 -4
- data/lib/fog/openstack/compute.rb +3 -0
- data/lib/fog/openstack/examples/compute/basics.rb +74 -0
- data/lib/fog/openstack/identity.rb +2 -3
- data/lib/fog/openstack/image.rb +1 -4
- data/lib/fog/openstack/metering.rb +1 -4
- data/lib/fog/openstack/models/compute/host.rb +5 -1
- data/lib/fog/openstack/models/compute/security_group.rb +18 -4
- data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
- data/lib/fog/openstack/models/compute/security_group_rules.rb +22 -0
- data/lib/fog/openstack/models/volume/volume_type.rb +20 -0
- data/lib/fog/openstack/models/volume/volume_types.rb +26 -0
- data/lib/fog/openstack/network.rb +34 -6
- data/lib/fog/openstack/requests/compute/add_flavor_access.rb +1 -1
- data/lib/fog/openstack/requests/compute/allocate_address.rb +1 -1
- data/lib/fog/openstack/requests/compute/attach_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_key_pair.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group.rb +4 -4
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +2 -2
- data/lib/fog/openstack/requests/compute/create_server.rb +12 -5
- data/lib/fog/openstack/requests/compute/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +2 -0
- data/lib/fog/openstack/requests/compute/get_security_group.rb +14 -24
- data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
- data/lib/fog/openstack/requests/compute/list_hosts.rb +3 -3
- data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -1
- data/lib/fog/openstack/requests/compute/remove_flavor_access.rb +1 -1
- data/lib/fog/openstack/requests/compute/update_quota.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_ec2_credential.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
- data/lib/fog/openstack/requests/identity/update_user.rb +1 -1
- data/lib/fog/openstack/requests/image/update_image_members.rb +1 -1
- data/lib/fog/openstack/requests/orchestration/create_stack.rb +2 -2
- data/lib/fog/openstack/requests/orchestration/update_stack.rb +1 -1
- data/lib/fog/openstack/requests/storage/get_object_http_url.rb +13 -0
- data/lib/fog/openstack/requests/storage/get_object_https_url.rb +0 -14
- data/lib/fog/openstack/requests/volume/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/volume/get_volume_type_details.rb +32 -0
- data/lib/fog/openstack/requests/volume/list_volume_types.rb +41 -0
- data/lib/fog/openstack/storage.rb +2 -0
- data/lib/fog/openstack/volume.rb +9 -5
- data/lib/fog/rackspace/compute.rb +1 -4
- data/lib/fog/rackspace/compute_v2.rb +1 -0
- data/lib/fog/rackspace/docs/auto_scale.md +9 -9
- data/lib/fog/rackspace/docs/getting_started.md +1 -0
- data/lib/fog/rackspace/docs/queues.md +312 -0
- data/lib/fog/rackspace/examples/queues/claim_messages.rb +60 -0
- data/lib/fog/rackspace/examples/queues/create_queue.rb +45 -0
- data/lib/fog/rackspace/examples/queues/delete_message.rb +72 -0
- data/lib/fog/rackspace/examples/queues/delete_queue.rb +53 -0
- data/lib/fog/rackspace/examples/queues/list_messages.rb +64 -0
- data/lib/fog/rackspace/examples/queues/post_message.rb +59 -0
- data/lib/fog/rackspace/models/compute_v2/key_pairs.rb +1 -1
- data/lib/fog/rackspace/models/compute_v2/server.rb +9 -3
- data/lib/fog/rackspace/models/compute_v2/servers.rb +2 -2
- data/lib/fog/rackspace/models/identity/service_catalog.rb +44 -59
- data/lib/fog/rackspace/models/queues/claim.rb +41 -1
- data/lib/fog/rackspace/models/queues/claims.rb +25 -0
- data/lib/fog/rackspace/models/queues/message.rb +43 -5
- data/lib/fog/rackspace/models/queues/messages.rb +37 -0
- data/lib/fog/rackspace/models/queues/queue.rb +66 -3
- data/lib/fog/rackspace/models/queues/queues.rb +15 -0
- data/lib/fog/rackspace/models/storage/file.rb +8 -1
- data/lib/fog/rackspace/requests/compute_v2/delete_keypair.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/get_keypair.rb +1 -1
- data/lib/fog/rackspace/requests/queues/create_claim.rb +15 -0
- data/lib/fog/rackspace/requests/queues/create_message.rb +15 -0
- data/lib/fog/rackspace/requests/queues/create_queue.rb +11 -0
- data/lib/fog/rackspace/requests/queues/delete_claim.rb +12 -0
- data/lib/fog/rackspace/requests/queues/delete_message.rb +14 -0
- data/lib/fog/rackspace/requests/queues/delete_queue.rb +10 -0
- data/lib/fog/rackspace/requests/queues/get_claim.rb +11 -0
- data/lib/fog/rackspace/requests/queues/get_message.rb +12 -0
- data/lib/fog/rackspace/requests/queues/get_queue.rb +10 -0
- data/lib/fog/rackspace/requests/queues/get_queue_stats.rb +10 -0
- data/lib/fog/rackspace/requests/queues/list_messages.rb +26 -0
- data/lib/fog/rackspace/requests/queues/list_queues.rb +17 -2
- data/lib/fog/rackspace/requests/queues/update_claim.rb +7 -0
- data/lib/fog/rackspace/service.rb +6 -2
- data/lib/fog/rackspace/storage.rb +1 -4
- data/lib/fog/riakcs.rb +2 -2
- data/lib/fog/riakcs/provisioning.rb +1 -3
- data/lib/fog/riakcs/requests/provisioning/create_user.rb +2 -2
- data/lib/fog/riakcs/requests/provisioning/get_user.rb +1 -1
- data/lib/fog/riakcs/requests/provisioning/list_users.rb +1 -1
- data/lib/fog/riakcs/requests/usage/get_usage.rb +1 -1
- data/lib/fog/riakcs/usage.rb +0 -2
- data/lib/fog/vcloud_director/README.md +2 -0
- data/lib/fog/vcloud_director/compute.rb +79 -8
- data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +91 -0
- data/lib/fog/vcloud_director/generators/compute/vapp.rb +30 -0
- data/lib/fog/vcloud_director/generators/compute/vm.rb +33 -0
- data/lib/fog/vcloud_director/models/compute/medias.rb +1 -1
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/requests/compute/delete_network.rb +64 -0
- data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +433 -333
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +3 -1
- data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_configure_edge_gateway_services.rb +20 -2
- data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +176 -0
- data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +1 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +37 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm.rb +39 -0
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +3 -0
- data/lib/fog/vsphere/models/compute/datastore.rb +1 -0
- data/lib/fog/vsphere/models/compute/interface.rb +50 -2
- data/lib/fog/vsphere/models/compute/interfaces.rb +25 -10
- data/lib/fog/vsphere/models/compute/scsicontroller.rb +19 -0
- data/lib/fog/vsphere/models/compute/server.rb +27 -8
- data/lib/fog/vsphere/requests/compute/create_vm.rb +34 -8
- data/lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb +26 -0
- data/lib/fog/vsphere/requests/compute/list_datastores.rb +9 -8
- data/lib/fog/vsphere/requests/compute/modify_vm_interface.rb +9 -6
- data/lib/fog/vsphere/requests/compute/set_vm_customvalue.rb +19 -0
- data/lib/fog/xenserver.rb +2 -1
- data/lib/fog/xenserver/compute.rb +37 -1
- data/lib/fog/xenserver/models/compute/blob.rb +22 -0
- data/lib/fog/xenserver/models/compute/blobs.rb +25 -0
- data/lib/fog/xenserver/models/compute/bond.rb +23 -0
- data/lib/fog/xenserver/models/compute/bonds.rb +25 -0
- data/lib/fog/xenserver/models/compute/console.rb +3 -1
- data/lib/fog/xenserver/models/compute/crash_dump.rb +19 -0
- data/lib/fog/xenserver/models/compute/crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/dr_task.rb +17 -0
- data/lib/fog/xenserver/models/compute/dr_tasks.rb +25 -0
- data/lib/fog/xenserver/models/compute/gpu_group.rb +22 -0
- data/lib/fog/xenserver/models/compute/gpu_groups.rb +25 -0
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +2 -1
- data/lib/fog/xenserver/models/compute/host.rb +41 -8
- data/lib/fog/xenserver/models/compute/host_cpu.rb +2 -1
- data/lib/fog/xenserver/models/compute/host_crash_dump.rb +20 -0
- data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/host_patch.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/network.rb +7 -6
- data/lib/fog/xenserver/models/compute/pbd.rb +3 -1
- data/lib/fog/xenserver/models/compute/pci.rb +22 -0
- data/lib/fog/xenserver/models/compute/pcis.rb +25 -0
- data/lib/fog/xenserver/models/compute/pgpu.rb +20 -0
- data/lib/fog/xenserver/models/compute/pgpus.rb +25 -0
- data/lib/fog/xenserver/models/compute/pif.rb +19 -8
- data/lib/fog/xenserver/models/compute/pif_metrics.rb +28 -0
- data/lib/fog/xenserver/models/compute/pifs_metrics.rb +25 -0
- data/lib/fog/xenserver/models/compute/pool.rb +18 -1
- data/lib/fog/xenserver/models/compute/pool_patch.rb +24 -0
- data/lib/fog/xenserver/models/compute/pool_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/role.rb +19 -0
- data/lib/fog/xenserver/models/compute/roles.rb +25 -0
- data/lib/fog/xenserver/models/compute/server.rb +59 -26
- data/lib/fog/xenserver/models/compute/server_appliance.rb +21 -0
- data/lib/fog/xenserver/models/compute/server_appliances.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_manager.rb +28 -0
- data/lib/fog/xenserver/models/compute/storage_managers.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_repository.rb +4 -1
- data/lib/fog/xenserver/models/compute/tunnel.rb +20 -0
- data/lib/fog/xenserver/models/compute/tunnels.rb +25 -0
- data/lib/fog/xenserver/models/compute/vbd.rb +3 -2
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/vdi.rb +4 -1
- data/lib/fog/xenserver/models/compute/vif.rb +11 -2
- data/lib/fog/xenserver/models/compute/vlan.rb +2 -1
- data/lib/fog/xenserver/models/compute/vmpp.rb +35 -0
- data/lib/fog/xenserver/models/compute/vmpps.rb +25 -0
- data/lib/fog/xenserver/models/compute/vtpm.rb +18 -0
- data/lib/fog/xenserver/models/compute/vtpms.rb +25 -0
- data/lib/fog/xenserver/requests/compute/reboot_server.rb +1 -1
- data/lib/tasks/changelog_task.rb +0 -1
- data/tests/aws/models/dns/record_tests.rb +1 -2
- data/tests/aws/models/dns/records_tests.rb +2 -7
- data/tests/aws/models/dns/zone_tests.rb +1 -1
- data/tests/aws/models/dns/zones_tests.rb +1 -1
- data/tests/aws/models/elb/model_tests.rb +10 -0
- data/tests/aws/models/storage/file_tests.rb +4 -0
- data/tests/aws/requests/compute/assign_private_ip_tests.rb +52 -0
- data/tests/aws/requests/compute/vpc_tests.rb +17 -1
- data/tests/aws/requests/dns/dns_tests.rb +1 -26
- data/tests/aws/requests/elb/load_balancer_tests.rb +6 -0
- data/tests/aws/requests/rds/{subnet_groups_test.rb → subnet_groups_tests.rb} +4 -0
- data/tests/aws/requests/storage/bucket_tests.rb +17 -0
- data/tests/aws/requests/storage/delete_multiple_objects_tests.rb +12 -0
- data/tests/brightbox/compute/schema.rb +0 -13
- data/tests/brightbox/models/compute/server_tests.rb +7 -9
- data/tests/brightbox/requests/compute/interface_tests.rb +7 -19
- data/tests/digitalocean/models/compute/server_tests.rb +4 -3
- data/tests/google/models/compute/disk_tests.rb +5 -0
- data/tests/google/models/compute/disks_tests.rb +5 -0
- data/tests/google/models/compute/server_tests.rb +5 -1
- data/tests/google/models/compute/servers_tests.rb +5 -0
- data/tests/google/requests/compute/disk_tests.rb +2 -1
- data/tests/google/requests/compute/firewall_tests.rb +1 -0
- data/tests/google/requests/compute/image_tests.rb +3 -0
- data/tests/google/requests/compute/network_tests.rb +1 -0
- data/tests/google/requests/compute/operation_tests.rb +1 -0
- data/tests/google/requests/compute/server_tests.rb +2 -3
- data/tests/google/requests/compute/zone_tests.rb +1 -6
- data/tests/helpers/collection_helper.rb +10 -2
- data/tests/helpers/mock_helper.rb +4 -5
- data/tests/local/models/directories_tests.rb +17 -0
- data/tests/openstack/models/compute/security_group_tests.rb +54 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +22 -20
- data/tests/openstack/requests/network/network_tests.rb +8 -8
- data/tests/rackspace/compute_tests.rb +0 -5
- data/tests/rackspace/helper.rb +9 -4
- data/tests/rackspace/models/compute_v2/server_tests.rb +29 -1
- data/tests/rackspace/models/identity/service_catalog_tests.rb +87 -39
- data/tests/rackspace/models/queues/message_tests.rb +16 -0
- data/tests/rackspace/models/storage/file_tests.rb +29 -0
- data/tests/rackspace/requests/compute_v2/address_tests.rb +3 -1
- data/tests/rackspace/requests/compute_v2/metadata_tests.rb +4 -2
- data/tests/rackspace/requests/compute_v2/server_tests.rb +3 -6
- data/tests/vcloud_director/models/compute/media_tests.rb +18 -5
- data/tests/vcloud_director/models/compute/vapp_tests.rb +3 -1
- data/tests/vcloud_director/models/compute/vms_tests.rb +2 -1
- data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +19 -10
- data/tests/vcloud_director/requests/compute/network_tests.rb +64 -3
- data/tests/vcloud_director/requests/compute/query_tests.rb +67 -2
- data/tests/vsphere/requests/compute/set_vm_customvalue_tests.rb +21 -0
- metadata +112 -11
- data/fogkeytest1.pem +0 -27
- data/lib/fog/hp/README_HP.rdoc +0 -61
data/lib/fog/core/hmac.rb
CHANGED
@@ -18,7 +18,7 @@ module Fog
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def setup_sha1
|
21
|
-
@digest = OpenSSL::Digest
|
21
|
+
@digest = OpenSSL::Digest.new('sha1')
|
22
22
|
@signer = lambda do |data|
|
23
23
|
OpenSSL::HMAC.digest(@digest, @key, data)
|
24
24
|
end
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
|
27
27
|
def setup_sha256
|
28
28
|
begin
|
29
|
-
@digest = OpenSSL::Digest
|
29
|
+
@digest = OpenSSL::Digest.new('sha256')
|
30
30
|
@signer = lambda do |data|
|
31
31
|
OpenSSL::HMAC.digest(@digest, @key, data)
|
32
32
|
end
|
@@ -45,4 +45,4 @@ module Fog
|
|
45
45
|
end
|
46
46
|
|
47
47
|
end
|
48
|
-
end
|
48
|
+
end
|
data/lib/fog/core/mock.rb
CHANGED
@@ -30,8 +30,8 @@ module Fog
|
|
30
30
|
@delay = new_delay
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.not_implemented
|
34
|
-
raise Fog::Errors::MockNotImplemented.new(
|
33
|
+
def self.not_implemented(message = 'Contributions welcome!')
|
34
|
+
raise Fog::Errors::MockNotImplemented.new(message)
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.random_ip(opts = {:version => :v4})
|
@@ -74,6 +74,13 @@ module Fog
|
|
74
74
|
rand(max).to_s
|
75
75
|
end
|
76
76
|
|
77
|
+
def self.random_letters_and_numbers(length)
|
78
|
+
random_selection(
|
79
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
|
80
|
+
length
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
77
84
|
def self.random_selection(characters, length)
|
78
85
|
selection = ''
|
79
86
|
length.times do
|
data/lib/fog/core/scp.rb
CHANGED
@@ -78,7 +78,7 @@ module Fog
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
def download(remote_path, local_path, download_options = {})
|
81
|
+
def download(remote_path, local_path, download_options = {}, &block)
|
82
82
|
begin
|
83
83
|
Net::SCP.start(@address, @username, @options) do |scp|
|
84
84
|
scp.download!(remote_path, local_path, download_options) do |ch, name, sent, total|
|
data/lib/fog/core/wait_for.rb
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
module Fog
|
2
|
+
@interval = 1
|
3
|
+
def self.interval
|
4
|
+
@interval
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.interval=(interval)
|
8
|
+
raise ArgumentError, "interval must be non-negative" unless interval >= 0
|
9
|
+
@interval = interval
|
10
|
+
end
|
11
|
+
|
2
12
|
@timeout = 600
|
3
13
|
def self.timeout
|
4
14
|
@timeout
|
@@ -17,6 +17,7 @@ module Fog
|
|
17
17
|
# Not documented in their API, but
|
18
18
|
# available nevertheless
|
19
19
|
attribute :public_ip_address, :aliases => 'ip_address'
|
20
|
+
attribute :private_ip_address
|
20
21
|
attribute :backups_active
|
21
22
|
|
22
23
|
attr_writer :ssh_keys
|
@@ -124,6 +125,9 @@ module Fog
|
|
124
125
|
elsif @ssh_keys
|
125
126
|
options[:ssh_key_ids] = @ssh_keys.map(&:id)
|
126
127
|
end
|
128
|
+
|
129
|
+
options[:private_networking] = !!attributes[:private_networking]
|
130
|
+
|
127
131
|
data = service.create_server name,
|
128
132
|
flavor_id,
|
129
133
|
image_id,
|
data/lib/fog/dnsimple/dns.rb
CHANGED
@@ -85,7 +85,7 @@ module Fog
|
|
85
85
|
"Accept" => "application/json",
|
86
86
|
"Content-Type" => "application/json" })
|
87
87
|
|
88
|
-
response = @connection.request(params
|
88
|
+
response = @connection.request(params)
|
89
89
|
|
90
90
|
unless response.body.empty?
|
91
91
|
response.body = Fog::JSON.decode(response.body)
|
data/lib/fog/dreamhost/dns.rb
CHANGED
@@ -47,8 +47,6 @@ module Fog
|
|
47
47
|
class Real
|
48
48
|
|
49
49
|
def initialize(options={})
|
50
|
-
require 'multi_json'
|
51
|
-
|
52
50
|
@dreamhost_api_key = options[:dreamhost_api_key]
|
53
51
|
if options[:dreamhost_url]
|
54
52
|
uri = URI.parse(options[:dreamhost_url])
|
@@ -68,12 +66,12 @@ module Fog
|
|
68
66
|
end
|
69
67
|
|
70
68
|
def request(params)
|
71
|
-
params[:query].merge!( { :key => @dreamhost_api_key,
|
69
|
+
params[:query].merge!( { :key => @dreamhost_api_key,
|
72
70
|
:format => 'json' } )
|
73
71
|
response = @connection.request(params)
|
74
72
|
|
75
73
|
unless response.body.empty?
|
76
|
-
response.body =
|
74
|
+
response.body = Fog::JSON.decode(response.body)
|
77
75
|
end
|
78
76
|
if response.body['result'] != 'success'
|
79
77
|
raise response.body['data']
|
data/lib/fog/ecloud/compute.rb
CHANGED
@@ -291,7 +291,7 @@ module Fog
|
|
291
291
|
@connection_options = options[:connection_options] || {}
|
292
292
|
@host = options[:ecloud_host] || API_URL
|
293
293
|
@persistent = options[:persistent] || false
|
294
|
-
@version = options[:ecloud_version] || "
|
294
|
+
@version = options[:ecloud_version] || "2013-06-01"
|
295
295
|
@authentication_method = options[:ecloud_authentication_method] || :cloud_api_auth
|
296
296
|
@access_key = options[:ecloud_access_key]
|
297
297
|
@private_key = options[:ecloud_private_key]
|
@@ -15,10 +15,12 @@ module Fog
|
|
15
15
|
def all
|
16
16
|
data = []
|
17
17
|
service.get_organization(href).body[:Locations][:Location].each do |d|
|
18
|
-
|
19
|
-
|
18
|
+
environments = d[:Environments]
|
19
|
+
next unless environments
|
20
|
+
if environments[:Environment].is_a?(Array)
|
21
|
+
environments[:Environment].each { |e| data << e }
|
20
22
|
else
|
21
|
-
data <<
|
23
|
+
data << environments[:Environment]
|
22
24
|
end
|
23
25
|
end
|
24
26
|
load(data)
|
data/lib/fog/google/compute.rb
CHANGED
@@ -29,13 +29,16 @@ module Fog
|
|
29
29
|
request :get_network
|
30
30
|
request :get_zone
|
31
31
|
request :get_snapshot
|
32
|
+
request :get_global_operation
|
33
|
+
request :get_zone_operation
|
32
34
|
|
33
35
|
request :delete_disk
|
34
36
|
request :delete_firewall
|
35
37
|
request :delete_image
|
36
38
|
request :delete_network
|
37
|
-
request :delete_operation
|
38
39
|
request :delete_server
|
40
|
+
request :delete_global_operation
|
41
|
+
request :delete_zone_operation
|
39
42
|
|
40
43
|
request :insert_disk
|
41
44
|
request :insert_firewall
|
@@ -59,6 +62,9 @@ module Fog
|
|
59
62
|
model :disk
|
60
63
|
collection :disks
|
61
64
|
|
65
|
+
model :operation
|
66
|
+
collection :operations
|
67
|
+
|
62
68
|
model :snapshot
|
63
69
|
collection :snapshots
|
64
70
|
|
@@ -66,31 +72,41 @@ module Fog
|
|
66
72
|
collection :zones
|
67
73
|
|
68
74
|
module Shared
|
69
|
-
attr_reader :project
|
75
|
+
attr_reader :project, :api_version
|
70
76
|
|
71
|
-
def
|
77
|
+
def shared_initialize(options = {})
|
78
|
+
@project = options[:google_project]
|
79
|
+
@api_version = 'v1beta16'
|
80
|
+
end
|
81
|
+
|
82
|
+
def build_excon_response(body, status=200)
|
72
83
|
response = Excon::Response.new
|
73
84
|
response.body = body
|
74
|
-
if response.body["error"]
|
85
|
+
if response.body and response.body["error"]
|
75
86
|
response.status = response.body["error"]["code"]
|
76
|
-
|
77
|
-
response.
|
78
|
-
|
87
|
+
msg = response.body["error"]["errors"].map{|error| error["message"]}.join(", ")
|
88
|
+
case response.status
|
89
|
+
when 404
|
90
|
+
raise Fog::Errors::NotFound.new(msg)
|
91
|
+
else
|
92
|
+
raise Fog::Errors::Error.new(msg)
|
79
93
|
end
|
80
94
|
else
|
81
|
-
response.status =
|
95
|
+
response.status = status
|
82
96
|
end
|
83
97
|
response
|
84
98
|
end
|
85
99
|
|
86
100
|
def backoff_if_unfound(&block)
|
87
101
|
retries_remaining = 10
|
102
|
+
sleep_time = 0.1
|
88
103
|
begin
|
89
104
|
result = block.call
|
90
105
|
rescue Exception => msg
|
91
106
|
if msg.to_s.include? 'was not found' and retries_remaining > 0
|
92
107
|
retries_remaining -= 1
|
93
|
-
sleep
|
108
|
+
sleep sleep_time
|
109
|
+
sleep_time *= 1.6
|
94
110
|
retry
|
95
111
|
else
|
96
112
|
raise msg
|
@@ -98,6 +114,7 @@ module Fog
|
|
98
114
|
end
|
99
115
|
result
|
100
116
|
end
|
117
|
+
|
101
118
|
end
|
102
119
|
|
103
120
|
class Mock
|
@@ -105,7 +122,7 @@ module Fog
|
|
105
122
|
include Shared
|
106
123
|
|
107
124
|
def initialize(options={})
|
108
|
-
|
125
|
+
shared_initialize(options)
|
109
126
|
end
|
110
127
|
|
111
128
|
def build_response(params={})
|
@@ -113,7 +130,7 @@ module Fog
|
|
113
130
|
build_excon_response(body)
|
114
131
|
end
|
115
132
|
|
116
|
-
def self.data
|
133
|
+
def self.data(api_version)
|
117
134
|
@data ||= Hash.new do |hash, key|
|
118
135
|
case key
|
119
136
|
when 'google'
|
@@ -121,51 +138,51 @@ module Fog
|
|
121
138
|
:images => {
|
122
139
|
"centos-6-2-v20120621" => {
|
123
140
|
"kind" => "compute#image",
|
124
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
141
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/images/centos-6-2-v20120621",
|
125
142
|
"id" => "12920641029336858796",
|
126
143
|
"creationTimestamp" => "2012-06-21T22:59:56.392-07:00",
|
127
144
|
"name" => "centos-6-2-v20120621",
|
128
145
|
"description" => "CentOS 6.2; Created Thu, 21 Jun 2012 14:22:21 +0000",
|
129
146
|
"sourceType" => "RAW",
|
130
|
-
"preferredKernel" => "https://www.googleapis.com/compute/
|
147
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-20120621",
|
131
148
|
"rawDisk" => {
|
132
149
|
"containerType" => "TAR",
|
133
150
|
"source" => ""
|
134
151
|
},
|
135
152
|
"deprecated" => {
|
136
153
|
"state" => "DELETED",
|
137
|
-
"replacement" => "https://www.googleapis.com/compute/
|
154
|
+
"replacement" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/images/centos-6-v20130104"
|
138
155
|
},
|
139
156
|
"status" => "READY"
|
140
157
|
},
|
141
158
|
"centos-6-v20120912" => {
|
142
159
|
"kind" => "compute#image",
|
143
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
160
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/images/centos-6-v20120912",
|
144
161
|
"id" => "12994279803511049620",
|
145
162
|
"creationTimestamp" => "2012-09-18T08:52:47.584-07:00",
|
146
163
|
"name" => "centos-6-v20120912",
|
147
164
|
"description" => "CentOS 6; Created Wed, 12 Sep 2012 00:00:00 +0000",
|
148
165
|
"sourceType" => "RAW",
|
149
|
-
"preferredKernel" => "https://www.googleapis.com/compute/
|
166
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20120912",
|
150
167
|
"rawDisk" => {
|
151
168
|
"containerType" => "TAR",
|
152
169
|
"source" => ""
|
153
170
|
},
|
154
171
|
"deprecated" => {
|
155
172
|
"state" => "DEPRECATED",
|
156
|
-
"replacement" => "https://www.googleapis.com/compute/
|
173
|
+
"replacement" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/images/centos-6-v20130104"
|
157
174
|
},
|
158
175
|
"status" => "READY"
|
159
176
|
},
|
160
177
|
"centos-6-v20121106" => {
|
161
178
|
"kind" => "compute#image",
|
162
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
179
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/images/centos-6-v20121106",
|
163
180
|
"id" => "13037720516378381209",
|
164
181
|
"creationTimestamp" => "2012-11-09T11:40:41.079-08:00",
|
165
182
|
"name" => "centos-6-v20121106",
|
166
183
|
"description" => "SCSI-enabled CentOS 6; Created Tue, 06 Nov 2012 00:00:00 +0000",
|
167
184
|
"sourceType" => "RAW",
|
168
|
-
"preferredKernel" => "https://www.googleapis.com/compute/
|
185
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20121106",
|
169
186
|
"rawDisk" => {
|
170
187
|
"containerType" => "TAR",
|
171
188
|
"source" => ""
|
@@ -179,13 +196,13 @@ module Fog
|
|
179
196
|
:images => {
|
180
197
|
"debian-6-squeeze-v20130816" => {
|
181
198
|
"kind" => "compute#image",
|
182
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
199
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-6-squeeze-v20130816",
|
183
200
|
"id" => "14841592146580482051",
|
184
201
|
"creationTimestamp" => "2013-09-04T13:21:53.292-07:00",
|
185
202
|
"name" => "debian-6-squeeze-v20130816",
|
186
203
|
"description" => "Debian GNU/Linux 6.0.7 (squeeze) built on 2013-08-16",
|
187
204
|
"sourceType" => "RAW",
|
188
|
-
"preferredKernel" => "https://www.googleapis.com/compute/
|
205
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
189
206
|
"rawDisk" => {
|
190
207
|
"containerType" => "TAR",
|
191
208
|
"source" => ""
|
@@ -194,13 +211,28 @@ module Fog
|
|
194
211
|
},
|
195
212
|
"debian-7-wheezy-v20130816" => {
|
196
213
|
"kind" => "compute#image",
|
197
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
214
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20130816",
|
198
215
|
"id" => "4213305957435180899",
|
199
216
|
"creationTimestamp" => "2013-09-04T13:24:30.479-07:00",
|
200
217
|
"name" => "debian-7-wheezy-v20130816",
|
201
218
|
"description" => "Debian GNU/Linux 7.1 (wheezy) built on 2013-08-16",
|
202
219
|
"sourceType" => "RAW",
|
203
|
-
"preferredKernel" => "https://www.googleapis.com/compute/
|
220
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
221
|
+
"rawDisk" => {
|
222
|
+
"containerType" => "TAR",
|
223
|
+
"source" => ""
|
224
|
+
},
|
225
|
+
"status" => "READY"
|
226
|
+
},
|
227
|
+
"debian-7-wheezy-v20131014" => {
|
228
|
+
"kind" => "compute#image",
|
229
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20131014",
|
230
|
+
"id" => "4213305957435180899",
|
231
|
+
"creationTimestamp" => "2013-09-04T13:24:30.479-07:00",
|
232
|
+
"name" => "debian-7-wheezy-v20131014",
|
233
|
+
"description" => "Debian GNU/Linux 7.1 (wheezy) built on 2013-10-14",
|
234
|
+
"sourceType" => "RAW",
|
235
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
204
236
|
"rawDisk" => {
|
205
237
|
"containerType" => "TAR",
|
206
238
|
"source" => ""
|
@@ -214,13 +246,13 @@ module Fog
|
|
214
246
|
:images => {
|
215
247
|
"centos-6-v20130813" => {
|
216
248
|
"kind" => "compute#image",
|
217
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
249
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/centos-6-v20130813",
|
218
250
|
"id" => "4670523370938782739",
|
219
251
|
"creationTimestamp" => "2013-08-19T11:56:47.004-07:00",
|
220
252
|
"name" => "centos-6-v20130813",
|
221
253
|
"description" => "SCSI-enabled CentOS 6; Created Tue, 13 Aug 2013 00:00:00 +0000",
|
222
254
|
"sourceType" => "RAW",
|
223
|
-
"preferredKernel" => "https://www.googleapis.com/compute/
|
255
|
+
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
224
256
|
"rawDisk" => {
|
225
257
|
"containerType" => "TAR",
|
226
258
|
"source" => ""
|
@@ -236,17 +268,17 @@ module Fog
|
|
236
268
|
"kind" => "compute#instance",
|
237
269
|
"id" => "1361932147851415727",
|
238
270
|
"creationTimestamp" => "2013-09-26T04:55:43.881-07:00",
|
239
|
-
"zone" => "https://www.googleapis.com/compute/
|
271
|
+
"zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
|
240
272
|
"status" => "RUNNING",
|
241
273
|
"name" => "fog-1380196541",
|
242
274
|
"tags" => { "fingerprint" => "42WmSpB8rSM=" },
|
243
|
-
"machineType" => "https://www.googleapis.com/compute/
|
244
|
-
"image" => "https://www.googleapis.com/compute/
|
245
|
-
"kernel" => "https://www.googleapis.com/compute/
|
275
|
+
"machineType" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/machineTypes/n1-standard-1",
|
276
|
+
"image" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/centos-6-v20130813",
|
277
|
+
"kernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
246
278
|
"canIpForward" => false,
|
247
279
|
"networkInterfaces" => [
|
248
280
|
{
|
249
|
-
"network" => "https://www.googleapis.com/compute/
|
281
|
+
"network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/default",
|
250
282
|
"networkIP" => "10.240.121.54",
|
251
283
|
"name" => "nic0",
|
252
284
|
"accessConfigs" => [
|
@@ -277,13 +309,13 @@ module Fog
|
|
277
309
|
}
|
278
310
|
]
|
279
311
|
},
|
280
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
312
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/instances/fog-1380196541"
|
281
313
|
}
|
282
314
|
},
|
283
315
|
:zones => {
|
284
316
|
"europe-west1-a" => {
|
285
317
|
"kind" => "compute#zone",
|
286
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
318
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-a",
|
287
319
|
"id" => "10419676573632995924",
|
288
320
|
"creationTimestamp" => "2013-09-26T02:56:13.115-07:00",
|
289
321
|
"name" => "europe-west1-a",
|
@@ -303,27 +335,28 @@ module Fog
|
|
303
335
|
{"metric" => "DISKS", "limit" => 16.0, "usage" => 0.0},
|
304
336
|
{"metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0}
|
305
337
|
],
|
306
|
-
"region" => "https://www.googleapis.com/compute/
|
338
|
+
"region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1"
|
307
339
|
},
|
308
340
|
"us-central1-a" => {
|
309
341
|
"kind" => "compute#zone",
|
310
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
342
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
|
311
343
|
"id" => "6562457277909136262",
|
312
344
|
"creationTimestamp" => "2013-09-26T02:56:13.116-07:00",
|
313
345
|
"name" => "us-central1-a",
|
314
346
|
"description" => "us-central1-a",
|
315
347
|
"status" => "UP",
|
348
|
+
"maintenanceWindows" => nil,
|
316
349
|
"quotas" => [
|
317
350
|
{"metric" => "INSTANCES", "limit" => 16.0, "usage" => 1.0},
|
318
351
|
{"metric" => "CPUS", "limit" => 24.0, "usage" => 1.0},
|
319
352
|
{"metric" => "DISKS", "limit" => 16.0, "usage" => 0.0},
|
320
353
|
{"metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0}
|
321
354
|
],
|
322
|
-
"region" => "https://www.googleapis.com/compute/
|
355
|
+
"region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1"
|
323
356
|
},
|
324
357
|
"us-central1-b" => {
|
325
358
|
"kind" => "compute#zone",
|
326
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
359
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-b",
|
327
360
|
"id" => "8701502109626061015",
|
328
361
|
"creationTimestamp" => "2013-09-26T02:56:13.124-07:00",
|
329
362
|
"name" => "us-central1-b",
|
@@ -339,11 +372,11 @@ module Fog
|
|
339
372
|
{"metric" => "DISKS", "limit" => 16.0, "usage" => 0.0},
|
340
373
|
{"metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0}
|
341
374
|
],
|
342
|
-
"region" => "https://www.googleapis.com/compute/
|
375
|
+
"region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1"
|
343
376
|
},
|
344
377
|
"us-central2-a" => {
|
345
378
|
"kind" => "compute#zone",
|
346
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
379
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central2-a",
|
347
380
|
"id" => "13611654493253680292",
|
348
381
|
"creationTimestamp" => "2013-09-26T02:56:13.125-07:00",
|
349
382
|
"name" => "us-central2-a",
|
@@ -363,7 +396,7 @@ module Fog
|
|
363
396
|
{"metric" => "DISKS", "limit" => 16.0, "usage" => 0.0},
|
364
397
|
{"metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0}
|
365
398
|
],
|
366
|
-
"region" => "https://www.googleapis.com/compute/
|
399
|
+
"region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central2"
|
367
400
|
}
|
368
401
|
},
|
369
402
|
:machine_types => Hash.new do |machine_types_hash, zone|
|
@@ -380,7 +413,7 @@ module Fog
|
|
380
413
|
"maximumPersistentDisks" => 4,
|
381
414
|
"maximumPersistentDisksSizeGb" => "3072",
|
382
415
|
"zone" => zone,
|
383
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
416
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/f1-micro"
|
384
417
|
},
|
385
418
|
"g1-small" => {
|
386
419
|
"kind" => "compute#machineType",
|
@@ -394,7 +427,7 @@ module Fog
|
|
394
427
|
"maximumPersistentDisks" => 4,
|
395
428
|
"maximumPersistentDisksSizeGb" => "3072",
|
396
429
|
"zone" => zone,
|
397
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
430
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/g1-small"
|
398
431
|
},
|
399
432
|
"n1-highcpu-2" => {
|
400
433
|
"kind" => "compute#machineType",
|
@@ -408,7 +441,7 @@ module Fog
|
|
408
441
|
"maximumPersistentDisks" => 16,
|
409
442
|
"maximumPersistentDisksSizeGb" => "10240",
|
410
443
|
"zone" => zone,
|
411
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
444
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-2"
|
412
445
|
},
|
413
446
|
"n1-highcpu-2-d" => {
|
414
447
|
"kind" => "compute#machineType",
|
@@ -427,7 +460,7 @@ module Fog
|
|
427
460
|
"maximumPersistentDisks" => 16,
|
428
461
|
"maximumPersistentDisksSizeGb" => "10240",
|
429
462
|
"zone" => zone,
|
430
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
463
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-2-d"
|
431
464
|
},
|
432
465
|
"n1-highcpu-4" => {
|
433
466
|
"kind" => "compute#machineType",
|
@@ -441,7 +474,7 @@ module Fog
|
|
441
474
|
"maximumPersistentDisks" => 16,
|
442
475
|
"maximumPersistentDisksSizeGb" => "10240",
|
443
476
|
"zone" => zone,
|
444
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
477
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-4"
|
445
478
|
},
|
446
479
|
"n1-highcpu-4-d" => {
|
447
480
|
"kind" => "compute#machineType",
|
@@ -460,7 +493,7 @@ module Fog
|
|
460
493
|
"maximumPersistentDisks" => 16,
|
461
494
|
"maximumPersistentDisksSizeGb" => "10240",
|
462
495
|
"zone" => zone,
|
463
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
496
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-4-d"
|
464
497
|
},
|
465
498
|
"n1-highcpu-8" => {
|
466
499
|
"kind" => "compute#machineType",
|
@@ -474,7 +507,7 @@ module Fog
|
|
474
507
|
"maximumPersistentDisks" => 16,
|
475
508
|
"maximumPersistentDisksSizeGb" => "10240",
|
476
509
|
"zone" => zone,
|
477
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
510
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-8"
|
478
511
|
},
|
479
512
|
"n1-highcpu-8-d" => {
|
480
513
|
"kind" => "compute#machineType",
|
@@ -496,7 +529,7 @@ module Fog
|
|
496
529
|
"maximumPersistentDisks" => 16,
|
497
530
|
"maximumPersistentDisksSizeGb" => "10240",
|
498
531
|
"zone" => zone,
|
499
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
532
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-8-d"
|
500
533
|
},
|
501
534
|
"n1-highmem-2" => {
|
502
535
|
"kind" => "compute#machineType",
|
@@ -510,7 +543,7 @@ module Fog
|
|
510
543
|
"maximumPersistentDisks" => 16,
|
511
544
|
"maximumPersistentDisksSizeGb" => "10240",
|
512
545
|
"zone" => zone,
|
513
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
546
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-2"
|
514
547
|
},
|
515
548
|
"n1-highmem-2-d" => {
|
516
549
|
"kind" => "compute#machineType",
|
@@ -529,7 +562,7 @@ module Fog
|
|
529
562
|
"maximumPersistentDisks" => 16,
|
530
563
|
"maximumPersistentDisksSizeGb" => "10240",
|
531
564
|
"zone" => zone,
|
532
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
565
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-2-d"
|
533
566
|
},
|
534
567
|
"n1-highmem-4" => {
|
535
568
|
"kind" => "compute#machineType",
|
@@ -543,7 +576,7 @@ module Fog
|
|
543
576
|
"maximumPersistentDisks" => 16,
|
544
577
|
"maximumPersistentDisksSizeGb" => "10240",
|
545
578
|
"zone" => zone,
|
546
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
579
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-4"
|
547
580
|
},
|
548
581
|
"n1-highmem-4-d" => {
|
549
582
|
"kind" => "compute#machineType",
|
@@ -562,7 +595,7 @@ module Fog
|
|
562
595
|
"maximumPersistentDisks" => 16,
|
563
596
|
"maximumPersistentDisksSizeGb" => "10240",
|
564
597
|
"zone" => zone,
|
565
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
598
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-4-d"
|
566
599
|
},
|
567
600
|
"n1-highmem-8" => {
|
568
601
|
"kind" => "compute#machineType",
|
@@ -576,7 +609,7 @@ module Fog
|
|
576
609
|
"maximumPersistentDisks" => 16,
|
577
610
|
"maximumPersistentDisksSizeGb" => "10240",
|
578
611
|
"zone" => zone,
|
579
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
612
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-8"
|
580
613
|
},
|
581
614
|
"n1-highmem-8-d" => {
|
582
615
|
"kind" => "compute#machineType",
|
@@ -598,7 +631,7 @@ module Fog
|
|
598
631
|
"maximumPersistentDisks" => 16,
|
599
632
|
"maximumPersistentDisksSizeGb" => "10240",
|
600
633
|
"zone" => zone,
|
601
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
634
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-8-d"
|
602
635
|
},
|
603
636
|
"n1-standard-1" => {
|
604
637
|
"kind" => "compute#machineType",
|
@@ -612,7 +645,7 @@ module Fog
|
|
612
645
|
"maximumPersistentDisks" => 16,
|
613
646
|
"maximumPersistentDisksSizeGb" => "10240",
|
614
647
|
"zone" => zone,
|
615
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
648
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-1"
|
616
649
|
},
|
617
650
|
"n1-standard-1-d" => {
|
618
651
|
"kind" => "compute#machineType",
|
@@ -631,7 +664,7 @@ module Fog
|
|
631
664
|
"maximumPersistentDisks" => 16,
|
632
665
|
"maximumPersistentDisksSizeGb" => "10240",
|
633
666
|
"zone" => zone,
|
634
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
667
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-1-d"
|
635
668
|
},
|
636
669
|
"n1-standard-2" => {
|
637
670
|
"kind" => "compute#machineType",
|
@@ -645,7 +678,7 @@ module Fog
|
|
645
678
|
"maximumPersistentDisks" => 16,
|
646
679
|
"maximumPersistentDisksSizeGb" => "10240",
|
647
680
|
"zone" => zone,
|
648
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
681
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-2"
|
649
682
|
},
|
650
683
|
"n1-standard-2-d" => {
|
651
684
|
"kind" => "compute#machineType",
|
@@ -664,7 +697,7 @@ module Fog
|
|
664
697
|
"maximumPersistentDisks" => 16,
|
665
698
|
"maximumPersistentDisksSizeGb" => "10240",
|
666
699
|
"zone" => zone,
|
667
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
700
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-2-d"
|
668
701
|
},
|
669
702
|
"n1-standard-4" => {
|
670
703
|
"kind" => "compute#machineType",
|
@@ -678,7 +711,7 @@ module Fog
|
|
678
711
|
"maximumPersistentDisks" => 16,
|
679
712
|
"maximumPersistentDisksSizeGb" => "10240",
|
680
713
|
"zone" => zone,
|
681
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
714
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-4"
|
682
715
|
},
|
683
716
|
"n1-standard-4-d" => {
|
684
717
|
"kind" => "compute#machineType",
|
@@ -697,7 +730,7 @@ module Fog
|
|
697
730
|
"maximumPersistentDisks" => 16,
|
698
731
|
"maximumPersistentDisksSizeGb" => "10240",
|
699
732
|
"zone" => zone,
|
700
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
733
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-4-d"
|
701
734
|
},
|
702
735
|
"n1-standard-8" => {
|
703
736
|
"kind" => "compute#machineType",
|
@@ -711,7 +744,7 @@ module Fog
|
|
711
744
|
"maximumPersistentDisks" => 16,
|
712
745
|
"maximumPersistentDisksSizeGb" => "10240",
|
713
746
|
"zone" => zone,
|
714
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
747
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-8"
|
715
748
|
},
|
716
749
|
"n1-standard-8-d" => {
|
717
750
|
"kind" => "compute#machineType",
|
@@ -733,11 +766,13 @@ module Fog
|
|
733
766
|
"maximumPersistentDisks" => 16,
|
734
767
|
"maximumPersistentDisksSizeGb" => "10240",
|
735
768
|
"zone" => zone,
|
736
|
-
"selfLink" => "https://www.googleapis.com/compute/
|
769
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-8-d"
|
737
770
|
}
|
738
771
|
}
|
739
772
|
end,
|
740
|
-
:images => {}
|
773
|
+
:images => {},
|
774
|
+
:disks => {},
|
775
|
+
:operations => {}
|
741
776
|
}
|
742
777
|
end
|
743
778
|
end
|
@@ -747,15 +782,18 @@ module Fog
|
|
747
782
|
@data = nil
|
748
783
|
end
|
749
784
|
|
750
|
-
def data
|
751
|
-
self.class.data[
|
785
|
+
def data(project = @project)
|
786
|
+
self.class.data(api_version)[project]
|
752
787
|
end
|
753
788
|
|
754
789
|
def reset_data
|
755
790
|
# not particularly useful because it deletes zones
|
756
|
-
self.class.data.delete(@project)
|
791
|
+
self.class.data(api_version).delete(@project)
|
757
792
|
end
|
758
793
|
|
794
|
+
def random_operation
|
795
|
+
"operation-#{Fog::Mock.random_numbers(13)}-#{Fog::Mock.random_hex(13)}-#{Fog::Mock.random_hex(8)}"
|
796
|
+
end
|
759
797
|
end
|
760
798
|
|
761
799
|
class Real
|
@@ -764,10 +802,9 @@ module Fog
|
|
764
802
|
|
765
803
|
def initialize(options)
|
766
804
|
base_url = 'https://www.googleapis.com/compute/'
|
767
|
-
api_version = 'v1beta16'
|
768
805
|
api_scope_url = 'https://www.googleapis.com/auth/compute'
|
806
|
+
shared_initialize(options)
|
769
807
|
|
770
|
-
@project = options[:google_project]
|
771
808
|
google_client_email = options[:google_client_email]
|
772
809
|
@api_url = base_url + api_version + '/projects/'
|
773
810
|
|
@@ -817,7 +854,7 @@ module Fog
|
|
817
854
|
# result = Google::APIClient::Result
|
818
855
|
# returns Excon::Response
|
819
856
|
def build_response(result)
|
820
|
-
build_excon_response(Fog::JSON.decode(result.body))
|
857
|
+
build_excon_response(result.body.nil? ? nil : Fog::JSON.decode(result.body), result.status)
|
821
858
|
end
|
822
859
|
|
823
860
|
end
|