PHP code example of klauke-enterprises / proxmoxve
1. Go to this page and download the library: Download klauke-enterprises/proxmoxve 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/ */
klauke-enterprises / proxmoxve example snippets
// Require the autoloader
e ProxmoxVE\Proxmox;
// Then simply pass your credentials when creating the API client object.
$proxmox = new Proxmox(
"[email protected]!myTokenId", // Your API Token Id
"9bb6dea8-b41b-479d-806f-cfd86f983f67" // Your API Token Secret
);
$allNodes = $proxmox->get('/nodes');
print_r($allNodes);
Array
(
[data] => Array
(
[0] => Array
(
[disk] => 2539465464
[cpu] => 0.031314446882002
[maxdisk] => 30805066770
[maxmem] => 175168446464
[node] => mynode1
[maxcpu] => 24
[level] =>
[uptime] => 139376
[id] => node/mynode1
[type] => node
[mem] => 20601992182
)
)
)