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

Functions

def convert_to_storage_image
 Changes type of the given Image.
def copy
 Copy selected image to user's images.
def delete
 Sets SystemImage state as 'locked'.
def download
 Downloads specified SystemImage.
def edit
 Sets Image's new attributes.
def get_by_id
def get_disk_controllers
def get_filesystems
def get_list
 Returns images.
def get_network_devices
def get_video_devices
def set_group
 Method sets specified Image access type as group (belonging to specified Group).
def set_private
 Removes SystemImage from public pool.
def set_public
 Makes SystemImage available in public pool.

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.admin_cm.system_image.convert_to_storage_image (   caller_id,
  system_image_id 
)

Changes type of the given Image.

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)
system_image_id(POST int) ID of an Image to change type of
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)

Definition at line 257 of file system_image.py.

def src.cm.views.admin_cm.system_image.copy (   caller_id,
  src_image_id,
  dest_user_id 
)

Copy selected image to user's images.

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)
src_image_id(POST int)
dest_user_id(POST int)

Definition at line 322 of file system_image.py.

def src.cm.views.admin_cm.system_image.delete (   caller_id,
  system_image_id_list 
)

Sets SystemImage state as 'locked'.

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)
system_image_id_list(POST list(int)) list of the specified Images ids
Todo:
Should delete SystemImage and set its state to deleted.

Definition at line 132 of file system_image.py.

def src.cm.views.admin_cm.system_image.download (   caller_id,
  description,
  name,
  path,
  disk_controller,
  network_device,
  platform,
  video_device 
)

Downloads specified SystemImage.

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)
description(POST string)
name(POST string)
path(POST string) HTTP or FTP path to image to download
disk_controller(POST)
network_device(POST)
platform(POST)
video_device(POST)

Definition at line 59 of file system_image.py.

def src.cm.views.admin_cm.system_image.edit (   caller_id,
  system_image_id,
  name = None,
  description = None,
  disk_controller = None,
  video_device = None,
  network_device = None,
  platform = None 
)

Sets Image's new attributes.

Those should be get by src.cm.manager.image.get_by_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)
system_image_id(POST string) new Image name
name(POST string) new Image name
description(POST string) new Image description
disk_controller(POST) new Image controller optional
video_device(POST) new video device optional
network_device(POST) new network device optional
platform(POST) optional

Definition at line 153 of file system_image.py.

def src.cm.views.admin_cm.system_image.get_by_id (   caller_id,
  system_image_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)
system_image_id(POST int) id of the Image to get
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) extended information about specified Image

Definition at line 118 of file system_image.py.

def src.cm.views.admin_cm.system_image.get_disk_controllers (   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)) disk controllers

Definition at line 309 of file system_image.py.

def src.cm.views.admin_cm.system_image.get_filesystems (   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)) supported filesystems

Definition at line 279 of file system_image.py.

def src.cm.views.admin_cm.system_image.get_list (   caller_id,
  access,
  group_id = None 
)

Returns images.

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)
access(POST) ( image_access['group'] | image_access['private'] | image_access['public'] , necessary for system and cd images)
group_id(POST list(int)) list of Group ids necessary when access is group, for system and cd images
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) SystemImage.dict property for each SystemImage.

Definition at line 98 of file system_image.py.

def src.cm.views.admin_cm.system_image.get_network_devices (   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)) network devices

Definition at line 299 of file system_image.py.

def src.cm.views.admin_cm.system_image.get_video_devices (   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)) video devices

Definition at line 289 of file system_image.py.

def src.cm.views.admin_cm.system_image.set_group (   caller_id,
  system_image_id,
  group_id 
)

Method sets specified Image access type as group (belonging to specified Group).

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)
system_image_id(POST int)
group_id(POST int) id of the Group Image should belong to
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)
Exceptions
CMException('image_set_group')cannot set group access type

Definition at line 212 of file system_image.py.

def src.cm.views.admin_cm.system_image.set_private (   caller_id,
  system_image_id 
)

Removes SystemImage from public pool.

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)
system_image_id(POST int)

Definition at line 186 of file system_image.py.

def src.cm.views.admin_cm.system_image.set_public (   caller_id,
  system_image_id 
)

Makes SystemImage available in public pool.

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)
system_image_id(POST int)

Definition at line 235 of file system_image.py.