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

Functions

def attach_vnc
 Attaches VNC redirection to VM.
def create
 Creates new VM with specified attributes.
def destroy
 Destroyes specified VMs.
def detach_vnc
 Detaches VNC redirection from VM.
def edit
 Updates VM attributes.
def erase
 Cleans up after each of the specified VMs.
def get_by_id
def get_list
 Returns list of VMs that are neither closed nor erased.
def restart
 Sends signal to reboot specified VMs.
def save_and_shutdown
 Saves and shutdowns specified VM, without checking User quota.

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
Maciej Nabożny di.di.nosp@m.jo@g.nosp@m.mail..nosp@m.com
Miłosz Zdybał milos.nosp@m.z.zd.nosp@m.ybal@.nosp@m.ifj..nosp@m.edu.p.nosp@m.l

Function Documentation

def src.cm.views.admin_cm.vm.attach_vnc (   caller_id,
  vm_id 
)

Attaches VNC redirection to VM.

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)
vm_id(POST int) id of the VM to have attached VM redirection

Definition at line 203 of file vm.py.

def src.cm.views.admin_cm.vm.create (   caller_id,
  name,
  description,
  image_id,
  template_id,
  public_ip_id,
  iso_list,
  disk_list,
  vnc,
  node_id 
)

Creates new VM with specified attributes.

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)
description(POST string)
image_id(POST int)
template_id(POST int)
public_ip_id(POST int)
iso_list(POST list(int))
disk_list(POST list(int))
vnc(POST)
node_id(POST)

Definition at line 53 of file vm.py.

def src.cm.views.admin_cm.vm.destroy (   caller_id,
  vm_id_list 
)

Destroyes specified VMs.

Destroyed VM can in no way be recovered.

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)
vm_id_list(POST list) ids to destroy
Returns
HttpResponse with JSON content:

Definition at line 75 of file vm.py.

def src.cm.views.admin_cm.vm.detach_vnc (   caller_id,
  vm_id 
)

Detaches VNC redirection from VM.

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)
vm_id(POST int) id of the VM to have detached VM redirection

Definition at line 221 of file vm.py.

def src.cm.views.admin_cm.vm.edit (   caller_id,
  vm_id,
  name = None,
  description = None 
)

Updates VM attributes.

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)
vm_id(POST)
name(POST) (optional) new VM name
description(POST) (optional) new VM description
Returns
HttpResponse with JSON content:

Definition at line 184 of file vm.py.

def src.cm.views.admin_cm.vm.erase (   caller_id,
  vm_id_list 
)

Cleans up after each of the specified VMs.

Erase should be called for failed machines after the inspection of the failure.

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)
vm_id_list(POST list) list of VM id's

Definition at line 92 of file vm.py.

def src.cm.views.admin_cm.vm.get_by_id (   caller_id,
  vm_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)
vm_id(POST) id of the requested VM
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) VM with id id

Definition at line 150 of file vm.py.

def src.cm.views.admin_cm.vm.get_list (   caller_id,
  user_id 
)

Returns list of VMs that are neither closed nor erased.

If user_id is provided, only VMs belonging to that user are returned.

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)
user_id(POST int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) VM.long_dict property of each VM

Definition at line 131 of file vm.py.

def src.cm.views.admin_cm.vm.restart (   caller_id,
  vm_id_list 
)

Sends signal to reboot specified VMs.

VM is not saved to SystemImage during reboot.

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)
vm_id_list(POST (list(int))) ids of the VMs to restart

Definition at line 167 of file vm.py.

def src.cm.views.admin_cm.vm.save_and_shutdown (   caller_id,
  vm_id,
  name,
  description 
)

Saves and shutdowns specified VM, without checking User quota.

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)
vm_id(POST string) id of the VM to save
name(POST string)
description(POST string)

Definition at line 109 of file vm.py.