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

Functions

def add
 Creates new admin of the cluster.
def am_i_admin
def change_password
 Method to change CM Admin password.
def delete
 Removes specified User with id cmadmin_id from CM Admins.
def list_admins
 Method returns list of the CM Admins.
def restart
 Method returns list of the CM Admins.

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
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.admin_cm.admin.add (   caller_id,
  user_id,
  new_password 
)

Creates new admin of the cluster.

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) id of the User to gain CM Admin privileges
new_password(POST string) CM Admin password for User

Definition at line 44 of file admin.py.

def src.cm.views.admin_cm.admin.am_i_admin (   caller_id)
 @returns HttpResponse with JSON content: 
  • response: response status,
  • data: (bool) True if caller is admin and False if not

Definition at line 137 of file admin.py.

def src.cm.views.admin_cm.admin.change_password (   caller_id,
  new_password 
)

Method to change CM Admin password.

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)
new_password(POST string) new password to set

Definition at line 86 of file admin.py.

def src.cm.views.admin_cm.admin.delete (   caller_id,
  user_id 
)

Removes specified User with id cmadmin_id from CM Admins.

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) id of the User to revoke CM admin privileges

Definition at line 69 of file admin.py.

def src.cm.views.admin_cm.admin.list_admins (   caller_id)

Method returns list of the CM Admins.

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(int)) ids of the CM Admins

Definition at line 104 of file admin.py.

def src.cm.views.admin_cm.admin.restart (   caller_id)

Method returns list of the CM Admins.

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)

Definition at line 118 of file admin.py.