1. Go to this page and download the library: Download client-api/pbs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
client-api / pbs example snippets
ClientApi\Pbs\Configuration;
use ClientApi\Pbs\Pve;
$cfg = Configuration::getDefaultConfiguration()
->setHost('https://pbs1.example.com:8007/api2/json')
->setApiKey('Authorization', 'PBSAPIToken=user@realm!tokenid:uuid-secret');
$pve = new Pbs($cfg);
// Per-tag accessors are lazily instantiated and share the same Configuration.
$status = $pbs->qemu()->qemuVmStatus(node: 'pbs1', vmid: 100);
$nodes = $pbs->nodes()->nodesGetNodes();