Sha256: 1834d61ab201d89e8b64d21ec3328f56d97f3cc96060636e5c393aa76da20581

Contents?: true

Size: 1.39 KB

Versions: 11

Compression:

Stored size: 1.39 KB

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

require 'fog/core/model'

module Fog
  module Network
    class Softlayer
      class Ip < Fog::Model
        identity :id

        attribute :subnet_id,             :aliases => 'subnetId'
        attribute :address,               :aliases => 'ipAddress'
        attribute :broadcast,            :aliases => 'isBroadcast'
        attribute :gateway,              :aliases => 'isGateway'
        attribute :network,              :aliases => 'isNetwork'
        attribute :reserved,             :aliases => 'isReserved'
        attribute :note
        attribute :assigned_to,           :aliases => ['hardware', 'virtualGuest']

        def initialize(attributes)
          @connection = attributes[:connection]
          super
        end

        def save
          requires :subnet_id
          identity ? update : create
        end

        def create

        end

        def update
          self
        end

        def destroy
          requires :id
          true
        end

        def broadcast?
          attribute[:broadcast]
        end

        def gateway?
          attribute[:gateway]
        end

        def network?
          attribute[:network]
        end

        def reserved?
          attribute[:reserved]
        end

      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-softlayer-0.3.9 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.8 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.7 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.6 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.6.pre.f82ffe9 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.6.pre.f7e3358 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.5 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.4.pre lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.3.pre lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.2 lib/fog/softlayer/models/network/ip.rb
fog-softlayer-0.3.1 lib/fog/softlayer/models/network/ip.rb