root / snf-astakos-app / astakos / im / presentation.py @ 0156e40c
History | View | Annotate | Download (7.8 kB)
1 |
# Copyright 2012, 2013 GRNET S.A. All rights reserved.
|
---|---|
2 |
#
|
3 |
# Redistribution and use in source and binary forms, with or
|
4 |
# without modification, are permitted provided that the following
|
5 |
# conditions are met:
|
6 |
#
|
7 |
# 1. Redistributions of source code must retain the above
|
8 |
# copyright notice, this list of conditions and the following
|
9 |
# disclaimer.
|
10 |
#
|
11 |
# 2. Redistributions in binary form must reproduce the above
|
12 |
# copyright notice, this list of conditions and the following
|
13 |
# disclaimer in the documentation and/or other materials
|
14 |
# provided with the distribution.
|
15 |
#
|
16 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
17 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
20 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
23 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
24 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
25 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
26 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 |
# POSSIBILITY OF SUCH DAMAGE.
|
28 |
#
|
29 |
# The views and conclusions contained in the software and
|
30 |
# documentation are those of the authors and should not be
|
31 |
# interpreted as representing official policies, either expressed
|
32 |
# or implied, of GRNET S.A.
|
33 |
|
34 |
from astakos.im import settings |
35 |
|
36 |
RESOURCES = { |
37 |
'groups': {
|
38 |
'compute': {
|
39 |
'help_text': ('Compute resources ' |
40 |
'(amount of VMs, CPUs, RAM, System disk) '),
|
41 |
'is_abbreviation': False, |
42 |
'report_desc': '', |
43 |
'verbose_name': 'compute', |
44 |
}, |
45 |
'storage': {
|
46 |
'help_text': ('Storage resources ' |
47 |
'(amount of space to store files on Pithos) '),
|
48 |
'is_abbreviation': False, |
49 |
'report_desc': '', |
50 |
'verbose_name': 'storage', |
51 |
}, |
52 |
'network': {
|
53 |
'help_text': ' Network resources (number of Private Networks) ', |
54 |
'is_abbreviation': False, |
55 |
'report_desc': '', |
56 |
'verbose_name': 'network', |
57 |
}, |
58 |
}, |
59 |
'resources': {
|
60 |
'pithos.diskspace': {
|
61 |
'help_text': ('This is the space on Pithos for storing files ' |
62 |
'and VM Images. '),
|
63 |
'help_text_input_each': ('This is the total amount of space on ' |
64 |
'Pithos that will be granted to each '
|
65 |
'user of this Project '),
|
66 |
'is_abbreviation': False, |
67 |
'report_desc': 'Storage Space', |
68 |
'placeholder': 'eg. 10GB', |
69 |
'verbose_name': 'Storage Space', |
70 |
'group': 'storage' |
71 |
}, |
72 |
'cyclades.disk': {
|
73 |
'help_text': ('This is the System Disk that the VMs have that ' |
74 |
'run the OS '),
|
75 |
'help_text_input_each': ("This is the total amount of System Disk " |
76 |
"that will be granted to each user of "
|
77 |
"this Project (this refers to the total "
|
78 |
"System Disk of all VMs, not each VM's "
|
79 |
"System Disk) "),
|
80 |
'is_abbreviation': False, |
81 |
'report_desc': 'System Disk', |
82 |
'placeholder': 'eg. 5GB, 2GB etc', |
83 |
'verbose_name': 'System Disk', |
84 |
'group': 'compute' |
85 |
}, |
86 |
'cyclades.ram': {
|
87 |
'help_text': 'RAM used by VMs ', |
88 |
'help_text_input_each': ('This is the total amount of RAM that ' |
89 |
'will be granted to each user of this '
|
90 |
'Project (on all VMs) '),
|
91 |
'is_abbreviation': True, |
92 |
'report_desc': 'RAM', |
93 |
'placeholder': 'eg. 4GB', |
94 |
'verbose_name': 'ram', |
95 |
'group': 'compute' |
96 |
|
97 |
}, |
98 |
'cyclades.cpu': {
|
99 |
'help_text': 'CPUs used by VMs ', |
100 |
'help_text_input_each': ('This is the total number of CPUs that ' |
101 |
'will be granted to each user of this '
|
102 |
'Project (on all VMs) '),
|
103 |
'is_abbreviation': True, |
104 |
'report_desc': 'CPUs', |
105 |
'placeholder': 'eg. 1', |
106 |
'verbose_name': 'cpu', |
107 |
'group': 'compute' |
108 |
|
109 |
}, |
110 |
'cyclades.vm': {
|
111 |
'help_text': ('These are the VMs one can create on the ' |
112 |
'Cyclades UI '),
|
113 |
'help_text_input_each': ('This is the total number of VMs that ' |
114 |
'will be granted to each user of this '
|
115 |
'Project '),
|
116 |
'is_abbreviation': True, |
117 |
'report_desc': 'Virtual Machines', |
118 |
'placeholder': 'eg. 2', |
119 |
'verbose_name': 'vm', |
120 |
'group': 'compute' |
121 |
|
122 |
}, |
123 |
'cyclades.network.private': {
|
124 |
'help_text': ('These are the Private Networks one can create on ' |
125 |
'the Cyclades UI. '),
|
126 |
'help_text_input_each': ('This is the total number of Private ' |
127 |
'Networks that will be granted to each '
|
128 |
'user of this Project '),
|
129 |
'is_abbreviation': False, |
130 |
'report_desc': 'Private Networks', |
131 |
'placeholder': 'eg. 1', |
132 |
'verbose_name': 'Private Network', |
133 |
'group': 'network' |
134 |
|
135 |
} |
136 |
}, |
137 |
'groups_order': ['storage', 'compute', 'network'], |
138 |
'resources_order': ['pithos.diskspace', |
139 |
'cyclades.disk',
|
140 |
'cyclades.cpu',
|
141 |
'cyclades.ram',
|
142 |
'cyclades.vm',
|
143 |
'cyclades.network.private'
|
144 |
] |
145 |
} |
146 |
|
147 |
|
148 |
def service_defaults(service_name): |
149 |
"""
|
150 |
Metadata for unkown services
|
151 |
"""
|
152 |
return {
|
153 |
'name': service_name,
|
154 |
'order': 1000, |
155 |
'verbose_name': service_name.title(),
|
156 |
'cloudbar': {
|
157 |
'show': True, |
158 |
'title': service_name
|
159 |
}, |
160 |
'dashboard': {
|
161 |
'show': True, |
162 |
'order': 1000, |
163 |
'description': '%s service' % service_name |
164 |
} |
165 |
} |
166 |
|
167 |
|
168 |
SERVICES = { |
169 |
'astakos': {
|
170 |
'url': '/im/landing', |
171 |
'order': 1, |
172 |
'dashboard': {
|
173 |
'order': 3, |
174 |
'show': True, |
175 |
'description': "Access the dashboard from the top right corner " |
176 |
"of your screen. Here you can manage your profile, "
|
177 |
"see the usage of your resources and manage "
|
178 |
"projects to share virtual resources with "
|
179 |
"colleagues."
|
180 |
}, |
181 |
'cloudbar': {
|
182 |
'show': False |
183 |
} |
184 |
}, |
185 |
'pithos': {
|
186 |
'url': '/pithos/ui/', |
187 |
'order': 2, |
188 |
'dashboard': {
|
189 |
'order': 1, |
190 |
'show': True, |
191 |
'description': "Pithos is the File Storage service. " |
192 |
"Click to start uploading and managing your "
|
193 |
"files on the cloud."
|
194 |
}, |
195 |
'cloudbar': {
|
196 |
'show': True |
197 |
} |
198 |
}, |
199 |
'cyclades': {
|
200 |
'url': '/cyclades/ui/', |
201 |
'order': 3, |
202 |
'dashboard': {
|
203 |
'order': 2, |
204 |
'show': True, |
205 |
'description': "Cyclades is the Compute and Network Service. " |
206 |
"Click to start creating Virtual Machines and "
|
207 |
"connect them to arbitrary Networks."
|
208 |
}, |
209 |
'cloudbar': {
|
210 |
'show': True |
211 |
} |
212 |
} |
213 |
} |