Merge branch '1946-request-body-vs-parameters'
[arvados.git] / doc / admin / cheat_sheet.textile
1 ---
2 layout: default
3 navsection: adminguide
4 title: Cheat Sheet
5 navorder: 1
6 ---
7
8 h1. Cheat Sheet
9
10 h3. CLI setup
11
12 <pre>
13 ARVADOS_API_HOST={{ site.arvados_api_host }}
14 ARVADOS_API_TOKEN=1234567890qwertyuiopasdfghjklzxcvbnm1234567890zzzz
15 </pre>
16
17 h3. Create VM
18
19 <pre>
20 arv virtual_machine create --virtual-machine '{"hostname":"xxxxxxxchangeme.example.com"}'
21 </pre>
22
23 h3. Activate user
24
25 <pre>
26 user_uuid=xxxxxxxchangeme
27
28 arv user update --uuid "$user_uuid" --user '{"is_active":true}'
29 </pre>
30
31 h3. User &rarr; VM
32
33 Give @$user_uuid@ permission to log in to @$vm_uuid@ as @$target_username@
34
35 <pre>
36 user_uuid=xxxxxxxchangeme
37 vm_uuid=xxxxxxxchangeme
38 target_username=xxxxxxxchangeme
39
40 read -rd $'\000' newlink <<EOF; arv link create --link "$newlink"
41 {
42 "tail_kind":"arvados#user",
43 "tail_uuid":"$user_uuid",
44 "head_kind":"arvados#virtualMachine",
45 "head_uuid":"$vm_uuid",
46 "link_class":"permission",
47 "name":"can_login",
48 "properties":{"username":"$target_username"}
49 }
50 EOF
51 </pre>
52
53 h3. User &rarr; repo
54
55 Give @$user_uuid@ permission to commit to @$repo_uuid@ as @$repo_username@
56
57 <pre>
58 user_uuid=xxxxxxxchangeme
59 repo_uuid=xxxxxxxchangeme
60 repo_username=xxxxxxxchangeme
61
62 read -rd $'\000' newlink <<EOF; arv link create --link "$newlink"
63 {
64 "tail_kind":"arvados#user",
65 "tail_uuid":"$user_uuid",
66 "head_kind":"arvados#repository",
67 "head_uuid":"$repo_uuid",
68 "link_class":"permission",
69 "name":"can_write",
70 "properties":{"username":"$repo_username"}
71 }
72 EOF
73 </pre>