Module: FogExtensions::Proxmox::Container

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/fog_extensions/proxmox/container.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ostemplate_fileObject

Returns the value of attribute ostemplate_file.



24
25
26
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 24

def ostemplate_file
  @ostemplate_file
end

#ostemplate_storageObject

Returns the value of attribute ostemplate_storage.



24
25
26
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 24

def ostemplate_storage
  @ostemplate_storage
end

#passwordObject

Returns the value of attribute password.



24
25
26
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 24

def password
  @password
end

Instance Method Details

#config_attributes=(attrs) ⇒ Object



51
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 51

def config_attributes=(attrs); end

#identityObject



31
32
33
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 31

def identity
    "#{type}_#{vmid}"
end

#interfacesObject



43
44
45
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 43

def interfaces
    config.interfaces
end

#interfaces_attributes=(attrs) ⇒ Object



49
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 49

def interfaces_attributes=(attrs); end

#memoryObject



40
41
42
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 40

def memory
    maxmem.to_i
end

#mount_pointsObject



37
38
39
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 37

def mount_points
    config.mount_points.collect { |mp| mp.id+': '+mp.volid }
end

#persisted?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 28

def persisted?
    !!identity && !!uptime
end

#templated?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 52

def templated?
    volumes.any? { |volume| volume.templated? }
end

#to_sObject



25
26
27
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 25

def to_s
    name
end

#vm_descriptionObject



46
47
48
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 46

def vm_description
    "Name=#{name}, vmid=#{vmid}"
end

#volumesObject



34
35
36
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 34

def volumes
    config.mount_points
end

#volumes_attributes=(attrs) ⇒ Object



50
# File 'app/models/concerns/fog_extensions/proxmox/container.rb', line 50

def volumes_attributes=(attrs); end