9 The Perl SDK provides a generic set of wrappers so you can make API calls easily.
11 It should be treated as alpha/experimental. Currently, limitations include:
13 * No native Keep client.
20 $ <code class="userinput">sudo apt-get install libjson-perl libio-socket-ssl-perl libwww-perl libipc-system-simple-perl</code>
21 $ <code class="userinput">git clone https://github.com/curoverse/arvados.git</code>
22 $ <code class="userinput">cd arvados/sdk/perl</code>
23 $ <code class="userinput">perl Makefile.PL</code>
24 $ <code class="userinput">sudo make install</code>
30 If the SDK is installed, @perl -MArvados -e ''@ should produce no errors.
32 If your @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables are set up correctly (see "api-tokens":{{site.baseurl}}/user/reference/api-tokens.html for details), the following test script should work:
35 <pre>$ <code class="userinput">perl <<'EOF'
37 my $arv = Arvados->new('apiVersion' => 'v1');
38 my $me = $arv->{'users'}->{'current'}->execute;
39 print ("arvados.v1.users.current.full_name = '", $me->{'full_name'}, "'\n");
41 arvados.v1.users.current.full_name = 'Your Name'
47 Set up an API client user agent:
50 <pre><code class="userinput">my $arv = Arvados->new('apiVersion' => 'v1');
54 Get the User object for the current user:
57 <pre><code class="userinput">my $current_user = $arv->{'users'}->{'current'}->execute;
61 Get the UUID of an object that was retrieved using the SDK:
64 <pre><code class="userinput">my $current_user_uuid = $current_user->{'uuid'}
68 Retrieve an object by ID:
71 <pre><code class="userinput">my $some_user = $arv->{'users'}->{'get'}->execute('uuid' => $current_user_uuid);
78 <pre><code class="userinput">my $test_link = $arv->{'links'}->{'create'}->execute('link' => { 'link_class' => 'test', 'name' => 'test' });
85 <pre><code class="userinput">my $test_link = $arv->{'links'}->{'update'}->execute(
86 'uuid' => $test_link->{'uuid'},
87 'link' => { 'properties' => { 'foo' => 'bar' } });
91 Get a list of objects:
94 <pre><code class="userinput">my $repos = $arv->{'repositories'}->{'list'}->execute;
95 print ("UUID of first repo returned is ", $repos->{'items'}->[0], "\n");
99 The SDK retrieves the list of API methods from the server at run time. Therefore, the set of available methods is determined by the server version rather than the SDK version.