Sha256: d06808ae6acef0d7f6777ea9a29708f88a02a54e7358e14fb086b8dc5f287b17

Contents?: true

Size: 823 Bytes

Versions: 28

Compression:

Stored size: 823 Bytes

Contents

require 'fog/core/collection'
require 'fog/vsphere/models/compute/customvalue'

module Fog
  module Compute
    class Vsphere
      class Customvalues < Fog::Collection
        model Fog::Compute::Vsphere::Customvalue

        attr_accessor :vm

        def all(filters = {})
          requires :vm
          case vm
            when Fog::Compute::Vsphere::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::Compute::Vsphere::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

28 entries across 28 versions & 4 rubygems

Version Path
ns-fog-1.22.8 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.7 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.6 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.23.0 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.4 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.3 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.2 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.22.1 lib/fog/vsphere/models/compute/customvalues.rb