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

Functions

def check_resources
 Checks if there is enough resources to start a farm.
def create
 Method creates new caller's Farm.
def destroy
 Destroys specified caller's farm.
def get_by_id
 Returns requested Farm.
def get_list
 Returns list of the caller's farms.
def save_and_shutdown
 Safely saves and shutdowns Farm's Head.

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
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.user.farm.check_resources (   caller_id,
  count,
  head_template_id,
  template_id 
)

Checks if there is enough resources to start a farm.

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)
count(POST int)
head_template_id(POST int)
template_id(POST int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (Boolean)

Definition at line 171 of file farm.py.

def src.cm.views.user.farm.create (   caller_id,
  name,
  description,
  image_id,
  head_template_id,
  worker_template_id,
  public_ip_id,
  iso_list,
  disk_list,
  vnc,
  groups,
  count 
)

Method creates new caller's Farm.

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) Farm's name
description(POST string)
image_id(POST int) image for WNs and Head
head_template_id(POST int) Head's template
worker_template_id(POST int) Worker Node's template
public_ip_id(POST int) Worker Node's template
iso_list(POST list)
disk_list(POST list)
vnc(POST list)
groups(POST list)
count(POST int) number of Worker Nodes
Exceptions
CMException('farm_create')

Definition at line 76 of file farm.py.

def src.cm.views.user.farm.destroy (   caller_id,
  farm_id 
)

Destroys specified caller's farm.

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)
farm_id(POST int) destroyed farm's id
Returns
HttpResponse with JSON content:

Definition at line 117 of file farm.py.

def src.cm.views.user.farm.get_by_id (   caller_id,
  farm_id 
)

Returns requested Farm.

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

Definition at line 52 of file farm.py.

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

Returns list of the caller's farms.

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)) data of the requested Farms

Definition at line 130 of file farm.py.

def src.cm.views.user.farm.save_and_shutdown (   caller_id,
  farm_id,
  name,
  description 
)

Safely saves and shutdowns Farm's Head.

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)
farm_id(POST int)
name(POST string)
description(POST string)
Returns
HttpResponse with JSON content:

Definition at line 151 of file farm.py.