---
layout: default
navsection: adminguide
title: Cheat Sheet
navorder: 1
---

h1. Cheat Sheet

h3. CLI setup

<pre>
ARVADOS_API_HOST=xyzzy.arvadosapi.com
ARVADOS_API_TOKEN=1234567890qwertyuiopasdfghjklzxcvbnm1234567890zzzz
</pre>

h3. Create VM

<pre>
arv virtual_machine create --virtual_machine '{"hostname":"xxxxxxxchangeme.example.com"}'
</pre>

h3. User &rarr; VM

Give @$user_uuid@ permission to log in to @$vm_uuid@ as @$target_username@

<pre>
user_uuid=xxxxxxxchangeme
vm_uuid=xxxxxxxchangeme
target_username=xxxxxxxchangeme

read newlink <<EOF; arv link create --link "$newlink"
{
"tail_kind":"arvados#user",
"tail_uuid":"$user_uuid",
"head_kind":"arvados#virtual_machine",
"head_uuid":"$vm_uuid",
"link_class":"permission",
"name":"can_login",
"properties":{"username":"$target_username"}
}
EOF
</pre>

h3. User &rarr; repo

Give @$user_uuid@ permission to commit to @$repo_uuid@ as @$repo_username@

<pre>
user_uuid=xxxxxxxchangeme
repo_uuid=xxxxxxxchangeme
repo_username=xxxxxxxchangeme

read newlink <<EOF; arv link create --link "$newlink"
{
"tail_kind":"arvados#user",
"tail_uuid":"$user_uuid",
"head_kind":"arvados#repository",
"head_uuid":"$repo_uuid",
"link_class":"permission",
"name":"can_write",
"properties":{"username":"$repo_username"}
}
EOF
</pre>
