cc1
v2.1
CC1 source code docs
Main Page
Related Pages
Packages
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Pages
public_ip.py
Go to the documentation of this file.
1
# -*- coding: utf-8 -*-
2
# @COPYRIGHT_begin
3
#
4
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5
#
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
9
#
10
# http://www.apache.org/licenses/LICENSE-2.0
11
#
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS,
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
# See the License for the specific language governing permissions and
16
# limitations under the License.
17
#
18
# @COPYRIGHT_end
19
20
##
21
# @package src.clm.views.user.public_ip
22
#
23
# @alldecoratedby{src.clm.utils.decorators.user_log}
24
#
25
26
from
clm.utils.decorators
import
user_log, cm_request
27
28
29
@
user_log
(log=
False
, pack=
False
)
30
@cm_request
31
##
32
#
33
# Returns list of caller's public IPs.
34
#
35
# @clmview_user
36
# @cm_request_transparent{user.public_ip.get_list()}
37
#
38
def
get_list
(cm_response, **data):
39
return
cm_response
40
41
42
@
user_log
(log=
True
, pack=
False
)
43
@cm_request
44
##
45
#
46
# Sends request to grant new public IP for caller. If caller's quota allowes,
47
# user will obtain new public IP.
48
#
49
# @clmview_user
50
# @cm_request_transparent{user.public_ip.request()}
51
#
52
def
request
(cm_response, **data):
53
return
cm_response
54
55
56
@
user_log
(log=
False
, pack=
False
)
57
@cm_request
58
##
59
#
60
# Assigns public IP to caller's VM with id \c vm_id
61
#
62
# @clmview_user
63
# @cm_request_transparent{user.public_ip.assign()}
64
#
65
def
assign
(cm_response, **data):
66
return
cm_response
67
68
69
@
user_log
(log=
False
, pack=
False
)
70
@cm_request
71
##
72
#
73
# Unassigns public IP from VM with given id. Unassigned public IP may be assigned
74
# to any of his VMs.
75
#
76
# @clmview_user
77
# @cm_request_transparent{user.public_ip.unassign()}
78
#
79
def
unassign
(cm_response, **data):
80
return
cm_response
81
82
83
@
user_log
(log=
True
, pack=
False
)
84
@cm_request
85
##
86
#
87
# Removes IP from callers public IP's pool and makes it available
88
# for other users to be further requested. Caller doesn't dispose this IP
89
# any more. He'll have to send another request if he needs more IPs.
90
#
91
# @clmview_user
92
# @cm_request_transparent{user.public_ip.release()}
93
#
94
def
release
(cm_response, **data):
95
return
cm_response
96
clm
views
user
public_ip.py
Generated on Wed Jun 18 2014 13:33:00 for cc1 by
1.8.1.2