PHP code example of monogramm / proxmox-bundle

1. Go to this page and download the library: Download monogramm/proxmox-bundle 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/ */

    

monogramm / proxmox-bundle example snippets


    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Monogramm\ProxmoxBundle\MonogrammProxmoxBundle(),
            // ...
        );

        return $bundles;
    }

// ...

    public function nodesAction()
    {
        // Get all nodes
        $this
            ->get('proxmox')
            ->getNodes()
        ;

        // ...
    }

    public function createVmAction($targetnode, $id)
    {
        // Create an lxc container
        $this
            ->get('proxmox')
            ->create(
                "/nodes/$targetnode/lxc",
                [
                    'net0' => 'name=myct0,bridge=vmbr0',
                    'ostemplate' => 'local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz',
                    'vmid' => "$id",
                ]
            )
        ;

        // ...
    }


// ...