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