1. Go to this page and download the library: Download lehuizi/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/ */
lehuizi / proxmoxve example snippets
// Require the autoloader
e ProxmoxVE\Proxmox;
// Create your credentials array
$credentials = [
'hostname' => 'proxmox.server.com', // Also can be an IP Address
'username' => 'root',
'password' => 'secret',
];
// Realm and port defaults to 'pam' and '8006' but you can specify them like so
$credentials = [
'hostname' => 'proxmox.server.com',
'username' => 'root',
'password' => 'secret',
'realm' => 'pve',
'port' => '9009',
];
// It is also possible to authenticate against your proxmox server using api tokens
$credentials = [
'hostname' => 'proxmox.server.com',
'username' => 'root',
'token_name' => 'mytoken',
'token_value' => '00000-00000-000000000000'
];
// Then simply pass your credentials when creating the API client object.
$proxmox = new Proxmox($credentials);
$nodes = $proxmox->get('/nodes');
print_r($nodes);