Sha256: af11f090553cd74970cf650b86327360e475cbb28fef7e5841e1c20d50490819

Contents?: true

Size: 679 Bytes

Versions: 40

Compression:

Stored size: 679 Bytes

Contents

module Fog
  module Compute
    class Vsphere
      class Folder < Fog::Model
        identity :id

        attribute :name
        attribute :parent
        attribute :datacenter
        attribute :path
        attribute :type

        # Pass :recursive => true to get a Servers object that searches for VM names recursively
        def vms(options = {})
          return [] if type.to_s != 'vm'
          service.servers(:folder => path, :datacenter => datacenter, :recursive => options[:recursive])
        end

        def to_s
          name
        end
        
        def destroy
          service.folder_destroy(path, datacenter)
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
fog-vsphere-1.7.0.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-2.1.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-2.1.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-2.0.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-2.0.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.13.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.13.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.12.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.11.3 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.11.2 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.11.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.11.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.10.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.9.2 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.9.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.9.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.8.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.7.1 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.7.0 lib/fog/vsphere/models/compute/folder.rb
fog-vsphere-1.6.0 lib/fog/vsphere/models/compute/folder.rb