restore XML-RPC fix, schedule import/export dummy backend
This commit is contained in:
parent
8a8ffc542c
commit
c078dbbaec
4 changed files with 580 additions and 10 deletions
|
@ -1047,7 +1047,7 @@ class GreenBox extends BasicStor{
|
||||||
|
|
||||||
/* ===================================================== restore funcitons*/
|
/* ===================================================== restore funcitons*/
|
||||||
/**
|
/**
|
||||||
* Restore a beckup file
|
* Restore a backup file
|
||||||
*
|
*
|
||||||
* @param sessid : string - session id
|
* @param sessid : string - session id
|
||||||
* @param filename : string - backup file path
|
* @param filename : string - backup file path
|
||||||
|
@ -1081,9 +1081,7 @@ class GreenBox extends BasicStor{
|
||||||
* Close a restore procedure
|
* Close a restore procedure
|
||||||
*
|
*
|
||||||
* @param token : string - restore token
|
* @param token : string - restore token
|
||||||
* @return status : hasharray - fields:
|
* @return status : bool - is success
|
||||||
* token: string - restore token
|
|
||||||
* status: string - working | fault | success
|
|
||||||
*/
|
*/
|
||||||
function backupRestoreClose($token) {
|
function backupRestoreClose($token) {
|
||||||
require_once 'Restore.php';
|
require_once 'Restore.php';
|
||||||
|
@ -1091,6 +1089,97 @@ class GreenBox extends BasicStor{
|
||||||
if (PEAR::isError($rs)) return $rs;
|
if (PEAR::isError($rs)) return $rs;
|
||||||
return $rs->closeRestore($token);
|
return $rs->closeRestore($token);
|
||||||
}
|
}
|
||||||
|
/*===================================================== scheduler methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open schedule import
|
||||||
|
*
|
||||||
|
* @param filename : string - import file
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
*/
|
||||||
|
function scheduleImportOpen($sessid,$filename) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->openImport($sessid,$filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check status of schedule import
|
||||||
|
*
|
||||||
|
* @param token : string - schedule import token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
* status: string - working | fault | success
|
||||||
|
*/
|
||||||
|
function scheduleImportCheck($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->checkImport($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close schedule import
|
||||||
|
*
|
||||||
|
* @param token : string - schedule import token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
*/
|
||||||
|
function scheduleImportClose($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->closeImport($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open schedule export
|
||||||
|
*
|
||||||
|
* @param sessid : string - schedule import token
|
||||||
|
* @param criteria : struct - see search criteria
|
||||||
|
* @param fromTime : time - begining time of schedule export
|
||||||
|
* @param toTime : time - ending time of schedule export
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
*/
|
||||||
|
function scheduleExportOpen($sessid,$criteria,$fromTime,$toTime) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->openExport($sessid,$criteria,$fromTime,$toTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check status of schedule export
|
||||||
|
*
|
||||||
|
* @param token : string - schedule export token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
* status: string - working | fault | success
|
||||||
|
* file : string - exported file location (available if status is success)
|
||||||
|
*/
|
||||||
|
function scheduleExportCheck($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->checkExport($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close schedule export
|
||||||
|
*
|
||||||
|
* @param token : string - schedule export token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
*/
|
||||||
|
function scheduleExportClose($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->closeExport($token);
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================================== methods for preferences */
|
/* ============================================== methods for preferences */
|
||||||
|
|
||||||
|
|
|
@ -1054,6 +1054,97 @@ class LocStor extends BasicStor{
|
||||||
return $rs->closeRestore($token);
|
return $rs->closeRestore($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===================================================== scheduler methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open schedule import
|
||||||
|
*
|
||||||
|
* @param filename : string - import file
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
*/
|
||||||
|
function scheduleImportOpen($sessid,$filename) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->openImport($sessid,$filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check status of schedule import
|
||||||
|
*
|
||||||
|
* @param token : string - schedule import token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
* status: string - working | fault | success
|
||||||
|
*/
|
||||||
|
function scheduleImportCheck($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->checkImport($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close schedule import
|
||||||
|
*
|
||||||
|
* @param token : string - schedule import token
|
||||||
|
* @return hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
*/
|
||||||
|
function scheduleImportClose($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->closeImport($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open schedule export
|
||||||
|
*
|
||||||
|
* @param sessid : string - schedule import token
|
||||||
|
* @param criteria : struct - see search criteria
|
||||||
|
* @param fromTime : time - begining time of schedule export
|
||||||
|
* @param toTime : time - ending time of schedule export
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
*/
|
||||||
|
function scheduleExportOpen($sessid,$criteria,$fromTime,$toTime) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->openExport($sessid,$criteria,$fromTime,$toTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check status of schedule export
|
||||||
|
*
|
||||||
|
* @param token : string - schedule export token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
* status: string - working | fault | success
|
||||||
|
*/
|
||||||
|
function scheduleExportCheck($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->checkExport($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close schedule export
|
||||||
|
*
|
||||||
|
* @param token : string - schedule export token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
*/
|
||||||
|
function scheduleExportClose($token) {
|
||||||
|
require_once 'Schedule.php';
|
||||||
|
$sc = new Schedule($this);
|
||||||
|
if (PEAR::isError($sc)) return $sc;
|
||||||
|
return $sc->closeExport($token);
|
||||||
|
}
|
||||||
|
|
||||||
/*===================================================== auxiliary methods */
|
/*===================================================== auxiliary methods */
|
||||||
/**
|
/**
|
||||||
* Dummy method - only returns livesupport version
|
* Dummy method - only returns livesupport version
|
||||||
|
|
104
livesupport/src/modules/storageServer/var/Schedule.php
Normal file
104
livesupport/src/modules/storageServer/var/Schedule.php
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<?php
|
||||||
|
class Schedule
|
||||||
|
{
|
||||||
|
function Schedule() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open schedule import
|
||||||
|
*
|
||||||
|
* @param filename : string - import file
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
*/
|
||||||
|
function openImport($sessid,$filename) {
|
||||||
|
return array ('token' => 'abcdef0123456789');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check status of schedule import
|
||||||
|
*
|
||||||
|
* @param token : string - schedule import token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
* status: string - working | fault | success
|
||||||
|
*/
|
||||||
|
function checkImport($token) {
|
||||||
|
if ($token == 'abcdef0123456789') {
|
||||||
|
return array(
|
||||||
|
'token' => $token,
|
||||||
|
'status' => 'working'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return PEAR::raiseError('Schedule::checkImport: invalid token');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close schedule import
|
||||||
|
*
|
||||||
|
* @param token : string - schedule import token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
*/
|
||||||
|
function closeImport($token) {
|
||||||
|
if ($token == 'abcdef0123456789') {
|
||||||
|
return array(
|
||||||
|
'token' => $token
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return PEAR::raiseError('Schedule::closeImport: invalid token');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open schedule export
|
||||||
|
*
|
||||||
|
* @param sessid : string - schedule import token
|
||||||
|
* @param criteria : struct - see search criteria
|
||||||
|
* @param fromTime : time - begining time of schedule export
|
||||||
|
* @param toTime : time - ending time of schedule export
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
*/
|
||||||
|
function openExport($sessid,$criteria,$fromTime,$toTime) {
|
||||||
|
return array ('token' => '123456789abcdef0');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check status of schedule export
|
||||||
|
*
|
||||||
|
* @param token : string - schedule export token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
* status: string - working | fault | success
|
||||||
|
* file : string - exported file location (available if status is success)
|
||||||
|
*/
|
||||||
|
function checkExport($token) {
|
||||||
|
if ($token == '123456789abcdef0') {
|
||||||
|
return array(
|
||||||
|
'token' => $token,
|
||||||
|
'status' => 'working'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
PEAR::raiseError('Schedule::checkExport: invalid token');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close schedule export
|
||||||
|
*
|
||||||
|
* @param token : string - schedule export token
|
||||||
|
* @return status : hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
*/
|
||||||
|
function closeExport($token) {
|
||||||
|
if ($token == '123456789abcdef0') {
|
||||||
|
return array(
|
||||||
|
'token' => $token
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
PEAR::raiseError('Schedule::closeExport: invalid token');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
|
@ -1937,7 +1937,7 @@ class XR_LocStor extends LocStor{
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------ restore methods */
|
/* ------------------------------------------------------ restore methods */
|
||||||
/**
|
/**
|
||||||
* Open writable URL for restore a backup file
|
* Open restore a backup file
|
||||||
*
|
*
|
||||||
* The XML-RPC name of this method is "locstor.restoreBackupOpen".
|
* The XML-RPC name of this method is "locstor.restoreBackupOpen".
|
||||||
*
|
*
|
||||||
|
@ -1950,7 +1950,6 @@ class XR_LocStor extends LocStor{
|
||||||
*
|
*
|
||||||
* On success, returns a XML-RPC struct with following fields:
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li> url : string - writable url</li>
|
|
||||||
* <li> token : string - PUT token</li>
|
* <li> token : string - PUT token</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
|
@ -1980,7 +1979,6 @@ class XR_LocStor extends LocStor{
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return new XML_RPC_Response(XML_RPC_encode(array(
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
'url'=>$res['url'],
|
|
||||||
'token'=>$res['token'],
|
'token'=>$res['token'],
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
@ -1998,7 +1996,9 @@ class XR_LocStor extends LocStor{
|
||||||
*
|
*
|
||||||
* On success, returns a XML-RPC struct with following fields:
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li> status : string - status</li>
|
* <li> status : hasharray - fields:
|
||||||
|
* token: string - restore token
|
||||||
|
* status: string - working | fault | success</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* On errors, returns an XML-RPC error response.
|
* On errors, returns an XML-RPC error response.
|
||||||
|
@ -2015,7 +2015,7 @@ class XR_LocStor extends LocStor{
|
||||||
* @return XMLRPC struct
|
* @return XMLRPC struct
|
||||||
* @see LocStor::restoreBackupCheck
|
* @see LocStor::restoreBackupCheck
|
||||||
*/
|
*/
|
||||||
function restoreBackupCheck($input)
|
function xr_restoreBackupCheck($input)
|
||||||
{
|
{
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
if(!$ok) return $r;
|
if(!$ok) return $r;
|
||||||
|
@ -2027,7 +2027,7 @@ class XR_LocStor extends LocStor{
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return new XML_RPC_Response(XML_RPC_encode(array(
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
'gunid'=>$res,
|
'status'=>$res,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2077,6 +2077,292 @@ class XR_LocStor extends LocStor{
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===================================================== scheduler methods */
|
||||||
|
/**
|
||||||
|
* Open import a schedule export file
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.scheduleImportOpen".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> sessid : string - session id </li>
|
||||||
|
* <li> chsum : string - md5 checksum of backup file</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> token : string - PUT token</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_restoreBackupOpen:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::scheduleImportOpen
|
||||||
|
*/
|
||||||
|
function xr_scheduleImportOpen($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->scheduleImportOpen($r['sessid'], $r['chsum']);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_scheduleImportOpen: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
|
'token'=>$res['token'],
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the state of schedule importing
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.scheduleImportCheck".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> token : string - access token </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> status : hasharray - fields:
|
||||||
|
* token: string - schedule import token
|
||||||
|
* status: string - working | fault | success</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_restoreBackupCheck:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::scheduleImportCheck
|
||||||
|
*/
|
||||||
|
function xr_scheduleImportCheck($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->scheduleImportCheck($r['token']);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_scheduleImportCheck: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
|
'status'=>$res,
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close import schedule
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.scheduleImportClose".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> token : string - access token </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> status : string - status</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_restoreBackupClose:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::scheduleImportClose
|
||||||
|
*/
|
||||||
|
function xr_scheduleImportClose($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->scheduleImportClose($r['token']);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_restoreBackupClose: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
|
'gunid'=>$res,
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open export schedule
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.scheduleExportOpen".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> sessid : string - session id </li>
|
||||||
|
* <li> criteria : struct - see search criteria</li>
|
||||||
|
* <li> fromTime : time - begining time of schedule export</li>
|
||||||
|
* <li> toTime : time - ending time of schedule export</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> hasharray - fields:
|
||||||
|
* token: string - schedule export token</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_restoreBackupOpen:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::scheduleExportOpen
|
||||||
|
*/
|
||||||
|
function xr_scheduleExportOpen($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->scheduleImportOpen($r['sessid'], $r['criteria'], $r['fromTime'], $r['toTime']);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_scheduleImportOpen: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
|
'token'=>$res['token'],
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the state of schedule export
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.scheduleExportCheck".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> token : string - schedule export token </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> status: hasharray - fields:
|
||||||
|
* token: string - schedule export token
|
||||||
|
* status: string - working | fault | success</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_restoreBackupCheck:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::scheduleExportCheck
|
||||||
|
*/
|
||||||
|
function xr_scheduleExportCheck($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->scheduleExportCheck($r['token']);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_scheduleExportCheck: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
|
'status'=>$res,
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close export schedule
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.scheduleExportClose".
|
||||||
|
*
|
||||||
|
* The input parameters are an XML-RPC struct with the following
|
||||||
|
* fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> token : string - access token </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> status : string - status</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_restoreBackupClose:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see LocStor::scheduleExportClose
|
||||||
|
*/
|
||||||
|
function xr_scheduleExportClose($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->scheduleExportClose($r['token']);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_restoreBackupClose: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(XML_RPC_encode(array(
|
||||||
|
'status'=>$res,
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
/*========================================================== info methods */
|
/*========================================================== info methods */
|
||||||
/**
|
/**
|
||||||
* Check if audio clip exists and return TRUE/FALSE
|
* Check if audio clip exists and return TRUE/FALSE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue