1. Go to this page and download the library: Download client-api/pve 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 / pve example snippets
ClientApi\Pve\Configuration;
use ClientApi\Pve\Pve;
$cfg = Configuration::getDefaultConfiguration()
->setHost('https://pve1.example.com:8006/api2/json')
->setApiKey('Authorization', 'PVEAPIToken=user@realm!tokenid=uuid-secret');
$pve = new Pve($cfg);
// Per-tag accessors are lazily instantiated and share the same Configuration.
$status = $pve->qemu()->qemuVmStatus(node: 'pve1', vmid: 100);
$nodes = $pve->nodes()->nodesGetNodes();