]> git.proxmox.com Git - pve-apiclient.git/blob - examples/example3.pl
bump version to 3.3.2
[pve-apiclient.git] / examples / example3.pl
1 #!/usr/bin/perl
2
3 # NOTE: you need to set the API token and PVE host below for this to work
4
5 use strict;
6 use warnings;
7
8 use PVE::APIClient::LWP;
9
10 use JSON;
11
12 my $apitoken = 'PVEAPIToken=USER@REALM!TOKENID=TOKENVALUE';
13 my $hostname = "127.0.0.1";
14
15 my $conn = PVE::APIClient::LWP->new(
16 apitoken => $apitoken,
17 host => $hostname,
18 # allow manual fingerprint verification
19 manual_verification => 1,
20 );
21
22 my $res = $conn->get("/access/permissions", {});
23
24 print to_json($res, { pretty => 1, canonical => 1});