Description
You can call this operation to immediately back up a cluster.
Call description
Prerequisites
You have the Create permission on cluster backup and recovery.
You have passed the authentication for the OCP application service.
Request path
POST /api/v2/ob/clusters/{id}/backup/backupNow
path:
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The ID of the cluster for which you want to create a backup. |
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| obBackupObject | Object | No | N/A | The backup object, which will be automatically populated. |
| backupMode | String | Yes | LOGICAL_BACKUP | The backup mode. Valid values: * LOGICAL_BACKUP * PHYSICAL_BACKUP |
| dataBackupMode | String | Yes | FULL_BACKUP | The data backup mode. Valid values: FULL_BACKUP and INCREMENTAL_BACKUP |
| obBackupServiceStorageConfig | Object | Yes | N/A | The storage configurations of the backup service. For more information, see the data structure in Create a backup strategy for a cluster. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The common response parameters for backup objects. For more information, see BackupCommonResponse. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of BackupCommonResponse
| Parameter | Type | Description |
|---|---|---|
| obBackupTaskType | String | The backup operation type, for example, CREATE_BACKUP_STRATEGY. |
| backupObjectOpsResultList | Array | The operation result set of the backup object. |
| |--obBackupObjectList | Array | The list of information returned for the backup object. |
| |--clusterId | Long | The ID of the cluster. |
| |--tenantId | Long | The ID of the tenant. |
| |--backupDimension | String | The backup dimension. Valid values: * CLUSTER * TENANT CLUSTER represents cluster backup and TENANT represents tenant backup. Tenant backup is not supported. |
| |--beSuccessful | Boolean | Indicates whether the operation was successful. |
| |--taskIdList | Array | The list of task numbers returned for asynchronous tasks. |
| |--errorCode | Object | The error code. |
| |--hint | String | The prompt information. |
Examples
Sample request
{
"obBackupObject": {
"clusterId": 8,
"backupDimension": "CLUSTER"
},
"dataBackupMode": "FULL_BACKUP",
"obBackupServiceStorageConfig": {
"alarmStoragePercentageThreshold": 95,
"configName": "ycnfs223_0915",
"obBackupStorageBaseInfo": {
"backupStorageType": "BACKUP_STORAGE_FILE",
"storageUrl": "/obbackup/"
},
"serviceName": "ycfor223",
"storageId": 26
}
}
Sample response
{
"data": {
"backupObjectOpsResultList": [
{
"beSuccessful": true,
"obBackupObjectList": [
{
"backupDimension": "CLUSTER",
"clusterId": 1000005
}
],
"taskIdList": [
3000041
]
}
],
"obBackupTaskType": "DATA_BACKUP_NOW"
},
"duration": 51,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-07T14:51:41.135+08:00",
"traceId": "5962f337662d4043"
}