Query the backup strategy of a tenant

2025-03-21 06:01:07  Updated

Description

You can call this operation to query the backup strategy of a tenant.

Call description

Prerequisites

You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.

Request path

GET /api/v2/ob/clusters/{id}/tenants/{tenantId}/backup/config/backupStrategy

Request parameters

Path parameters

Parameter Type Required Example value Description
id Integer Yes 1002 The ID of the cluster.
tenantId Integer Yes 108 The ID of the tenant.

Response parameters

Basic data structure

Parameter Type Description
data Object The details of the backup strategy. For more information, see Data structure of OcpBackupStrategy.
successful Boolean Indicates whether the request was successful.
timestamp Datetime The timestamp when the server completed the request.
duration Integer The amount of time taken by the server to process the request, in milliseconds.
status Integer The 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 OcpBackupStrategy

Parameter Type Description
id Integer The ID of the backup strategy.
createTime String The time when the backup strategy was created.
updateTime String The time when the backup strategy was modified.
clusterName String The name of the cluster.
obClusterId Integer The ID of the OceanBase cluster.
clusterId Integer The ID of the cluster.
backupDimension String The backup dimension. For example, CLUSTER indicates cluster backup and TENANT indicates tenant backup.
tenantName String The name of the tenant.
obTenantId Integer The ID of the OceanBase Database tenant.
tenantId Integer The ID of the tenant.
type String The destination type of the backup.
obBackupServiceStorageConfig ObBackupServiceStorageConfig The backup storage configuration. For more information, see Data structure of ObBackupServiceStorageConfig.
backupMode String The backup mode. Valid values:
  • LOGICAL_BACKUP: indicates logical backup.
  • PHYSICAL_BACKUP: indicates physical backup.
  • serviceConfigName String The name of the service configuration.
    obBackupScheduleConfig ObBackupScheduleConfig The backup scheduling configuration. For more information, see Data structure of obBackupScheduleConfig.
    obBackupThresholdConfig ObBackupThresholdConfig The backup alert threshold configuration. For more information, see Data structure of ObBackupThresholdConfig.

    Data structure of ObBackupServiceStorageConfig

    Parameter Type Description
    configName String The name of the storage configuration.
    obBackupStorageBaseInfo ObBackupStorageBaseInfo The backup storage information. For more information, see Data structure of ObBackupStorageBaseInfo.
    alarmStoragePercentageThreshold Integer The threshold for backup storage capacity alerts. Set this parameter to a percentage value.
    storageId Integer The ID of the storage configuration.
    serviceType String The service type. Valid values:
  • BACKUP_RESTORE_SERVICE: indicates the backup and restore service (logical backup and restore).
  • OB_CLUSTER: indicates physical backup and restore for OceanBase clusters.
  • OTHERS: indicates other services.
  • serviceId Integer The service ID. When the service type is BACKUP_RESTORE_SERVICE, the value is the ID of the backup and restore service. When the service type is OB_CLUSTER, the value is a cluster ID.
    serviceName String The service name. When the service type is BACKUP_RESTORE_SERVICE, the value is the name of the backup and restore service. When the service type is OB_CLUSTER, the value is a cluster name.
    hostIdList Array The list of host IDs for host resolution in global restore. When the service type is BACKUP_RESTORE_SERVICE, the value is a list of host IDs of the backup and restore service. When the service type is OB_CLUSTER, the value is a list of IDs of hosts in a cluster.

    Data structure of ObBackupStorageBaseInfo

    Parameter Type Description
    backupStorageType String The storage type. Valid values: BACKUP_STORAGE_FILE, BACKUP_STORAGE_OSS, BACKUP_STORAGE_COS, and BACKUP_STORAGE_S3.
    storageUrl String The storage directory. Specify a directory without any protocol name, for example, /obbackup/ or osstest/backup.
    ossAccessKey OssAccessKey The information about Alibaba Cloud Object Storage Service (OSS). This parameter is valid only when backupStorageType is set to BACKUP_STORAGE_OSS. For more information, see Data structure of OssAccessKey.
    cosAccessKey CosAccessKey The information about Tencent Cloud Object Storage (COS). This parameter is valid only when backupStorageType is set to BACKUP_STORAGE_COS. For more information, see Data structure of CosAccessKey.
    s3AccessKey S3AccessKey The information about Amazon Simple Storage Service (S3). This parameter is valid only when backupStorageType is set to BACKUP_STORAGE_S3. For more information, see Data structure of S3AccessKey.

    Data structure of OssAccessKey

    Parameter Type Description
    endpoint String The domain name for access.
    accessKeyId String The AccessKey ID.
    accessKeySecret String The AccessKey secret.

    Data structure of CosAccessKey

    Parameter Type Description
    endpoint String The domain name for access.
    accessKeyId String The AccessKey ID.
    accessKeySecret String The AccessKey secret.
    appId String The application ID.

    Data structure of S3AccessKey

    Parameter Type Description
    endpoint String The domain name for access.
    accessKeyId String The AccessKey ID.
    accessKeySecret String The AccessKey secret.
    region String The region.

    Data structure of ObBackupScheduleConfig

    Parameter Type Description
    backupScheduleMode String The backup scheduling cycle. Valid values:
  • WEEK: indicates that backup is scheduled on a weekly basis.
  • MONTH: indicates that backup is scheduled on a monthly basis.
  • backupScheduleEnabled Boolean The backup switch.
    backupScheduleTime Object The scheduled backup time, for example, "02:00:00.000+08:00".
    dayAndDataBackupModelMap Object The backup schedule and data backup method. For example, { "2": "FULL_BACKUP", "4": "FULL_BACKUP", "6": "INCREMENTAL_BACKUP" } specifies to perform full data backup on Tuesday and Thursday and perform incremental data backup on Saturday.
    startLogBackup Boolean Specifies whether to start log backup at the same time. This parameter is usually set to true.
    cleanEnabled Boolean Specifies whether to delete expired data.
    backupDataRetentionDays Integer The retention period of backup data, in days. For example, the value 7 specifies to retain the backup data for at least seven days. This parameter takes effect only when cleanEnabled is set to true.
    cleanScheduleTime Object The scheduled time to delete expired data.

    Data structure of ObBackupThresholdConfig

    Parameter Type Description
    dataBackupTimeoutMinutes Long The timeout period for data backup, in minutes.
    noSuccessfulDataBackupAlarmDays Long The number of consecutive days exceeding which an alert for no successful backups is triggered.
    libObLogExpireDays Long The retention days of liboblog data. This parameter is valid only for logical backup.
    logBackupDelaySeconds Long The threshold for log backup delay alerts, in seconds.

    Examples

    Sample request

    GET /api/v2/ob/clusters/1000005/tenants/1000012/backup/config/backupStrategy

    Sample response

    {
      "data": {
            "backupDimension": "TENANT",
            "backupMode": "PHYSICAL_BACKUP",
            "clusterId": 1000005,
            "clusterName": "yc0820_17",
            "createTime": "2024-08-02T14:54:45.000+0800",
            "id": 1,
            "obBackupThresholdConfig": {
                "dataBackupTimeoutMinutes": 7,
                "logBackupDelaySeconds": 300,
                "noSuccessfulDataBackupAlarmDays": 2
            },
            "obBackupScheduleConfig": {
                "dayAndDataBackupModelMap": {
                    "2": "FULL_BACKUP",
                    "4": "FULL_BACKUP",
                    "6": "FULL_BACKUP"
                },
                "startLogBackup": true,
                "backupScheduleEnabled": true,
                "backupScheduleMode": "WEEK",
                "backupScheduleTime": "02:00:00.000+08:00"
            },
            "obBackupServiceStorageConfig": {
                "configName": "nfs0907_1452",
                "obBackupStorageBaseInfo": {
                    "backupStorageType": "BACKUP_STORAGE_FILE",
                    "storageUrl": "/obbackup/"
                },
                "alarmStoragePercentageThreshold": 80,
                "storageId": 26
            },
            "obClusterId": 5,
            "obTenantId": 1001,
            "physical": true,
            "physicalAndWasLogical": false,
            "retainMode": "RESERVE_ALL",
            "secondaryBackupEnabled": false,
            "tenantId": 1000012,
            "tenantName": "yctest",
            "type": "BACKUP",
            "updateTime": "2024-08-02T14:54:45.379+0800"
        },
        "duration": 51,
        "server": "a83ad33525",
        "status": 200,
        "successful": true,
        "timestamp": "2024-08-07T16:32:06.441+08:00",
        "traceId": "5962f337662d4043"
    }
    

    Contact Us