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

Functions

def attach
 Attaches specified IsoImage to specified VM.
def delete
 Deletes specified IsoImage.
def detach
 Detaches specified IsoImage from specified VM.
def download
 Downloads specified IsoImage and saves it with specified name and description.
def edit
 Updates IsoImage's attributes.
def get_by_id
 Returns requested IsoImage provided it belongs to caller.
def get_disk_controllers
def get_list
 Returns caller's IsoImages on current CM.

Detailed Description

Note
All functions here are decorated by src.cm.utils.decorators.user_log. It's recommended to read src.cm.utils.decorators.user_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
Miłosz Zdybał milos.nosp@m.z.zd.nosp@m.ybal@.nosp@m.ifj..nosp@m.edu.p.nosp@m.l
Maciej Nabożny mn@mn.nosp@m.aboz.nosp@m.ny.pl

Function Documentation

def src.cm.views.user.iso_image.attach (   caller_id,
  iso_image_id,
  vm_id 
)

Attaches specified IsoImage to specified VM.

It makes possible booting any operating system on created VM.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
iso_image_id(POST int) id of block device (should be IsoImage type)
vm_id(POST int) id of the VM which IsoImage should be attached to
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)

Definition at line 187 of file iso_image.py.

def src.cm.views.user.iso_image.delete (   caller_id,
  iso_image_ids 
)

Deletes specified IsoImage.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
iso_image_ids(POST) id of the IsoImage to delete

Definition at line 122 of file iso_image.py.

def src.cm.views.user.iso_image.detach (   caller_id,
  iso_image_id,
  vm_id 
)

Detaches specified IsoImage from specified VM.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
iso_image_id(POST int) id of the IsoImage to detach
vm_id(POST int) id of the VM from which IsoImage should be detached
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)

Definition at line 215 of file iso_image.py.

def src.cm.views.user.iso_image.download (   caller_id,
  name,
  description,
  path,
  disk_controller 
)

Downloads specified IsoImage and saves it with specified name and description.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
name(POST string)
description(POST string)
path(POST string) HTTP or FTP path to IsoImage to download
disk_controller(POST)

Definition at line 54 of file iso_image.py.

def src.cm.views.user.iso_image.edit (   caller_id,
  iso_image_id,
  name = None,
  description = None,
  disk_controller = None 
)

Updates IsoImage's attributes.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
iso_image_id(POST int) id of the Image to edit
name(POST string) new name
description(POST string) new description
disk_controller(POST) new controller (optional)

Definition at line 156 of file iso_image.py.

def src.cm.views.user.iso_image.get_by_id (   caller_id,
  iso_image_id 
)

Returns requested IsoImage provided it belongs to caller.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
iso_image_id(POST int) id of the IsoImage to get
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) IsoImage.dict property of the requested IsoImage.

Definition at line 110 of file iso_image.py.

def src.cm.views.user.iso_image.get_disk_controllers (   caller_id)
Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) id and name of each IsoImage

Definition at line 233 of file iso_image.py.

def src.cm.views.user.iso_image.get_list (   caller_id)

Returns caller's IsoImages on current CM.

Note
The cm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: cm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
caller_id(POST int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) list of the caller's IsoImages on current CM

Definition at line 92 of file iso_image.py.