X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eae48c31bb338689ec67fbc6a14a2e0b1fb5e3b6..731c5e81f5aedc82d03786670610bde68bba27c7:/doc/sdk/perl/example.html.textile.liquid?ds=sidebyside
diff --git a/doc/sdk/perl/example.html.textile.liquid b/doc/sdk/perl/example.html.textile.liquid
index 980129cf13..b51cfe4cb5 100644
--- a/doc/sdk/perl/example.html.textile.liquid
+++ b/doc/sdk/perl/example.html.textile.liquid
@@ -4,17 +4,20 @@ navsection: sdk
navmenu: Perl
title: "Examples"
...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
h2. Initialize SDK
Set up an API client user agent:
-
-
+{% codeblock as perl %}
use Arvados;
my $arv = Arvados->new('apiVersion' => 'v1');
-
-
+{% endcodeblock %}
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.
@@ -22,60 +25,53 @@ h2. create
Create an object:
-
-my $test_link = $arv->{'links'}->{'create'}->execute('link' => { 'link_class' => 'test', 'name' => 'test' });
-
-
+{% codeblock as perl %}
+my $test_link = $arv->{'links'}->{'create'}->execute('link' => { 'link_class' => 'test', 'name' => 'test' });
+{% endcodeblock %}
h2. delete
-
-my $some_user = $arv->{'collections'}->{'get'}->execute('uuid' => $collection_uuid);
-
-
+{% codeblock as perl %}
+my $some_user = $arv->{'collections'}->{'get'}->execute('uuid' => $collection_uuid);
+{% endcodeblock %}
h2. get
Retrieve an object by ID:
-
-my $some_user = $arv->{'users'}->{'get'}->execute('uuid' => $current_user_uuid);
-
-
+{% codeblock as perl %}
+my $some_user = $arv->{'users'}->{'get'}->execute('uuid' => $current_user_uuid);
+{% endcodeblock %}
Get the UUID of an object that was retrieved using the SDK:
-
-my $current_user_uuid = $current_user->{'uuid'}
-
-
+{% codeblock as perl %}
+my $current_user_uuid = $current_user->{'uuid'}
+{% endcodeblock %}
h2. list
Get a list of objects:
-
-my $repos = $arv->{'repositories'}->{'list'}->execute;
+{% codeblock as perl %}
+my $repos = $arv->{'repositories'}->{'list'}->execute;
print ("UUID of first repo returned is ", $repos->{'items'}->[0], "\n");
-
-
+{% endcodeblock %}
h2. update
Update an object:
-
-my $test_link = $arv->{'links'}->{'update'}->execute(
+{% codeblock as perl %}
+my $test_link = $arv->{'links'}->{'update'}->execute(
'uuid' => $test_link->{'uuid'},
'link' => { 'properties' => { 'foo' => 'bar' } });
-
-
+{% endcodeblock %}
h2. Get current user
Get the User object for the current user:
-
-my $current_user = $arv->{'users'}->{'current'}->execute;
-
-
+{% codeblock as perl %}
+my $current_user = $arv->{'users'}->{'current'}->execute;
+{% endcodeblock %}