fog 1.38.0 → 1.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -3
- data/CHANGELOG.md +66 -0
- data/Gemfile +1 -1
- data/LICENSE.md +1 -1
- data/README.md +13 -0
- data/fog.gemspec +27 -6
- data/gemfiles/Gemfile-1.9 +16 -0
- data/gemfiles/Gemfile-2.0 +11 -0
- data/gemfiles/Gemfile-edge +1 -1
- data/gemfiles/Gemfile-edge-1.9 +20 -0
- data/gemfiles/Gemfile-edge-2.0 +16 -0
- data/lib/fog.rb +0 -1
- data/lib/fog/bin.rb +0 -1
- data/lib/fog/cloudsigma/compute.rb +9 -0
- data/lib/fog/cloudsigma/models/server.rb +5 -0
- data/lib/fog/cloudsigma/models/snapshot.rb +77 -0
- data/lib/fog/cloudsigma/models/snapshots.rb +26 -0
- data/lib/fog/cloudsigma/models/volume.rb +15 -0
- data/lib/fog/cloudsigma/requests/clone_snapshot.rb +31 -0
- data/lib/fog/cloudsigma/requests/create_snapshot.rb +27 -0
- data/lib/fog/cloudsigma/requests/delete_snapshot.rb +17 -0
- data/lib/fog/cloudsigma/requests/get_snapshot.rb +17 -0
- data/lib/fog/cloudsigma/requests/list_snapshots.rb +17 -0
- data/lib/fog/cloudsigma/requests/stop_server.rb +5 -4
- data/lib/fog/cloudsigma/requests/update_snapshot.rb +17 -0
- data/lib/fog/cloudstack/core.rb +2 -0
- data/lib/fog/joyent/compute.rb +4 -16
- data/lib/fog/opennebula/README.md +0 -0
- data/lib/fog/opennebula/compute.rb +90 -19
- data/lib/fog/opennebula/models/compute/server.rb +9 -1
- data/lib/fog/opennebula/requests/compute/image_pool.rb +0 -1
- data/lib/fog/opennebula/requests/compute/list_vms.rb +8 -26
- data/lib/fog/opennebula/requests/compute/template_pool.rb +8 -29
- data/lib/fog/opennebula/requests/compute/vm_allocate.rb +24 -15
- data/lib/fog/opennebula/requests/compute/vm_destroy.rb +13 -4
- data/lib/fog/opennebula/requests/compute/vm_disk_snapshot.rb +8 -2
- data/lib/fog/opennebula/requests/compute/vm_resume.rb +13 -23
- data/lib/fog/opennebula/requests/compute/vm_shutdown.rb +1 -1
- data/lib/fog/opennebula/requests/compute/vm_stop.rb +3 -10
- data/lib/fog/opennebula/requests/compute/vm_suspend.rb +31 -0
- data/lib/fog/ovirt/compute.rb +4 -0
- data/lib/fog/ovirt/models/compute/instance_type.rb +39 -0
- data/lib/fog/ovirt/models/compute/instance_types.rb +20 -0
- data/lib/fog/ovirt/models/compute/server.rb +1 -0
- data/lib/fog/ovirt/requests/compute/get_instance_type.rb +17 -0
- data/lib/fog/ovirt/requests/compute/list_instance_types.rb +19 -0
- data/lib/fog/ovirt/requests/compute/mock_files/instance_type.xml +42 -0
- data/lib/fog/ovirt/requests/compute/mock_files/instance_types.xml +197 -0
- data/lib/fog/rage4/dns.rb +1 -0
- data/lib/fog/rage4/requests/dns/bulk_update_records.rb +38 -0
- data/lib/fog/vcloud_director/compute.rb +1 -0
- data/lib/fog/vcloud_director/generators/compute/compose_common.rb +17 -16
- data/lib/fog/vcloud_director/generators/compute/create_snapshot.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/post_create_snapshot.rb +21 -0
- data/lib/fog/version.rb +1 -1
- data/lib/tasks/changelog_task.rb +4 -4
- data/spec/fog/bin/dnsimple_spec.rb +2 -2
- data/spec/fog/bin_spec.rb +3 -6
- data/tests/cloudsigma/models/snapshot_tests.rb +23 -0
- data/tests/cloudsigma/models/snapshots_tests.rb +15 -0
- data/tests/cloudsigma/models/volume_tests.rb +3 -3
- data/tests/cloudsigma/requests/server_tests.rb +10 -10
- data/tests/cloudsigma/requests/snapshots_tests.rb +83 -0
- data/tests/cloudsigma/requests/volumes_tests.rb +12 -11
- data/tests/compute/helper.rb +0 -19
- data/tests/helpers/mock_helper.rb +0 -4
- data/tests/opennebula/models/compute/flavor_tests.rb +2 -2
- data/tests/opennebula/models/compute/network_tests.rb +1 -2
- data/tests/opennebula/requests/compute/vm_allocate_tests.rb +20 -3
- data/tests/opennebula/requests/compute/vm_suspend_resume_tests.rb +52 -0
- data/tests/rage4/requests/dns/dns_tests.rb +12 -0
- data/tests/storage/helper.rb +0 -6
- metadata +101 -389
- data/lib/fog/bin/digitalocean.rb +0 -29
- data/lib/fog/bin/dnsimple.rb +0 -29
- data/lib/fog/bin/ninefold.rb +0 -34
- data/lib/fog/digitalocean.rb +0 -1
- data/lib/fog/digitalocean/CHANGELOG.md +0 -6
- data/lib/fog/digitalocean/compute_v2.rb +0 -109
- data/lib/fog/digitalocean/core.rb +0 -9
- data/lib/fog/digitalocean/examples/getting_started.md +0 -124
- data/lib/fog/digitalocean/models/compute_v2/flavor.rb +0 -17
- data/lib/fog/digitalocean/models/compute_v2/flavors.rb +0 -21
- data/lib/fog/digitalocean/models/compute_v2/image.rb +0 -25
- data/lib/fog/digitalocean/models/compute_v2/images.rb +0 -42
- data/lib/fog/digitalocean/models/compute_v2/region.rb +0 -13
- data/lib/fog/digitalocean/models/compute_v2/regions.rb +0 -21
- data/lib/fog/digitalocean/models/compute_v2/server.rb +0 -170
- data/lib/fog/digitalocean/models/compute_v2/servers.rb +0 -43
- data/lib/fog/digitalocean/models/compute_v2/ssh_key.rb +0 -31
- data/lib/fog/digitalocean/models/compute_v2/ssh_keys.rb +0 -40
- data/lib/fog/digitalocean/models/paging_collection.rb +0 -41
- data/lib/fog/digitalocean/requests/compute_v2/change_kernel.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/convert_to_snapshot.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/create_server.rb +0 -93
- data/lib/fog/digitalocean/requests/compute_v2/create_ssh_key.rb +0 -49
- data/lib/fog/digitalocean/requests/compute_v2/delete_ssh_key.rb +0 -32
- data/lib/fog/digitalocean/requests/compute_v2/destroy_server.rb +0 -35
- data/lib/fog/digitalocean/requests/compute_v2/disable_backups.rb +0 -45
- data/lib/fog/digitalocean/requests/compute_v2/enable_ipv6.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/enable_private_networking.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/get_droplet_action.rb +0 -36
- data/lib/fog/digitalocean/requests/compute_v2/get_image_details.rb +0 -42
- data/lib/fog/digitalocean/requests/compute_v2/get_server_details.rb +0 -84
- data/lib/fog/digitalocean/requests/compute_v2/get_ssh_key.rb +0 -34
- data/lib/fog/digitalocean/requests/compute_v2/list_droplet_actions.rb +0 -38
- data/lib/fog/digitalocean/requests/compute_v2/list_flavors.rb +0 -131
- data/lib/fog/digitalocean/requests/compute_v2/list_images.rb +0 -50
- data/lib/fog/digitalocean/requests/compute_v2/list_regions.rb +0 -94
- data/lib/fog/digitalocean/requests/compute_v2/list_servers.rb +0 -28
- data/lib/fog/digitalocean/requests/compute_v2/list_ssh_keys.rb +0 -31
- data/lib/fog/digitalocean/requests/compute_v2/password_reset.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/power_cycle.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/power_off.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/power_on.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/reboot_server.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/rebuild.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/rename.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/resize.rb +0 -48
- data/lib/fog/digitalocean/requests/compute_v2/restore.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/shutdown.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/snapshot.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/transfer_image.rb +0 -44
- data/lib/fog/digitalocean/requests/compute_v2/update_ssh_key.rb +0 -46
- data/lib/fog/digitalocean/requests/compute_v2/upgrade.rb +0 -44
- data/lib/fog/digitalocean/service.rb +0 -51
- data/lib/fog/dnsimple.rb +0 -1
- data/lib/fog/dnsimple/core.rb +0 -10
- data/lib/fog/dnsimple/dns.rb +0 -112
- data/lib/fog/dnsimple/models/dns/record.rb +0 -63
- data/lib/fog/dnsimple/models/dns/records.rb +0 -34
- data/lib/fog/dnsimple/models/dns/zone.rb +0 -46
- data/lib/fog/dnsimple/models/dns/zones.rb +0 -25
- data/lib/fog/dnsimple/requests/dns/create_domain.rb +0 -62
- data/lib/fog/dnsimple/requests/dns/create_record.rb +0 -67
- data/lib/fog/dnsimple/requests/dns/delete_domain.rb +0 -35
- data/lib/fog/dnsimple/requests/dns/delete_record.rb +0 -30
- data/lib/fog/dnsimple/requests/dns/get_domain.rb +0 -39
- data/lib/fog/dnsimple/requests/dns/get_record.rb +0 -49
- data/lib/fog/dnsimple/requests/dns/list_domains.rb +0 -34
- data/lib/fog/dnsimple/requests/dns/list_records.rb +0 -34
- data/lib/fog/dnsimple/requests/dns/update_record.rb +0 -53
- data/lib/fog/ninefold.rb +0 -1
- data/lib/fog/ninefold/compute.rb +0 -144
- data/lib/fog/ninefold/core.rb +0 -11
- data/lib/fog/ninefold/models/compute/address.rb +0 -100
- data/lib/fog/ninefold/models/compute/addresses.rb +0 -27
- data/lib/fog/ninefold/models/compute/flavor.rb +0 -24
- data/lib/fog/ninefold/models/compute/flavors.rb +0 -26
- data/lib/fog/ninefold/models/compute/image.rb +0 -38
- data/lib/fog/ninefold/models/compute/images.rb +0 -26
- data/lib/fog/ninefold/models/compute/ip_forwarding_rule.rb +0 -76
- data/lib/fog/ninefold/models/compute/ip_forwarding_rules.rb +0 -27
- data/lib/fog/ninefold/models/compute/server.rb +0 -182
- data/lib/fog/ninefold/models/compute/servers.rb +0 -27
- data/lib/fog/ninefold/requests/compute/assign_to_load_balancer_rule.rb +0 -11
- data/lib/fog/ninefold/requests/compute/associate_ip_address.rb +0 -12
- data/lib/fog/ninefold/requests/compute/change_service_for_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/create_ip_forwarding_rule.rb +0 -12
- data/lib/fog/ninefold/requests/compute/create_load_balancer_rule.rb +0 -11
- data/lib/fog/ninefold/requests/compute/delete_ip_forwarding_rule.rb +0 -12
- data/lib/fog/ninefold/requests/compute/delete_load_balancer_rule.rb +0 -11
- data/lib/fog/ninefold/requests/compute/deploy_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/destroy_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/disable_static_nat.rb +0 -12
- data/lib/fog/ninefold/requests/compute/disassociate_ip_address.rb +0 -12
- data/lib/fog/ninefold/requests/compute/enable_static_nat.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_accounts.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_async_jobs.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_capabilities.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_disk_offerings.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_events.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_hypervisors.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_ip_forwarding_rules.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_load_balancer_rule_instances.rb +0 -11
- data/lib/fog/ninefold/requests/compute/list_load_balancer_rules.rb +0 -11
- data/lib/fog/ninefold/requests/compute/list_network_offerings.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_networks.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_public_ip_addresses.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_resource_limits.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_service_offerings.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_templates.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_virtual_machines.rb +0 -12
- data/lib/fog/ninefold/requests/compute/list_zones.rb +0 -12
- data/lib/fog/ninefold/requests/compute/query_async_job_result.rb +0 -12
- data/lib/fog/ninefold/requests/compute/reboot_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/remove_from_load_balancer_rule.rb +0 -11
- data/lib/fog/ninefold/requests/compute/reset_password_for_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/start_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/stop_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/requests/compute/update_load_balancer_rule.rb +0 -11
- data/lib/fog/ninefold/requests/compute/update_virtual_machine.rb +0 -12
- data/lib/fog/ninefold/storage.rb +0 -53
- data/spec/fog/bin/digitalocean_spec.rb +0 -9
- data/spec/fog/bin/ninefold_spec.rb +0 -10
- data/tests/digitalocean/helper.rb +0 -56
- data/tests/digitalocean/requests/compute_v2/list_flavors_tests.rb +0 -25
- data/tests/digitalocean/requests/compute_v2/list_images_tests.rb +0 -25
- data/tests/digitalocean/requests/compute_v2/list_regions_tests.rb +0 -21
- data/tests/digitalocean/requests/compute_v2/server_tests.rb +0 -77
- data/tests/dnsimple/requests/dns/dns_tests.rb +0 -122
- data/tests/hp/block_storage_tests.rb +0 -47
- data/tests/hp/cdn_tests.rb +0 -23
- data/tests/hp/compute_tests.rb +0 -22
- data/tests/hp/models/block_storage/bootable_volume_tests.rb +0 -23
- data/tests/hp/models/block_storage/snapshot_tests.rb +0 -23
- data/tests/hp/models/block_storage/volume_tests.rb +0 -21
- data/tests/hp/models/block_storage_v2/snapshot_tests.rb +0 -22
- data/tests/hp/models/block_storage_v2/snapshots_tests.rb +0 -10
- data/tests/hp/models/block_storage_v2/volume_backup_tests.rb +0 -22
- data/tests/hp/models/block_storage_v2/volume_backups_tests.rb +0 -9
- data/tests/hp/models/block_storage_v2/volume_tests.rb +0 -22
- data/tests/hp/models/block_storage_v2/volumes_tests.rb +0 -5
- data/tests/hp/models/compute/address_tests.rb +0 -18
- data/tests/hp/models/compute/addresses_tests.rb +0 -5
- data/tests/hp/models/compute/key_pair_tests.rb +0 -26
- data/tests/hp/models/compute/key_pairs_tests.rb +0 -5
- data/tests/hp/models/compute/metadata_image_tests.rb +0 -60
- data/tests/hp/models/compute/metadata_server_tests.rb +0 -54
- data/tests/hp/models/compute/security_group_tests.rb +0 -38
- data/tests/hp/models/compute/security_groups_tests.rb +0 -5
- data/tests/hp/models/compute_v2/address_tests.rb +0 -23
- data/tests/hp/models/compute_v2/addresses_tests.rb +0 -7
- data/tests/hp/models/compute_v2/availability_zone_tests.rb +0 -11
- data/tests/hp/models/compute_v2/availability_zones_tests.rb +0 -13
- data/tests/hp/models/compute_v2/key_pair_tests.rb +0 -28
- data/tests/hp/models/compute_v2/key_pairs_tests.rb +0 -7
- data/tests/hp/models/compute_v2/metadata_image_tests.rb +0 -60
- data/tests/hp/models/compute_v2/metadata_server_tests.rb +0 -56
- data/tests/hp/models/compute_v2/server_tests.rb +0 -45
- data/tests/hp/models/compute_v2/servers_tests.rb +0 -9
- data/tests/hp/models/compute_v2/volume_attachment_tests.rb +0 -40
- data/tests/hp/models/compute_v2/volume_attachments_tests.rb +0 -17
- data/tests/hp/models/dns/domain_tests.rb +0 -25
- data/tests/hp/models/dns/domains_tests.rb +0 -14
- data/tests/hp/models/dns/record_tests.rb +0 -29
- data/tests/hp/models/dns/records_tests.rb +0 -9
- data/tests/hp/models/lb/algorithms_tests.rb +0 -15
- data/tests/hp/models/lb/load_balancer_node_tests.rb +0 -9
- data/tests/hp/models/lb/load_balancer_nodes_tests.rb +0 -27
- data/tests/hp/models/lb/load_balancer_tests.rb +0 -6
- data/tests/hp/models/lb/load_balancer_virtual_ips_tests.rb +0 -22
- data/tests/hp/models/lb/load_balancers_tests.rb +0 -22
- data/tests/hp/models/lb/protocols_tests.rb +0 -15
- data/tests/hp/models/network/floating_ip_tests.rb +0 -37
- data/tests/hp/models/network/floating_ips_tests.rb +0 -8
- data/tests/hp/models/network/network_tests.rb +0 -25
- data/tests/hp/models/network/networks_tests.rb +0 -15
- data/tests/hp/models/network/port_tests.rb +0 -30
- data/tests/hp/models/network/ports_tests.rb +0 -21
- data/tests/hp/models/network/router_tests.rb +0 -55
- data/tests/hp/models/network/routers_tests.rb +0 -19
- data/tests/hp/models/network/security_group_rule_tests.rb +0 -25
- data/tests/hp/models/network/security_group_rules_tests.rb +0 -23
- data/tests/hp/models/network/security_group_tests.rb +0 -20
- data/tests/hp/models/network/security_groups_tests.rb +0 -20
- data/tests/hp/models/network/subnet_tests.rb +0 -30
- data/tests/hp/models/network/subnets_tests.rb +0 -22
- data/tests/hp/models/storage/directories_tests.rb +0 -23
- data/tests/hp/models/storage/directory_tests.rb +0 -131
- data/tests/hp/models/storage/file_tests.rb +0 -44
- data/tests/hp/models/storage/files_tests.rb +0 -38
- data/tests/hp/requests/block_storage/bootable_volume_tests.rb +0 -78
- data/tests/hp/requests/block_storage/snapshot_tests.rb +0 -56
- data/tests/hp/requests/block_storage/volume_tests.rb +0 -94
- data/tests/hp/requests/block_storage_v2/snapshot_tests.rb +0 -69
- data/tests/hp/requests/block_storage_v2/volume_backup_tests.rb +0 -117
- data/tests/hp/requests/block_storage_v2/volume_tests.rb +0 -106
- data/tests/hp/requests/cdn/container_tests.rb +0 -56
- data/tests/hp/requests/compute/address_tests.rb +0 -72
- data/tests/hp/requests/compute/flavor_tests.rb +0 -45
- data/tests/hp/requests/compute/image_tests.rb +0 -79
- data/tests/hp/requests/compute/key_pair_tests.rb +0 -65
- data/tests/hp/requests/compute/metadata_tests.rb +0 -70
- data/tests/hp/requests/compute/persistent_server_tests.rb +0 -66
- data/tests/hp/requests/compute/security_group_rule_tests.rb +0 -54
- data/tests/hp/requests/compute/security_group_tests.rb +0 -63
- data/tests/hp/requests/compute/server_address_tests.rb +0 -45
- data/tests/hp/requests/compute/server_tests.rb +0 -126
- data/tests/hp/requests/compute/server_volume_tests.rb +0 -75
- data/tests/hp/requests/compute_v2/address_tests.rb +0 -80
- data/tests/hp/requests/compute_v2/availability_zone_tests.rb +0 -19
- data/tests/hp/requests/compute_v2/flavor_tests.rb +0 -45
- data/tests/hp/requests/compute_v2/image_tests.rb +0 -86
- data/tests/hp/requests/compute_v2/key_pair_tests.rb +0 -66
- data/tests/hp/requests/compute_v2/metadata_tests.rb +0 -101
- data/tests/hp/requests/compute_v2/persistent_server_tests.rb +0 -67
- data/tests/hp/requests/compute_v2/server_address_tests.rb +0 -46
- data/tests/hp/requests/compute_v2/server_security_group_tests.rb +0 -42
- data/tests/hp/requests/compute_v2/server_tests.rb +0 -113
- data/tests/hp/requests/compute_v2/server_volume_tests.rb +0 -84
- data/tests/hp/requests/dns/domain_tests.rb +0 -72
- data/tests/hp/requests/dns/records_tests.rb +0 -64
- data/tests/hp/requests/lb/algorithms_tests.rb +0 -14
- data/tests/hp/requests/lb/limits_tests.rb +0 -16
- data/tests/hp/requests/lb/load_balancer_nodes_tests.rb +0 -46
- data/tests/hp/requests/lb/load_balancer_tests.rb +0 -56
- data/tests/hp/requests/lb/protocols_tests.rb +0 -14
- data/tests/hp/requests/lb/versions_tests.rb +0 -16
- data/tests/hp/requests/lb/virtual_ips_tests.rb +0 -34
- data/tests/hp/requests/network/floating_ip_tests.rb +0 -70
- data/tests/hp/requests/network/network_tests.rb +0 -57
- data/tests/hp/requests/network/port_tests.rb +0 -71
- data/tests/hp/requests/network/router_tests.rb +0 -108
- data/tests/hp/requests/network/security_group_rule_tests.rb +0 -58
- data/tests/hp/requests/network/security_group_tests.rb +0 -48
- data/tests/hp/requests/network/subnet_tests.rb +0 -71
- data/tests/hp/requests/storage/container_tests.rb +0 -86
- data/tests/hp/requests/storage/object_tests.rb +0 -121
- data/tests/hp/storage_tests.rb +0 -28
- data/tests/hp/user_agent_tests.rb +0 -13
- data/tests/ninefold/models/storage/file_update_tests.rb +0 -19
- data/tests/ninefold/models/storage/nested_directories_tests.rb +0 -23
- data/tests/ninefold/requests/compute/address_tests.rb +0 -42
- data/tests/ninefold/requests/compute/async_job_tests.rb +0 -33
- data/tests/ninefold/requests/compute/helper.rb +0 -369
- data/tests/ninefold/requests/compute/list_tests.rb +0 -56
- data/tests/ninefold/requests/compute/load_balancer_tests.rb +0 -66
- data/tests/ninefold/requests/compute/nat_tests.rb +0 -91
- data/tests/ninefold/requests/compute/network_tests.rb +0 -21
- data/tests/ninefold/requests/compute/template_tests.rb +0 -21
- data/tests/ninefold/requests/compute/virtual_machine_tests.rb +0 -68
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/dnsimple/models/dns/zone'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module DNS
|
6
|
-
class DNSimple
|
7
|
-
class Zones < Fog::Collection
|
8
|
-
model Fog::DNS::DNSimple::Zone
|
9
|
-
|
10
|
-
def all
|
11
|
-
clear
|
12
|
-
data = service.list_domains.body.map {|zone| zone['domain']}
|
13
|
-
load(data)
|
14
|
-
end
|
15
|
-
|
16
|
-
def get(zone_id)
|
17
|
-
data = service.get_domain(zone_id).body['domain']
|
18
|
-
new(data)
|
19
|
-
rescue Excon::Errors::NotFound
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Create a single domain in DNSimple in your account.
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * name<~String> - domain name to host (ie example.com)
|
9
|
-
#
|
10
|
-
# ==== Returns
|
11
|
-
# * response<~Excon::Response>:
|
12
|
-
# * body<~Hash>:
|
13
|
-
# * 'domain'<~Hash> The representation of the domain.
|
14
|
-
def create_domain(name)
|
15
|
-
body = {
|
16
|
-
"domain" => {
|
17
|
-
"name" => name
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
request(
|
22
|
-
:body => Fog::JSON.encode(body),
|
23
|
-
:expects => 201,
|
24
|
-
:method => 'POST',
|
25
|
-
:path => "/domains"
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class Mock
|
31
|
-
def create_domain(name)
|
32
|
-
body = {
|
33
|
-
"domain" => {
|
34
|
-
"id" => Fog::Mock.random_numbers(1).to_i,
|
35
|
-
"user_id" => 1,
|
36
|
-
"registrant_id" => nil,
|
37
|
-
"name" => name,
|
38
|
-
"unicode_name" => name,
|
39
|
-
"token" => "4fIFYWYiJayvL2tkf_mkBkqC4L+4RtYqDA",
|
40
|
-
"state" => "registered",
|
41
|
-
"language" => nil,
|
42
|
-
"lockable" => true,
|
43
|
-
"auto_renew" => nil,
|
44
|
-
"whois_protected" => false,
|
45
|
-
"record_count" => 0,
|
46
|
-
"service_count" => 0,
|
47
|
-
"expires_on" => Date.today + 365,
|
48
|
-
"created_at" => Time.now.iso8601,
|
49
|
-
"updated_at" => Time.now.iso8601,
|
50
|
-
}
|
51
|
-
}
|
52
|
-
self.data[:domains] << body
|
53
|
-
|
54
|
-
response = Excon::Response.new
|
55
|
-
response.status = 201
|
56
|
-
response.body = body
|
57
|
-
response
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Create a new host in the specified zone
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * domain<~String> - domain name or numeric ID
|
9
|
-
# * name<~String>
|
10
|
-
# * type<~String>
|
11
|
-
# * content<~String>
|
12
|
-
# * options<~Hash> - optional
|
13
|
-
# * priority<~Integer>
|
14
|
-
# * ttl<~Integer>
|
15
|
-
#
|
16
|
-
# ==== Returns
|
17
|
-
# * response<~Excon::Response>:
|
18
|
-
# * body<~Hash>:
|
19
|
-
# * 'record'<~Hash> The representation of the record.
|
20
|
-
def create_record(domain, name, type, content, options = {})
|
21
|
-
body = {
|
22
|
-
"record" => {
|
23
|
-
"name" => name,
|
24
|
-
"record_type" => type,
|
25
|
-
"content" => content
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
body["record"].merge!(options)
|
30
|
-
|
31
|
-
request(
|
32
|
-
:body => Fog::JSON.encode(body),
|
33
|
-
:expects => 201,
|
34
|
-
:method => 'POST',
|
35
|
-
:path => "/domains/#{domain}/records"
|
36
|
-
)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
class Mock
|
41
|
-
def create_record(domain, name, type, content, options = {})
|
42
|
-
body = {
|
43
|
-
"record" => {
|
44
|
-
"id" => Fog::Mock.random_numbers(1).to_i,
|
45
|
-
"domain_id" => domain,
|
46
|
-
"name" => name,
|
47
|
-
"content" => content,
|
48
|
-
"ttl" => 3600,
|
49
|
-
"prio" => nil,
|
50
|
-
"record_type" => type,
|
51
|
-
"system_record" => nil,
|
52
|
-
"created_at" => Time.now.iso8601,
|
53
|
-
"updated_at" => Time.now.iso8601,
|
54
|
-
}.merge(options)
|
55
|
-
}
|
56
|
-
self.data[:records][domain] ||= []
|
57
|
-
self.data[:records][domain] << body
|
58
|
-
|
59
|
-
response = Excon::Response.new
|
60
|
-
response.status = 201
|
61
|
-
response.body = body
|
62
|
-
response
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Delete the given domain from your account. You may use
|
6
|
-
# either the domain ID or the domain name.
|
7
|
-
#
|
8
|
-
# Please note that for domains which are registered with
|
9
|
-
# DNSimple this will not delete the domain from the registry.
|
10
|
-
#
|
11
|
-
# ==== Parameters
|
12
|
-
# * domain<~String> - domain name or numeric ID
|
13
|
-
#
|
14
|
-
def delete_domain(domain)
|
15
|
-
request(
|
16
|
-
:expects => 200,
|
17
|
-
:method => 'DELETE',
|
18
|
-
:path => "/domains/#{domain}"
|
19
|
-
)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class Mock
|
24
|
-
def delete_domain(name)
|
25
|
-
self.data[:records].delete name
|
26
|
-
self.data[:domains].reject! { |domain| domain["domain"]["name"] == name }
|
27
|
-
|
28
|
-
response = Excon::Response.new
|
29
|
-
response.status = 200
|
30
|
-
response
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Delete the record with the given ID for the given domain.
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * domain<~String> - domain name or numeric ID
|
9
|
-
# * record_id<~String>
|
10
|
-
def delete_record(domain, record_id)
|
11
|
-
request(
|
12
|
-
:expects => 200,
|
13
|
-
:method => "DELETE",
|
14
|
-
:path => "/domains/#{domain}/records/#{record_id}"
|
15
|
-
)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class Mock
|
20
|
-
def delete_record(domain, record_id)
|
21
|
-
self.data[:records][domain].reject! { |record| record["record"]["id"] == record_id }
|
22
|
-
|
23
|
-
response = Excon::Response.new
|
24
|
-
response.status = 200
|
25
|
-
response
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Get the details for a specific domain in your account. You
|
6
|
-
# may pass either the domain numeric ID or the domain name
|
7
|
-
# itself.
|
8
|
-
#
|
9
|
-
# ==== Parameters
|
10
|
-
# * domain<~String> - domain name or numeric ID
|
11
|
-
#
|
12
|
-
# ==== Returns
|
13
|
-
# * response<~Excon::Response>:
|
14
|
-
# * body<~Hash>:
|
15
|
-
# * 'domain'<~Hash> The representation of the domain.
|
16
|
-
def get_domain(domain)
|
17
|
-
request(
|
18
|
-
:expects => 200,
|
19
|
-
:method => "GET",
|
20
|
-
:path => "/domains/#{domain}"
|
21
|
-
)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class Mock
|
26
|
-
def get_domain(id)
|
27
|
-
domain = self.data[:domains].find do |domain|
|
28
|
-
domain["domain"]["id"] == id || domain["domain"]["name"] == id
|
29
|
-
end
|
30
|
-
|
31
|
-
response = Excon::Response.new
|
32
|
-
response.status = 200
|
33
|
-
response.body = domain
|
34
|
-
response
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Gets record from given domain.
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * domain<~String> - domain name or numeric ID
|
9
|
-
# * record_id<~String>
|
10
|
-
#
|
11
|
-
# ==== Returns
|
12
|
-
# * response<~Excon::Response>:
|
13
|
-
# * body<~Hash>:
|
14
|
-
# * 'record'<~Hash> The representation of the record.
|
15
|
-
def get_record(domain, record_id)
|
16
|
-
request(
|
17
|
-
:expects => 200,
|
18
|
-
:method => "GET",
|
19
|
-
:path => "/domains/#{domain}/records/#{record_id}"
|
20
|
-
)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
class Mock
|
25
|
-
def get_record(domain, record_id)
|
26
|
-
response = Excon::Response.new
|
27
|
-
|
28
|
-
if self.data[:records].key?(domain)
|
29
|
-
response.status = 200
|
30
|
-
response.body = self.data[:records][domain].find { |record| record["record"]["id"] == record_id }
|
31
|
-
|
32
|
-
if response.body.nil?
|
33
|
-
response.status = 404
|
34
|
-
response.body = {
|
35
|
-
"error" => "Couldn't find Record with id = #{record_id}"
|
36
|
-
}
|
37
|
-
end
|
38
|
-
else
|
39
|
-
response.status = 404
|
40
|
-
response.body = {
|
41
|
-
"error" => "Couldn't find Domain with name = #{domain}"
|
42
|
-
}
|
43
|
-
end
|
44
|
-
response
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Get the details for a specific domain in your account. You
|
6
|
-
# may pass either the domain numeric ID or the domain name itself.
|
7
|
-
#
|
8
|
-
# ==== Parameters
|
9
|
-
#
|
10
|
-
# ==== Returns
|
11
|
-
# * response<~Excon::Response>:
|
12
|
-
# * body<~Hash>:
|
13
|
-
# * <~Array>:
|
14
|
-
# * 'domain'<~Hash> The representation of the domain.
|
15
|
-
def list_domains
|
16
|
-
request(
|
17
|
-
:expects => 200,
|
18
|
-
:method => 'GET',
|
19
|
-
:path => '/domains'
|
20
|
-
)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
class Mock
|
25
|
-
def list_domains
|
26
|
-
response = Excon::Response.new
|
27
|
-
response.status = 200
|
28
|
-
response.body = self.data[:domains]
|
29
|
-
response
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Get the list of records for the specific domain.
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * domain<~String> - domain name or numeric ID
|
9
|
-
#
|
10
|
-
# ==== Returns
|
11
|
-
# * response<~Excon::Response>:
|
12
|
-
# * body<~Hash>:
|
13
|
-
# * <~Array>:
|
14
|
-
# * 'record'<~Hash> The representation of the record.
|
15
|
-
def list_records(domain)
|
16
|
-
request(
|
17
|
-
:expects => 200,
|
18
|
-
:method => "GET",
|
19
|
-
:path => "/domains/#{domain}/records"
|
20
|
-
)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
class Mock
|
25
|
-
def list_records(domain)
|
26
|
-
response = Excon::Response.new
|
27
|
-
response.status = 200
|
28
|
-
response.body = self.data[:records][domain] || []
|
29
|
-
response
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class DNSimple
|
4
|
-
class Real
|
5
|
-
# Update the given record for the given domain.
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * domain<~String> - domain name or numeric ID
|
9
|
-
# * record_id<~String>
|
10
|
-
# * options<~Hash> - optional
|
11
|
-
# * type<~String>
|
12
|
-
# * content<~String>
|
13
|
-
# * priority<~Integer>
|
14
|
-
# * ttl<~Integer>
|
15
|
-
#
|
16
|
-
# ==== Returns
|
17
|
-
# * response<~Excon::Response>:
|
18
|
-
# * body<~Hash>:
|
19
|
-
# * 'record'<~Hash> The representation of the record.
|
20
|
-
def update_record(domain, record_id, options)
|
21
|
-
body = {
|
22
|
-
"record" => options
|
23
|
-
}
|
24
|
-
|
25
|
-
request(
|
26
|
-
:body => Fog::JSON.encode(body),
|
27
|
-
:expects => 200,
|
28
|
-
:method => "PUT",
|
29
|
-
:path => "/domains/#{domain}/records/#{record_id}"
|
30
|
-
)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
class Mock
|
35
|
-
def update_record(domain, record_id, options)
|
36
|
-
record = self.data[:records][domain].find { |record| record["record"]["id"] == record_id }
|
37
|
-
response = Excon::Response.new
|
38
|
-
|
39
|
-
if record.nil?
|
40
|
-
response.status = 400
|
41
|
-
else
|
42
|
-
response.status = 200
|
43
|
-
record["record"].merge!(options)
|
44
|
-
record["record"]["updated_at"] = Time.now.iso8601
|
45
|
-
response.body = record
|
46
|
-
end
|
47
|
-
|
48
|
-
response
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
data/lib/fog/ninefold.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'fog/ninefold/compute'
|
data/lib/fog/ninefold/compute.rb
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
require 'fog/ninefold/core'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class Ninefold < Fog::Service
|
6
|
-
API_URL = "http://api.ninefold.com/compute/v1.0/"
|
7
|
-
|
8
|
-
requires :ninefold_compute_key, :ninefold_compute_secret
|
9
|
-
recognizes :ninefold_api_url # allow us to specify non-prod environments
|
10
|
-
|
11
|
-
model_path 'fog/ninefold/models/compute'
|
12
|
-
model :server
|
13
|
-
collection :servers
|
14
|
-
model :flavor
|
15
|
-
collection :flavors
|
16
|
-
model :image
|
17
|
-
collection :images
|
18
|
-
model :address
|
19
|
-
collection :addresses
|
20
|
-
model :ip_forwarding_rule
|
21
|
-
collection :ip_forwarding_rules
|
22
|
-
|
23
|
-
request_path 'fog/ninefold/requests/compute'
|
24
|
-
# General list-only stuff
|
25
|
-
request :list_accounts
|
26
|
-
request :list_events
|
27
|
-
request :list_service_offerings
|
28
|
-
request :list_disk_offerings
|
29
|
-
request :list_capabilities
|
30
|
-
request :list_hypervisors
|
31
|
-
request :list_zones
|
32
|
-
request :list_network_offerings
|
33
|
-
request :list_resource_limits
|
34
|
-
# Templates
|
35
|
-
request :list_templates
|
36
|
-
# Virtual Machines
|
37
|
-
request :deploy_virtual_machine
|
38
|
-
request :destroy_virtual_machine
|
39
|
-
request :list_virtual_machines
|
40
|
-
request :reboot_virtual_machine
|
41
|
-
request :stop_virtual_machine
|
42
|
-
request :start_virtual_machine
|
43
|
-
request :change_service_for_virtual_machine
|
44
|
-
request :reset_password_for_virtual_machine
|
45
|
-
request :update_virtual_machine
|
46
|
-
# Jobs
|
47
|
-
request :list_async_jobs
|
48
|
-
request :query_async_job_result
|
49
|
-
# Networks
|
50
|
-
request :list_networks
|
51
|
-
# Addresses
|
52
|
-
request :associate_ip_address
|
53
|
-
request :list_public_ip_addresses
|
54
|
-
request :disassociate_ip_address
|
55
|
-
# NAT
|
56
|
-
request :enable_static_nat
|
57
|
-
request :disable_static_nat
|
58
|
-
request :create_ip_forwarding_rule
|
59
|
-
request :delete_ip_forwarding_rule
|
60
|
-
request :list_ip_forwarding_rules
|
61
|
-
# Load Balancers
|
62
|
-
request :create_load_balancer_rule
|
63
|
-
request :delete_load_balancer_rule
|
64
|
-
request :remove_from_load_balancer_rule
|
65
|
-
request :assign_to_load_balancer_rule
|
66
|
-
request :list_load_balancer_rules
|
67
|
-
request :list_load_balancer_rule_instances
|
68
|
-
request :update_load_balancer_rule
|
69
|
-
|
70
|
-
class Mock
|
71
|
-
def initialize(options)
|
72
|
-
@api_url = options[:ninefold_api_url] || API_URL
|
73
|
-
@ninefold_compute_key = options[:ninefold_compute_key]
|
74
|
-
@ninefold_compute_secret = options[:ninefold_compute_secret]
|
75
|
-
end
|
76
|
-
|
77
|
-
def request(options)
|
78
|
-
raise "Not implemented"
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
class Real
|
83
|
-
def initialize(options)
|
84
|
-
@api_url = options[:ninefold_api_url] || API_URL
|
85
|
-
@ninefold_compute_key = options[:ninefold_compute_key]
|
86
|
-
@ninefold_compute_secret = options[:ninefold_compute_secret]
|
87
|
-
@connection_options = options[:connection_options] || {}
|
88
|
-
@persistent = options[:persistent] || false
|
89
|
-
@connection = Fog::XML::Connection.new(@api_url, @persistent, @connection_options)
|
90
|
-
end
|
91
|
-
|
92
|
-
def request(command, params, options)
|
93
|
-
params['response'] = "json"
|
94
|
-
# convert params to strings for sort
|
95
|
-
req_params = params.merge('apiKey' => @ninefold_compute_key, 'command' => command)
|
96
|
-
req = URI.escape(req_params.sort_by{|k,v| k.to_s }.map{|e| "#{e[0].to_s}=#{e[1].to_s}"}.join('&'))
|
97
|
-
encoded_signature = url_escape(encode_signature(req))
|
98
|
-
|
99
|
-
options = {
|
100
|
-
:expects => 200,
|
101
|
-
:method => 'GET',
|
102
|
-
:query => "#{req}&signature=#{encoded_signature}"
|
103
|
-
}.merge(options)
|
104
|
-
|
105
|
-
begin
|
106
|
-
response = @connection.request(options)
|
107
|
-
end
|
108
|
-
unless response.body.empty?
|
109
|
-
# Because the response is some weird xml-json thing, we need to try and mung
|
110
|
-
# the values out with a prefix, and if there is an empty data entry return an
|
111
|
-
# empty version of the expected type (if provided)
|
112
|
-
response = Fog::JSON.decode(response.body)
|
113
|
-
if options.key? :response_prefix
|
114
|
-
keys = options[:response_prefix].split('/')
|
115
|
-
keys.each do |k|
|
116
|
-
if response[k]
|
117
|
-
response = response[k]
|
118
|
-
elsif options[:response_type]
|
119
|
-
response = options[:response_type].new
|
120
|
-
break
|
121
|
-
else
|
122
|
-
end
|
123
|
-
end
|
124
|
-
response
|
125
|
-
else
|
126
|
-
response
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
private
|
132
|
-
def url_escape(string)
|
133
|
-
string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
|
134
|
-
'%' + $1.unpack('H2' * $1.size).join('%').upcase
|
135
|
-
end.tr(' ', '+')
|
136
|
-
end
|
137
|
-
|
138
|
-
def encode_signature(data)
|
139
|
-
Base64.encode64(OpenSSL::HMAC.digest('sha1', @ninefold_compute_secret, URI.encode(data.downcase).gsub('+', '%20'))).chomp
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|