fog 0.3.31 → 0.3.32
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +3 -0
- data/.gitignore +10 -0
- data/Gemfile.lock +1 -4
- data/README.rdoc +29 -37
- data/Rakefile +5 -25
- data/bin/fog +1 -3
- data/examples/dns_methods.rb +389 -0
- data/examples/storage.rb +103 -0
- data/fog.gemspec +4 -778
- data/lib/fog.rb +5 -66
- data/lib/fog/aws.rb +3 -0
- data/lib/fog/aws/bin.rb +7 -2
- data/lib/fog/aws/cdn.rb +2 -2
- data/lib/fog/aws/compute.rb +2 -2
- data/lib/fog/aws/dns.rb +101 -0
- data/lib/fog/aws/elb.rb +2 -2
- data/lib/fog/aws/iam.rb +2 -2
- data/lib/fog/aws/models/compute/image.rb +1 -0
- data/lib/fog/aws/models/compute/server.rb +1 -1
- data/lib/fog/aws/models/compute/servers.rb +1 -13
- data/lib/fog/aws/parsers/compute/describe_images.rb +36 -34
- data/lib/fog/aws/parsers/dns/change_resource_record_sets.rb +26 -0
- data/lib/fog/aws/parsers/dns/create_hosted_zone.rb +55 -0
- data/lib/fog/aws/parsers/dns/delete_hosted_zone.rb +25 -0
- data/lib/fog/aws/parsers/dns/get_change.rb +26 -0
- data/lib/fog/aws/parsers/dns/get_hosted_zone.rb +43 -0
- data/lib/fog/aws/parsers/dns/list_hosted_zones.rb +35 -0
- data/lib/fog/aws/parsers/dns/list_resource_record_sets.rb +46 -0
- data/lib/fog/aws/requests/compute/describe_images.rb +1 -0
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +90 -0
- data/lib/fog/aws/requests/dns/create_hosted_zone.rb +68 -0
- data/lib/fog/aws/requests/dns/delete_hosted_zone.rb +48 -0
- data/lib/fog/aws/requests/dns/get_change.rb +47 -0
- data/lib/fog/aws/requests/dns/get_hosted_zone.rb +51 -0
- data/lib/fog/aws/requests/dns/list_hosted_zones.rb +63 -0
- data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +68 -0
- data/lib/fog/aws/requests/storage/get_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/put_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/sync_clock.rb +28 -0
- data/lib/fog/aws/simpledb.rb +2 -2
- data/lib/fog/aws/storage.rb +5 -3
- data/lib/fog/bluebox.rb +2 -0
- data/lib/fog/bluebox/compute.rb +2 -2
- data/lib/fog/brightbox.rb +2 -0
- data/lib/fog/brightbox/compute.rb +2 -2
- data/lib/fog/core.rb +21 -1
- data/lib/fog/core/bin.rb +3 -1
- data/lib/fog/core/compute.rb +1 -0
- data/lib/fog/core/credentials.rb +72 -50
- data/lib/fog/core/deprecation.rb +11 -5
- data/lib/fog/core/mock.rb +34 -0
- data/lib/fog/core/model.rb +9 -1
- data/lib/fog/core/service.rb +40 -26
- data/lib/fog/core/storage.rb +1 -0
- data/lib/fog/core/time.rb +21 -0
- data/lib/fog/core/wait_for.rb +17 -0
- data/lib/fog/go_grid.rb +2 -0
- data/lib/fog/go_grid/compute.rb +2 -2
- data/lib/fog/google.rb +2 -0
- data/lib/fog/google/requests/storage/get_bucket.rb +6 -5
- data/lib/fog/google/requests/storage/get_object_url.rb +4 -4
- data/lib/fog/google/requests/storage/put_object_url.rb +4 -4
- data/lib/fog/google/storage.rb +4 -3
- data/lib/fog/linode.rb +3 -0
- data/lib/fog/linode/bin.rb +5 -3
- data/lib/fog/linode/compute.rb +6 -2
- data/lib/fog/linode/dns.rb +80 -0
- data/lib/fog/linode/requests/dns/domain_create.rb +52 -0
- data/lib/fog/linode/requests/dns/domain_delete.rb +35 -0
- data/lib/fog/linode/requests/dns/domain_list.rb +50 -0
- data/lib/fog/linode/requests/dns/domain_resource_create.rb +53 -0
- data/lib/fog/linode/requests/dns/domain_resource_delete.rb +36 -0
- data/lib/fog/linode/requests/dns/domain_resource_list.rb +48 -0
- data/lib/fog/linode/requests/dns/domain_resource_update.rb +54 -0
- data/lib/fog/linode/requests/dns/domain_update.rb +48 -0
- data/lib/fog/local.rb +2 -0
- data/lib/fog/local/storage.rb +3 -3
- data/lib/fog/new_servers.rb +2 -0
- data/lib/fog/new_servers/compute.rb +2 -2
- data/lib/fog/rackspace.rb +2 -0
- data/lib/fog/rackspace/cdn.rb +2 -2
- data/lib/fog/rackspace/compute.rb +2 -2
- data/lib/fog/rackspace/storage.rb +2 -2
- data/lib/fog/slicehost.rb +3 -0
- data/lib/fog/slicehost/bin.rb +2 -0
- data/lib/fog/slicehost/compute.rb +2 -2
- data/lib/fog/slicehost/dns.rb +84 -0
- data/lib/fog/slicehost/parsers/dns/create_record.rb +26 -0
- data/lib/fog/slicehost/parsers/dns/create_zone.rb +26 -0
- data/lib/fog/slicehost/parsers/dns/get_record.rb +26 -0
- data/lib/fog/slicehost/parsers/dns/get_records.rb +30 -0
- data/lib/fog/slicehost/parsers/dns/get_zone.rb +26 -0
- data/lib/fog/slicehost/parsers/dns/get_zones.rb +30 -0
- data/lib/fog/slicehost/requests/compute/create_slice.rb +2 -2
- data/lib/fog/slicehost/requests/compute/delete_slice.rb +3 -17
- data/lib/fog/slicehost/requests/dns/create_record.rb +61 -0
- data/lib/fog/slicehost/requests/dns/create_zone.rb +54 -0
- data/lib/fog/slicehost/requests/dns/delete_record.rb +31 -0
- data/lib/fog/slicehost/requests/dns/delete_zone.rb +31 -0
- data/lib/fog/slicehost/requests/dns/get_record.rb +40 -0
- data/lib/fog/slicehost/requests/dns/get_records.rb +41 -0
- data/lib/fog/slicehost/requests/dns/get_zone.rb +40 -0
- data/lib/fog/slicehost/requests/dns/get_zones.rb +38 -0
- data/lib/fog/terremark.rb +2 -0
- data/lib/fog/terremark/ecloud.rb +2 -4
- data/lib/fog/vcloud.rb +4 -2
- data/lib/fog/vcloud/bin.rb +3 -1
- data/lib/fog/vcloud/mock_data_classes.rb +77 -11
- data/lib/fog/vcloud/terremark/ecloud.rb +22 -7
- data/lib/fog/vcloud/terremark/ecloud/models/backup_internet_service.rb +60 -0
- data/lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb +36 -0
- data/lib/fog/vcloud/terremark/ecloud/models/internet_service.rb +28 -13
- data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +2 -2
- data/lib/fog/vcloud/terremark/ecloud/models/ip.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/network.rb +4 -1
- data/lib/fog/vcloud/terremark/ecloud/models/server.rb +5 -5
- data/lib/fog/vcloud/terremark/ecloud/models/vdc.rb +6 -2
- data/lib/fog/vcloud/terremark/ecloud/requests/add_backup_internet_service.rb +111 -0
- data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +2 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +1 -3
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +39 -27
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb +1 -2
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb +21 -6
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb +2 -1
- data/lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb +34 -17
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb +12 -10
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb +15 -10
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb +1 -12
- data/lib/fog/zerigo.rb +15 -0
- data/lib/fog/zerigo/bin.rb +25 -0
- data/lib/fog/zerigo/dns.rb +96 -0
- data/lib/fog/zerigo/parsers/dns/count_hosts.rb +24 -0
- data/lib/fog/zerigo/parsers/dns/count_zones.rb +24 -0
- data/lib/fog/zerigo/parsers/dns/create_host.rb +26 -0
- data/lib/fog/zerigo/parsers/dns/create_zone.rb +26 -0
- data/lib/fog/zerigo/parsers/dns/find_hosts.rb +30 -0
- data/lib/fog/zerigo/parsers/dns/get_host.rb +26 -0
- data/lib/fog/zerigo/parsers/dns/get_zone.rb +56 -0
- data/lib/fog/zerigo/parsers/dns/get_zone_stats.rb +26 -0
- data/lib/fog/zerigo/parsers/dns/list_hosts.rb +30 -0
- data/lib/fog/zerigo/parsers/dns/list_zones.rb +30 -0
- data/lib/fog/zerigo/requests/dns/count_hosts.rb +36 -0
- data/lib/fog/zerigo/requests/dns/count_zones.rb +36 -0
- data/lib/fog/zerigo/requests/dns/create_host.rb +70 -0
- data/lib/fog/zerigo/requests/dns/create_zone.rb +97 -0
- data/lib/fog/zerigo/requests/dns/delete_host.rb +32 -0
- data/lib/fog/zerigo/requests/dns/delete_zone.rb +33 -0
- data/lib/fog/zerigo/requests/dns/find_hosts.rb +63 -0
- data/lib/fog/zerigo/requests/dns/get_host.rb +47 -0
- data/lib/fog/zerigo/requests/dns/get_zone.rb +57 -0
- data/lib/fog/zerigo/requests/dns/get_zone_stats.rb +44 -0
- data/lib/fog/zerigo/requests/dns/list_hosts.rb +48 -0
- data/lib/fog/zerigo/requests/dns/list_zones.rb +53 -0
- data/lib/fog/zerigo/requests/dns/update_host.rb +60 -0
- data/lib/fog/zerigo/requests/dns/update_zone.rb +78 -0
- data/spec/spec_helper.rb +0 -5
- data/spec/vcloud/spec_helper.rb +3 -2
- data/spec/vcloud/terremark/ecloud/models/backup_internet_service_spec.rb +49 -0
- data/spec/vcloud/terremark/ecloud/models/backup_internet_services_spec.rb +29 -0
- data/spec/vcloud/terremark/ecloud/models/internet_service_spec.rb +32 -13
- data/spec/vcloud/terremark/ecloud/models/network_spec.rb +7 -4
- data/spec/vcloud/terremark/ecloud/models/server_spec.rb +20 -0
- data/spec/vcloud/terremark/ecloud/requests/add_backup_internet_service_spec.rb +60 -0
- data/spec/vcloud/terremark/ecloud/requests/configure_internet_service_spec.rb +3 -0
- data/spec/vcloud/terremark/ecloud/requests/configure_network_ip_spec.rb +55 -0
- data/spec/vcloud/terremark/ecloud/requests/delete_vapp_spec.rb +9 -0
- data/spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb +60 -14
- data/spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb +2 -0
- data/spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb +3 -3
- data/tests/aws/requests/compute/image_tests.rb +15 -14
- data/tests/aws/requests/dns/dns_tests.rb +276 -0
- data/tests/brightbox/requests/compute/account_tests.rb +20 -9
- data/tests/brightbox/requests/compute/api_client_tests.rb +12 -4
- data/tests/brightbox/requests/compute/cloud_ip_tests.rb +20 -6
- data/tests/brightbox/requests/compute/image_tests.rb +9 -4
- data/tests/brightbox/requests/compute/interface_tests.rb +8 -2
- data/tests/brightbox/requests/compute/server_tests.rb +17 -5
- data/tests/brightbox/requests/compute/server_type_tests.rb +8 -4
- data/tests/brightbox/requests/compute/user_tests.rb +13 -5
- data/tests/brightbox/requests/compute/zone_tests.rb +8 -4
- data/tests/core/attribute_tests.rb +45 -0
- data/tests/helper.rb +0 -2
- data/tests/linode/requests/dns/dns_tests.rb +262 -0
- data/tests/rackspace/requests/compute/address_tests.rb +1 -1
- data/tests/rackspace/requests/compute/image_tests.rb +1 -1
- data/tests/slicehost/requests/dns_tests/dns_tests.rb +279 -0
- data/tests/zerigo/helper.rb +0 -0
- data/tests/zerigo/requests/dns/dns_tests.rb +374 -0
- metadata +280 -36
- data/spec/compact_progress_bar_formatter.rb +0 -195
- data/spec/core/attributes_spec.rb +0 -52
- data/spec/lorem.txt +0 -1
@@ -0,0 +1,32 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Delete a host record
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * host_id<~Integer> - Id of host record to delete
|
10
|
+
# ==== Returns
|
11
|
+
# * response<~Excon::Response>:
|
12
|
+
# * 'status'<~Integer> - 200 indicates success
|
13
|
+
def delete_host(host_id)
|
14
|
+
request(
|
15
|
+
:expects => 200,
|
16
|
+
:method => 'DELETE',
|
17
|
+
:path => "/api/1.1/hosts/#{host_id}.xml"
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
class Mock
|
24
|
+
|
25
|
+
def delete_host(host_id)
|
26
|
+
Fog::Mock.not_implemented
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Delete a zone from Zerigo
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * zone_id<~Integer> - Id of zone to delete
|
10
|
+
# ==== Returns
|
11
|
+
# * response<~Excon::Response>:
|
12
|
+
# * 'status'<~Integer> - 200 indicates success
|
13
|
+
|
14
|
+
def delete_zone(zone_id)
|
15
|
+
request(
|
16
|
+
:expects => 200,
|
17
|
+
:method => 'DELETE',
|
18
|
+
:path => "/api/1.1/zones/#{zone_id}.xml"
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
class Mock
|
25
|
+
|
26
|
+
def delete_zone(zone_id)
|
27
|
+
Fog::Mock.not_implemented
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/zerigo/parsers/dns/find_hosts'
|
7
|
+
|
8
|
+
# Get list of all the host records that match the FQDN. If desired, can limit
|
9
|
+
# search to a specific zone
|
10
|
+
#
|
11
|
+
#
|
12
|
+
# ==== Parameters
|
13
|
+
# * fqdn<~String> - domain to look for
|
14
|
+
# * zone_id<~Integer> - if want to limit search to specific zone
|
15
|
+
# ==== Returns
|
16
|
+
# * response<~Excon::Response>:
|
17
|
+
# * body<~Hash>:
|
18
|
+
# * 'hosts'<~Hash>
|
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 indicated success
|
31
|
+
#
|
32
|
+
def find_hosts( fqdn, zone_id = nil)
|
33
|
+
if zone_id.nil?
|
34
|
+
#look for matching host across all zones
|
35
|
+
request(
|
36
|
+
:expects => 200,
|
37
|
+
:method => 'GET',
|
38
|
+
:parser => Fog::Parsers::Zerigo::DNS::FindHosts.new,
|
39
|
+
:path => "/api/1.1/hosts.xml?fqdn=#{fqdn}"
|
40
|
+
)
|
41
|
+
else
|
42
|
+
#look for hosts in a specific zone
|
43
|
+
request(
|
44
|
+
:expects => 200,
|
45
|
+
:method => 'GET',
|
46
|
+
:parser => Fog::Parsers::Zerigo::DNS::FindHosts.new,
|
47
|
+
:path => "/api/1.1/zones/#{zone_id}/hosts.xml?fqdn=#{fqdn}"
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
class Mock
|
55
|
+
|
56
|
+
def find_hosts( fqdn, zone_id = nil)
|
57
|
+
Fog::Mock.not_implemented
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/zerigo/parsers/dns/get_host'
|
7
|
+
|
8
|
+
# get details about a given host record
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * host_id<~Integer> - ID of the host record to retrieve
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'created-at'<~String>
|
16
|
+
# * 'data'<~String>
|
17
|
+
# * 'fqdn'<~String>
|
18
|
+
# * 'host-type'<~String>
|
19
|
+
# * 'hostname'<~String>
|
20
|
+
# * 'id'<~Integer>
|
21
|
+
# * 'notes'<~String>
|
22
|
+
# * 'priority'<~Integer>
|
23
|
+
# * 'ttl'<~Integer>
|
24
|
+
# * 'updated-at'<~String>
|
25
|
+
# * 'zone-id'<~String>
|
26
|
+
# * 'status'<~Integer> - 200 indicates success
|
27
|
+
def get_host( host_id)
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => 'GET',
|
31
|
+
:parser => Fog::Parsers::Zerigo::DNS::GetHost.new,
|
32
|
+
:path => "/api/1.1/hosts/#{host_id}.xml"
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
class Mock
|
39
|
+
|
40
|
+
def get_host( host_id)
|
41
|
+
Fog::Mock.not_implemented
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/zerigo/parsers/dns/get_zone'
|
7
|
+
|
8
|
+
# Get details of a DNS zone. The response is similar to list_zones, with the
|
9
|
+
# addition of hosts-count and possibly hosts.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# * zone<~String> - Either the zone ID or the zone name (ie sample-domain.com)
|
13
|
+
#
|
14
|
+
# ==== Returns
|
15
|
+
# * response<~Excon::Response>:
|
16
|
+
# * body<~Hash>:
|
17
|
+
# * 'default-ttl'<~Integer>
|
18
|
+
# * 'id'<~Integer>
|
19
|
+
# * 'nx-ttl'<~Integer>
|
20
|
+
# * 'hosts-count'<~Integer>
|
21
|
+
# * 'created-at'<~String>
|
22
|
+
# * 'custom-nameservers'<~String>
|
23
|
+
# * 'custom-ns'<~String>
|
24
|
+
# * 'domain'<~String>
|
25
|
+
# * 'hostmaster'<~String>
|
26
|
+
# * 'notes'<~String>
|
27
|
+
# * 'ns1'<~String>
|
28
|
+
# * 'ns-type'<~String>
|
29
|
+
# * 'slave-nameservers'<~String>
|
30
|
+
# * 'tag-list'<~String>
|
31
|
+
# * 'updated-at'<~String>
|
32
|
+
# * 'hosts'<~Array> - a list of all host records. For the format of host info, see get_host()
|
33
|
+
# * 'axfr-ips'<~String>
|
34
|
+
# * 'restrict-axfr'<~String>
|
35
|
+
# * 'status'<~Integer> - 200 indicates success
|
36
|
+
|
37
|
+
def get_zone(zone)
|
38
|
+
request(
|
39
|
+
:expects => 200,
|
40
|
+
:method => 'GET',
|
41
|
+
:parser => Fog::Parsers::Zerigo::DNS::GetZone.new,
|
42
|
+
:path => "/api/1.1/zones/#{zone}.xml"
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
class Mock
|
49
|
+
|
50
|
+
def get_zone(zone)
|
51
|
+
Fog::Mock.not_implemented
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/zerigo/parsers/dns/get_zone_stats'
|
7
|
+
|
8
|
+
# returns current traffic statistics about this zone. Queries is measured from the
|
9
|
+
# beginning of the current period through the time of the API call.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# * zone_id<~Integer> - the zone ID
|
13
|
+
#
|
14
|
+
# ==== Returns
|
15
|
+
# * response<~Excon::Response>:
|
16
|
+
# * body<~Hash>:
|
17
|
+
# * 'domain'<~String> - domain name (ie example.com)
|
18
|
+
# * 'id'<~Integer> - Id of the zone
|
19
|
+
# * 'period-being'<~String> - date in following format 2010-07-01
|
20
|
+
# * 'period-end'<~String> - date
|
21
|
+
# * 'queries'<~Integer> - # of queries for the zone during period
|
22
|
+
# * 'status'<~Integer> - 200 indicates success
|
23
|
+
|
24
|
+
def get_zone_stats(zone_id)
|
25
|
+
request(
|
26
|
+
:expects => 200,
|
27
|
+
:method => 'GET',
|
28
|
+
:parser => Fog::Parsers::Zerigo::DNS::GetZoneStats.new,
|
29
|
+
:path => "/api/1.1/zones/#{zone_id}/stats.xml"
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
class Mock
|
36
|
+
|
37
|
+
def get_zone_stats(zone_id)
|
38
|
+
Fog::Mock.not_implemented
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/zerigo/parsers/dns/list_hosts'
|
7
|
+
|
8
|
+
# Get list of all DNS zones hosted on Slicehost (for this account)
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * zone_id<~Integer> - the zone ID of the zone from which to get the host records for
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'hosts'<~Array>
|
16
|
+
# * 'created-at'<~String>
|
17
|
+
# * 'data'<~String>
|
18
|
+
# * 'fqdn'<~String>
|
19
|
+
# * 'host-type'<~String>
|
20
|
+
# * 'hostname'<~String>
|
21
|
+
# * 'id'<~Integer>
|
22
|
+
# * 'notes'<~String>
|
23
|
+
# * 'priority'<~Integer>
|
24
|
+
# * 'ttl'<~Integer>
|
25
|
+
# * 'updated-at'<~String>
|
26
|
+
# * 'zone-id'<~String>
|
27
|
+
# * 'status'<~Integer> - 200 indicates success
|
28
|
+
def list_hosts( zone_id)
|
29
|
+
request(
|
30
|
+
:expects => 200,
|
31
|
+
:method => 'GET',
|
32
|
+
:parser => Fog::Parsers::Zerigo::DNS::ListHosts.new,
|
33
|
+
:path => "/api/1.1/zones/#{zone_id}/hosts.xml"
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
class Mock
|
40
|
+
|
41
|
+
def list_hosts( zone_id)
|
42
|
+
Fog::Mock.not_implemented
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/zerigo/parsers/dns/list_zones'
|
7
|
+
|
8
|
+
# Get list of all DNS zones hosted on Slicehost (for this account)
|
9
|
+
#
|
10
|
+
# ==== Returns
|
11
|
+
# * response<~Excon::Response>:
|
12
|
+
# * body<~Hash>:
|
13
|
+
# * 'zones'<~Array>
|
14
|
+
# * 'default-ttl'<~Integer>
|
15
|
+
# * 'id'<~Integer>
|
16
|
+
# * 'nx-ttl'<~Integer>
|
17
|
+
# * 'hosts-count'<~Integer>
|
18
|
+
# * 'created-at'<~String>
|
19
|
+
# * 'custom-nameservers'<~String>
|
20
|
+
# * 'custom-ns'<~String>
|
21
|
+
# * 'domain'<~String>
|
22
|
+
# * 'hostmaster'<~String>
|
23
|
+
# * 'notes'<~String>
|
24
|
+
# * 'ns1'<~String>
|
25
|
+
# * 'ns-type'<~String>
|
26
|
+
# * 'slave-nameservers'<~String>
|
27
|
+
# * 'tag-list'<~String>
|
28
|
+
# * 'updated-at'<~String>
|
29
|
+
# * 'hosts'<~String>
|
30
|
+
# * 'axfr-ips'<~String>
|
31
|
+
# * 'restrict-axfr'<~String>
|
32
|
+
# * 'status'<~Integer> - 200 indicates success
|
33
|
+
def list_zones
|
34
|
+
request(
|
35
|
+
:expects => 200,
|
36
|
+
:method => 'GET',
|
37
|
+
:parser => Fog::Parsers::Zerigo::DNS::ListZones.new,
|
38
|
+
:path => '/api/1.1/zones.xml'
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
class Mock
|
45
|
+
|
46
|
+
def list_zones
|
47
|
+
Fog::Mock.not_implemented
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Fog
|
2
|
+
module Zerigo
|
3
|
+
class DNS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Update a host record
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * host_id<~Integer> - host ID of the record to update
|
10
|
+
# * options<~Hash> - optional paramaters
|
11
|
+
# * host_type<~String>
|
12
|
+
# * data<~String>
|
13
|
+
# * hostname<~String> - Note: normally this is set/required!!
|
14
|
+
# * notes<~String>
|
15
|
+
# * priority<~Integer> - Note: required for MX or SRV records
|
16
|
+
# * ttl<~Integer>
|
17
|
+
# ==== Returns
|
18
|
+
# * response<~Excon::Response>:
|
19
|
+
# * 'status'<~Integer> - 200 for success
|
20
|
+
#
|
21
|
+
def update_host( host_id, options = {})
|
22
|
+
|
23
|
+
optional_tags= ''
|
24
|
+
options.each { |option, value|
|
25
|
+
case option
|
26
|
+
when :host_type
|
27
|
+
optional_tags+= "<host-type>#{host_type}</host-type>"
|
28
|
+
when :data
|
29
|
+
optional_tags+= "<data>#{data}</data>"
|
30
|
+
when :hostname
|
31
|
+
optional_tags+= "<hostname>#{value}</hostname>"
|
32
|
+
when :notes
|
33
|
+
optional_tags+= "<notes>#{value}</notes>"
|
34
|
+
when :priority
|
35
|
+
optional_tags+= "<priority>#{value}</priority>"
|
36
|
+
when :ttl
|
37
|
+
optional_tags+= "<ttl>#{value}</ttl>"
|
38
|
+
end
|
39
|
+
}
|
40
|
+
|
41
|
+
request(
|
42
|
+
:body => %Q{<?xml version="1.0" encoding="UTF-8"?><host>#{optional_tags}</host>},
|
43
|
+
:expects => 200,
|
44
|
+
:method => 'PUT',
|
45
|
+
:path => "/api/1.1/hosts/#{host_id}.xml"
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
class Mock
|
52
|
+
|
53
|
+
def update_host( host_id, options = {})
|
54
|
+
Fog::Mock.not_implemented
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|