Revision 9d84caa4 docs/examplesdir/astakos.rst

b/docs/examplesdir/astakos.rst
11 11
User
12 12
----
13 13

  
14
The *authenticate* command will send a token to the server, for authentication.
15
Be default, the token provided in the cloud configuration (config file) will be
16
used:
17

  
14 18
.. code-block:: console
15 19

  
16 20
    $ kamaki user authenticate
......
25 29
        name: cyclades_admin
26 30
    user:
27 31
        roles_links:
28
        id: some-u53r-1d
32
        id: s0m3-u53r-1d
29 33
        roles:
30 34
            id: 1
31 35
            name: default
32 36
        name: Example User
33 37

  
38
To authenticate other users, provide their token, as shown bellow:
39

  
40
.. code-block:: console
41

  
34 42
    $ kamaki user add z01db3rgs-u53r-t0k3n
35 43
    ...
36 44
    endpoints:
......
48 56
            id: 1
49 57
            name: default
50 58
        name: Dr. Harold Zoidberg
59
    $ kamaki user list
60
    s0m5-u53r-1d       Example User
61
    z01db3rgs-u53r-1d  Dr. Harold Zoidberg
62

  
63
At any time, get the current user's information, or provide a user id for
64
information on any existing user. In the following example, "Example User" is
65
the current user, meaning that all kamaki commands will run for him/her.
66

  
67
.. code-block:: console
51 68

  
52 69
    $ kamaki user info
53 70
    roles_links:
......
65 82
        name: default
66 83
    name: EDr. Harold Zoidberg
67 84

  
85
You can switch between authenticated users
86

  
87
.. code-block:: console
88

  
68 89
    $ kamaki user select z01db3rgs-u53r-1d
69 90
    Are you sure? [y/N]: y
70 91

  
92
Use the *uuid2name* and *name2uuid* commands to map uuids to usernames and vice
93
versa.
94

  
95
.. code-block:: console
96

  
71 97
    $ kamaki user uuid2name z01db3rgs-u53r-1d s0m3-u53r-1d
72 98
    z01db3rgs-u53r-1d: zoidberg@planetexpress.com
73 99
    s0m3-u53r-1d: someuser@example.com
......
75 101
Quotas and resources
76 102
--------------------
77 103

  
104
Each user is assigned a set of limits on various resources:
105

  
78 106
.. code-block:: console
79 107

  
80 108
    $ kamaki quota list
......
104 132
            limit: 5
105 133
            pending: 0
106 134

  
135
If the information above is not clear, use *resource list* for descriptions
136
fetched fresh from the server:
137

  
138
.. code-block:: console
139

  
107 140
    $ kamaki resource list
108 141
    cyclades.disk:
109 142
        service: cyclades_compute
......
139 172
Projects
140 173
--------
141 174

  
175
If the standard policy of a synnefo deployment does not meet the needs of an
176
organization, they should make a request for a *synnefo project*.
177

  
178
First, create a file with the project specification. The specification should
179
be in json format, as described at the
180
`project API <http://www.synnefo.org/docs/synnefo/latest/project-api-guide.html#create-a-project>`_
181
(see "Example request").
182

  
183
Let's request a project of 48 CPUs, with an 8 CPU limit per member. Also 200GB
184
storage space per user, without a project limit.
185

  
186
.. code-block:: console
187

  
188
    $ cat > my_project.txt
189
    {
190
        "name": "My example project",
191
        "homepage": "http://www.exampleorganization.org",
192
        "description": "An example testing project",
193
        "comments": "We need more CPUs and more disk space",
194
        "end_date": "2031-02-13",
195
        "resources": {
196
            "cyclades.vm": {
197
                "project_capacity": 48,
198
                "member_capacity": 8
199
            },
200
            "pithos.diskspace": {
201
                "project_capacity": None,
202
                "member_capacity": 53687091200
203
            }
204
        }
205
    }
206
    $ cat my_project.txt | kamaki project create
207

  
208
List all the projects to see if our project is listed
209

  
142 210
.. code-block:: console
143 211

  
144 212
    $ kamaki project list
......
189 257
                member_capacity: 1000
190 258
                project_capacity: None
191 259

  
260
No, our project is not in the list yet, probably because we wait for (manual)
261
authorization.
262

  
263
To get information on a project:
264

  
265
.. code-block:: console
266

  
267
    $ kamaki project info 29
268
    name: many.quotas
269
    id: 29
270
    end_date: 2013-12-12T00:00:00+00:00
271
    description: I need more quotas
272
    join_policy: moderated
273
    max_members: 10
274
    applicant: s0m3-u53r-1d
275
    leave_policy: auto
276
    creation_date: 2013-02-14T09:26:23.034177+00:00
277
    application: 108
278
    state: active
279
    start_date: 2013-02-14T00:00:00+00:00
280
    owner: s0m3-u53r-1d
281
    homepage: http://example.com
282
    resources:
283
        cyclades.disk:
284
            member_capacity: 109951162777600
285
            project_capacity: None
286
        cyclades.vm:
287
            member_capacity: 1000
288
            project_capacity: None
289
        cyclades.cpu:
290
            member_capacity: 2000
291
            project_capacity: None
292
        cyclades.ram:
293
            member_capacity: 4398046511104
294
            project_capacity: None
295
        pithos.diskspace:
296
            member_capacity: 107374182400
297
            project_capacity: None
298
        cyclades.floating_ip:
299
            member_capacity: 1000
300
            project_capacity: None
301

  
302
Project membership
303
------------------
304

  
305
Assuming that our project has been approved and assigned the id 42, we can now
306
see its details and assign users to benefit from it.
307

  
308
.. code-block:: console
309

  
310
    $ kamaki project info 42
311
        name: My example project
312
        id: 42
313
        end_date: 2031-02-13T00:00:00+00:00
314
        description: An example testing project
315
        commends: We need more CPUs and more disk space
316
        join_policy: moderated
317
        applicant: s0m3-u53r-1d
318
        leave_policy: auto
319
        creation_date: <NOW>
320
        application: 109
321
        state: active
322
        start_date: <NOW>
323
        owner: s0m3-u53r-1d
324
        homepage: http://example.com
325
        resources:
326
            cyclades.disk:
327
                member_capacity: 107374182400
328
                project_capacity: None
329
            cyclades.vm:
330
                member_capacity: 2
331
                project_capacity: None
332
            cyclades.cpu:
333
                member_capacity: 8
334
                project_capacity: 48
335
            cyclades.ram:
336
                member_capacity: 6442450944
337
                project_capacity: None
338
            pithos.diskspace:
339
                member_capacity: 53687091200
340
                project_capacity: None
341
            cyclades.floating_ip:
342
                member_capacity: 2
343
                project_capacity: None
344

  
345
Great! Now, we should allow some users to benefit from this project:
346

  
347
.. code-block:: console
348

  
349
    $ kamaki membership enroll 42 my_favorite@user.example.com
350
    Membership id: 128345
351
    $ kamaki membership enroll 42 that_guy@user.example.com
352
    Membership id: 128346
353
    $ kamaki membership list --with-project-id=42
354
    128345
355
        42 my_favorite@user.example.com OK
356
    238346
357
        42 that_guy@user.example.com OK
358

  
359
We changed our minds: we don't want the last user to be part of the project:
360

  
361
    .. code-block:: console
362

  
363
        $ kamaki membership remove 238346 "Our cooperation was not productive"
364

  
365
Later, the removed user attempts to apply for our project:
366

  
367
.. code-block:: console    
368

  
369
    that_guy$ kamaki membership join 42
370

  
371
We may reject his application:
372

  
373
.. code-block:: console
374

  
375
    $ kamaki memebrship list
376
    128345
377
        42 my_favorite@user.example.com OK
378
    238347
379
        42 that_guy@user.example.com PENDING
380
    $ kamaki membership reject 238347 "Not in need of a new partner"
381

  
382
or accept:
383

  
384
.. code-block:: console    
385

  
386
    $ kamaki membership accept 238347
387

  
388
In the later case, the user decided to leave the project:
389

  
390
.. code-block:: console    
391

  
392
    that_guy$ kamaki membership leave 42

Also available in: Unified diff