Skip to content

Commit 93d81c4

Browse files
author
Martin
committed
Initial commit
0 parents  commit 93d81c4

22 files changed

+1172
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.idea
2+
/vendor
3+
/*.php

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# vmware-php
2+
3+
A PHP wrapper for the VMWare API.
4+
5+
## Installation
6+
```
7+
composer require martinmulder/vmware-api
8+
```
9+
10+
## Guide
11+
Our VMWare API implementation contains the following features:
12+
- Simple login using application passwords.
13+
- Automatic retry functionionality that retries requests when connection errors or status codes >= 500 occur.
14+
- Direct function calls for much used api endpoints.
15+
- Easy syntax for all other endpoints using `$api->request($method, $uri, $json = [], $query = [])`.
16+
17+
```php
18+
// Create a new API instance, endpoint should end on "/rest/".
19+
$api = new \MartinMulder\VMWare\[Vcenter|Appliance|Inventory]IApi('https://vcenter.local/rest/');
20+
```
21+
22+
```php
23+
// LEGACY LOGIN WITH TOKEN
24+
$api->login('yourusername', 'yourpassword');
25+
```
26+
27+
Now your API should be ready to use:
28+
```php
29+
$vms = $api->getListOfVms();
30+
31+
foreach($vms as $vm) {
32+
var_dump($vm);
33+
}
34+
```
35+
36+
## Documentation
37+
- http://vmware.github.io/vsphere-automation-sdk-rest/6.5/

composer.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "martinmulder/vmware-api",
3+
"description": "A PHP implementation for the VMWare API",
4+
"keywords": [
5+
"vmware",
6+
"vcenter",
7+
"api",
8+
"martinmulder"
9+
],
10+
"homepage": "https://github.com/MartinMulder/vmware-php",
11+
"license": "MIT",
12+
"require": {
13+
"php": "7.*",
14+
"ext-json": "*",
15+
"guzzlehttp/guzzle": "6.*"
16+
},
17+
"autoload": {
18+
"psr-4": {
19+
"MartinMulder\\VMWare\\": "src"
20+
}
21+
},
22+
"minimum-stability": "stable",
23+
"config": {
24+
"sort-packages": true
25+
},
26+
"prefer-stable": true
27+
}

0 commit comments

Comments
 (0)