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
@@ -9,36 +9,51 @@ module Fog
|
|
9
9
|
|
10
10
|
model Fog::Compute::Vsphere::Interface
|
11
11
|
|
12
|
-
|
12
|
+
attribute :server
|
13
13
|
|
14
14
|
def all(filters = {})
|
15
|
-
requires :
|
16
|
-
|
15
|
+
requires :server
|
16
|
+
|
17
|
+
case server
|
17
18
|
when Fog::Compute::Vsphere::Server
|
18
|
-
load service.list_vm_interfaces(
|
19
|
+
load service.list_vm_interfaces(server.id)
|
19
20
|
when Fog::Compute::Vsphere::Template
|
20
|
-
load service.list_template_interfaces(
|
21
|
+
load service.list_template_interfaces(server.id)
|
21
22
|
else
|
22
23
|
raise 'interfaces should have vm or template'
|
23
24
|
end
|
25
|
+
|
26
|
+
self.each { |interface| interface.server_id = server.id }
|
27
|
+
self
|
24
28
|
end
|
25
29
|
|
26
30
|
def get(id)
|
27
|
-
requires :
|
28
|
-
|
31
|
+
requires :server
|
32
|
+
|
33
|
+
case server
|
29
34
|
when Fog::Compute::Vsphere::Server
|
30
|
-
interface=service.get_vm_interface(
|
35
|
+
interface = service.get_vm_interface(server.id, :key => id, :mac=> id, :name => id)
|
31
36
|
when Fog::Compute::Vsphere::Template
|
32
|
-
interface=service.get_template_interfaces(
|
37
|
+
interface = service.get_template_interfaces(server.id, :key => id, :mac=> id, :name => id)
|
33
38
|
else
|
39
|
+
|
34
40
|
raise 'interfaces should have vm or template'
|
35
41
|
end
|
42
|
+
|
36
43
|
if interface
|
37
|
-
Fog::Compute::Vsphere::Interface.new(interface)
|
44
|
+
Fog::Compute::Vsphere::Interface.new(interface.merge(:server_id => server.id, :service => service))
|
38
45
|
else
|
39
46
|
nil
|
40
47
|
end
|
41
48
|
end
|
49
|
+
|
50
|
+
def new(attributes = {})
|
51
|
+
if server
|
52
|
+
super({ :server_id => server.id }.merge(attributes))
|
53
|
+
else
|
54
|
+
super
|
55
|
+
end
|
56
|
+
end
|
42
57
|
end
|
43
58
|
end
|
44
59
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Vsphere
|
4
|
+
|
5
|
+
class SCSIController < Fog::Model
|
6
|
+
|
7
|
+
attribute :shared_bus
|
8
|
+
attribute :type
|
9
|
+
attribute :unit_number
|
10
|
+
attribute :key
|
11
|
+
|
12
|
+
def to_s
|
13
|
+
"#{type} ##{key}: shared: #{shared_bus}, unit_number: #{unit_number}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -46,6 +46,7 @@ module Fog
|
|
46
46
|
attribute :resource_pool
|
47
47
|
attribute :instance_uuid # move this --> id
|
48
48
|
attribute :guest_id
|
49
|
+
attribute :scsi_controller # this is the first scsi controller. Right now no more of them can be used.
|
49
50
|
|
50
51
|
def initialize(attributes={} )
|
51
52
|
super defaults.merge(attributes)
|
@@ -53,6 +54,7 @@ module Fog
|
|
53
54
|
initialize_interfaces
|
54
55
|
initialize_volumes
|
55
56
|
initialize_customvalues
|
57
|
+
initialize_scsi_controller
|
56
58
|
end
|
57
59
|
|
58
60
|
# Lazy Loaded Attributes
|
@@ -86,7 +88,7 @@ module Fog
|
|
86
88
|
end
|
87
89
|
|
88
90
|
def stop(options = {})
|
89
|
-
options = { :force => !tools_installed? }.merge(options)
|
91
|
+
options = { :force => !tools_installed? || !tools_running? }.merge(options)
|
90
92
|
requires :instance_uuid
|
91
93
|
service.vm_power_off('instance_uuid' => instance_uuid, 'force' => options[:force])
|
92
94
|
end
|
@@ -101,7 +103,7 @@ module Fog
|
|
101
103
|
requires :instance_uuid
|
102
104
|
if ready?
|
103
105
|
# need to turn it off before destroying
|
104
|
-
stop
|
106
|
+
stop(options)
|
105
107
|
wait_for { !ready? }
|
106
108
|
end
|
107
109
|
service.vm_destroy('instance_uuid' => instance_uuid)
|
@@ -153,6 +155,10 @@ module Fog
|
|
153
155
|
tools_state != "toolsNotInstalled"
|
154
156
|
end
|
155
157
|
|
158
|
+
def tools_running?
|
159
|
+
tools_state == "toolsOk"
|
160
|
+
end
|
161
|
+
|
156
162
|
# defines VNC attributes on the hypervisor
|
157
163
|
def config_vnc(options = {})
|
158
164
|
requires :instance_uuid
|
@@ -178,7 +184,7 @@ module Fog
|
|
178
184
|
end
|
179
185
|
|
180
186
|
def interfaces
|
181
|
-
attributes[:interfaces] ||= id.nil? ? [] : service.interfaces( :
|
187
|
+
attributes[:interfaces] ||= id.nil? ? [] : service.interfaces( :server => self )
|
182
188
|
end
|
183
189
|
|
184
190
|
def interface_ready? attrs
|
@@ -186,8 +192,9 @@ module Fog
|
|
186
192
|
end
|
187
193
|
|
188
194
|
def add_interface attrs
|
189
|
-
|
190
|
-
|
195
|
+
Fog::Logger.deprecation("<server>.add_interface is deprecated. Call <server>.interfaces.create instead.")
|
196
|
+
|
197
|
+
interfaces.create(attrs)
|
191
198
|
end
|
192
199
|
|
193
200
|
def update_interface attrs
|
@@ -196,8 +203,9 @@ module Fog
|
|
196
203
|
end
|
197
204
|
|
198
205
|
def destroy_interface attrs
|
199
|
-
|
200
|
-
|
206
|
+
Fog::Logger.deprecation("<server>.destroy_vm_interface is deprecated. Call <server>.interfaces.get(:key => <nic_key>).destroy instead.")
|
207
|
+
|
208
|
+
interfaces.get(attrs[:key] || attrs['key']).destroy
|
201
209
|
end
|
202
210
|
|
203
211
|
def volumes
|
@@ -208,6 +216,10 @@ module Fog
|
|
208
216
|
attributes[:customvalues] ||= id.nil? ? [] : service.customvalues( :vm => self )
|
209
217
|
end
|
210
218
|
|
219
|
+
def scsi_controller
|
220
|
+
self.attributes[:scsi_controller] ||= service.get_vm_first_scsi_controller(id)
|
221
|
+
end
|
222
|
+
|
211
223
|
def folder
|
212
224
|
return nil unless datacenter and path
|
213
225
|
attributes[:folder] ||= service.folders(:datacenter => datacenter, :type => :vm).get(path)
|
@@ -243,7 +255,7 @@ module Fog
|
|
243
255
|
:cpus => 1,
|
244
256
|
# :corespersocket => 1,
|
245
257
|
:memory_mb => 512,
|
246
|
-
|
258
|
+
:guest_id => 'otherGuest',
|
247
259
|
:path => '/'
|
248
260
|
}
|
249
261
|
end
|
@@ -265,6 +277,13 @@ module Fog
|
|
265
277
|
self.attributes[:customvalues].map { |cfield| cfield.is_a?(Hash) ? service.customvalue.new(cfield) : cfield}
|
266
278
|
end
|
267
279
|
end
|
280
|
+
|
281
|
+
def initialize_scsi_controller
|
282
|
+
if attributes[:scsi_controller] and attributes[:scsi_controller].is_a?(Hash)
|
283
|
+
Fog::Compute::Vsphere::SCSIController.new(self.attributes[:scsi_controller])
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
268
287
|
end
|
269
288
|
|
270
289
|
end
|
@@ -44,7 +44,7 @@ module Fog
|
|
44
44
|
end
|
45
45
|
|
46
46
|
if (disks = attributes[:volumes])
|
47
|
-
devices << create_controller
|
47
|
+
devices << create_controller(attributes[:scsi_controller]||attributes["scsi_controller"]||{})
|
48
48
|
devices << disks.map { |disk| create_disk(disk, disks.index(disk)) }
|
49
49
|
end
|
50
50
|
devices.flatten
|
@@ -80,17 +80,43 @@ module Fog
|
|
80
80
|
}
|
81
81
|
end
|
82
82
|
|
83
|
-
def create_controller
|
83
|
+
def create_controller options=nil
|
84
|
+
options=if options
|
85
|
+
controller_default_options.merge(Hash[options.map{|k,v| [k.to_sym,v] }])
|
86
|
+
else
|
87
|
+
controller_default_options
|
88
|
+
end
|
89
|
+
controller_class=if options[:type].is_a? String then
|
90
|
+
Fog::class_from_string options[:type], "RbVmomi::VIM"
|
91
|
+
else
|
92
|
+
options[:type]
|
93
|
+
end
|
84
94
|
{
|
85
|
-
:operation => operation,
|
86
|
-
:device =>
|
87
|
-
:key =>
|
88
|
-
:busNumber => bus_id,
|
89
|
-
:sharedBus =>
|
90
|
-
)
|
95
|
+
:operation => options[:operation],
|
96
|
+
:device => controller_class.new({
|
97
|
+
:key => options[:key],
|
98
|
+
:busNumber => options[:bus_id],
|
99
|
+
:sharedBus => controller_get_shared_from_options(options),
|
100
|
+
})
|
91
101
|
}
|
92
102
|
end
|
93
103
|
|
104
|
+
def controller_default_options
|
105
|
+
{:operation => "add", :type => RbVmomi::VIM.VirtualLsiLogicController.class, :key => 1000, :bus_id => 0, :shared => false }
|
106
|
+
end
|
107
|
+
|
108
|
+
def controller_get_shared_from_options options
|
109
|
+
if (options.has_key? :shared and options[:shared]==false) or not options.has_key? :shared then
|
110
|
+
:noSharing
|
111
|
+
elsif options[:shared]==true then
|
112
|
+
:virtualSharing
|
113
|
+
elsif options[:shared].is_a? String
|
114
|
+
options[:shared]
|
115
|
+
else
|
116
|
+
:noSharing
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
94
120
|
def create_disk disk, index = 0, operation = :add, controller_key = 1000
|
95
121
|
payload = {
|
96
122
|
:operation => operation,
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
module Fog
|
3
|
+
module Compute
|
4
|
+
class Vsphere
|
5
|
+
class Real
|
6
|
+
def get_vm_first_scsi_controller(vm_id)
|
7
|
+
Fog::Compute::Vsphere::SCSIController.new(get_vm_first_scsi_controller_raw(vm_id))
|
8
|
+
end
|
9
|
+
def get_vm_first_scsi_controller_raw(vm_id)
|
10
|
+
ctrl=get_vm_ref(vm_id).config.hardware.device.grep(RbVmomi::VIM::VirtualSCSIController).select{ | ctrl | ctrl.key == 1000 }.first
|
11
|
+
{
|
12
|
+
:type => ctrl.class.to_s,
|
13
|
+
:shared_bus => ctrl.sharedBus.to_s,
|
14
|
+
:unit_number => ctrl.scsiCtlrUnitNumber,
|
15
|
+
:key => ctrl.key,
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
class Mock
|
21
|
+
def get_vm_first_scsi_controller(vm_id)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -19,13 +19,14 @@ module Fog
|
|
19
19
|
|
20
20
|
def datastore_attributes datastore, datacenter
|
21
21
|
{
|
22
|
-
:id
|
23
|
-
:name
|
24
|
-
:accessible
|
25
|
-
:type
|
26
|
-
:freespace
|
27
|
-
:capacity
|
28
|
-
:
|
22
|
+
:id => managed_obj_id(datastore),
|
23
|
+
:name => datastore.name,
|
24
|
+
:accessible => datastore.summary.accessible,
|
25
|
+
:type => datastore.summary.type,
|
26
|
+
:freespace => datastore.summary.freeSpace,
|
27
|
+
:capacity => datastore.summary.capacity,
|
28
|
+
:uncommitted => datastore.summary.uncommitted,
|
29
|
+
:datacenter => datacenter,
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
@@ -37,4 +38,4 @@ module Fog
|
|
37
38
|
end
|
38
39
|
end
|
39
40
|
end
|
40
|
-
end
|
41
|
+
end
|
@@ -6,33 +6,36 @@ module Fog
|
|
6
6
|
def add_vm_interface(vmid, options = {})
|
7
7
|
raise ArgumentError, "instance id is a required parameter" unless vmid
|
8
8
|
|
9
|
-
interface=get_interface_from_options(vmid, options)
|
9
|
+
interface = get_interface_from_options(vmid, options.merge(:server_id => vmid))
|
10
10
|
vm_reconfig_hardware('instance_uuid' => vmid, 'hardware_spec' => {'deviceChange'=>[create_interface(interface)]})
|
11
11
|
end
|
12
12
|
|
13
13
|
def destroy_vm_interface(vmid, options = {})
|
14
14
|
raise ArgumentError, "instance id is a required parameter" unless vmid
|
15
15
|
|
16
|
-
interface=
|
16
|
+
interface = get_interface_from_options(vmid, options.merge(:server_id => vmid))
|
17
17
|
vm_reconfig_hardware('instance_uuid' => vmid, 'hardware_spec' => {'deviceChange'=>[create_interface(interface, interface.key, :remove)]})
|
18
18
|
end
|
19
19
|
|
20
20
|
def update_vm_interface(vmid, options = {})
|
21
21
|
raise ArgumentError, "instance id is a required parameter" unless vmid
|
22
22
|
|
23
|
-
interface=
|
24
|
-
vm_reconfig_hardware('instance_uuid' => vmid, 'hardware_spec' => {'deviceChange'=>[create_interface(interface, interface.key, :edit)]})
|
23
|
+
interface = get_interface_from_options(vmid, options.merge(:server_id => vmid))
|
24
|
+
vm_reconfig_hardware('instance_uuid' => vmid, 'hardware_spec' => {'deviceChange'=>[create_interface(interface, interface.key, :edit)]})
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
28
|
def get_interface_from_options(vmid, options)
|
29
29
|
if options and options[:interface]
|
30
30
|
options[:interface]
|
31
|
+
|
31
32
|
elsif options[:key] and options[:key]>0
|
32
|
-
oldattributes=get_vm_interface(vmid, options)
|
33
|
-
Fog::Compute::Vsphere::Interface.new
|
33
|
+
oldattributes = get_vm_interface(vmid, options)
|
34
|
+
Fog::Compute::Vsphere::Interface.new(oldattributes.merge(options))
|
35
|
+
|
34
36
|
elsif options[:type] and options[:network]
|
35
37
|
Fog::Compute::Vsphere::Interface.new options
|
38
|
+
|
36
39
|
else
|
37
40
|
raise ArgumentError, "interface is a required parameter or pass options with type and network"
|
38
41
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Vsphere
|
4
|
+
class Real
|
5
|
+
def set_vm_customvalue(vm_id, key, value)
|
6
|
+
vm_ref = get_vm_ref(vm_id)
|
7
|
+
vm_ref.setCustomValue(:key => key, :value => value)
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
class Mock
|
12
|
+
def set_vm_customvalue(vm_id, key, value)
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
data/lib/fog/xenserver.rb
CHANGED
@@ -14,9 +14,10 @@ module Fog
|
|
14
14
|
class Connection
|
15
15
|
require 'xmlrpc/client'
|
16
16
|
|
17
|
-
def initialize(host)
|
17
|
+
def initialize(host, timeout)
|
18
18
|
@factory = XMLRPC::Client.new(host, '/')
|
19
19
|
@factory.set_parser(NokogiriStreamParser.new)
|
20
|
+
@factory.timeout = timeout
|
20
21
|
end
|
21
22
|
|
22
23
|
def authenticate( username, password )
|
@@ -12,10 +12,45 @@ module Fog
|
|
12
12
|
requires :xenserver_password
|
13
13
|
requires :xenserver_url
|
14
14
|
recognizes :xenserver_defaults
|
15
|
+
recognizes :xenserver_timeout
|
15
16
|
|
16
17
|
model_path 'fog/xenserver/models/compute'
|
18
|
+
model :blob
|
19
|
+
collection :blobs
|
20
|
+
model :bond
|
21
|
+
collection :bonds
|
22
|
+
model :crash_dump
|
23
|
+
collection :crash_dumps
|
24
|
+
model :dr_task
|
25
|
+
collection :dr_tasks
|
26
|
+
model :gpu_group
|
27
|
+
collection :gpu_groups
|
28
|
+
model :host_crash_dump
|
29
|
+
collection :host_crash_dumps
|
30
|
+
model :host_patch
|
31
|
+
collection :host_patchs
|
32
|
+
model :pci
|
33
|
+
collection :pcis
|
34
|
+
model :pgpu
|
35
|
+
collection :pgpus
|
36
|
+
model :pif_metrics
|
37
|
+
collection :pifs_metrics
|
38
|
+
model :pool_patch
|
39
|
+
collection :pool_patchs
|
40
|
+
model :role
|
41
|
+
collection :roles
|
17
42
|
model :server
|
18
43
|
collection :servers
|
44
|
+
model :server_appliance
|
45
|
+
collection :server_appliances
|
46
|
+
model :storage_manager
|
47
|
+
collection :storage_managers
|
48
|
+
model :tunnel
|
49
|
+
collection :tunnels
|
50
|
+
model :vmpp
|
51
|
+
collection :vmpps
|
52
|
+
model :vtpm
|
53
|
+
collection :vtpms
|
19
54
|
model :host
|
20
55
|
collection :hosts
|
21
56
|
collection :vifs
|
@@ -86,7 +121,8 @@ module Fog
|
|
86
121
|
@username = options[:xenserver_username]
|
87
122
|
@password = options[:xenserver_password]
|
88
123
|
@defaults = options[:xenserver_defaults] || {}
|
89
|
-
@
|
124
|
+
@timeout = options[:xenserver_timeout] || 30
|
125
|
+
@connection = Fog::XenServer::Connection.new(@host, @timeout)
|
90
126
|
@connection.authenticate(@username, @password)
|
91
127
|
end
|
92
128
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class XenServer
|
6
|
+
class Blob < Fog::Model
|
7
|
+
# API Reference here:
|
8
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=blob
|
9
|
+
|
10
|
+
identity :reference
|
11
|
+
|
12
|
+
attribute :last_updated
|
13
|
+
attribute :mime_type
|
14
|
+
attribute :description, :aliases => :name_description
|
15
|
+
attribute :name, :aliases => :name_label
|
16
|
+
attribute :public
|
17
|
+
attribute :size
|
18
|
+
attribute :uuid
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|