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
fog-1.36.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.35.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-2.0.0.pre.0 lib/fog/vsphere/models/compute/customvalues.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/vsphere/models/compute/customvalues.rb
fog-1.34.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.33.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.32.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.31.0 lib/fog/vsphere/models/compute/customvalues.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/vsphere/models/compute/customvalues.rb
fog-1.30.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.29.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.28.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.27.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.26.0 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.25.0 lib/fog/vsphere/models/compute/customvalues.rb
nsidc-fog-1.24.1 lib/fog/vsphere/models/compute/customvalues.rb
fog-1.24.0 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.11 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.10 lib/fog/vsphere/models/compute/customvalues.rb
ns-fog-1.22.9 lib/fog/vsphere/models/compute/customvalues.rb