PBX API : POST /Events/Upgrade/

For remote upgrade PBX from Portal, make an HTTP POST request with basic authorization (SERIAL and IDENTITY as user/password), resource URI:

http(s)://{PBX}/api/v1/Events/Upgrade/
 

Response example:

POST http(s)://<PBX>/api/v1/Events/Upgrade/
Status code: 200
$responseData = array(
  'type' => 'result',
  'result' => 'DONE',
);

 

On this event PBX start background script:

/usr/sbin/autoupgrade.php from_portal 1>/dev/null 2>/dev/null

Script will ask Portal to configuration for upgrade (repository and email for notifications) and if data were received will start upgrade

Portal response:

On Success:

Status code: 200
$responseData = array(
  'type' => 'result',
  'result' => array(
		'repo' => 'rel380',  // repository name 
		'email' => 'alexander.soloviov@wildix.com',  // email for send notification about upgrade
              ),
);

On Error:
Status code: 500

responseData = array(
  'type' => 'error',
  'result' => array(
		'reason' => 'what exactly happened',   
		'code' => 500,
              ),
);