Examples

Initialize SDK

Set up an API client user agent:

use Arvados;
my $arv = Arvados->new('apiVersion' => 'v1');

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.

create

Create an object:

my $test_link = $arv->{'links'}->{'create'}->execute('link' => { 'link_class' => 'test', 'name' => 'test' });

delete

my $some_user = $arv->{'collections'}->{'get'}->execute('uuid' => $collection_uuid);

get

Retrieve an object by ID:

my $some_user = $arv->{'users'}->{'get'}->execute('uuid' => $current_user_uuid);

Get the UUID of an object that was retrieved using the SDK:

my $current_user_uuid = $current_user->{'uuid'}

list

Get a list of objects:

my $repos = $arv->{'repositories'}->{'list'}->execute;
print ("UUID of first repo returned is ", $repos->{'items'}->[0], "\n");

update

Update an object:

my $test_link = $arv->{'links'}->{'update'}->execute(
        'uuid' => $test_link->{'uuid'},
        'link' => { 'properties' => { 'foo' => 'bar' } });

Get current user

Get the User object for the current user:

my $current_user = $arv->{'users'}->{'current'}->execute;

Previous: Installation

The content of this documentation is licensed under the Creative Commons Attribution-Share Alike 3.0 United States licence.
Code samples in this documentation are licensed under the Apache License, Version 2.0.