Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / docs / projects_specs.rst @ 2a422621

History | View | Annotate | Download (15.6 kB)

1 07c87d4f Georgios D. Tsoukalas
Synnefo Projects
2 07c87d4f Georgios D. Tsoukalas
================
3 07c87d4f Georgios D. Tsoukalas
4 07c87d4f Georgios D. Tsoukalas
Projects can be thought of as contracts between the infrastructure
5 07c87d4f Georgios D. Tsoukalas
and the members of the project, so that resources can be allocated
6 07c87d4f Georgios D. Tsoukalas
by the members and used for a specified period in time.
7 07c87d4f Georgios D. Tsoukalas
8 07c87d4f Georgios D. Tsoukalas
Definition
9 07c87d4f Georgios D. Tsoukalas
----------
10 dfbf5c50 Giorgos Korfiatis
A **definition** for a project, which represents the initialization
11 dfbf5c50 Giorgos Korfiatis
or modification of a project, has the following attributes:
12 07c87d4f Georgios D. Tsoukalas
13 07c87d4f Georgios D. Tsoukalas
``name``
14 07c87d4f Georgios D. Tsoukalas
    *in dot-hierarchical dns-like form*
15 07c87d4f Georgios D. Tsoukalas
16 07c87d4f Georgios D. Tsoukalas
``description``
17 07c87d4f Georgios D. Tsoukalas
    *text describing the project for the public*
18 07c87d4f Georgios D. Tsoukalas
19 07c87d4f Georgios D. Tsoukalas
``start_date``
20 07c87d4f Georgios D. Tsoukalas
    *when the project is to be started*
21 07c87d4f Georgios D. Tsoukalas
22 07c87d4f Georgios D. Tsoukalas
``end_date``
23 07c87d4f Georgios D. Tsoukalas
    *when the project is to be ended*
24 07c87d4f Georgios D. Tsoukalas
25 07c87d4f Georgios D. Tsoukalas
``member_join_policy``
26 07c87d4f Georgios D. Tsoukalas
    *an enumeration of policies on how new join requests are to be accepted.
27 07c87d4f Georgios D. Tsoukalas
    The policies include the following:*
28 07c87d4f Georgios D. Tsoukalas
29 07c87d4f Georgios D. Tsoukalas
    ``auto_accept``
30 07c87d4f Georgios D. Tsoukalas
        *new join requests are automatically accepted by the system*
31 07c87d4f Georgios D. Tsoukalas
32 07c87d4f Georgios D. Tsoukalas
    ``owner_accepts``
33 07c87d4f Georgios D. Tsoukalas
        *new join requests must be accepted by the owner of the project*
34 07c87d4f Georgios D. Tsoukalas
35 07c87d4f Georgios D. Tsoukalas
    ``closed``
36 07c87d4f Georgios D. Tsoukalas
        *no new members can join the project, even if old ones leave*
37 07c87d4f Georgios D. Tsoukalas
38 07c87d4f Georgios D. Tsoukalas
``member_leave_policy``
39 07c87d4f Georgios D. Tsoukalas
    *an enumeration of policies on how new leave requests are to be accepted.
40 07c87d4f Georgios D. Tsoukalas
    The policies include the following:*
41 07c87d4f Georgios D. Tsoukalas
42 07c87d4f Georgios D. Tsoukalas
    ``auto_accept``
43 07c87d4f Georgios D. Tsoukalas
        *leave requests are automatically accepted by the system*
44 07c87d4f Georgios D. Tsoukalas
45 07c87d4f Georgios D. Tsoukalas
    ``owner_accepts``
46 07c87d4f Georgios D. Tsoukalas
        *leave requests must be accepted by the owner of the project**
47 07c87d4f Georgios D. Tsoukalas
48 07c87d4f Georgios D. Tsoukalas
    ``closed``
49 07c87d4f Georgios D. Tsoukalas
        *no member can leave the project*
50 07c87d4f Georgios D. Tsoukalas
51 07c87d4f Georgios D. Tsoukalas
``limit_on_members_number``
52 07c87d4f Georgios D. Tsoukalas
    *the maximum number of members that can be admitted to the project*
53 07c87d4f Georgios D. Tsoukalas
54 07c87d4f Georgios D. Tsoukalas
``limits_on_resources``
55 07c87d4f Georgios D. Tsoukalas
    *a set of limits on the total resources the group can grant to its members*
56 07c87d4f Georgios D. Tsoukalas
57 07c87d4f Georgios D. Tsoukalas
``resource_grants``
58 07c87d4f Georgios D. Tsoukalas
    *a set of resource usage limits each member is granted by the project*
59 07c87d4f Georgios D. Tsoukalas
60 07c87d4f Georgios D. Tsoukalas
61 07c87d4f Georgios D. Tsoukalas
62 07c87d4f Georgios D. Tsoukalas
Application for a Project
63 07c87d4f Georgios D. Tsoukalas
-------------------------
64 07c87d4f Georgios D. Tsoukalas
An **application** for a project must be issued by a user and
65 07c87d4f Georgios D. Tsoukalas
approved by the Service before any resources are granted.
66 07c87d4f Georgios D. Tsoukalas
Its attributes are:
67 07c87d4f Georgios D. Tsoukalas
68 07c87d4f Georgios D. Tsoukalas
``serial``
69 07c87d4f Georgios D. Tsoukalas
    *a unique serial number identifying the application*
70 07c87d4f Georgios D. Tsoukalas
71 07c87d4f Georgios D. Tsoukalas
``applicant``
72 07c87d4f Georgios D. Tsoukalas
    *who applies for creation or modification of a project*
73 07c87d4f Georgios D. Tsoukalas
74 07c87d4f Georgios D. Tsoukalas
``owner``
75 07c87d4f Georgios D. Tsoukalas
    *the requested owner of the project*
76 07c87d4f Georgios D. Tsoukalas
77 07c87d4f Georgios D. Tsoukalas
``comments``
78 07c87d4f Georgios D. Tsoukalas
    *text comments for the application*
79 07c87d4f Georgios D. Tsoukalas
80 07c87d4f Georgios D. Tsoukalas
``definition``
81 07c87d4f Georgios D. Tsoukalas
    *the definition of the project being requested*
82 07c87d4f Georgios D. Tsoukalas
83 07c87d4f Georgios D. Tsoukalas
``issue_date``
84 07c87d4f Georgios D. Tsoukalas
    *when the application was submitted*
85 07c87d4f Georgios D. Tsoukalas
86 07c87d4f Georgios D. Tsoukalas
``precursor_application``
87 07c87d4f Georgios D. Tsoukalas
    *a reference by serial to a previous application which this application
88 07c87d4f Georgios D. Tsoukalas
    requests to modify. It can be null if there is no precursor.*
89 07c87d4f Georgios D. Tsoukalas
90 68f03797 Georgios D. Tsoukalas
An application is immutable in its attributes above,
91 68f03797 Georgios D. Tsoukalas
but its status depends on how it has been processed.
92 68f03797 Georgios D. Tsoukalas
The *application status* can be:
93 68f03797 Georgios D. Tsoukalas
94 68f03797 Georgios D. Tsoukalas
    :(1):   pending
95 68f03797 Georgios D. Tsoukalas
    :(2a):  approved
96 68f03797 Georgios D. Tsoukalas
    :(2b):  rejected
97 68f03797 Georgios D. Tsoukalas
    :(3):   replaced
98 68f03797 Georgios D. Tsoukalas
99 68f03797 Georgios D. Tsoukalas
When an application becomes *approved* and set to the project,
100 68f03797 Georgios D. Tsoukalas
its precursor must automatically be set to *replaced*.
101 07c87d4f Georgios D. Tsoukalas
102 07c87d4f Georgios D. Tsoukalas
103 07c87d4f Georgios D. Tsoukalas
Project Membership
104 07c87d4f Georgios D. Tsoukalas
-------------------------
105 07c87d4f Georgios D. Tsoukalas
A *project membership* object maps a user to a project and holds
106 07c87d4f Georgios D. Tsoukalas
state for this mapping.
107 07c87d4f Georgios D. Tsoukalas
There are no inherent constraints to this mapping,
108 07c87d4f Georgios D. Tsoukalas
any user might be a member to any project.
109 07c87d4f Georgios D. Tsoukalas
110 07c87d4f Georgios D. Tsoukalas
The **state** of membership can be:
111 07c87d4f Georgios D. Tsoukalas
112 07c87d4f Georgios D. Tsoukalas
    :(1):   *pending acceptance*
113 07c87d4f Georgios D. Tsoukalas
    :(2a):  *rejected*
114 07c87d4f Georgios D. Tsoukalas
    :(2b):  *accepted, pending synchronization*
115 07c87d4f Georgios D. Tsoukalas
    :(3):   *active*
116 07c87d4f Georgios D. Tsoukalas
    :(4):   *pending removal*
117 07c87d4f Georgios D. Tsoukalas
    :(5):   *removed, pending synchronization*
118 07c87d4f Georgios D. Tsoukalas
    :(6):   *removed*
119 07c87d4f Georgios D. Tsoukalas
120 07c87d4f Georgios D. Tsoukalas
The transitions from 2b to 3, and 5 to 6, must first
121 07c87d4f Georgios D. Tsoukalas
commit their starting state and then only update to the next state
122 07c87d4f Georgios D. Tsoukalas
after the *Synchronize Membership* procedure has been
123 07c87d4f Georgios D. Tsoukalas
acknowledged as successful.
124 07c87d4f Georgios D. Tsoukalas
125 07c87d4f Georgios D. Tsoukalas
Except states 2b and 5 which explicitly state that they are *pending*,
126 07c87d4f Georgios D. Tsoukalas
all other states are considered *synchronized*
127 07c87d4f Georgios D. Tsoukalas
128 07c87d4f Georgios D. Tsoukalas
129 07c87d4f Georgios D. Tsoukalas
130 07c87d4f Georgios D. Tsoukalas
Project
131 07c87d4f Georgios D. Tsoukalas
-------
132 07c87d4f Georgios D. Tsoukalas
A **project** is created or modified upon the approval of an application.
133 07c87d4f Georgios D. Tsoukalas
It is initialized with the *definition* contained in the application,
134 07c87d4f Georgios D. Tsoukalas
and grants resources as specified, and acquires all the extra state needed.
135 07c87d4f Georgios D. Tsoukalas
The *definition* of a project does not belong to its mutable state,
136 07c87d4f Georgios D. Tsoukalas
and can only be changed by approving a new application.
137 07c87d4f Georgios D. Tsoukalas
The attributes for a project are:
138 07c87d4f Georgios D. Tsoukalas
139 07c87d4f Georgios D. Tsoukalas
``serial``
140 07c87d4f Georgios D. Tsoukalas
    *a unique serial number identifying the project*
141 07c87d4f Georgios D. Tsoukalas
142 07c87d4f Georgios D. Tsoukalas
``application``
143 07c87d4f Georgios D. Tsoukalas
    *the application which has created or modified the project.
144 07c87d4f Georgios D. Tsoukalas
    An application is approved by setting it to this attribute.*
145 07c87d4f Georgios D. Tsoukalas
146 07c87d4f Georgios D. Tsoukalas
``last_application_synced``
147 07c87d4f Georgios D. Tsoukalas
    *the last application that was successfully synchronized with Quotaholder.
148 07c87d4f Georgios D. Tsoukalas
    Normally, this is the same as the ``application`` above.
149 07c87d4f Georgios D. Tsoukalas
    However, on approval, only ``application`` is set
150 07c87d4f Georgios D. Tsoukalas
    so the two attributes differ, marking the project as pending definition
151 07c87d4f Georgios D. Tsoukalas
    synchronization. Upon successful synchronization with Quotaholder,
152 07c87d4f Georgios D. Tsoukalas
    ``last_application_synced`` is also set,
153 07c87d4f Georgios D. Tsoukalas
    marking the project definition synchronized.
154 07c87d4f Georgios D. Tsoukalas
    Note that if during the synchronization another approval
155 07c87d4f Georgios D. Tsoukalas
    updates ``application``, then after synchronization the project
156 07c87d4f Georgios D. Tsoukalas
    is still out of sync, and needs another loop.*
157 07c87d4f Georgios D. Tsoukalas
158 07c87d4f Georgios D. Tsoukalas
``creation_date``
159 07c87d4f Georgios D. Tsoukalas
    *when the project was created (i.e. was first approved)*
160 07c87d4f Georgios D. Tsoukalas
161 07c87d4f Georgios D. Tsoukalas
``last_approval_date``
162 07c87d4f Georgios D. Tsoukalas
    *when was the last approval (i.e. creation or modification).
163 07c87d4f Georgios D. Tsoukalas
    Null if the project has not been approved or has been suspended.*
164 07c87d4f Georgios D. Tsoukalas
165 07c87d4f Georgios D. Tsoukalas
``termination_start_date``
166 07c87d4f Georgios D. Tsoukalas
    *when the project was ordered to terminate,
167 07c87d4f Georgios D. Tsoukalas
    and declared out of sync for its resource grants to be removed.
168 07c87d4f Georgios D. Tsoukalas
    (is null if the project has not been ordered to terminate)*
169 07c87d4f Georgios D. Tsoukalas
170 07c87d4f Georgios D. Tsoukalas
``termination_date``
171 07c87d4f Georgios D. Tsoukalas
    *when the project termination was actually completed by the service
172 07c87d4f Georgios D. Tsoukalas
    following the successful revocation of resource grants.
173 07c87d4f Georgios D. Tsoukalas
    (is null if the project has not been terminated)*
174 07c87d4f Georgios D. Tsoukalas
175 07c87d4f Georgios D. Tsoukalas
``members``
176 07c87d4f Georgios D. Tsoukalas
    *the set of members for this project*
177 07c87d4f Georgios D. Tsoukalas
178 b22de10a Sofia Papagiannaki
``membership_dirty``
179 07c87d4f Georgios D. Tsoukalas
    *boolean attribute declaring that the project
180 07c87d4f Georgios D. Tsoukalas
    needs membership synchronization.
181 07c87d4f Georgios D. Tsoukalas
    It must be atomically set and committed before
182 07c87d4f Georgios D. Tsoukalas
    any synchronization begins.
183 07c87d4f Georgios D. Tsoukalas
    It must be unset only after synchronization
184 07c87d4f Georgios D. Tsoukalas
    has been confirmed as successful.*
185 07c87d4f Georgios D. Tsoukalas
186 07c87d4f Georgios D. Tsoukalas
187 07c87d4f Georgios D. Tsoukalas
188 07c87d4f Georgios D. Tsoukalas
Rules
189 07c87d4f Georgios D. Tsoukalas
-----
190 07c87d4f Georgios D. Tsoukalas
191 07c87d4f Georgios D. Tsoukalas
1. **Valid projects**
192 07c87d4f Georgios D. Tsoukalas
193 07c87d4f Georgios D. Tsoukalas
    Projects are valid only if they violate none of the rules
194 07c87d4f Georgios D. Tsoukalas
195 07c87d4f Georgios D. Tsoukalas
2. **Active projects**
196 07c87d4f Georgios D. Tsoukalas
197 07c87d4f Georgios D. Tsoukalas
    A project is declared **active** when its resource grants are in effect.
198 07c87d4f Georgios D. Tsoukalas
    A valid project can be active if and only if
199 07c87d4f Georgios D. Tsoukalas
    - its ``last_approval_date`` is not null
200 07c87d4f Georgios D. Tsoukalas
    - its ``termination_date`` is null
201 07c87d4f Georgios D. Tsoukalas
    - its ``limit_on_members_number`` and ``limits_on_resources`` are not violated
202 07c87d4f Georgios D. Tsoukalas
203 07c87d4f Georgios D. Tsoukalas
2. **Terminated projects**
204 07c87d4f Georgios D. Tsoukalas
205 07c87d4f Georgios D. Tsoukalas
    A valid project is declared **terminated**, if and only if
206 07c87d4f Georgios D. Tsoukalas
    its ``termination_date`` is not null
207 07c87d4f Georgios D. Tsoukalas
208 07c87d4f Georgios D. Tsoukalas
4. **Suspended projects**
209 07c87d4f Georgios D. Tsoukalas
210 2a422621 Giorgos Korfiatis
    A valid project is declared **suspended** if and only if
211 dfbf5c50 Giorgos Korfiatis
212 07c87d4f Georgios D. Tsoukalas
    - its ``termination_date`` is null
213 07c87d4f Georgios D. Tsoukalas
    - its ``last_approval_date`` is null,
214 07c87d4f Georgios D. Tsoukalas
      or its ``limit_on_members_number`` and ``limits_on_resources`` are violated
215 07c87d4f Georgios D. Tsoukalas
216 07c87d4f Georgios D. Tsoukalas
5. **Alive projects**
217 07c87d4f Georgios D. Tsoukalas
218 07c87d4f Georgios D. Tsoukalas
    Projects are declared **alive** if they are either *active*, or *suspended*.
219 07c87d4f Georgios D. Tsoukalas
    Users and owners are always able to interact with alive projects.
220 07c87d4f Georgios D. Tsoukalas
221 07c87d4f Georgios D. Tsoukalas
6. **Life status**
222 07c87d4f Georgios D. Tsoukalas
223 07c87d4f Georgios D. Tsoukalas
    The status of being alive, active, suspended, terminated.
224 07c87d4f Georgios D. Tsoukalas
225 07c87d4f Georgios D. Tsoukalas
7. **Project states**
226 07c87d4f Georgios D. Tsoukalas
227 07c87d4f Georgios D. Tsoukalas
    The states of a project that are significant from a control flow aspect,
228 07c87d4f Georgios D. Tsoukalas
    are the following:
229 07c87d4f Georgios D. Tsoukalas
230 07c87d4f Georgios D. Tsoukalas
    :(0):   pending approval
231 07c87d4f Georgios D. Tsoukalas
    :(1a):  alive, pending definition sync
232 07c87d4f Georgios D. Tsoukalas
    :(1b):  alive, pending membership sync
233 07c87d4f Georgios D. Tsoukalas
    :(1c):  alive, pending total sync
234 07c87d4f Georgios D. Tsoukalas
    :(2):   alive
235 07c87d4f Georgios D. Tsoukalas
    :(3a):  terminated, pending definition sync
236 07c87d4f Georgios D. Tsoukalas
    :(3b):  terminated, pending membership sync
237 07c87d4f Georgios D. Tsoukalas
    :(3c):  terminated, pending total sync
238 07c87d4f Georgios D. Tsoukalas
    :(4):   terminated
239 07c87d4f Georgios D. Tsoukalas
240 07c87d4f Georgios D. Tsoukalas
241 07c87d4f Georgios D. Tsoukalas
7. **Synchronization status**
242 07c87d4f Georgios D. Tsoukalas
243 07c87d4f Georgios D. Tsoukalas
    The status of the project's synchronization with Quotaholder
244 07c87d4f Georgios D. Tsoukalas
    can be either **synchronized** or **unsyncrhonized**.
245 07c87d4f Georgios D. Tsoukalas
246 dfbf5c50 Giorgos Korfiatis
    An alive project is declared synchronized by setting
247 07c87d4f Georgios D. Tsoukalas
    ``last_application_synced`` to be equal to the ``application``,
248 b22de10a Sofia Papagiannaki
    and setting ``membership_dirty`` to false,
249 07c87d4f Georgios D. Tsoukalas
250 07c87d4f Georgios D. Tsoukalas
    Semantically, the project becomes synchronized when its application
251 07c87d4f Georgios D. Tsoukalas
    definition has been fully implemented and committed to quotaholder,
252 07c87d4f Georgios D. Tsoukalas
    and all its memberships are also synchronized.
253 07c87d4f Georgios D. Tsoukalas
254 07c87d4f Georgios D. Tsoukalas
    The alive project loses its synchronization on two occasions.
255 07c87d4f Georgios D. Tsoukalas
    On the approval of a new application modifying the project,
256 07c87d4f Georgios D. Tsoukalas
    and on the addition or removal of any of its memberships.
257 07c87d4f Georgios D. Tsoukalas
258 07c87d4f Georgios D. Tsoukalas
    In general, also considering projects under termination,
259 07c87d4f Georgios D. Tsoukalas
    a project is declared synchronized if and only if:
260 07c87d4f Georgios D. Tsoukalas
261 07c87d4f Georgios D. Tsoukalas
    - ``last_application_synced`` equals ``application``
262 b22de10a Sofia Papagiannaki
    - ``membership_dirty`` is false
263 07c87d4f Georgios D. Tsoukalas
    - ``termination_start_date`` is null or ``termination_date`` is set
264 07c87d4f Georgios D. Tsoukalas
265 07c87d4f Georgios D. Tsoukalas
    Depending on which of the previous three clauses fail,
266 07c87d4f Georgios D. Tsoukalas
    a synchronizing process knows what to do:
267 07c87d4f Georgios D. Tsoukalas
    definition, membership, or termination and combinations.
268 07c87d4f Georgios D. Tsoukalas
269 07c87d4f Georgios D. Tsoukalas
8. **Unique project names**
270 07c87d4f Georgios D. Tsoukalas
271 07c87d4f Georgios D. Tsoukalas
    The project name (as specified in its application's definition)
272 07c87d4f Georgios D. Tsoukalas
    must be unique among all *alive* projects.
273 07c87d4f Georgios D. Tsoukalas
274 07c87d4f Georgios D. Tsoukalas
9. **Inconsistent dates**
275 07c87d4f Georgios D. Tsoukalas
276 07c87d4f Georgios D. Tsoukalas
    If either ``creation_date`` or ``last_approval_date``
277 07c87d4f Georgios D. Tsoukalas
    is in the future, the project state is declared **inconsistent**
278 07c87d4f Georgios D. Tsoukalas
    but the project is still considered created or approved, respectively.
279 dfbf5c50 Giorgos Korfiatis
280 07c87d4f Georgios D. Tsoukalas
    If ``termination_date`` is in the future, the project state is declared
281 07c87d4f Georgios D. Tsoukalas
    **inconsistent** but the project is still considered terminated.
282 07c87d4f Georgios D. Tsoukalas
283 07c87d4f Georgios D. Tsoukalas
10. **No project without application**
284 07c87d4f Georgios D. Tsoukalas
285 07c87d4f Georgios D. Tsoukalas
    A project can only exist in reference of the application that has defined it.
286 07c87d4f Georgios D. Tsoukalas
    The attributes in the definition such as its name, resource grants
287 07c87d4f Georgios D. Tsoukalas
    cannot be modified without a new application that must be approved.
288 07c87d4f Georgios D. Tsoukalas
289 07c87d4f Georgios D. Tsoukalas
11. **Creating and modifying projects with follow-up applications**
290 07c87d4f Georgios D. Tsoukalas
291 07c87d4f Georgios D. Tsoukalas
    Every application for a project can be followed up with another one.
292 07c87d4f Georgios D. Tsoukalas
    The new application points back to it with its ``precursor`` attribute.
293 dfbf5c50 Giorgos Korfiatis
294 07c87d4f Georgios D. Tsoukalas
    This means that an applicant can update their application
295 07c87d4f Georgios D. Tsoukalas
    before it has been approved.
296 dfbf5c50 Giorgos Korfiatis
297 07c87d4f Georgios D. Tsoukalas
    Apart from an applicant, whoever can approve the project,
298 07c87d4f Georgios D. Tsoukalas
    can also post a follow up application for it, modifying
299 07c87d4f Georgios D. Tsoukalas
    some aspects of the definition and approve that instead.
300 07c87d4f Georgios D. Tsoukalas
    For example, a user might request for 100 GB storage,
301 07c87d4f Georgios D. Tsoukalas
    but the Service may approve a project with only 80GB,
302 07c87d4f Georgios D. Tsoukalas
    via a follow up application.
303 dfbf5c50 Giorgos Korfiatis
304 07c87d4f Georgios D. Tsoukalas
    If the precursor of an application is not associated with a project
305 07c87d4f Georgios D. Tsoukalas
    (i.e. no project references it as its defining ``application``),
306 07c87d4f Georgios D. Tsoukalas
    then a new project entry is created and initialized.
307 dfbf5c50 Giorgos Korfiatis
308 07c87d4f Georgios D. Tsoukalas
    If the precursor of an application *is* associated with a valid project,
309 07c87d4f Georgios D. Tsoukalas
    then the same project entry is used and is re-initialized according
310 07c87d4f Georgios D. Tsoukalas
    to the new application's definition.
311 07c87d4f Georgios D. Tsoukalas
    The project is made alive (if terminated) and its previous state
312 07c87d4f Georgios D. Tsoukalas
    is maintained (mainly, the member set).
313 07c87d4f Georgios D. Tsoukalas
    If the new definition causes the project to exceed its limits,
314 07c87d4f Georgios D. Tsoukalas
    it will be suspended as required.
315 07c87d4f Georgios D. Tsoukalas
316 07c87d4f Georgios D. Tsoukalas
317 07c87d4f Georgios D. Tsoukalas
318 07c87d4f Georgios D. Tsoukalas
Procedures
319 07c87d4f Georgios D. Tsoukalas
----------
320 07c87d4f Georgios D. Tsoukalas
321 07c87d4f Georgios D. Tsoukalas
The following procedures are considered essential primitives
322 07c87d4f Georgios D. Tsoukalas
for the function of the Projects feature, and should constitute
323 07c87d4f Georgios D. Tsoukalas
a natural *internal* API to it. This is not a public API for users,
324 07c87d4f Georgios D. Tsoukalas
although the public one should be thinly layered on top of it.
325 07c87d4f Georgios D. Tsoukalas
326 07c87d4f Georgios D. Tsoukalas
For quotaholder interactions, a primitive to synchronize quotaholder
327 07c87d4f Georgios D. Tsoukalas
with a user's resource quotas is assumed to be available.
328 07c87d4f Georgios D. Tsoukalas
329 07c87d4f Georgios D. Tsoukalas
#. Submit an application
330 07c87d4f Georgios D. Tsoukalas
331 07c87d4f Georgios D. Tsoukalas
   Every user might submit an application to create or modify a project.
332 07c87d4f Georgios D. Tsoukalas
   There are no inherent constraints.
333 07c87d4f Georgios D. Tsoukalas
   However, policy may impose restrictions.
334 07c87d4f Georgios D. Tsoukalas
335 07c87d4f Georgios D. Tsoukalas
#. Retrieve applications
336 07c87d4f Georgios D. Tsoukalas
337 07c87d4f Georgios D. Tsoukalas
   Applications should be retrievable by serial, by applicant,
338 07c87d4f Georgios D. Tsoukalas
   and by approval status.
339 07c87d4f Georgios D. Tsoukalas
   Because applications are immutable, some kind of extra state
340 07c87d4f Georgios D. Tsoukalas
   is needed in order to index by approval status.
341 07c87d4f Georgios D. Tsoukalas
   For example, one might instantiate a mutable object for approval state,
342 07c87d4f Georgios D. Tsoukalas
   with attributes (``approval_serial``, ``approval_state``, ``approval_data``)
343 07c87d4f Georgios D. Tsoukalas
344 07c87d4f Georgios D. Tsoukalas
#. Approve an application (create or modify a Project)
345 07c87d4f Georgios D. Tsoukalas
346 07c87d4f Georgios D. Tsoukalas
   Application approval must atomically perform and commit all of the following:
347 07c87d4f Georgios D. Tsoukalas
   - create or modify the project at its specified definition
348 07c87d4f Georgios D. Tsoukalas
   - set the project state to be pending synchronization with quotaholder
349 07c87d4f Georgios D. Tsoukalas
350 07c87d4f Georgios D. Tsoukalas
   After committing, the procedure to synchronize the project (see below)
351 07c87d4f Georgios D. Tsoukalas
   should be called.
352 07c87d4f Georgios D. Tsoukalas
353 07c87d4f Georgios D. Tsoukalas
#. Retrieve projects
354 07c87d4f Georgios D. Tsoukalas
355 07c87d4f Georgios D. Tsoukalas
   Projects should be retrievable by serial, by owner,
356 07c87d4f Georgios D. Tsoukalas
   by application, by life status, and by synchronization status.
357 07c87d4f Georgios D. Tsoukalas
358 07c87d4f Georgios D. Tsoukalas
   *By application* means that given an application, one must be able
359 07c87d4f Georgios D. Tsoukalas
   to retrieve the project that has it approved, if any.
360 07c87d4f Georgios D. Tsoukalas
361 07c87d4f Georgios D. Tsoukalas
#. Add or remove a user to a project
362 07c87d4f Georgios D. Tsoukalas
363 07c87d4f Georgios D. Tsoukalas
   When a new membership is created for a project or
364 07c87d4f Georgios D. Tsoukalas
   an existing one is modified, then in the same
365 07c87d4f Georgios D. Tsoukalas
   transaction the project must be declared *unsynchronized*.
366 07c87d4f Georgios D. Tsoukalas
367 07c87d4f Georgios D. Tsoukalas
#. Suspend a project
368 07c87d4f Georgios D. Tsoukalas
369 07c87d4f Georgios D. Tsoukalas
   A project is suspended by setting ``last_approval_date`` to None
370 07c87d4f Georgios D. Tsoukalas
371 07c87d4f Georgios D. Tsoukalas
#. Terminate a project
372 07c87d4f Georgios D. Tsoukalas
373 07c87d4f Georgios D. Tsoukalas
   Project termination must atomically perform and commit all of the following:
374 07c87d4f Georgios D. Tsoukalas
   - set the project ``termination_start_date``
375 07c87d4f Georgios D. Tsoukalas
   - set the ``termination_date`` to null (this is a redundant safeguard)
376 07c87d4f Georgios D. Tsoukalas
   in order to mark the project as pending termination synchronization.
377 07c87d4f Georgios D. Tsoukalas
378 07c87d4f Georgios D. Tsoukalas
   After committing, the procedure to synchronize the project (see below)
379 07c87d4f Georgios D. Tsoukalas
   should be called.
380 dfbf5c50 Giorgos Korfiatis
381 07c87d4f Georgios D. Tsoukalas
#. Synchronize a membership with quotaholder
382 07c87d4f Georgios D. Tsoukalas
383 07c87d4f Georgios D. Tsoukalas
   This procedure is not required to be an independent procedure
384 07c87d4f Georgios D. Tsoukalas
   available for individual memberships.
385 07c87d4f Georgios D. Tsoukalas
   That is, if user synchronization takes care of all memberships,
386 07c87d4f Georgios D. Tsoukalas
   one can call user synchronization instead of membership synchronization.
387 07c87d4f Georgios D. Tsoukalas
388 dfbf5c50 Giorgos Korfiatis
#. Synchronize a user with quotaholder
389 07c87d4f Georgios D. Tsoukalas
390 07c87d4f Georgios D. Tsoukalas
   User synchronization is equivalent to the synchronization of
391 07c87d4f Georgios D. Tsoukalas
   all the user's memberships.
392 07c87d4f Georgios D. Tsoukalas
393 07c87d4f Georgios D. Tsoukalas
#. Synchronize a project with quotaholder
394 07c87d4f Georgios D. Tsoukalas
395 07c87d4f Georgios D. Tsoukalas
   Project synchronization is equivelent to the synchronization of
396 07c87d4f Georgios D. Tsoukalas
   either all its memberships, or all its members.
397 07c87d4f Georgios D. Tsoukalas
398 07c87d4f Georgios D. Tsoukalas
399 07c87d4f Georgios D. Tsoukalas
400 07c87d4f Georgios D. Tsoukalas
View elements
401 07c87d4f Georgios D. Tsoukalas
-------------
402 07c87d4f Georgios D. Tsoukalas
In this context, view elements refer to (at best effort) self-contained
403 07c87d4f Georgios D. Tsoukalas
elements that display information for and offer interaction with their
404 07c87d4f Georgios D. Tsoukalas
underlying objects. A final view, such as a web page, or console command
405 07c87d4f Georgios D. Tsoukalas
output, may include several elements.
406 07c87d4f Georgios D. Tsoukalas
407 07c87d4f Georgios D. Tsoukalas
Interaction with the feature is going through several view elements.
408 07c87d4f Georgios D. Tsoukalas
Each element has two pieces of input,
409 07c87d4f Georgios D. Tsoukalas
the *objects being referenced*, and the *accessing user*,
410 dfbf5c50 Giorgos Korfiatis
and its appearance and function is accordingly parameterized.
411 07c87d4f Georgios D. Tsoukalas
412 07c87d4f Georgios D. Tsoukalas
Each *project element* may need to display information
413 07c87d4f Georgios D. Tsoukalas
that internally belongs to its linked object,
414 07c87d4f Georgios D. Tsoukalas
such as its *definition* or *memberships*.
415 07c87d4f Georgios D. Tsoukalas
416 07c87d4f Georgios D. Tsoukalas
A proposed list of elements is following.
417 07c87d4f Georgios D. Tsoukalas
The elements are only considered building blocks
418 07c87d4f Georgios D. Tsoukalas
for views and not full views by themselves.
419 07c87d4f Georgios D. Tsoukalas
More on views later on.
420 07c87d4f Georgios D. Tsoukalas
421 07c87d4f Georgios D. Tsoukalas
#. Project list element
422 07c87d4f Georgios D. Tsoukalas
423 07c87d4f Georgios D. Tsoukalas
   This represents a list of *projects.*
424 07c87d4f Georgios D. Tsoukalas
   Technically, most of information about a project resides in its *application*.
425 07c87d4f Georgios D. Tsoukalas
426 07c87d4f Georgios D. Tsoukalas
   In the case of a *pending application*,
427 07c87d4f Georgios D. Tsoukalas
   one that has not been approved yet,
428 07c87d4f Georgios D. Tsoukalas
   then the row is filled with data from the
429 07c87d4f Georgios D. Tsoukalas
   current (approved and effective) application,
430 07c87d4f Georgios D. Tsoukalas
   or they are left blank if no such project exists yet.
431 07c87d4f Georgios D. Tsoukalas
432 07c87d4f Georgios D. Tsoukalas
   Additionally, the column that displays the pending status
433 07c87d4f Georgios D. Tsoukalas
   of the project (creation or modification), should be a link
434 07c87d4f Georgios D. Tsoukalas
   to the corresponding application detail element.
435 07c87d4f Georgios D. Tsoukalas
436 07c87d4f Georgios D. Tsoukalas
#. Membership element
437 07c87d4f Georgios D. Tsoukalas
438 07c87d4f Georgios D. Tsoukalas
   A list of project members for a single (or maybe multiple) projects.
439 07c87d4f Georgios D. Tsoukalas
   The list must not display user emails if the viewer is not the owner
440 07c87d4f Georgios D. Tsoukalas
   of the group, or a service administrator.
441 07c87d4f Georgios D. Tsoukalas
442 07c87d4f Georgios D. Tsoukalas
#. Application details element
443 07c87d4f Georgios D. Tsoukalas
444 07c87d4f Georgios D. Tsoukalas
   Displays all application details in full,
445 07c87d4f Georgios D. Tsoukalas
   with a link to the (alive) project it defines, if any,
446 07c87d4f Georgios D. Tsoukalas
   or a pending notice,
447 07c87d4f Georgios D. Tsoukalas
   or an obsolescence note if the project it defined was since modified,
448 07c87d4f Georgios D. Tsoukalas
   or a rejection notice.
449 07c87d4f Georgios D. Tsoukalas
450 07c87d4f Georgios D. Tsoukalas
#. Project details element
451 07c87d4f Georgios D. Tsoukalas
452 07c87d4f Georgios D. Tsoukalas
   This element contains both details for the defining application
453 07c87d4f Georgios D. Tsoukalas
   and for the current state of the project.
454 07c87d4f Georgios D. Tsoukalas
455 07c87d4f Georgios D. Tsoukalas
   Details for the current state of the project may include
456 07c87d4f Georgios D. Tsoukalas
   statistics on membership and resource usage.
457 07c87d4f Georgios D. Tsoukalas
458 07c87d4f Georgios D. Tsoukalas
#. Application form element
459 07c87d4f Georgios D. Tsoukalas
460 07c87d4f Georgios D. Tsoukalas
   It submits a new application.
461 07c87d4f Georgios D. Tsoukalas
   If the application is in reference
462 07c87d4f Georgios D. Tsoukalas
   to previous application (the ``precursor``)
463 07c87d4f Georgios D. Tsoukalas
   then the form should be initialized to be a copy of it.
464 07c87d4f Georgios D. Tsoukalas
465 07c87d4f Georgios D. Tsoukalas
   Otherwise, it may be blank, or initialized with defaults from a template.
466 07c87d4f Georgios D. Tsoukalas
467 07c87d4f Georgios D. Tsoukalas
#. Project search element
468 07c87d4f Georgios D. Tsoukalas
469 07c87d4f Georgios D. Tsoukalas
   This is an entry point to a listing, with configurable filtering.
470 07c87d4f Georgios D. Tsoukalas
471 07c87d4f Georgios D. Tsoukalas
#. History and statistics view
472 07c87d4f Georgios D. Tsoukalas
473 07c87d4f Georgios D. Tsoukalas
   No specification currently.