1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
require 'fog/openstack/models/model'
module Fog
module OpenStack
class DNS
class V2
class Zone < Fog::OpenStack::Model
identity :id
attribute :name
attribute :email
attribute :pool_id
attribute :project_id
attribute :serial
attribute :status
attribute :action
attribute :masters
attribute :version
attribute :links
attribute :created_at
attribute :transfered_at
attribute :ttl
attribute :description
attribute :type
attribute :updated_at
def save
raise Fog::Errors::Error, 'Resaving an existing object may create a duplicate' if persisted?
requires :name, :email
merge_attributes(service.create_zone(name, email, attributes).body)
true
end
def update(options = nil)
requires :id
merge_attributes(service.update_zone(id, options || attributes).body)
self
end
def destroy(options = {})
requires :id
service.delete_zone(id, options)
true
end
end
end
end
end
end
|