Class: VSphereCloud::Resources::Disk

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud/vsphere/resources/disk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cid, size_in_mb, datastore, path) ⇒ Disk

Returns a new instance of Disk.



6
7
8
9
10
11
# File 'lib/cloud/vsphere/resources/disk.rb', line 6

def initialize(cid, size_in_mb, datastore, path)
  @cid = cid
  @size_in_mb = size_in_mb
  @datastore = datastore
  @path = path
end

Instance Attribute Details

#cidObject (readonly)

Returns the value of attribute cid.



4
5
6
# File 'lib/cloud/vsphere/resources/disk.rb', line 4

def cid
  @cid
end

#datastoreObject (readonly)

Returns the value of attribute datastore.



4
5
6
# File 'lib/cloud/vsphere/resources/disk.rb', line 4

def datastore
  @datastore
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/cloud/vsphere/resources/disk.rb', line 4

def path
  @path
end

#size_in_mbObject (readonly)

Returns the value of attribute size_in_mb.



4
5
6
# File 'lib/cloud/vsphere/resources/disk.rb', line 4

def size_in_mb
  @size_in_mb
end

Instance Method Details

#attach_spec(controller_key) ⇒ Object



13
14
15
16
# File 'lib/cloud/vsphere/resources/disk.rb', line 13

def attach_spec(controller_key)
  DiskConfig.new(datastore.name, path, controller_key, size_in_mb).
    spec(independent: true)
end