Sha256: 686b047f6adcb9ceee3fe0c17e736fa05a094328e00a03e7eb77a47d0549614a

Contents?: true

Size: 1.02 KB

Versions: 35

Compression:

Stored size: 1.02 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 Datacenter < Fog::Model
        identity :id

        attribute :long_name,   :aliases => 'longName'
        attribute :name

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

        def routers
          requires :id
          @routers ||= service.get_datacenter_routers(id).body
        end

        def routable_subnets
          requires :id
          @routable_subnets ||= service.request(:location_datacenter, "#{id}/get_bound_subnets").body
        end

        def save
          raise "Not possible."
        end

        def create
          raise "Not possible."
        end

        def update
          raise "Not possible."
        end

        def destroy
          raise "Not possible."
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
fog-softlayer-0.4.2.pre lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.4.1 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.4.0 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.30 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.29 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.28 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.27 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.26 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.25 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.24 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.23 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.22 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.21 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.20 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.19 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.18 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.17 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.16 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.15 lib/fog/softlayer/models/network/datacenter.rb
fog-softlayer-0.3.14 lib/fog/softlayer/models/network/datacenter.rb