-
Notifications
You must be signed in to change notification settings - Fork 3
/
ahsay-api-wrapper-example.php
38 lines (29 loc) · 1.39 KB
/
ahsay-api-wrapper-example.php
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
37
38
<?php
require 'ahsay-api-wrapper.php';
const BACKUPSERVER_ADDRESS = 'http://ahsay.server.com';
const BACKUPSERVER_ADMINUSER = 'adminuser';
const BACKUPSERVER_ADMINPASSWORD = 'password';
const BACKUPSERVER_VERSION = 'OBSversion';
try {
$api = new AhsayApiWrapper(BACKUPSERVER_ADDRESS, BACKUPSERVER_ADMINUSER, BACKUPSERVER_ADMINPASSWORD, BACKUPSERVER_VERSION);
$api->debug(true);
$user = 'user01'; // Ahsay username
$backupSet = '1317401234567'; // Ahsay numeric backupset ID
$lastJobID = $api->getMostRecentBackupJob($user, $backupSet);
$lastJobDetailArray = $api->getUserBackupJobDetails($user, $backupSet, $lastJobID);
$DestinationID = $api->getDestinationID($user, $backupSet, $backupJob);
//var_dump($api->getUser($user));
//var_dump($api->getUSerBackupSet($user, $backupSet));
//var_dump($api->getUserStorageStats($user, $date));
//var_dump($api->getBackupJobsForSet($user, $backupSet));
//var_dump($api->getBackupSetJobIds($user, $backupSet));
//var_dump($api->listBackupJobStatus($user, $date));
//var_dump($api->getUserBackupJobs($user));
//var_dump($api->getMostRecentBackupJob($user, $backupset));
printf ('DestinationID: ' . $DestinationID . "\n\r");
printf('BackupJobStatus: '. $lastJobDetailArray->Data->BackupJobStatus . "\n");
printf('EndTime: '. $lastJobDetailArray->Data->EndTime . "\n");
} catch (Exception $e) {
echo $e->GetMessage();
}
?>