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

Functions

def add
 Adds new Node to this Cluster.
def check
 Tries to restart cc1-node service on each specified Node.
def configure
def delete
 Deletes specified Node from database provided the Node does not host any VM's.
def edit
 Updates Node attributes according to data provided in node_info.
def get_by_id
 Returns details of the requested Node.
def get_by_id_details
 Returns more details of the requested Node.
def get_list
def install
def lock
 Sets specified Node's state as locked.
def unlock
 Unlocks specified Node.

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
Tomek Sośnicki tom.s.nosp@m.osni.nosp@m.cki@g.nosp@m.mail.nosp@m..com

Function Documentation

def src.cm.views.admin_cm.node.add (   caller_id,
  address,
  username,
  transport,
  driver,
  suffix,
  cpu,
  memory,
  disk 
)

Adds new Node to this Cluster.

Node must be a machine preconfigured to be CC1 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)
username(POST string) Node's operating system username for transport. Should be cc1.
address(POST string) added Node IP adress or domain name
transport(POST string) unix, ssh, tls or other available transport name for hypervisor
suffix(POST string) optional suffix for transport (i.e. /system for KVM)
driver(POST string) hypervisior name (XEN, KVM or other, KVM is recommended)
cpu(POST int)
memory(POST int)
disk(POST int)
Note
Not used (but might be used one day)

Definition at line 55 of file node.py.

def src.cm.views.admin_cm.node.check (   caller_id,
  node_id_list 
)

Tries to restart cc1-node service on each 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)
node_id_list(POST list(int))
Note
Not used (but might be used one day)

Definition at line 108 of file node.py.

def src.cm.views.admin_cm.node.configure (   caller_id,
  node_id,
  interfaces 
)
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_id(POST int) node id
interfaces(POST string list) list of interfaces, which node should use to communicate with other nodes and cm.
Note
Not used (but might be used one day)

Definition at line 90 of file node.py.

def src.cm.views.admin_cm.node.delete (   caller_id,
  node_id 
)

Deletes specified Node from database provided the Node does not host any VM's.

Node's operating system setup isn't affected. To bring deleted Node back available for CC1 Cluster, one has to add it once again via Web Interface.

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_id(POST int) id of the Node to delete
Exceptions
CMException('node_has_vms')
CMException('node_delete')

Definition at line 222 of file node.py.

def src.cm.views.admin_cm.node.edit (   caller_id,
  node_id,
  node_info 
)

Updates Node attributes according to data provided in node_info.

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_id(POST int) id of the Node to edit
node_info(POST string) dictionary where cm.models.Node model's fields are the keys and values are values to set
Exceptions
CMException('node_edit')

Definition at line 249 of file node.py.

def src.cm.views.admin_cm.node.get_by_id (   caller_id,
  node_id 
)

Returns details of the requested 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)
node_id(POST int) id of the requested Node
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) Node.long_dict property of the requested Node

Definition at line 137 of file node.py.

def src.cm.views.admin_cm.node.get_by_id_details (   caller_id,
  node_id 
)

Returns more details of the requested 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)
node_id(POST int) id of the requested Node
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) Node.long_long_dict property of the requested Node

Definition at line 151 of file node.py.

def src.cm.views.admin_cm.node.get_list (   caller_id)
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)) Node.dict property for each Node added to current CM

Definition at line 124 of file node.py.

def src.cm.views.admin_cm.node.install (   caller_id,
  node_id,
  distribution 
)
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_id(POST int) id of the Node where cc1-node should be deployed
distribution(POST string) OS distribution name, e.g. Debian
Note
Not used (but might be used one day)

Definition at line 72 of file node.py.

def src.cm.views.admin_cm.node.lock (   caller_id,
  node_id_list 
)

Sets specified Node's state as locked.

No VMs can be run on locked 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)
node_id_list(POST int) list of the specified Nodes ids
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)
Exceptions
CMException('node_lock')

Definition at line 168 of file node.py.

def src.cm.views.admin_cm.node.unlock (   caller_id,
  node_id_list 
)

Unlocks specified Node.

After unlock Node's state is ok and Users are able to run VMs on that 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)
node_id_list(POST int) list of the specified Nodes ids
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)
Exceptions
CMException('node_unlock')

Definition at line 194 of file node.py.