Create a standby tenant

2024-11-06 03:13:28  Updated

Description

You can call this operation to create a standby tenant for an OceanBase cluster.

Call description

Prerequisites

  • You have the permission to modify clusters.

    For more information about the permissions, see Overview and Overview.

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

Request path

POST /api/v2/ob/clusters/{id}/tenants/createStandbyTenant

Request parameters

Path parameters

Parameter Type Required Example value Description
id Integer Yes 1 The ID of the cluster.

Body parameters

Parameter Type Required Example value Description
name String Yes standbyA The name of the tenant.
primaryZone String No zone1;zone2;zone3 The primary zone.
primaryTenantId Integer Yes 1 The ID of the primary tenant.
logTransportMode String Yes NETWORK The log transfer mode. Valid values: NETWORK and LOG_BACKUP.
restoreTenant Boolean No false Specifies whether to create the standby tenant based on the backup set. This parameter is valid only when logTransportMode is set to NETWORK.
enableArbitration Boolean No false Specifies whether to enable the arbitration service.
backupConfig BackupConfigParam No - The information about the backup set. This parameter is not required if you directly create a network-based standby tenant or use an existing backup strategy of OCP to create a standby tenant. For more information, see Data structure of BackupConfigParam.
zones ZoneParam Yes - The zones.
parameters TenantParameterParam No - The parameters of the standby tenant.
description String No this is standby tenant The description of the standby tenant.

Data structure of BackupConfigParam

Parameter Type Required Example value Description
backupStorageType Enum Yes BACKUP_STORAGE_FILE
  • BACKUP_STORAGE_FILE: Network File System (NFS) is used for backup storage.
  • BACKUP_STORAGE_OSS: Alibaba Cloud Object Storage Service (OSS) is used for backup storage.
  • BACKUP_STORAGE_COS: Tencent Cloud Object Storage (COS) is used for backup storage.
  • BACKUP_STORAGE_S3: AWS Simple Storage Service (S3) is used for backup storage.
    dataBackupUrl String Yes /obbackup/clusterA/tenantA/data The data backup directory.
    logBackupUrl String Yes /obbackup/clusterA/tenantA/clog The log backup directory.
    ossSecretModel ObjectStorageSecretParam No - The AccessKey pair of the object storage service. This parameter is required when the storage mode is OSS, COS, or S3. For more information, see Data structure of ObjectStorageSecretParam.

    Data structure of ObjectStorageSecretParam

    Parameter Type Required Example value Description
    endpoint String Yes oss.endpoint.sahnghai.com The endpoint of the object storage service.
    accessKeyId String Yes - The AccessKey ID of the object storage service.
    accessKeySecret String Yes - The AccessKey secrete of the object storage service.
    region String No - The region, which can be left empty. This parameter is required only when the storage mode is AWS S3.
    appId String No - The application ID. This parameter is required only when the storage mode is COS.

    Response parameters

    Basic data structure

    Parameter Type Description
    data Object The information about the asynchronous task. For more information, see Task return structure.
    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.

    Examples

    Sample request

    POST /api/v2/ob/clusters/{id}/tenants/createStandbyTenant

    Body:

    {
        "enableArbitration": false,
        "backupConfig": null,
        "zones": [
            {
                "name": "zone1"
                "replicaType": "FULL",
                "resourcePool": {
                    "unitSpecName": "S1",
                    "unitCount": 1
                }
            }
        ],
        "primaryTenantId": 2000022,
        "name": "ohayo_2",
        "logTransportMode": "NETWORK",
        "serviceName": "SERVICE_C",
        "parameters": [
            {
                "name": "connect_timeout",
                "value": "2000",
                "parameterType": "OB_SYSTEM_VARIABLE"
            }
        ]
    }
    

    Sample response

    {
        "data": {
            "clusterId": 3000010,
            "creator": "admin",
            "executor": "xxx.xxx.xxx.xxx",
            "id": 12022234,
            "name": "Create network standby tenant",
            "operation": "EXECUTE",
            "prohibitRollback": false,
            "startTime": "2024-07-23T17:55:37.066+08:00",
            "status": "RUNNING",
            "subtasks": [
                {
                    "description": "Create tenant service name",
                    "downstreams": [
                        13025800
                    ],
                    "id": 13025806,
                    "name": "Create tenant service name",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 2,
                    "status": "PENDING",
                    "timeout": 1800,
                    "upstreams": [
                        13025803
                    ]
                },
                {
                    "description": "Create standby tenant read only user",
                    "downstreams": [
                        13025804
                    ],
                    "id": 13025808,
                    "name": "Create standby tenant read only user",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 4,
                    "status": "PENDING",
                    "timeout": 1800,
                    "upstreams": [
                        13025807
                    ]
                },
                {
                    "description": "Update tenant status",
                    "downstreams": [],
                    "id": 13025799,
                    "name": "Update tenant status",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 5,
                    "status": "PENDING",
                    "timeout": 300,
                    "upstreams": [
                        13025797
                    ]
                },
                {
                    "description": "Sync tenant information",
                    "downstreams": [
                        13025797
                    ],
                    "id": 13025800,
                    "name": "Sync tenant information",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 6,
                    "status": "PENDING",
                    "timeout": 300,
                    "upstreams": [
                        13025806
                    ]
                },
                {
                    "description": "Create resource pool",
                    "downstreams": [
                        13025808
                    ],
                    "id": 13025807,
                    "name": "Create resource pool",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 3,
                    "status": "PENDING",
                    "timeout": 600,
                    "upstreams": [
                        13025798
                    ]
                },
                {
                    "description": "Set ob tenant parameters",
                    "downstreams": [
                        13025799
                    ],
                    "id": 13025797,
                    "name": "Set ob tenant parameters",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 7,
                    "status": "PENDING",
                    "timeout": 300,
                    "upstreams": [
                        13025800
                    ]
                },
                {
                    "description": "Check tenant log transport status ok",
                    "downstreams": [
                        13025806
                    ],
                    "id": 13025803,
                    "name": "Check tenant log transport status ok",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 10,
                    "status": "PENDING",
                    "timeout": 1800,
                    "upstreams": [
                        13025801
                    ]
                },
                {
                    "description": "Wait all relation tenants accessible",
                    "downstreams": [
                        13025805
                    ],
                    "id": 13025804,
                    "name": "Wait all relation tenants accessible",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 0,
                    "status": "PENDING",
                    "timeout": 3600,
                    "upstreams": [
                        13025808
                    ]
                },
                {
                    "description": "Wait ob tenant accessible",
                    "downstreams": [
                        13025801
                    ],
                    "id": 13025802,
                    "name": "Wait ob tenant accessible",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 9,
                    "status": "PENDING",
                    "timeout": 600,
                    "upstreams": [
                        13025805
                    ]
                },
                {
                    "description": "Set standby tenant continuous recovery",
                    "downstreams": [
                        13025803
                    ],
                    "id": 13025801,
                    "name": "Set standby tenant continuous recovery",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 1,
                    "status": "PENDING",
                    "timeout": 300,
                    "upstreams": [
                        13025802
                    ]
                },
                {
                    "description": "Create standby tenant",
                    "downstreams": [
                        13025802
                    ],
                    "id": 13025805
                    "name": "Create standby tenant",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 11,
                    "status": "PENDING",
                    "timeout": 1800,
                    "upstreams": [
                        13025804
                    ]
                },
                {
                    "description": "Prepare create tenant",
                    "downstreams": [
                        13025807
                    ],
                    "id": 13025798,
                    "name": "Prepare create tenant",
                    "nodeType": "JAVA_TASK",
                    "operation": "EXECUTE",
                    "parallelIdx": -1,
                    "prohibitRollback": false,
                    "runTime": 1,
                    "seriesId": 8,
                    "status": "READY",
                    "timeout": 30,
                    "upstreams": []
                }
            ],
            "taskDefinitionId": -1,
            "tenantId": 2000026,
            "type": "MANUAL"
        },
        "duration": 197,
        "server": "3af57a8e6b",
        "status": 200,
        "successful": true,
        "timestamp": "2024-07-23T17:55:37.11+08:00",
        "traceId": "ee452617f4e04661"
    }
    

    Contact Us