mtxserv / vmware-api
PHP library for interacting with the VMware Rest API.
Installs: 7 329
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Requires
- php: ^7.0|^8.0|^8.1
- guzzlehttp/guzzle: ^7.0
README
vSphere Api is a modern PHP library based on Guzzle for VMware Rest API.
Dependencies
- PHP 7 / 8
- Guzzle: ^7.0
Installation
Installation of VMware Rest Api is only officially supported using Composer:
composer require mtxserv/vmware-api
Example
<?php use VMware\VMwareClient; use GuzzleHttp\Exception\GuzzleException; $client = new VMwareClient([ 'base_uri' => 'https://my-pcc.ovh.com', 'vmware_user' => 'my_user', 'vmware_password' => 'my_password', ]); try { // Get VM list $response = $client->get('/rest/vcenter/vm'); // See: https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/api/vcenter/vm/get/ $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR); var_dump($json); } catch (GuzzleException $e) { var_dump($e->getMessage()); }