Revision 3d9f561d
b/README.deploy | ||
---|---|---|
301 | 301 |
|
302 | 302 |
7. Initialization of Synnefo DB: |
303 | 303 |
You need to initialize the Synnefo DB and load fixtures |
304 |
db/fixtures/{flavors,images}.json, which make the API usable by end users by |
|
305 |
defining a sample set of hardware configurations (flavors) and OS images. |
|
304 |
db/fixtures/{users,flavors,images}.json, which make the API usable by end |
|
305 |
users by defining a sample set of users, hardware configurations (flavors) |
|
306 |
and OS images. |
|
306 | 307 |
|
307 |
IMPORTANT: Be sure to modify db/fixtures/initial_data.json and select
|
|
308 |
IMPORTANT: Be sure to modify db/fixtures/users.json and select
|
|
308 | 309 |
a unique token for each of the initial and any other users defined in this |
309 | 310 |
file. DO NOT LEAVE THE SAMPLE AUTHENTICATION TOKENS enabled in deployed |
310 | 311 |
configurations. |
311 | 312 |
|
312 | 313 |
$ ./bin/python manage.py syncdb |
313 | 314 |
$ ./bin/python manage.py migrate db |
315 |
$ ./bin/python manage.py loaddata db/fixtures/users.json |
|
314 | 316 |
$ ./bin/python manage.py loaddata db/fixtures/flavors.json |
315 | 317 |
$ ./bin/python manage.py loaddata db/fixtures/images.json |
316 | 318 |
|
b/db/fixtures/initial_data.json | ||
---|---|---|
1 | 1 |
[ |
2 | 2 |
{ |
3 |
"model": "db.SynnefoUser", |
|
4 |
"pk": 1, |
|
5 |
"fields": { |
|
6 |
"name": "testdbuser", |
|
7 |
"realname" :"test db user", |
|
8 |
"uniq" :"test@synnefo.gr", |
|
9 |
"credit": 10, |
|
10 |
"auth_token": "46e427d657b20defe352804f0eb6f8a2", |
|
11 |
"auth_token_created": "2011-05-10", |
|
12 |
"auth_token_expires": "2015-05-10", |
|
13 |
"type": "ADMIN", |
|
14 |
"created": "2011-05-10", |
|
15 |
"max_invitations" : 1000 |
|
16 |
} |
|
17 |
}, |
|
18 |
{ |
|
19 |
"model": "db.SynnefoUser", |
|
20 |
"pk": 2, |
|
21 |
"fields": { |
|
22 |
"name": "helpdesk", |
|
23 |
"realname" :"HelpDesk user", |
|
24 |
"uniq" :"helpdesk@synnefo.grnet.gr", |
|
25 |
"credit": 10, |
|
26 |
"auth_token": "839636858b1feafd37010f05dc4582e2", |
|
27 |
"auth_token_created": "2011-05-10", |
|
28 |
"auth_token_expires": "2015-05-10", |
|
29 |
"type": "HELPDESK", |
|
30 |
"created": "2011-05-10", |
|
31 |
"max_invitations" : 10 |
|
32 |
} |
|
33 |
}, |
|
34 |
{ |
|
35 | 3 |
"model": "db.NetworkLink", |
36 | 4 |
"pk": 1, |
37 | 5 |
"fields": { |
... | ... | |
52 | 20 |
"link": 1 |
53 | 21 |
} |
54 | 22 |
}, |
55 |
{ |
|
56 |
"model" : "db.Invitations", |
|
57 |
"pk" : 1, |
|
58 |
"fields": { |
|
59 |
"source": 1, |
|
60 |
"target": 1, |
|
61 |
"accepted": "True", |
|
62 |
"level" : -1, |
|
63 |
"created": "2011-06-01", |
|
64 |
"updated": "2011-06-01" |
|
65 |
} |
|
66 |
} |
|
67 | 23 |
] |
b/db/fixtures/users.json | ||
---|---|---|
1 |
[ |
|
2 |
{ |
|
3 |
"model": "db.SynnefoUser", |
|
4 |
"pk": 1, |
|
5 |
"fields": { |
|
6 |
"name": "testdbuser", |
|
7 |
"realname" :"test db user", |
|
8 |
"uniq" :"test@synnefo.gr", |
|
9 |
"credit": 10, |
|
10 |
"auth_token": "46e427d657b20defe352804f0eb6f8a2", |
|
11 |
"auth_token_created": "2011-05-10", |
|
12 |
"auth_token_expires": "2015-05-10", |
|
13 |
"type": "ADMIN", |
|
14 |
"created": "2011-05-10", |
|
15 |
"max_invitations" : 1000 |
|
16 |
} |
|
17 |
}, |
|
18 |
{ |
|
19 |
"model": "db.SynnefoUser", |
|
20 |
"pk": 2, |
|
21 |
"fields": { |
|
22 |
"name": "helpdesk", |
|
23 |
"realname" :"HelpDesk user", |
|
24 |
"uniq" :"helpdesk@synnefo.grnet.gr", |
|
25 |
"credit": 10, |
|
26 |
"auth_token": "839636858b1feafd37010f05dc4582e2", |
|
27 |
"auth_token_created": "2011-05-10", |
|
28 |
"auth_token_expires": "2015-05-10", |
|
29 |
"type": "HELPDESK", |
|
30 |
"created": "2011-05-10", |
|
31 |
"max_invitations" : 10 |
|
32 |
} |
|
33 |
}, |
|
34 |
{ |
|
35 |
"model" : "db.Invitations", |
|
36 |
"pk" : 1, |
|
37 |
"fields": { |
|
38 |
"source": 1, |
|
39 |
"target": 1, |
|
40 |
"accepted": "True", |
|
41 |
"level" : -1, |
|
42 |
"created": "2011-06-01", |
|
43 |
"updated": "2011-06-01" |
|
44 |
} |
|
45 |
} |
|
46 |
] |
Also available in: Unified diff