Skip to content

Commit 0184f76

Browse files
author
cp6
committed
Updated readme
Updated readme for composer support
1 parent c9a188a commit 0184f76

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

README.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,54 @@
1-
# Vultr API PHP class wrapper
1+
# Vultr API v2 PHP class wrapper
22

33

4-
Simple to use PHP class built for the [Vultr API](https://www.vultr.com/api). Do all server actions along with account services like Block storage, backups, DNS, network, snapshots, Custom ISO's saved ip addresses and more.
4+
Simple to use PHP class built for the [Vultr API](https://www.vultr.com/api). Updated for the API v2! Do all server actions along with account services like Block storage, backups, DNS, network, snapshots, Custom ISO's saved ip addresses and more.
55

6-
### Version
76

8-
1.0 Initial release 18/4/2020
7+
### Usage
8+
9+
Install with:
10+
```
11+
composer require corbpie/vultr-api-v2
12+
```
13+
14+
Use like:
15+
```php
16+
<?php
17+
require __DIR__ . '/vendor/autoload.php';
18+
19+
use Corbpie\VultrAPIv2\VultrAPI;
20+
21+
$vultr = new VultrAPI();
22+
23+
echo $vultr->listServers();
24+
```
25+
26+
### Current version
27+
28+
2.0 Initial release (API v2) 7 Nov 2020
929

1030
### Requires
1131

1232
Vultr API key obtained form your Vultr account menu.
1333

34+
Add the Vultr API key line 7: ```src/class.php```
35+
1436
### Examples
1537

38+
List all instances:
1639

40+
```php
41+
$vultr->listServers();
1742
```
18-
example.php
19-
```
43+
44+
Create a server
45+
46+
```php
47+
$vultr->serverCreateDC(19);//Sydney Australia location
48+
$vultr->serverCreatePlan(202);//(2048 MB RAM,55 GB SSD,2.00 TB BW)
49+
$vultr->serverCreateType('ISO', 146817);//Deploy with my custom ISO id:146817
50+
$vultr->serverCreateLabel('Created with API');//label instance as "Created with API"
51+
echo $vultr->serverCreate();//Creates instance/server with parameters set above (returns subid)
52+
```
53+
54+
See ```example.php``` for more.

0 commit comments

Comments
 (0)