X-Git-Url: https://git.proxmox.com/?p=pve-apiclient.git;a=blobdiff_plain;f=examples%2Fexample1.pl;h=7f7b34445f08c8303e6ff66309dfca11c16a1ae1;hp=b0fedeedb4cdd405f24b583c484fe365e8f8c7c1;hb=adbda0b73e98c41dbb5771caa39f843b58e86116;hpb=d12f292e8a8dafe95eb850641154f99b7bbe4ce2 diff --git a/examples/example1.pl b/examples/example1.pl index b0fedee..7f7b344 100755 --- a/examples/example1.pl +++ b/examples/example1.pl @@ -1,9 +1,11 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # NOTE: you need to run this on a PVE host, or modify the source to # provide username/password/hostname from somewhere else. use strict; +use warnings; + use PVE::APIClient::LWP; use PVE::AccessControl; @@ -29,6 +31,6 @@ my $conn = PVE::APIClient::LWP->new( manual_verification => 1, ); -my $res = $conn->get("api2/json/", {}); +my $res = $conn->get("/", {}); print to_json($res, { pretty => 1, canonical => 1});