-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.php
More file actions
36 lines (28 loc) · 820 Bytes
/
example.php
File metadata and controls
36 lines (28 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// Composer autoloading
if (file_exists(__DIR__.'/vendor/autoload.php')) {
$loader = include __DIR__.'/vendor/autoload.php';
}
define('API_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxx');
use Narno\Gandi\Api as GandiAPI;
try {
$api = new GandiAPI(true);
// account info
print_r($api->account->info([API_KEY]));
// PASS vhost list
print_r($api->paas->vhost->list([API_KEY]));
// PASS vhost info
print_r($api->paas->vhost->info([API_KEY, 'github.narno.org']));
// PASS create (generic) vhost
print_r($api->paas->vhost->create([
API_KEY,
[
'paas_id' => 00000,
'vhost' => time().'.narno.org',
'override' => false,
'zone_alter' => true,
],
]));
} catch (Exception $e) {
echo $e->getMessage();
}