cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
src.cm.views.admin_cm.storage Namespace Reference

Functions

def check
 Check each Node for mounted and unmounted Storages.
def create
 Registers new Storage.
def get_list
 Returns list of Storages.
def lock
 Locks specified Storage.
def mount
 Mounts specified Storages on specified Node.
def unlock
 Unlocks specified Storage.

Detailed Description

Note
All functions here are decorated by src.cm.utils.decorators.admin_cm_log. It's recommended to read src.cm.utils.decorators.admin_cm_log docs before using functions below.
Author
Maciej Nabożny di.di.nosp@m.jo@g.nosp@m.mail..nosp@m.com

Function Documentation

def src.cm.views.admin_cm.storage.check (   caller_id,
  node_list 
)

Check each Node for mounted and unmounted Storages.

Note
The cm.utils.decorators.admin_cm_log decorator performs CMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.admin_cm_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
admin_password(POST string)
node_list(POST list(int)) list of Node ids
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) for each node dict with fields:
    • mounted (list) list of Storages mounted to each Node
    • unmounted (list) list of Storages not mounted to each Node

Definition at line 207 of file storage.py.

def src.cm.views.admin_cm.storage.create (   caller_id,
  name,
  address,
  directory,
  capacity 
)

Registers new Storage.

Note
The cm.utils.decorators.admin_cm_log decorator performs CMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.admin_cm_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
admin_password(POST string)
name(POST string) libvirt's pool name
address(POST string) storage ip address or hostname
directory(POST string) directory on storage
capacity(POST int) maximum storage capacity [MB]
Exceptions
CMException('storage_already_exist')
CMException('storage_create')

Definition at line 55 of file storage.py.

def src.cm.views.admin_cm.storage.get_list (   caller_id)

Returns list of Storages.

Note
The cm.utils.decorators.admin_cm_log decorator performs CMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.admin_cm_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
admin_password(POST string)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) Storage.dict property for each Storage

Definition at line 88 of file storage.py.

def src.cm.views.admin_cm.storage.lock (   caller_id,
  storage_id 
)

Locks specified Storage.

Note
The cm.utils.decorators.admin_cm_log decorator performs CMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.admin_cm_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
admin_password(POST string)
storage_id(POST int)

Definition at line 100 of file storage.py.

def src.cm.views.admin_cm.storage.mount (   caller_id,
  storage_id = None,
  node_id = None 
)

Mounts specified Storages on specified Node.

Note
The cm.utils.decorators.admin_cm_log decorator performs CMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.admin_cm_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
admin_password(POST string)
storage_id(POST) id of Storage to mount (None for all)
node_id(POST) id of Node where to mount Storage (None for all)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) Node's responses

Definition at line 139 of file storage.py.

def src.cm.views.admin_cm.storage.unlock (   caller_id,
  storage_id 
)

Unlocks specified Storage.

Note
The cm.utils.decorators.admin_cm_log decorator performs CMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.admin_cm_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
admin_password(POST string)
storage_id(POST int)

Definition at line 118 of file storage.py.