Download the PHP package alexisducastel/pve2api without Composer

On this page you can find all versions of the php package alexisducastel/pve2api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pve2api

This class implements a simple PHP client for Proxmox API (version 2 or later).

See http://pve.proxmox.com/wiki/Proxmox_VE_API for information about how this API works. API spec available at http://pve.proxmox.com/pve2-api-doc/

Requirements:

PHP 5 with cURL (including SSL) support.

Usage:

Example - Return status array for each Proxmox Host in this cluster.

# use composer autoloader
require_once __DIR__."/vendor/autoload.php";

$api=new PVE\Api\Client('hostname');

# realm can be pve, pam or any other realm available.
$api->login('login','realm','password');

foreach ($api->get_node_list() as $node_name) {
    print_r($api->get("/nodes/".$node_name."/status"));
}

Example - Create a new OpenVZ Container on the first host in the cluster.

# use composer autoloader
require_once __DIR__."/vendor/autoload.php";

$api=new PVE\Api\Client('hostname');

# realm can be pve, pam or any other realm available.
$api->login('login','realm','password');

# Get first node name.
$nodes = $api->get_node_list();

# Create a VZ container on the first node in the cluster.
$new_container_settings = array();
$new_container_settings['ostemplate'] = "local:vztmpl/debian-6.0-standard_6.0-4_amd64.tar.gz";
$new_container_settings['vmid'] = "1234";
$new_container_settings['cpus'] = "2";
$new_container_settings['description'] = "Test VM using Proxmox 2.0 API";
$new_container_settings['disk'] = "8";
$new_container_settings['hostname'] = "testapi.domain.tld";
$new_container_settings['memory'] = "1024";
$new_container_settings['nameserver'] = "8.8.8.8";

print_r($api->post("/nodes/".$nodes[0]."/openvz", $new_container_settings));

Example - Modify DNS settings on an existing container on the first host.

# use composer autoloader
require_once __DIR__."/vendor/autoload.php";

$api=new PVE\Api\Client('hostname');

# realm can be pve, pam or any other realm available.
$api->login('login','realm','password');

# Get first node name.
$nodes = $api->get_node_list();
$openvzId = "100";

# Update container settings.
$container_settings = array();
$container_settings['nameserver'] = "4.2.2.2";

var_dump($api->put("/nodes/".$first_node."/openvz/".$openvzId."/config", $container_settings));

Example - Delete an existing container.

# use composer autoloader
require_once __DIR__."/vendor/autoload.php";

$api=new PVE\Api\Client('hostname');

# realm can be pve, pam or any other realm available.
$api->login('login','realm','password');

# Get first node name.
$nodes = $api->get_node_list();
$openvzId = "100";

var_dump($api->delete("/nodes/".$nodes[0]."/openvz/".$openvzId));

Licensed under the MIT License. See LICENSE file.


All versions of pve2api with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alexisducastel/pve2api contains the following files

Loading the files please wait ....