fog 1.41.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/stale.yml +17 -0
- data/.travis.yml +1 -8
- data/CHANGELOG.md +78 -0
- data/README.md +4 -5
- data/Rakefile +0 -3
- data/fog.gemspec +13 -13
- data/lib/fog/bin/brightbox.rb +2 -2
- data/lib/fog/bin.rb +0 -2
- data/lib/fog/cloudstack/models/compute/server.rb +2 -0
- data/lib/fog/linode/requests/compute/avail_datacenters.rb +1 -0
- data/lib/fog/opennebula/compute.rb +6 -1
- data/lib/fog/opennebula/requests/compute/OpenNebulaVNC.rb +5 -1
- data/lib/fog/vcloud_director/compute.rb +3 -2
- data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +2 -2
- data/lib/fog/vcloud_director/generators/compute/network_config_section.rb +68 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp.rb +0 -4
- data/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb +11 -11
- data/lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_config_network_section_vapp.rb +26 -0
- data/lib/fog/version.rb +1 -1
- data/lib/fog.rb +0 -2
- data/lib/tasks/changelog_task.rb +4 -1
- data/lib/tasks/github_release_task.rb +1 -1
- data/spec/fog/bin/atmos_spec.rb +0 -10
- data/spec/fog/bin/aws_spec.rb +0 -18
- data/spec/fog/bin/baremetalcloud_spec.rb +0 -10
- data/spec/fog/bin/brightbox_spec.rb +2 -2
- data/spec/fog/bin_spec.rb +0 -6
- data/tests/cloudsigma/models/snapshot_tests.rb +2 -0
- data/tests/cloudsigma/models/snapshots_tests.rb +1 -0
- data/tests/cloudsigma/requests/snapshots_tests.rb +1 -0
- data/tests/cloudsigma/requests/volumes_tests.rb +1 -1
- data/tests/cloudstack/compute/models/volume_tests.rb +1 -1
- data/tests/compute/helper.rb +0 -9
- data/tests/dns/helper.rb +0 -9
- data/tests/helpers/collection_helper.rb +0 -6
- data/tests/helpers/mock_helper.rb +0 -7
- data/tests/opennebula/compute_tests.rb +5 -2
- data/tests/opennebula/models/compute/flavor_tests.rb +5 -1
- data/tests/opennebula/models/compute/flavors_tests.rb +5 -2
- data/tests/opennebula/models/compute/group_tests.rb +5 -2
- data/tests/opennebula/models/compute/groups_tests.rb +5 -2
- data/tests/opennebula/models/compute/network_tests.rb +5 -1
- data/tests/opennebula/models/compute/networks_tests.rb +5 -2
- data/tests/opennebula/requests/compute/vm_allocate_tests.rb +5 -1
- data/tests/opennebula/requests/compute/vm_suspend_resume_tests.rb +5 -2
- metadata +37 -546
- data/gemfiles/Gemfile-1.9 +0 -16
- data/gemfiles/Gemfile-edge-1.9 +0 -20
- data/lib/fog/bin/bluebox.rb +0 -36
- data/lib/fog/bin/ovirt.rb +0 -28
- data/lib/fog/bin/zerigo.rb +0 -29
- data/lib/fog/bluebox/blb.rb +0 -82
- data/lib/fog/bluebox/compute.rb +0 -98
- data/lib/fog/bluebox/core.rb +0 -12
- data/lib/fog/bluebox/dns.rb +0 -101
- data/lib/fog/bluebox/models/blb/lb_application.rb +0 -29
- data/lib/fog/bluebox/models/blb/lb_applications.rb +0 -24
- data/lib/fog/bluebox/models/blb/lb_backend.rb +0 -19
- data/lib/fog/bluebox/models/blb/lb_backends.rb +0 -27
- data/lib/fog/bluebox/models/blb/lb_service.rb +0 -32
- data/lib/fog/bluebox/models/blb/lb_services.rb +0 -27
- data/lib/fog/bluebox/models/compute/flavor.rb +0 -41
- data/lib/fog/bluebox/models/compute/flavors.rb +0 -24
- data/lib/fog/bluebox/models/compute/image.rb +0 -30
- data/lib/fog/bluebox/models/compute/images.rb +0 -24
- data/lib/fog/bluebox/models/compute/location.rb +0 -13
- data/lib/fog/bluebox/models/compute/locations.rb +0 -24
- data/lib/fog/bluebox/models/compute/server.rb +0 -121
- data/lib/fog/bluebox/models/compute/servers.rb +0 -32
- data/lib/fog/bluebox/models/dns/record.rb +0 -52
- data/lib/fog/bluebox/models/dns/records.rb +0 -32
- data/lib/fog/bluebox/models/dns/zone.rb +0 -62
- data/lib/fog/bluebox/models/dns/zones.rb +0 -24
- data/lib/fog/bluebox/parsers/dns/create_record.rb +0 -22
- data/lib/fog/bluebox/parsers/dns/create_zone.rb +0 -22
- data/lib/fog/bluebox/parsers/dns/get_record.rb +0 -17
- data/lib/fog/bluebox/parsers/dns/get_records.rb +0 -24
- data/lib/fog/bluebox/parsers/dns/get_zone.rb +0 -22
- data/lib/fog/bluebox/parsers/dns/get_zones.rb +0 -26
- data/lib/fog/bluebox/requests/blb/add_machine_to_lb_application.rb +0 -33
- data/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb +0 -31
- data/lib/fog/bluebox/requests/blb/get_lb_application.rb +0 -32
- data/lib/fog/bluebox/requests/blb/get_lb_applications.rb +0 -30
- data/lib/fog/bluebox/requests/blb/get_lb_backend.rb +0 -35
- data/lib/fog/bluebox/requests/blb/get_lb_backends.rb +0 -35
- data/lib/fog/bluebox/requests/blb/get_lb_machine.rb +0 -34
- data/lib/fog/bluebox/requests/blb/get_lb_machines.rb +0 -34
- data/lib/fog/bluebox/requests/blb/get_lb_service.rb +0 -35
- data/lib/fog/bluebox/requests/blb/get_lb_services.rb +0 -35
- data/lib/fog/bluebox/requests/blb/remove_machine_from_lb_backend.rb +0 -28
- data/lib/fog/bluebox/requests/blb/update_lb_backend_machine.rb +0 -29
- data/lib/fog/bluebox/requests/compute/create_block.rb +0 -44
- data/lib/fog/bluebox/requests/compute/create_template.rb +0 -25
- data/lib/fog/bluebox/requests/compute/destroy_block.rb +0 -24
- data/lib/fog/bluebox/requests/compute/destroy_template.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_block.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_blocks.rb +0 -26
- data/lib/fog/bluebox/requests/compute/get_location.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_locations.rb +0 -22
- data/lib/fog/bluebox/requests/compute/get_product.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_products.rb +0 -23
- data/lib/fog/bluebox/requests/compute/get_template.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_templates.rb +0 -24
- data/lib/fog/bluebox/requests/compute/reboot_block.rb +0 -25
- data/lib/fog/bluebox/requests/dns/create_record.rb +0 -44
- data/lib/fog/bluebox/requests/dns/create_zone.rb +0 -48
- data/lib/fog/bluebox/requests/dns/delete_record.rb +0 -27
- data/lib/fog/bluebox/requests/dns/delete_zone.rb +0 -27
- data/lib/fog/bluebox/requests/dns/get_record.rb +0 -36
- data/lib/fog/bluebox/requests/dns/get_records.rb +0 -37
- data/lib/fog/bluebox/requests/dns/get_zone.rb +0 -40
- data/lib/fog/bluebox/requests/dns/get_zones.rb +0 -39
- data/lib/fog/bluebox/requests/dns/update_record.rb +0 -30
- data/lib/fog/bluebox/requests/dns/update_zone.rb +0 -26
- data/lib/fog/bluebox.rb +0 -3
- data/lib/fog/ovirt/compute.rb +0 -155
- data/lib/fog/ovirt/core.rb +0 -16
- data/lib/fog/ovirt/models/compute/affinity_group.rb +0 -25
- data/lib/fog/ovirt/models/compute/affinity_groups.rb +0 -20
- data/lib/fog/ovirt/models/compute/cluster.rb +0 -20
- data/lib/fog/ovirt/models/compute/clusters.rb +0 -20
- data/lib/fog/ovirt/models/compute/instance_type.rb +0 -39
- data/lib/fog/ovirt/models/compute/instance_types.rb +0 -20
- data/lib/fog/ovirt/models/compute/interface.rb +0 -19
- data/lib/fog/ovirt/models/compute/interfaces.rb +0 -29
- data/lib/fog/ovirt/models/compute/quota.rb +0 -16
- data/lib/fog/ovirt/models/compute/quotas.rb +0 -20
- data/lib/fog/ovirt/models/compute/server.rb +0 -175
- data/lib/fog/ovirt/models/compute/servers.rb +0 -27
- data/lib/fog/ovirt/models/compute/template.rb +0 -58
- data/lib/fog/ovirt/models/compute/templates.rb +0 -20
- data/lib/fog/ovirt/models/compute/volume.rb +0 -36
- data/lib/fog/ovirt/models/compute/volumes.rb +0 -28
- data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/add_interface.rb +0 -20
- data/lib/fog/ovirt/requests/compute/add_to_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/add_volume.rb +0 -21
- data/lib/fog/ovirt/requests/compute/attach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/create_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/create_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/datacenters.rb +0 -20
- data/lib/fog/ovirt/requests/compute/deactivate_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_affinity_group.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_interface.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_vm.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/detach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/get_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/get_api_version.rb +0 -16
- data/lib/fog/ovirt/requests/compute/get_cluster.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_instance_type.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_quota.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_template.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +0 -17
- data/lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb +0 -22
- data/lib/fog/ovirt/requests/compute/list_affinity_groups.rb +0 -20
- data/lib/fog/ovirt/requests/compute/list_clusters.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_instance_types.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_networks.rb +0 -16
- data/lib/fog/ovirt/requests/compute/list_quotas.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_templates.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroup.xml +0 -8
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroup_vms.xml +0 -9
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroups.xml +0 -17
- data/lib/fog/ovirt/requests/compute/mock_files/cluster.xml +0 -20
- data/lib/fog/ovirt/requests/compute/mock_files/clusters.xml +0 -39
- data/lib/fog/ovirt/requests/compute/mock_files/data_centers.xml +0 -17
- data/lib/fog/ovirt/requests/compute/mock_files/disks.xml +0 -58
- data/lib/fog/ovirt/requests/compute/mock_files/instance_type.xml +0 -42
- data/lib/fog/ovirt/requests/compute/mock_files/instance_types.xml +0 -197
- data/lib/fog/ovirt/requests/compute/mock_files/nics.xml +0 -10
- data/lib/fog/ovirt/requests/compute/mock_files/quotas.xml +0 -7
- data/lib/fog/ovirt/requests/compute/mock_files/storage_domains.xml +0 -36
- data/lib/fog/ovirt/requests/compute/mock_files/template.xml +0 -39
- data/lib/fog/ovirt/requests/compute/mock_files/templates.xml +0 -110
- data/lib/fog/ovirt/requests/compute/mock_files/vm.xml +0 -52
- data/lib/fog/ovirt/requests/compute/mock_files/vms.xml +0 -152
- data/lib/fog/ovirt/requests/compute/mock_files/volumes.xml +0 -40
- data/lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/storage_domains.rb +0 -20
- data/lib/fog/ovirt/requests/compute/update_interface.rb +0 -35
- data/lib/fog/ovirt/requests/compute/update_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/update_volume.rb +0 -39
- data/lib/fog/ovirt/requests/compute/vm_action.rb +0 -22
- data/lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb +0 -19
- data/lib/fog/ovirt/requests/compute/vm_ticket.rb +0 -17
- data/lib/fog/ovirt.rb +0 -1
- data/lib/fog/zerigo/core.rb +0 -10
- data/lib/fog/zerigo/dns.rb +0 -114
- data/lib/fog/zerigo/models/dns/record.rb +0 -66
- data/lib/fog/zerigo/models/dns/records.rb +0 -45
- data/lib/fog/zerigo/models/dns/zone.rb +0 -84
- data/lib/fog/zerigo/models/dns/zones.rb +0 -26
- data/lib/fog/zerigo/parsers/dns/count_hosts.rb +0 -20
- data/lib/fog/zerigo/parsers/dns/count_zones.rb +0 -20
- data/lib/fog/zerigo/parsers/dns/create_host.rb +0 -24
- data/lib/fog/zerigo/parsers/dns/create_zone.rb +0 -22
- data/lib/fog/zerigo/parsers/dns/find_hosts.rb +0 -28
- data/lib/fog/zerigo/parsers/dns/get_host.rb +0 -24
- data/lib/fog/zerigo/parsers/dns/get_zone.rb +0 -53
- data/lib/fog/zerigo/parsers/dns/get_zone_stats.rb +0 -22
- data/lib/fog/zerigo/parsers/dns/list_hosts.rb +0 -28
- data/lib/fog/zerigo/parsers/dns/list_zones.rb +0 -26
- data/lib/fog/zerigo/requests/dns/count_hosts.rb +0 -45
- data/lib/fog/zerigo/requests/dns/count_zones.rb +0 -37
- data/lib/fog/zerigo/requests/dns/create_host.rb +0 -125
- data/lib/fog/zerigo/requests/dns/create_zone.rb +0 -128
- data/lib/fog/zerigo/requests/dns/delete_host.rb +0 -41
- data/lib/fog/zerigo/requests/dns/delete_zone.rb +0 -40
- data/lib/fog/zerigo/requests/dns/find_hosts.rb +0 -74
- data/lib/fog/zerigo/requests/dns/get_host.rb +0 -54
- data/lib/fog/zerigo/requests/dns/get_zone.rb +0 -64
- data/lib/fog/zerigo/requests/dns/get_zone_stats.rb +0 -57
- data/lib/fog/zerigo/requests/dns/list_hosts.rb +0 -73
- data/lib/fog/zerigo/requests/dns/list_zones.rb +0 -62
- data/lib/fog/zerigo/requests/dns/update_host.rb +0 -68
- data/lib/fog/zerigo/requests/dns/update_zone.rb +0 -86
- data/lib/fog/zerigo.rb +0 -1
- data/spec/fog/bin/bluebox_spec.rb +0 -55
- data/spec/fog/bin/ovirt_spec.rb +0 -10
- data/spec/fog/bin/zerigo_spec.rb +0 -10
- data/spec/fog/compute_spec.rb +0 -19
- data/spec/fog/dns_spec.rb +0 -19
- data/tests/bluebox/requests/blb/helper.rb +0 -64
- data/tests/bluebox/requests/blb/lb_tests.rb +0 -75
- data/tests/bluebox/requests/compute/block_tests.rb +0 -83
- data/tests/bluebox/requests/compute/helper.rb +0 -16
- data/tests/bluebox/requests/compute/location_tests.rb +0 -32
- data/tests/bluebox/requests/compute/product_tests.rb +0 -34
- data/tests/bluebox/requests/compute/template_tests.rb +0 -37
- data/tests/bluebox/requests/dns/dns_tests.rb +0 -258
- data/tests/ovirt/compute_tests.rb +0 -25
- data/tests/ovirt/models/compute/cluster_tests.rb +0 -31
- data/tests/ovirt/models/compute/clusters_tests.rb +0 -9
- data/tests/ovirt/models/compute/interface_tests.rb +0 -27
- data/tests/ovirt/models/compute/interfaces_tests.rb +0 -9
- data/tests/ovirt/models/compute/server_tests.rb +0 -51
- data/tests/ovirt/models/compute/servers_tests.rb +0 -14
- data/tests/ovirt/models/compute/template_tests.rb +0 -28
- data/tests/ovirt/models/compute/templates_tests.rb +0 -9
- data/tests/ovirt/requests/compute/create_vm_tests.rb +0 -26
- data/tests/ovirt/requests/compute/destroy_vm_tests.rb +0 -18
- data/tests/ovirt/requests/compute/list_datacenters_tests.rb +0 -13
- data/tests/ovirt/requests/compute/list_quotas_tests.rb +0 -12
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +0 -13
- data/tests/ovirt/requests/compute/update_vm_tests.rb +0 -18
- data/tests/ovirt/requests/compute/update_volume_tests.rb +0 -20
- data/tests/zerigo/requests/dns/dns_tests.rb +0 -440
@@ -1,54 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
require 'fog/zerigo/parsers/dns/get_host'
|
6
|
-
|
7
|
-
# get details about a given host record
|
8
|
-
#
|
9
|
-
# ==== Parameters
|
10
|
-
# * host_id<~Integer> - ID of the host record to retrieve
|
11
|
-
# ==== Returns
|
12
|
-
# * response<~Excon::Response>:
|
13
|
-
# * body<~Hash>:
|
14
|
-
# * 'created-at'<~String>
|
15
|
-
# * 'data'<~String>
|
16
|
-
# * 'fqdn'<~String>
|
17
|
-
# * 'host-type'<~String>
|
18
|
-
# * 'hostname'<~String>
|
19
|
-
# * 'id'<~Integer>
|
20
|
-
# * 'notes'<~String>
|
21
|
-
# * 'priority'<~Integer>
|
22
|
-
# * 'ttl'<~Integer>
|
23
|
-
# * 'updated-at'<~String>
|
24
|
-
# * 'zone-id'<~String>
|
25
|
-
# * 'status'<~Integer> - 200 indicates success
|
26
|
-
def get_host(host_id)
|
27
|
-
request(
|
28
|
-
:expects => 200,
|
29
|
-
:method => 'GET',
|
30
|
-
:parser => Fog::Parsers::DNS::Zerigo::GetHost.new,
|
31
|
-
:path => "/api/1.1/hosts/#{host_id}.xml"
|
32
|
-
)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Mock # :nodoc:all
|
37
|
-
def get_host(host_id)
|
38
|
-
host = find_host(host_id)
|
39
|
-
|
40
|
-
response = Excon::Response.new
|
41
|
-
|
42
|
-
if host
|
43
|
-
response.status = 200
|
44
|
-
response.body = host
|
45
|
-
else
|
46
|
-
response.status = 404
|
47
|
-
end
|
48
|
-
|
49
|
-
response
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
require 'fog/zerigo/parsers/dns/get_zone'
|
6
|
-
|
7
|
-
# Get details of a DNS zone. The response is similar to list_zones, with the
|
8
|
-
# addition of hosts-count and possibly hosts.
|
9
|
-
#
|
10
|
-
# ==== Parameters
|
11
|
-
# * zone<~String> - Either the zone ID or the zone name (ie sample-domain.com)
|
12
|
-
#
|
13
|
-
# ==== Returns
|
14
|
-
# * response<~Excon::Response>:
|
15
|
-
# * body<~Hash>:
|
16
|
-
# * 'default-ttl'<~Integer>
|
17
|
-
# * 'id'<~Integer>
|
18
|
-
# * 'nx-ttl'<~Integer>
|
19
|
-
# * 'hosts-count'<~Integer>
|
20
|
-
# * 'created-at'<~String>
|
21
|
-
# * 'custom-nameservers'<~String>
|
22
|
-
# * 'custom-ns'<~String>
|
23
|
-
# * 'domain'<~String>
|
24
|
-
# * 'hostmaster'<~String>
|
25
|
-
# * 'notes'<~String>
|
26
|
-
# * 'ns1'<~String>
|
27
|
-
# * 'ns-type'<~String>
|
28
|
-
# * 'slave-nameservers'<~String>
|
29
|
-
# * 'tag-list'<~String>
|
30
|
-
# * 'updated-at'<~String>
|
31
|
-
# * 'hosts'<~Array> - a list of all host records. For the format of host info, see get_host()
|
32
|
-
# * 'axfr-ips'<~String>
|
33
|
-
# * 'restrict-axfr'<~String>
|
34
|
-
# * 'status'<~Integer> - 200 indicates success
|
35
|
-
|
36
|
-
def get_zone(zone_id_or_domain)
|
37
|
-
request(
|
38
|
-
:expects => 200,
|
39
|
-
:method => 'GET',
|
40
|
-
:parser => Fog::Parsers::DNS::Zerigo::GetZone.new,
|
41
|
-
:path => "/api/1.1/zones/#{zone_id_or_domain}.xml"
|
42
|
-
)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
class Mock # :nodoc:all
|
47
|
-
def get_zone(zone_id_or_domain)
|
48
|
-
zone = find_by_zone_id(zone_id_or_domain) || find_by_domain(zone_id_or_domain)
|
49
|
-
|
50
|
-
response = Excon::Response.new
|
51
|
-
|
52
|
-
if zone
|
53
|
-
response.status = 200
|
54
|
-
response.body = zone
|
55
|
-
else
|
56
|
-
response.status = 404
|
57
|
-
end
|
58
|
-
|
59
|
-
response
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
require 'fog/zerigo/parsers/dns/get_zone_stats'
|
6
|
-
|
7
|
-
# returns current traffic statistics about this zone. Queries is measured from the
|
8
|
-
# beginning of the current period through the time of the API call.
|
9
|
-
#
|
10
|
-
# ==== Parameters
|
11
|
-
# * zone_id<~Integer> - the zone ID
|
12
|
-
#
|
13
|
-
# ==== Returns
|
14
|
-
# * response<~Excon::Response>:
|
15
|
-
# * body<~Hash>:
|
16
|
-
# * 'domain'<~String> - domain name (ie example.com)
|
17
|
-
# * 'id'<~Integer> - Id of the zone
|
18
|
-
# * 'period-being'<~String> - date in following format 2010-07-01
|
19
|
-
# * 'period-end'<~String> - date
|
20
|
-
# * 'queries'<~Integer> - # of queries for the zone during period
|
21
|
-
# * 'status'<~Integer> - 200 indicates success
|
22
|
-
|
23
|
-
def get_zone_stats(zone_id)
|
24
|
-
request(
|
25
|
-
:expects => 200,
|
26
|
-
:method => 'GET',
|
27
|
-
:parser => Fog::Parsers::DNS::Zerigo::GetZoneStats.new,
|
28
|
-
:path => "/api/1.1/zones/#{zone_id}/stats.xml"
|
29
|
-
)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
class Mock # :nodoc:all
|
34
|
-
def get_zone_stats(zone_id)
|
35
|
-
zone = find_by_zone_id(zone_id)
|
36
|
-
|
37
|
-
response = Excon::Response.new
|
38
|
-
|
39
|
-
if zone
|
40
|
-
response.status = 200
|
41
|
-
response.body = {
|
42
|
-
'id' => zone,
|
43
|
-
'domain' => zone['domain'],
|
44
|
-
'period-begin' => zone['created-at'].strftime("%F"),
|
45
|
-
'period-end' => Date.today.to_s,
|
46
|
-
'queries' => 0
|
47
|
-
}
|
48
|
-
else
|
49
|
-
response.status = 404
|
50
|
-
end
|
51
|
-
|
52
|
-
response
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
require "fog/zerigo/parsers/dns/list_hosts"
|
6
|
-
|
7
|
-
# Get list of all DNS zones hosted on Slicehost (for this account)
|
8
|
-
#
|
9
|
-
# ==== Parameters
|
10
|
-
# * zone_id<~Integer> - the zone ID of the zone from which to get the host records for
|
11
|
-
# * 'options'<~Hash> - optional parameters
|
12
|
-
# * 'page' <~Integer>
|
13
|
-
# * 'per_page' <~Integer>
|
14
|
-
# * 'fqdn' <~String>
|
15
|
-
# ==== Returns
|
16
|
-
# * response<~Excon::Response>:
|
17
|
-
# * body<~Hash>:
|
18
|
-
# * 'hosts'<~Array>
|
19
|
-
# * 'created-at'<~String>
|
20
|
-
# * 'data'<~String>
|
21
|
-
# * 'fqdn'<~String>
|
22
|
-
# * 'host-type'<~String>
|
23
|
-
# * 'hostname'<~String>
|
24
|
-
# * 'id'<~Integer>
|
25
|
-
# * 'notes'<~String>
|
26
|
-
# * 'priority'<~Integer>
|
27
|
-
# * 'ttl'<~Integer>
|
28
|
-
# * 'updated-at'<~String>
|
29
|
-
# * 'zone-id'<~String>
|
30
|
-
# * 'status'<~Integer> - 200 indicates success
|
31
|
-
def list_hosts(zone_id, options={})
|
32
|
-
request(
|
33
|
-
:query => options,
|
34
|
-
:expects => 200,
|
35
|
-
:method => "GET",
|
36
|
-
:parser => Fog::Parsers::DNS::Zerigo::ListHosts.new,
|
37
|
-
:path => "/api/1.1/zones/#{zone_id}/hosts.xml"
|
38
|
-
)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
class Mock # :nodoc:all
|
43
|
-
def list_hosts(zone_id, options={})
|
44
|
-
zone = find_by_zone_id(zone_id)
|
45
|
-
|
46
|
-
response = Excon::Response.new
|
47
|
-
|
48
|
-
if zone
|
49
|
-
if options.empty?
|
50
|
-
response.status = 200
|
51
|
-
response.body = {
|
52
|
-
"hosts" => zone["hosts"]
|
53
|
-
}
|
54
|
-
else
|
55
|
-
hosts = zone["hosts"]
|
56
|
-
hosts = hosts.select {|h| h["fqdn"] == options["fqdn"]} if options["fqdn"]
|
57
|
-
hosts = options["per_page"] ? hosts.each_slice(options["per_page"] - 1).to_a : hosts.each_slice(100).to_a
|
58
|
-
hosts = options["page"] ? hosts[options["page"]] : hosts[0]
|
59
|
-
response.status = 200
|
60
|
-
response.body = {
|
61
|
-
"hosts" => hosts
|
62
|
-
}
|
63
|
-
end
|
64
|
-
else
|
65
|
-
response.status = 404
|
66
|
-
end
|
67
|
-
|
68
|
-
response
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
require 'fog/zerigo/parsers/dns/list_zones'
|
6
|
-
|
7
|
-
# Get list of all DNS zones hosted on Slicehost (for this account)
|
8
|
-
#
|
9
|
-
# ==== Parameters
|
10
|
-
# * options<~Hash>
|
11
|
-
# * page<~Integer> - Indicates where to begin in your list of zones.
|
12
|
-
# * per_page<~Integer> - The maximum number of zones to be included in the response body
|
13
|
-
#
|
14
|
-
# ==== Returns
|
15
|
-
# * response<~Excon::Response>:
|
16
|
-
# * body<~Hash>:
|
17
|
-
# * 'zones'<~Array>
|
18
|
-
# * 'default-ttl'<~Integer>
|
19
|
-
# * 'id'<~Integer>
|
20
|
-
# * 'nx-ttl'<~Integer>
|
21
|
-
# * 'hosts-count'<~Integer>
|
22
|
-
# * 'created-at'<~String>
|
23
|
-
# * 'custom-nameservers'<~String>
|
24
|
-
# * 'custom-ns'<~String>
|
25
|
-
# * 'domain'<~String>
|
26
|
-
# * 'hostmaster'<~String>
|
27
|
-
# * 'notes'<~String>
|
28
|
-
# * 'ns1'<~String>
|
29
|
-
# * 'ns-type'<~String>
|
30
|
-
# * 'slave-nameservers'<~String>
|
31
|
-
# * 'tag-list'<~String>
|
32
|
-
# * 'updated-at'<~String>
|
33
|
-
# * 'hosts'<~String>
|
34
|
-
# * 'axfr-ips'<~String>
|
35
|
-
# * 'restrict-axfr'<~String>
|
36
|
-
# * 'status'<~Integer> - 200 indicates success
|
37
|
-
def list_zones(options = {})
|
38
|
-
request(
|
39
|
-
:query => options,
|
40
|
-
:expects => 200,
|
41
|
-
:method => 'GET',
|
42
|
-
:parser => Fog::Parsers::DNS::Zerigo::ListZones.new,
|
43
|
-
:path => '/api/1.1/zones.xml'
|
44
|
-
)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
class Mock # :nodoc:all
|
49
|
-
def list_zones
|
50
|
-
response = Excon::Response.new
|
51
|
-
|
52
|
-
response.status = 200
|
53
|
-
response.body = {
|
54
|
-
'zones' => self.data[:zones]
|
55
|
-
}
|
56
|
-
|
57
|
-
response
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
# Update a host record
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# * host_id<~Integer> - host ID of the record to update
|
9
|
-
# * options<~Hash> - optional paramaters
|
10
|
-
# * host_type<~String>
|
11
|
-
# * data<~String>
|
12
|
-
# * hostname<~String> - Note: normally this is set/required!!
|
13
|
-
# * notes<~String>
|
14
|
-
# * priority<~Integer> - Note: required for MX or SRV records
|
15
|
-
# * ttl<~Integer>
|
16
|
-
# ==== Returns
|
17
|
-
# * response<~Excon::Response>:
|
18
|
-
# * 'status'<~Integer> - 200 for success
|
19
|
-
#
|
20
|
-
def update_host(host_id, options = {})
|
21
|
-
optional_tags= ''
|
22
|
-
options.each { |option, value|
|
23
|
-
case option
|
24
|
-
when :host_type
|
25
|
-
optional_tags+= "<host-type>#{value}</host-type>"
|
26
|
-
when :data
|
27
|
-
optional_tags+= "<data>#{value}</data>"
|
28
|
-
when :hostname
|
29
|
-
optional_tags+= "<hostname>#{value}</hostname>"
|
30
|
-
when :notes
|
31
|
-
optional_tags+= "<notes>#{value}</notes>"
|
32
|
-
when :priority
|
33
|
-
optional_tags+= "<priority>#{value}</priority>"
|
34
|
-
when :ttl
|
35
|
-
optional_tags+= "<ttl>#{value}</ttl>"
|
36
|
-
end
|
37
|
-
}
|
38
|
-
|
39
|
-
request(
|
40
|
-
:body => %Q{<?xml version="1.0" encoding="UTF-8"?><host>#{optional_tags}</host>},
|
41
|
-
:expects => 200,
|
42
|
-
:method => 'PUT',
|
43
|
-
:path => "/api/1.1/hosts/#{host_id}.xml"
|
44
|
-
)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
class Mock # :nodoc:all
|
49
|
-
def update_host(host_id, options = {})
|
50
|
-
host = find_host(host_id)
|
51
|
-
|
52
|
-
response = Excon::Response.new
|
53
|
-
|
54
|
-
if host
|
55
|
-
options.each { |k, v| host[k.to_s] = v } # Deal with symbols in requests but strings in responses.
|
56
|
-
host['updated-at'] = Time.now
|
57
|
-
|
58
|
-
response.status = 200
|
59
|
-
else
|
60
|
-
response.status = 404
|
61
|
-
end
|
62
|
-
|
63
|
-
response
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module DNS
|
3
|
-
class Zerigo
|
4
|
-
class Real
|
5
|
-
# Update the parameters of a zone
|
6
|
-
# ==== Parameters
|
7
|
-
#
|
8
|
-
# * zone_id<~Integer>
|
9
|
-
# * options<~Hash> - optional paramaters
|
10
|
-
# * default_ttl<~Integer>
|
11
|
-
# * ns_type<~String>
|
12
|
-
# * ns1<~String> - required if ns_type == sec
|
13
|
-
# * nx_ttl<~Integer> -
|
14
|
-
# * slave_nameservers<~String> - required if ns_type == pri
|
15
|
-
# * axfr_ips<~String> - comma-separated list of IPs or IP blocks allowed to perform AXFRs
|
16
|
-
# * custom_nameservers<~String> - comma-separated list of custom nameservers
|
17
|
-
# * custom_ns<~String> - indicates if vanity (custom) nameservers are enabled for this domain
|
18
|
-
# * hostmaster<~String> - email of the DNS administrator or hostmaster
|
19
|
-
# * notes<~String> - notes about the domain
|
20
|
-
# * restrict_axfr<~String> - indicates if AXFR transfers should be restricted to IPs in axfr-ips
|
21
|
-
# * tag_list<~String> - List of all tags associated with this domain
|
22
|
-
#
|
23
|
-
# ==== Returns
|
24
|
-
# * response<~Excon::Response>:
|
25
|
-
# * 'status'<~Integer> - 200 for success
|
26
|
-
def update_zone(zone_id, options = {})
|
27
|
-
optional_tags= ''
|
28
|
-
options.each { |option, value|
|
29
|
-
case option
|
30
|
-
when :default_ttl
|
31
|
-
optional_tags+= "<default-ttl>#{value}</default-ttl>"
|
32
|
-
when :ns_type
|
33
|
-
optional_tags+= "<ns-type>#{value}</ns-type>"
|
34
|
-
when :ns1
|
35
|
-
optional_tags+= "<ns1>#{value}</ns1>"
|
36
|
-
when :nx_ttl
|
37
|
-
optional_tags+= "<nx-ttl type='interger'>#{value}</nx-ttl>"
|
38
|
-
when :slave_nameservers
|
39
|
-
optional_tags+= "<slave-nameservers>#{value}</slave-nameservers>"
|
40
|
-
when :axfr_ips
|
41
|
-
optional_tags+= "<axfr-ips>#{value}</axfr-ips>"
|
42
|
-
when :custom_nameservers
|
43
|
-
optional_tags+= "<custom-nameservers>#{value}</custom-nameservers>"
|
44
|
-
when :custom_ns
|
45
|
-
optional_tags+= "<custom-ns>#{value}</custom-ns>"
|
46
|
-
when :hostmaster
|
47
|
-
optional_tags+= "<hostmaster>#{value}</hostmaster>"
|
48
|
-
when :notes
|
49
|
-
optional_tags+= "<notes>#{value}</notes>"
|
50
|
-
when :restrict_axfr
|
51
|
-
optional_tags+= "<restrict-axfr>#{value}</restrict-axfr>"
|
52
|
-
when :tag_list
|
53
|
-
optional_tags+= "<tag-list>#{value}</tag-list>"
|
54
|
-
end
|
55
|
-
}
|
56
|
-
|
57
|
-
request(
|
58
|
-
:body => %Q{<?xml version="1.0" encoding="UTF-8"?><zone>#{optional_tags}</zone>},
|
59
|
-
:expects => 200,
|
60
|
-
:method => 'PUT',
|
61
|
-
:path => "/api/1.1/zones/#{zone_id}.xml"
|
62
|
-
)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class Mock # :nodoc:all
|
67
|
-
def update_zone(zone_id, options = {})
|
68
|
-
zone = find_by_zone_id(zone_id)
|
69
|
-
|
70
|
-
response = Excon::Response.new
|
71
|
-
|
72
|
-
if zone
|
73
|
-
options.each { |k, v| zone[k.to_s] = v } # Deal with symbols in requests but strings in responses.
|
74
|
-
zone['updated-at'] = Time.now
|
75
|
-
|
76
|
-
response.status = 200
|
77
|
-
else
|
78
|
-
response.status = 404
|
79
|
-
end
|
80
|
-
|
81
|
-
response
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
data/lib/fog/zerigo.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'fog/zerigo/dns'
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "fog/bin"
|
3
|
-
require "helpers/bin"
|
4
|
-
|
5
|
-
describe Bluebox do
|
6
|
-
include Fog::BinSpec
|
7
|
-
|
8
|
-
let(:subject) { Bluebox }
|
9
|
-
|
10
|
-
describe "#services" do
|
11
|
-
it "includes all services" do
|
12
|
-
assert_includes Bluebox.services, :compute
|
13
|
-
assert_includes Bluebox.services, :dns
|
14
|
-
assert_includes Bluebox.services, :blb
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "#class_for" do
|
19
|
-
describe "when requesting compute service" do
|
20
|
-
it "returns correct class" do
|
21
|
-
assert_equal Fog::Compute::Bluebox, Bluebox.class_for(:compute)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "when requesting dns service" do
|
26
|
-
it "returns correct class" do
|
27
|
-
assert_equal Fog::DNS::Bluebox, Bluebox.class_for(:dns)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "when requesting blb service" do
|
32
|
-
it "returns correct class" do
|
33
|
-
assert_equal Fog::Bluebox::BLB, Bluebox.class_for(:blb)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe "#[]" do
|
39
|
-
describe "when requesting compute service" do
|
40
|
-
it "returns instance" do
|
41
|
-
Fog::Compute::Bluebox.stub(:new, "instance") do
|
42
|
-
assert_equal "instance", Bluebox[:compute]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "when requesting dns service" do
|
48
|
-
it "returns instance" do
|
49
|
-
Fog::DNS::Bluebox.stub(:new, "instance") do
|
50
|
-
assert_equal "instance", Bluebox[:dns]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
data/spec/fog/bin/ovirt_spec.rb
DELETED
data/spec/fog/bin/zerigo_spec.rb
DELETED
data/spec/fog/compute_spec.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Fog::Compute do
|
4
|
-
Fog::Compute.providers.each do |provider|
|
5
|
-
describe "when #{provider} is passed with no available credentials" do
|
6
|
-
it "returns ArgumentError" do
|
7
|
-
# Stub credentials so you still see errors where the tester really has credentials
|
8
|
-
Fog.stub :credentials, {} do
|
9
|
-
# These providers do not raise ArgumentError since they have no requirements defined
|
10
|
-
if [:openvz, :vmfusion].include?(provider)
|
11
|
-
assert Fog::Compute[provider]
|
12
|
-
else
|
13
|
-
assert_raises(ArgumentError) { Fog::Compute[provider] }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/spec/fog/dns_spec.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Fog::DNS do
|
4
|
-
Fog::DNS.providers.each do |provider|
|
5
|
-
describe "when #{provider} is passed with no available credentials" do
|
6
|
-
it "returns ArgumentError" do
|
7
|
-
# Stub credentials so you still see errors where the tester really has credentials
|
8
|
-
Fog.stub :credentials, {} do
|
9
|
-
# These providers do not raise ArgumentError since they have no requirements defined
|
10
|
-
if [:dnsimple].include?(provider)
|
11
|
-
assert Fog::DNS[provider]
|
12
|
-
else
|
13
|
-
assert_raises(ArgumentError) { Fog::DNS[provider] }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
class Bluebox
|
2
|
-
module BLB
|
3
|
-
module Formats
|
4
|
-
LB_APPLICATION = {
|
5
|
-
'id' => String,
|
6
|
-
'ip_v4' => String,
|
7
|
-
'ip_v6' => String,
|
8
|
-
'name' => String,
|
9
|
-
'lb_services' => Array,
|
10
|
-
'source_ip_v4' => Fog::Nullable::String,
|
11
|
-
}
|
12
|
-
|
13
|
-
LB_APPLICATIONS = [LB_APPLICATION]
|
14
|
-
|
15
|
-
LB_SERVICE = {
|
16
|
-
'name' => String,
|
17
|
-
'port' => Integer,
|
18
|
-
'private' => Fog::Boolean,
|
19
|
-
'status_username' => String,
|
20
|
-
'status_password' => String,
|
21
|
-
'status_url' => String,
|
22
|
-
'service_type' => String,
|
23
|
-
'created' => String,
|
24
|
-
'lb_backends' => Array,
|
25
|
-
'pem_file_uploaded?' => Fog::Nullable::Boolean,
|
26
|
-
}
|
27
|
-
|
28
|
-
LB_SERVICES = [LB_SERVICE]
|
29
|
-
|
30
|
-
LB_BACKEND = {
|
31
|
-
'id' => String,
|
32
|
-
'backend_name' => String,
|
33
|
-
'lb_machines' => Array,
|
34
|
-
'acl_name' => String,
|
35
|
-
'acl_name' => String,
|
36
|
-
'monitoring_url_hostname' => String,
|
37
|
-
'monitoring_url' => String,
|
38
|
-
'monitoring_url_hostname' => String,
|
39
|
-
'check_interval' => Integer,
|
40
|
-
'rise' => Fog::Nullable::Integer,
|
41
|
-
'order' => Fog::Nullable::Integer,
|
42
|
-
'fall' => Fog::Nullable::Integer,
|
43
|
-
}
|
44
|
-
|
45
|
-
LB_BACKENDS = [LB_BACKEND]
|
46
|
-
|
47
|
-
LB_MACHINE = {
|
48
|
-
'port' => Integer,
|
49
|
-
'id' => String,
|
50
|
-
'ip' => String,
|
51
|
-
'maxconn' => Integer,
|
52
|
-
'hostname' => String,
|
53
|
-
'created' => String,
|
54
|
-
}
|
55
|
-
|
56
|
-
ADD_MACHINE_TO_LB = [
|
57
|
-
{ 'text' => String },
|
58
|
-
{ 'status' => String },
|
59
|
-
]
|
60
|
-
|
61
|
-
REMOVE_MACHINE_FROM_BACKEND = 'Record Removed.'
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|