X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ebb166d65eb37f89edeccfc5be97014f3f2a73e2..72007cdcdcc228f1ba04b6963fdd9864b30bf281:/doc/sdk/perl/index.html.textile.liquid diff --git a/doc/sdk/perl/index.html.textile.liquid b/doc/sdk/perl/index.html.textile.liquid index 448cbb1ede..407008d1f7 100644 --- a/doc/sdk/perl/index.html.textile.liquid +++ b/doc/sdk/perl/index.html.textile.liquid @@ -2,8 +2,7 @@ layout: default navsection: sdk navmenu: Perl -title: "Perl SDK" - +title: "Installation" ... The Perl SDK provides a generic set of wrappers so you can make API calls easily. @@ -15,85 +14,51 @@ It should be treated as alpha/experimental. Currently, limitations include: h3. Installation - -
-$ sudo apt-get install libjson-perl libio-socket-ssl-perl libwww-perl libipc-system-simple-perl
-$ git clone https://github.com/curoverse/arvados.git
-$ cd arvados/sdk/perl
-$ perl Makefile.PL
-$ sudo make install
-
-
+h4. Option 1: Install from distribution packages -h4. Test installation +First, "add the appropriate package repository for your distribution":{{ site.baseurl }}/install/install-manual-prerequisites.html#repos. -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: +On Debian-based systems: -
$ perl <<'EOF'
-use Arvados;
-my $arv = Arvados->new('apiVersion' => 'v1');
-my $me = $arv->{'users'}->{'current'}->execute;
-print ("arvados.v1.users.current.full_name = '", $me->{'full_name'}, "'\n");
-EOF
-arvados.v1.users.current.full_name = 'Your Name'
-
-
- -h3. Examples - -Set up an API client user agent: - - -
my $arv = Arvados->new('apiVersion' => 'v1');
+
~$ sudo apt-get install libjson-perl libio-socket-ssl-perl libwww-perl libipc-system-simple-perl libarvados-perl
 
-Get the User object for the current user: +On Red Hat-based systems: -
my $current_user = $arv->{'users'}->{'current'}->execute;
+
~$ sudo yum install perl-ExtUtils-MakeMaker perl-JSON perl-IO-Socket-SSL perl-Crypt-SSLeay perl-WWW-Curl libarvados-perl
 
-Get the UUID of an object that was retrieved using the SDK: +h4. Option 2: Install from source - -
my $current_user_uuid = $current_user->{'uuid'}
-
-
- -Retrieve an object by ID: - - -
my $some_user = $arv->{'users'}->{'get'}->execute('uuid' => $current_user_uuid);
-
-
+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: -
my $test_link = $arv->{'links'}->{'create'}->execute('link' => { 'link_class' => 'test', 'name' => 'test' });
+
~$ git clone https://github.com/curoverse/arvados.git
+~$ cd arvados/sdk/perl
+~$ perl Makefile.PL
+~$ sudo make install
 
-Update an object: +h3. Test installation - -
my $test_link = $arv->{'links'}->{'update'}->execute(
-        'uuid' => $test_link->{'uuid'},
-        'link' => { 'properties' => { 'foo' => 'bar' } });
-
-
+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: -
my $repos = $arv->{'repositories'}->{'list'}->execute;
-print ("UUID of first repo returned is ", $repos->{'items'}->[0], "\n");
-
+
~$ perl <<'EOF'
+use Arvados;
+my $arv = Arvados->new('apiVersion' => 'v1');
+my $me = $arv->{'users'}->{'current'}->execute;
+print ("arvados.v1.users.current.full_name = '", $me->{'full_name'}, "'\n");
+EOF
+arvados.v1.users.current.full_name = 'Your Name'
+
- -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.