Sha256: d01a546d63047e83f95a335c92ab66cf336245513b62c5a6a3487fa26f6f7aad

Contents?: true

Size: 872 Bytes

Versions: 13

Compression:

Stored size: 872 Bytes

Contents

module Fog
  module Vsphere
    class Compute
      class Interfacetypes < Fog::Collection
        model Fog::Vsphere::Compute::Interfacetype
        attr_accessor :datacenter
        attr_accessor :servertype

        def all(filters = {})
          requires :servertype
          case servertype
          when Fog::Vsphere::Compute::Servertype
            load service.list_interface_types(filters.merge(datacenter: datacenter,
                                                            servertype: servertype.id))
          else
            raise 'interfacetypes should have a servertype'
          end
        end

        def get(id)
          requires :servertype
          requires :datacenter
          new service.get_interface_type id, servertype, datacenter
        rescue Fog::Vsphere::Compute::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fog-vsphere-3.7.0 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.8 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.7 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.6 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.5 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.4 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.3 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.2 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.5.3 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.6.0 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.5.2 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.5.1 lib/fog/vsphere/models/compute/interfacetypes.rb
fog-vsphere-3.5.0 lib/fog/vsphere/models/compute/interfacetypes.rb