2012-03-10 17:02:28 -05:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module DNS
|
|
|
|
class Dreamhost
|
|
|
|
|
|
|
|
class Record < Fog::Model
|
|
|
|
|
|
|
|
identity :name, :aliases => 'record'
|
|
|
|
|
|
|
|
attribute :value
|
|
|
|
attribute :zone
|
|
|
|
attribute :type
|
|
|
|
attribute :editable
|
|
|
|
attribute :account_id
|
|
|
|
attribute :comment
|
|
|
|
|
|
|
|
def destroy
|
2013-01-19 17:39:33 -05:00
|
|
|
service.delete_record(name, type, value)
|
2012-03-10 17:02:28 -05:00
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def save
|
|
|
|
requires :name, :type, :value
|
|
|
|
|
2013-01-21 16:16:56 -05:00
|
|
|
data = service.create_record(name, type, value, comment).body
|
|
|
|
merge_attributes(data)
|
2012-03-10 17:02:28 -05:00
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|