]>
Commit | Line | Data |
---|---|---|
7b6f8f1d FG |
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}); |