Sha256: 296d117c3da1c391327e5cf9f352b041319367f892f29863c35377733d2557db

Contents?: true

Size: 1.63 KB

Versions: 25

Compression:

Stored size: 1.63 KB

Contents

require 'fog/core/model'

module Fog
  module Compute
    class XenServer
      class VIF < Fog::Model
        # API Reference here:
        # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VIF

        identity :reference

        attribute :mac,                :aliases => :MAC
        attribute :uuid
        attribute :allowed_operations
        attribute :current_operations
        attribute :currently_attached
        attribute :device
        attribute :ipv4_allowed
        attribute :ipv6_allowed
        attribute :locking_mode
        attribute :mac_autogenerated,  :aliases => :MAC_autogenerated
        attribute :__metrics,          :aliases => :metrics
        attribute :other_config
        attribute :qos_algorithm_params
        attribute :qos_algorithm_type
        attribute :qos_supported_algorithms
        attribute :runtime_properties
        attribute :mtu,                :aliases => :MTU
        attribute :__network,          :aliases => :network
        attribute :status_code
        attribute :status_detail
        attribute :__vm,               :aliases => :VM

        def destroy
          service.destroy_vif reference
        end

        def network
          service.networks.get __network
        end

        def server
          service.servers.get __vm
        end

        def save
          requires :server
          raise ArgumentError.new('network is required for this operation') \
            unless attributes[:__network]
          ref = service.create_vif attributes[:server], attributes[:__network]
          merge_attributes service.vifs.get(ref).attributes
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/xenserver/models/compute/vif.rb
fog-1.34.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.33.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.32.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.31.0 lib/fog/xenserver/models/compute/vif.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/xenserver/models/compute/vif.rb
fog-1.30.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.29.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.28.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.27.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.26.0 lib/fog/xenserver/models/compute/vif.rb
fog-1.25.0 lib/fog/xenserver/models/compute/vif.rb
nsidc-fog-1.24.1 lib/fog/xenserver/models/compute/vif.rb
fog-1.24.0 lib/fog/xenserver/models/compute/vif.rb
ns-fog-1.22.11 lib/fog/xenserver/models/compute/vif.rb
ns-fog-1.22.10 lib/fog/xenserver/models/compute/vif.rb
ns-fog-1.22.9 lib/fog/xenserver/models/compute/vif.rb
ns-fog-1.22.8 lib/fog/xenserver/models/compute/vif.rb
ns-fog-1.22.7 lib/fog/xenserver/models/compute/vif.rb
ns-fog-1.22.6 lib/fog/xenserver/models/compute/vif.rb