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

Functions

def list_available_networks
def list_leases
 Returns all Leases in specified UserNetwork.
def list_user_networks
def release
 When UserNetwork isn't needed anymore, it should be explicitly released by User.
def request
 Tries to allocate network with specified mask for caller.

Detailed Description

Author
Maciej Nabożny mn@mn.nosp@m.aboz.nosp@m.ny.pl

Database model describing single lease or mirco-network (depends on networking model) for VM

Author
Maciej Nabożny mn@mn.nosp@m.aboz.nosp@m.ny.pl

Database model describing public ip addresses, which could be mapped on vm ip lease (Lease entity). Attached ips are redirected by nodes, on which vm are running. This is done by one-to-one NAT (SNAT+DNAT)

Author
Maciej Nabożny mn@mn.nosp@m.aboz.nosp@m.ny.pl

Database model describing user network

Author
Maciej Nabożny mn@mn.nosp@m.aboz.nosp@m.ny.pl

Functions for creating and deleting networks

Function Documentation

def src.cm.views.user.network.list_available_networks (   caller_id)
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)) AvailableNetwork.dict property for each AvailableNetwork

Definition at line 103 of file network.py.

def src.cm.views.user.network.list_leases (   caller_id,
  network_id 
)

Returns all Leases in specified UserNetwork.

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)
network_id(POST) id of the UserNetwork which Leases should be listed from
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) Lease.dict property for each Lease in specified UserNetwork

Definition at line 141 of file network.py.

def src.cm.views.user.network.list_user_networks (   caller_id)
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)) UserNetwork.dict property for each caller's UserNetwork

Definition at line 118 of file network.py.

def src.cm.views.user.network.release (   caller_id,
  network_id 
)

When UserNetwork isn't needed anymore, it should be explicitly released by User.

If UserNetwork is in use, exception is thrown. Released UserNetwork is deleted.

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)
network_id(POST)

Definition at line 84 of file network.py.

def src.cm.views.user.network.request (   caller_id,
  mask,
  name 
)

Tries to allocate network with specified mask for caller.

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)
mask(POST)
name(POST)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) UserNetwork.dict property of the newly created UserNetwork

Definition at line 48 of file network.py.