Sha256: 6e6b2b6caa0d73f3960b72874dde16857d69a054ac422c2156f9a1bccdc074fd

Contents?: true

Size: 1.23 KB

Versions: 22

Compression:

Stored size: 1.23 KB

Contents

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

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
fog-openstack-1.1.5 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.1.4 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.1.3 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.1.2 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-fork-99 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.1.0 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.1.0.pre lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.11 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.10 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.9 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.8 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.7 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.6 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.5 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.4 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.3 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.2 lib/fog/openstack/dns/v2/models/zone.rb
fog-openstack-1.0.1 lib/fog/openstack/dns/v2/models/zone.rb