mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-31 05:53:54 +00:00
26 lines
547 B
Perl
Executable File
26 lines
547 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
|
|
use strict;
|
|
use PVE::API2Client;
|
|
use PVE::AccessControl;
|
|
use PVE::INotify;
|
|
|
|
use Data::Dumper;
|
|
|
|
my $hostname = PVE::INotify::read_file("hostname");
|
|
|
|
# normally you use username/password,
|
|
# but we can simply create a ticket if we are root
|
|
my $ticket = PVE::AccessControl::assemble_ticket('root');
|
|
|
|
my $conn = PVE::API2Client->new(
|
|
#username => 'root',
|
|
#password => 'yourpassword',
|
|
ticket => $ticket,
|
|
host => $hostname,
|
|
);
|
|
|
|
my $res = $conn->get("api2/json/access/domains", {});
|
|
print "TEST: " . Dumper($res);
|