Super backup: create
Request
HTTP request
POST /super-backup/v1/c/<cloudId> HTTP/1.1
Parameters
Property name | Value | Description |
---|---|---|
cloudId | string | ID of cloud which we want to backup |
Request Body
Property name | Value | Description |
---|---|---|
Required properties | ||
target | target resource | Backup target |
copyDelay | unsigned int | Delay for copying images [sec] |
Optional properties | ||
deleteDelay | unsigned int/null | Delay for deleting images [sec] after backing up, no deletion if null |
logLife | unsigned int | Days to keep the backup log [days] |
Response
If successful, this method returns a Super Backup resource in the response body.
Response HTTP status code
HTTP status code | Description |
---|---|
200 | Success, returns with super backup resource |
For more information about HTTP codes, click here.
Rate limit
Detailed information for cloud rate limitation is available on Shardimage developers.
SDK
use shardimage\shardimagephp\auth\Client;
use shardimage\shardimagephp\models\cloud\Cloud;
use shardimage\shardimagephp\models\superbackup\SuperBackup;
use shardimage\shardimagephp\models\superbackup\targets\CloudinaryTarget;
$client = new Client([
'apiKey' => '<apiKey>',
'apiSecret' => '<apiSecret>',
'imageSecret' => '<imageSecret>',
]);
try {
$cloud = $client->getCloudService()->view('<cloudId>');
$target = new CloudinaryTarget();
$target->cloudName = '<cloudName>';
$target->apiKey = '<apiKey>';
$target->apiSecret = '<apiSecret>';
$superBackup = new SuperBackup();
$superBackup->cloud = $cloud;
$superBackup->copyDelay = 0;
$superBackup->logLife = 1;
$superBackup->target = $target;
$result = $client->getSuperBackupService()->create($superBackup);
} catch (\Exception $ex) {
// Handle error
}