cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
src.cm.models.storage.Storage Class Reference

STORAGE Model Class for storages. More...

Classes

class  Meta

Public Member Functions

def __unicode__
def dict
def free_space
def libvirt_template
def lock
 Method sets this Storage's state as "locked".
def path
def unlock
 Method sets this Storage's state as "ok".
def used_space
 Returns total size of images space (system, disks and cds) used on this Storage [MB].

Static Public Member Functions

def get
 Returns the Storage with the most amount of free space.

Public Attributes

 state

Static Public Attributes

tuple address = models.CharField(max_length=64, null=True)
tuple capacity = models.IntegerField()
tuple dir = models.CharField(max_length=256, null=True)
tuple name = models.CharField(max_length=256)
tuple state = models.IntegerField(default=0)
tuple transport = models.CharField(max_length=20, default="netfs")

Detailed Description

STORAGE Model Class for storages.

This class controlls cluster's Storage - where Images are stored. Storage is mounted to Node physical machine via web interface.

Definition at line 42 of file storage.py.

Member Function Documentation

def src.cm.models.storage.Storage.__unicode__ (   self)

Definition at line 54 of file storage.py.

def src.cm.models.storage.Storage.dict (   self)
Returns
(dict) this Storage's data
fields:
  • id (int)
  • state see also: src.common.states.storage_states
  • name (string) human-readable name of this Storage
  • capacity (int) space total [MB] of this Storage
  • used_space (int) space used [MB]
  • mountpoint (string) mountpoint path to this Storage on the CM
  • dir (string) export path on the NFC server
  • address (string) NFC server address

Definition at line 71 of file storage.py.

def src.cm.models.storage.Storage.free_space (   self)
Returns
(int) free space on this Storage [MB]

Definition at line 123 of file storage.py.

def src.cm.models.storage.Storage.get ( )
static

Returns the Storage with the most amount of free space.

Returns
(Storage) instance of Storage with the most amount of free space
Exceptions
CMException('storage_no_storage')no Storages mounted

Definition at line 134 of file storage.py.

def src.cm.models.storage.Storage.libvirt_template (   self)

Definition at line 165 of file storage.py.

def src.cm.models.storage.Storage.lock (   self)

Method sets this Storage's state as "locked".

Nothing can be read from or written to this Storage. Images saved on this Storage are displayed on the Web Interface as unavailable.

Definition at line 155 of file storage.py.

def src.cm.models.storage.Storage.path (   self)
Returns
(string) total mountpoint path to this Storage on the CM

Definition at line 89 of file storage.py.

def src.cm.models.storage.Storage.unlock (   self)

Method sets this Storage's state as "ok".

Storage may be used as usual.

Definition at line 162 of file storage.py.

def src.cm.models.storage.Storage.used_space (   self)

Returns total size of images space (system, disks and cds) used on this Storage [MB].

Returns
(int) used space on storage

Definition at line 114 of file storage.py.

Member Data Documentation

tuple src.cm.models.storage.Storage.address = models.CharField(max_length=64, null=True)
static

Definition at line 46 of file storage.py.

tuple src.cm.models.storage.Storage.capacity = models.IntegerField()
static

Definition at line 44 of file storage.py.

tuple src.cm.models.storage.Storage.dir = models.CharField(max_length=256, null=True)
static

Definition at line 47 of file storage.py.

tuple src.cm.models.storage.Storage.name = models.CharField(max_length=256)
static

Definition at line 43 of file storage.py.

tuple src.cm.models.storage.Storage.state = models.IntegerField(default=0)
static

Definition at line 45 of file storage.py.

src.cm.models.storage.Storage.state

Definition at line 156 of file storage.py.

tuple src.cm.models.storage.Storage.transport = models.CharField(max_length=20, default="netfs")
static

Definition at line 48 of file storage.py.


The documentation for this class was generated from the following file: