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

Functions

def add
 Adds specified CC1 User to current CM.
def change_quota
 Changes specified User's quota.
def get_list
 Returns all Users.
def get_quota
 Get specified User's qouta.
def multiple_change_quota
 Changes quota of multiple users.

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. (except for add)
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.user.add (   caller_id,
  user_id 
)

Adds specified CC1 User to 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)
Note
This method is decorated by user_log decorator, not by admin_cm_log. This is caused by the fact that CLMAdmin doesn't need to be CMAdmin and despite not having rights to call CMAdmin functions he needs to call it on CMAdmin privileges.
Parameters
user_id(POST)

Definition at line 44 of file user.py.

def src.cm.views.admin_cm.user.change_quota (   caller_id,
  user_id,
  memory = None,
  cpu = None,
  storage = None,
  public_ip = None,
  points = None 
)

Changes specified User's quota.

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)
memory(POST)
cpu(POST int)
storage(POST int)
public_ip(POST int)
points(POST int)

Definition at line 62 of file user.py.

def src.cm.views.admin_cm.user.get_list (   caller_id,
  short = False 
)

Returns all Users.

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)
short(POST bool) caller's CM admin password
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) User.long_dict property for each User

Definition at line 128 of file user.py.

def src.cm.views.admin_cm.user.get_quota (   caller_id,
  user_id 
)

Get specified User's qouta.

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 int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) Full User's quota

Definition at line 115 of file user.py.

def src.cm.views.admin_cm.user.multiple_change_quota (   caller_id,
  user_ids,
  memory = None,
  cpu = None,
  storage = None,
  public_ip = None,
  points = None 
)

Changes quota of multiple users.

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_ids(POST list(int))
memory(POST int) new RAM memory limit [MB]
cpu(POST int) new CPU's limit
storage(POST int) new storage space's limit [MB]
public_ip(POST int) new limit of public_ips
points(POST int) new monthly points limit

Definition at line 91 of file user.py.