Sha256: 4725bf854a6ca084d7ca39d26a54254a2c33ba1e5158d16541f66a4eb0b3215e

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

require 'fog/huaweicloud/models/model'

module Fog
  module DNS
    class HuaweiCloud
      class V2
        class Zone < Fog::HuaweiCloud::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

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/dns/huaweicloud/v2/models/zone.rb
fog-huaweicloud-0.0.2 lib/fog/dns/huaweicloud/v2/models/zone.rb
fog-huaweicloud-0.1.3 lib/fog/dns/huaweicloud/v2/models/zone.rb
fog-huaweicloud-0.1.2 lib/fog/dns/huaweicloud/v2/models/zone.rb