Sha256: 652492ac1a82fb3d9707210222ac29e7af4607da1d03ab8f631fde4f6809a056

Contents?: true

Size: 807 Bytes

Versions: 10

Compression:

Stored size: 807 Bytes

Contents

module Fog
  module Vsphere
    class Compute
      class Customvalues < Fog::Collection
        autoload :Customvalue, File.expand_path('../customvalue', __FILE__)

        model Fog::Vsphere::Compute::Customvalue

        attr_accessor :vm

        def all(_filters = {})
          requires :vm
          case vm
          when Fog::Vsphere::Compute::Server
            load service.list_vm_customvalues(vm.id)
          else
            raise 'customvalues should have vm'
          end
        end

        def get(key)
          requires :vm
          case vm
          when Fog::Vsphere::Compute::Server
            load service.list_vm_customvalues(vm.id)
          else
            raise 'customvalues should have vm'
          end.find { |cv| cv.key == key }
        end
     end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fog-vsphere-3.4.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.3.1 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.3.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.2.5 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.2.2 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.2.1 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.2.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.1.1 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.1.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-vsphere-3.0.0 lib/fog/vsphere/models/compute/customvalues.rb