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

Functions

def add
 Creates and saves new VM Template.
def delete
 Sets specified Template's state as deleted.
def edit
 Updates specified Template's attributes.
def get_by_id
def get_list
 Returns list of Templates.

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.template.add (   caller_id,
  name,
  memory,
  cpu,
  description,
  points,
  ec2name 
)

Creates and saves new VM Template.

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)
memory(POST int)
cpu(POST int)
description(POST string)
points(POST int)
ec2name(POST string) name for EC2 interface

Definition at line 83 of file template.py.

def src.cm.views.admin_cm.template.delete (   caller_id,
  template_id 
)

Sets specified Template's state as deleted.

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)
template_id(POST int) id of the Template to remove.

Definition at line 108 of file template.py.

def src.cm.views.admin_cm.template.edit (   caller_id,
  template_id,
  name = None,
  memory = None,
  cpu = None,
  description = None,
  points = None,
  ec2name = None 
)

Updates specified Template's 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)
template_id(POST int) id of the Template to edit
name(POST string)
memory(POST int)
cpu(POST int)
description(POST string)
points(POST int)
ec2name(POST int)

Definition at line 132 of file template.py.

def src.cm.views.admin_cm.template.get_by_id (   caller_id,
  template_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)
template_id(POST int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) Template.dict property of the requested Template

Definition at line 59 of file template.py.

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

Returns list of Templates.

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)) Template.dict property of each Template

Definition at line 41 of file template.py.