mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
WIP: add stub model classes
This commit is contained in:
parent
8354d3c043
commit
fdb90eda30
7 changed files with 130 additions and 5 deletions
1
Rakefile
1
Rakefile
|
@ -50,6 +50,7 @@ namespace :test do
|
|||
task :dynect do
|
||||
[false, true].each do |mock|
|
||||
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/dns/requests/dynect")
|
||||
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/dns/models/")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,11 @@ module Fog
|
|||
recognizes :timeout, :persistent
|
||||
recognizes :provider # remove post deprecation
|
||||
|
||||
# model_path 'fog/dns/models/dynect'
|
||||
# model :record
|
||||
# collection :records
|
||||
# model :zone
|
||||
# collection :zones
|
||||
model_path 'fog/dns/models/dynect'
|
||||
model :record
|
||||
collection :records
|
||||
model :zone
|
||||
collection :zones
|
||||
|
||||
request_path 'fog/dns/requests/dynect'
|
||||
request :session
|
||||
|
|
38
lib/fog/dns/models/dynect/record.rb
Normal file
38
lib/fog/dns/models/dynect/record.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module Dynect
|
||||
class DNS
|
||||
|
||||
class Record < Fog::Model
|
||||
extend Fog::Deprecation
|
||||
deprecate :ip, :value
|
||||
deprecate :ip=, :value=
|
||||
|
||||
identity :id
|
||||
attribute :name
|
||||
attribute :value, :aliases => "content"
|
||||
attribute :ttl
|
||||
attribute :created_at
|
||||
attribute :updated_at
|
||||
attribute :zone_id, :aliases => "domain_id"
|
||||
attribute :type, :aliases => "record_type"
|
||||
attribute :priority, :aliases => "prio"
|
||||
|
||||
def initialize(attributes={})
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def zone
|
||||
end
|
||||
|
||||
def save
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
27
lib/fog/dns/models/dynect/records.rb
Normal file
27
lib/fog/dns/models/dynect/records.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/dns/models/dynect/record'
|
||||
|
||||
module Fog
|
||||
module Dynect
|
||||
class DNS
|
||||
|
||||
class Records < Fog::Collection
|
||||
|
||||
attribute :zone
|
||||
|
||||
model Fog::Dynect::DNS::Record
|
||||
|
||||
def all
|
||||
end
|
||||
|
||||
def get(record_id)
|
||||
end
|
||||
|
||||
def new(attributes = {})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
32
lib/fog/dns/models/dynect/zone.rb
Normal file
32
lib/fog/dns/models/dynect/zone.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
require 'fog/core/model'
|
||||
require 'fog/dns/models/dynect/records'
|
||||
|
||||
module Fog
|
||||
module Dynect
|
||||
class DNS
|
||||
|
||||
class Zone < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :domain, :aliases => 'name'
|
||||
attribute :created_at
|
||||
attribute :updated_at
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def records
|
||||
end
|
||||
|
||||
def nameservers
|
||||
end
|
||||
|
||||
def save
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
22
lib/fog/dns/models/dynect/zones.rb
Normal file
22
lib/fog/dns/models/dynect/zones.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/dns/models/dynect/zone'
|
||||
|
||||
module Fog
|
||||
module Dynect
|
||||
class DNS
|
||||
|
||||
class Zones < Fog::Collection
|
||||
|
||||
model Fog::Dynect::DNS::Zone
|
||||
|
||||
def all
|
||||
end
|
||||
|
||||
def get(zone_id)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -12,5 +12,10 @@ Shindo.tests('Dynect::dns | DNS requests', ['dynect', 'dns']) do
|
|||
returns(true) { response.body['zones'].first =~ /\.com/ && true }
|
||||
returns(true) { response.status == 200 }
|
||||
end
|
||||
|
||||
tests "create record"
|
||||
tests "delete record"
|
||||
tests "update record"
|
||||
tests "list jobs"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue