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

Functions

def destroy
 Destroyes specified Farms.
def erase
 Cleanes up after failed Farm.
def get_by_id
def get_list
 Returns farms belonging:
def save_and_shutdown
 Saves and shutdowns specified Farm's head.

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.farm.destroy (   caller_id,
  farm_ids 
)

Destroyes specified Farms.

Neither Farm's head nor worker nodes are saved. Destroyed Farm cannot 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)
farm_ids(POST list(int)) ids of the Farms to destroy
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list{HTTPResponse}) list of responses for each VM destruction

Definition at line 55 of file farm.py.

def src.cm.views.admin_cm.farm.erase (   caller_id,
  farm_ids 
)

Cleanes up after failed Farm.

Only admin may erase Farm so that he previously may perform some analytics.

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)
farm_ids(POST list(int)) ids of the Farms to erase

Definition at line 105 of file farm.py.

def src.cm.views.admin_cm.farm.get_by_id (   caller_id,
  farm_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)
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 40 of file farm.py.

def src.cm.views.admin_cm.farm.get_list (   caller_id,
  user_id = False 
)

Returns farms belonging:

 - either to the User specified by <b>\c user_id</b>
 - or to all Users if no <b>\c user_id</b> is provided.
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 list) id of the requested Farm's owner
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) Farm.dict property for each Farm

Definition at line 74 of file farm.py.

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

Saves and shutdowns specified Farm's head.

Worker nodes are destroyed.

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)
farm_id(POST int) id of the Farm to save
name(POST string) name which Farm's head should saved to
description(POST string) description for newly saved Farm

Definition at line 91 of file farm.py.