6 use PVE
::AccessControl
;
11 my $hostname = PVE
::INotify
::read_file
("hostname");
13 # normally you use username/password,
14 # but we can simply create a ticket and CRSF token if we are root
15 my $ticket = PVE
::AccessControl
::assemble_ticket
('root@pam');
16 my $csrftoken = PVE
::AccessControl
::assemble_csrf_prevention_token
('root@pam');
18 my $conn = PVE
::API2Client-
>new(
19 #username => 'root@pam',
20 #password => 'yourpassword',
22 csrftoken
=> $csrftoken,
26 my $res = $conn->get("api2/json/access/domains", {});
27 print "TEST: " . Dumper
($res);