Merge branch '1608-api-documentation' of git.clinicalfuture.com:arvados into 1608...
[arvados.git] / doc / user / reference / sdk-cli.textile
1 ---
2 layout: default
3 navsection: userguide
4 title: "Command line SDK"
5 navorder: 322
6 ---
7
8 h1. Reference: Command line SDK
9
10 If you are logged in to an Arvados VM, the command line SDK should be installed. Try:
11
12 @arv --help@
13
14 <!-- _Help is not helpful.  See bug #1667_ -->
15
16 h3. First...
17
18 Set the ARVADOS_API_HOST environment variable.
19
20 @export ARVADOS_API_HOST={{ site.arvados_api_host }}@
21
22 Log in to Workbench and get an API token for your account. Set the ARVADOS_API_TOKEN environment variable.
23
24 @export
25 ARVADOS_API_TOKEN=c0vdbi8wp7f703lbthyadlvmaivgldxssy3l32isslmax93k9@
26
27 If you are using a development instance with an unverifiable SSL certificate, set the ARVADOS_API_HOST_INSECURE environment variable.
28
29 @export ARVADOS_API_HOST_INSECURE=1@
30
31 <!-- _This should link back to "api-tokens":api-tokens.html instead of
32 re-explaining it__ -->
33
34 h3. Usage
35
36 @arv [global_options] resource_type resource_method [method_parameters]@
37
38 <!-- _This is what arv --help really ought to print out_ -->
39
40 h3. Basic examples
41
42 Get UUID of the current user
43 @arv user current@
44
45 Get entire record (json) for current user
46 @arv -h user current@
47
48 Get entire record for identified user
49 @arv -h user get --uuid 6dnxa-tpzed-iimd25zhzh84gbk@
50
51 Update user record
52 @arv user update --uuid 6dnxa-tpzed-iimd25zhzh84gbk --first-name "Bob"@
53
54 Get list of groups (showing just UUIDs)
55 @arv group list@
56
57 Get list of groups (showing entire records)
58 @arv -h group list@
59
60 h3. Global options
61
62 <!-- _Move these up to before "basic examples", and give examples of what
63 these options do and how they might be useful._ -->
64
65 - @--json@, @-j@ := Output entire response as compact JSON.
66
67 - @--pretty@, @--human@, @-h@ := Output entire response as JSON with whitespace for better human-readability.
68
69 - @--uuid@ := Output only the UUIDs of object(s) in the API response, one per line.
70
71 h3. Resource types and methods
72
73 Get list of resource types
74 @arv --help@
75
76 Get list of resource methods for the "user" resource type
77 @arv user --help@