15924: Update github links to arvados org.
[arvados.git] / doc / sdk / perl / index.html.textile.liquid
index 448cbb1ede54814a6db5285a9ffc66b92e4e2cb8..0561a47e787aa8a7b1675a903a3d782da6821a0c 100644 (file)
@@ -2,9 +2,13 @@
 layout: default
 navsection: sdk
 navmenu: Perl
-title: "Perl SDK"
-
+title: "Installation"
 ...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
 
 The Perl SDK provides a generic set of wrappers so you can make API calls easily.
 
@@ -15,85 +19,51 @@ It should be treated as alpha/experimental. Currently, limitations include:
 
 h3. Installation
 
-<notextile>
-<pre>
-$ <code class="userinput">sudo apt-get install libjson-perl libio-socket-ssl-perl libwww-perl libipc-system-simple-perl</code>
-$ <code class="userinput">git clone https://github.com/curoverse/arvados.git</code>
-$ <code class="userinput">cd arvados/sdk/perl</code>
-$ <code class="userinput">perl Makefile.PL</code>
-$ <code class="userinput">sudo make install</code>
-</pre>
-</notextile>
-
-h4. Test installation
-
-If the SDK is installed, @perl -MArvados -e ''@ should produce no errors.
-
-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:
-
-<notextile>
-<pre>$ <code class="userinput">perl &lt;&lt;'EOF'
-use Arvados;
-my $arv = Arvados-&gt;new('apiVersion' => 'v1');
-my $me = $arv-&gt;{'users'}-&gt;{'current'}-&gt;execute;
-print ("arvados.v1.users.current.full_name = '", $me-&gt;{'full_name'}, "'\n");
-EOF</code>
-arvados.v1.users.current.full_name = 'Your Name'
-</pre>
-</notextile>
-
-h3. Examples
+h4. Option 1: Install from distribution packages
 
-Set up an API client user agent:
+First, "add the appropriate package repository for your distribution":{{ site.baseurl }}/install/install-manual-prerequisites.html#repos.
 
-<notextile>
-<pre><code class="userinput">my $arv = Arvados->new('apiVersion' => 'v1');
-</code></pre>
-</notextile>
-
-Get the User object for the current user:
+On Debian-based systems:
 
 <notextile>
-<pre><code class="userinput">my $current_user = $arv->{'users'}->{'current'}->execute;
+<pre><code>~$ <span class="userinput">sudo apt-get install libjson-perl libio-socket-ssl-perl libwww-perl libipc-system-simple-perl libarvados-perl</code>
 </code></pre>
 </notextile>
 
-Get the UUID of an object that was retrieved using the SDK:
+On Red Hat-based systems:
 
 <notextile>
-<pre><code class="userinput">my $current_user_uuid = $current_user->{'uuid'}
+<pre><code>~$ <span class="userinput">sudo yum install perl-ExtUtils-MakeMaker perl-JSON perl-IO-Socket-SSL perl-Crypt-SSLeay perl-WWW-Curl libarvados-perl</code>
 </code></pre>
 </notextile>
 
-Retrieve an object by ID:
+h4. Option 2: Install from source
 
-<notextile>
-<pre><code class="userinput">my $some_user = $arv->{'users'}->{'get'}->execute('uuid' => $current_user_uuid);
-</code></pre>
-</notextile>
+First, install dependencies from your distribution.  Refer to the package lists above, but don't install @libarvados-perl@.
 
-Create an object:
+Then run the following:
 
 <notextile>
-<pre><code class="userinput">my $test_link = $arv->{'links'}->{'create'}->execute('link' => { 'link_class' => 'test', 'name' => 'test' });
+<pre><code>~$ <span class="userinput">git clone https://github.com/arvados/arvados.git</span>
+~$ <span class="userinput">cd arvados/sdk/perl</span>
+~$ <span class="userinput">perl Makefile.PL</span>
+~$ <span class="userinput">sudo make install</span>
 </code></pre>
 </notextile>
 
-Update an object:
+h3. Test installation
 
-<notextile>
-<pre><code class="userinput">my $test_link = $arv->{'links'}->{'update'}->execute(
-        'uuid' => $test_link->{'uuid'},
-        'link' => { 'properties' => { 'foo' => 'bar' } });
-</code></pre>
-</notextile>
+If the SDK is installed, @perl -MArvados -e ''@ should produce no errors.
 
-Get a list of objects:
+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:
 
 <notextile>
-<pre><code class="userinput">my $repos = $arv->{'repositories'}->{'list'}->execute;
-print ("UUID of first repo returned is ", $repos->{'items'}->[0], "\n");
-</code></pre>
+<pre>~$ <code class="userinput">perl &lt;&lt;'EOF'
+use Arvados;
+my $arv = Arvados-&gt;new('apiVersion' => 'v1');
+my $me = $arv-&gt;{'users'}-&gt;{'current'}-&gt;execute;
+print ("arvados.v1.users.current.full_name = '", $me-&gt;{'full_name'}, "'\n");
+EOF</code>
+arvados.v1.users.current.full_name = 'Your Name'
+</pre>
 </notextile>
-
-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.