Incoming APIs are used to control objects in the Morro Data system such as shares or CacheDrives through 3rd party applications like Veeam.


Supported objects:

  • Replicate Share
  • Archive Share
  • CacheDrives


The API include two parts:

  • Endpoint: A url specifying which object will be the target to control. 
  • Command: Specifies the action.


An endpoint and command will be assembled like below format:

https://biggerinside.morrodata.com/xapi/a534dd11d1048929408b4ad701288ea6?cmd=sync-now


Commands


Shares

  • sync-now
  • check-progress

 

sync-now

Triggers a replicate or archive sync. The command has the same effect as clicking “SYNC NOW” button in the Replicate/Archive share “SCHEDULE” page. 


Return:

None


Return Code:
None


check-progress

Checks the status of the replicate or archive share job.


Return:

ssync_busy


Return Codes:

1. “running” means job is in progress.

2. “pending” means job is queued and waiting to run.

3. ”not running” means no jobs are active.


Example:

{"ssync_busy":"busy doing"}


CacheDrive

  • power-off
  • Firmware-update


power-off

Shuts down the CacheDrive.


Return:

None


Return Code:
None


firmware-update

Triggers a firmware update.


Return:

"error", "result"


Return Codes:

If CacheDrive is already the latest version:

{"error":true,"result":{"emsg":"Current 4.2.0-Build4686 has been the latest!"}}


Examples


Scripts

Customer can write script to control share or CacheDrive via Incoming API, below are two examples for Powershell and Linux. These two scripts will trigger share to run job.


PowerShell:

pre-freeze.ps1

$endpoint = "https://biggerinside.morrodata.com/xapi/d8559e571b8e4be1171fdca6b4f733dc"
$resp = Invoke-RestMethod "$($endpoint)?cmd=sync-now" -Method Get
If ($resp.error) {
  Write-Host "Error to communicate with Morro API"
}


Linux:

pre-freeze.sh

endpoint = https://biggerinside.morrodata.com/xapi/d8559e571b8e4be1171fdca6b4f733dc
wget –no-check-certificate –q -O /dev/null “${endpoint}?cmd=sync-now”


  

Applications

For third-party applications, like Veeam, that support scripts, admins can run commands in Morro Data. 


Veeam allows jobs to be run before or after a backup job.  Use a script to execute the API from Veeam. 


In the example below, the the powershell script is run after a Veeam backup job completed to start the Replicate or Archive share "SYNC NOW".