1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

add support for linode domain.list method

linode has a full API to support managed DNS.  Have the 1st call, domain.list working
method also support option parameter to narrow results to a single domain
This commit is contained in:
Athir Nuaimi 2010-12-10 14:07:00 -05:00
parent 0b5e0d9e19
commit 909d062d89
3 changed files with 110 additions and 0 deletions

View file

@ -13,10 +13,22 @@ module Fog
request :avail_kernels
request :avail_linodeplans
request :avail_stackscripts
request :domain_create
# request :domain_delete
request :domain_list
# request :domain_update
# request :domain_resource_create
# request :domain_resource_delete
# request :domain_resource_list
# request :domain_resource_update
# request :linode_boot
request :linode_create
request :linode_delete
request :linode_list
request :linode_reboot
# request :linode_resize
# request :linode_shutdown
# request :linode_update
class Mock

View file

@ -0,0 +1,48 @@
module Fog
module Linode
class Compute
class Real
# Creates a domain record
#
# ==== Parameters
# * domain<~String>: The zone's name
# * type<~String>: master or slave
# * options<~Hash>
# * description<~String> Currently undisplayed
# * SOA_email<~String> Required when type=master
# * refresh_sec<~Integer> numeric, default: '0'
# * retry_sec<~Integer> numeric, default: '0'
# * expire_sec<~Integer> numeric, default: '0'
# * ttl_sec<~String> numeric, default: '0'
# * status<~Integer> 0, 1, or 2 (disabled, active, edit mode), default: 1
# * master_ips<~String> When type=slave, the zone's master DNS servers list, semicolon separated
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# TODO: docs
def domain_create( domain, type, options)
request(
:expects => 200,
:method => 'GET',
:query => {
:api_action => 'domain.create',
:domain => domain,
:type => type
}
)
end
end
class Mock
def linode_create(datacenter_id, payment_term, plan_id)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -0,0 +1,50 @@
module Fog
module Linode
class Compute
class Real
# List of domains (you have access to)
#
# ==== Parameters
# * domain_id<~Integer>: limit the list to the domain ID specified
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * DATA<~Array>
# * 'DOMAINID'<~Interger>
# * 'SOA_EMAIL'<~String>
# * 'DESCRIPTION'<~String>
# * 'TTL_SEC'<~String>
# * 'EXPIRE_SEC'<~Integer>
# * 'RETRY_SEC'<~Integer>
# * 'DOMAIN'<~String>
# * 'STATUS'<~Integer>
# * 'MASTER_IPS'<~String>
# * 'REFRESH_SEC'<~Integer>
# * 'TYPE'<~String>
def domain_list(domain_id = nil)
options = {}
if domain_id
options.merge!(:domainId => domain_id)
end
request(
:expects => 200,
:method => 'GET',
:query => { :api_action => 'domain.list' }.merge!(options)
)
end
end
class Mock
def avail_kernels(options={})
Fog::Mock.not_implemented
end
end
end
end
end