Add a replica for a tenant

2024-10-18 08:35:53  Updated

Description

You can call this operation to add a replica for a tenant.

Call description

Prerequisite

You have passed the authentication for the OCP application service.

Request path

POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/addReplica

Path parameters

Parameter Type Required Example value Description
id Long Yes 1 The ID of the cluster to which the tenant belongs.
tenantId Long Yes 1 The ID of the tenant.

Request parameters

Parameter Type Required Example value Description
zoneName String Yes foo The name of the tenant, which is unique in the cluster.
replicaType String Yes FULL The type of the replica. Valid values: * FULL * LOGONLY * READONLY
resourcePool Object Yes -- --
├─unitSpecName Object Yes S1 The unit specifications. You can view the unit specifications on the Unit Specification Management page.
├─unitCount Integer Yes 1 The number of units.

Response parameters

Basic data structure

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

Examples

Sample request

POST /api/v2/ob/clusters/1/tenants/2/addReplica

body:

[
  {
    "zoneName": "zone1",
    "replicaType": "FULL",
    "resourcePool": {
      "unitSpecName": "S0",
      "unitCount": 1
    }
  }
]

Sample response

{
  "data": {
    "clusterId": 9,
    "context": {
      "listMap": {
        
      },
      "parallel": false,
      "parallelIdx": -1,
      "stringMap": {
        "tenant_id": "18",
        "cluster_id": "9",
        "zone_name": "zone2"
      }
    },
    "creator": "admin",
    "executor": "192.168.0.1",
    "id": 239151,
    "name": "Add tenant replica",
    "operation": "EXECUTE",
    "startTime": "2021-06-30T11:33:14.296+08:00",
    "status": "RUNNING",
    "subtasks": [
      {
        "className": "com.alipay.ocp.service.task.business.tenant.WaitAlterLocalityTask",
        "description": "Wait alter locality",
        "downstreams": [
          304131
        ],
        "id": 304130,
        "name": "Wait alter locality",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 0,
        "status": "PENDING",
        "timeout": 3600,
        "upstreams": [
          304129
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.PrepareAlterTenantTask",
        "description": "Prepare alter tenant",
        "downstreams": [
          304130
        ],
        "id": 304129,
        "name": "Prepare alter tenant",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 3,
        "status": "READY",
        "timeout": 300,
        "upstreams": [
          
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.SyncTenantInfoTask",
        "description": "Sync tenant information",
        "downstreams": [
          304132
        ],
        "id": 304131,
        "name": "Sync tenant information",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 1,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          304130
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.UpdateTenantStatusTask",
        "description": "Update tenant status",
        "downstreams": [
          
        ],
        "id": 304132,
        "name": "Update tenant status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 2,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          304131
        ]
      }
    ],
    "taskDefinitionId": -1,
    "tenantId": 18,
    "type": "MANUAL"
  },
  "duration": 220,
  "server": "192.168.0.3",
  "status": 200,
  "successful": true,
  "timestamp": "2021-06-30T11:33:14.316+08:00",
  "traceId": "3c390d0597744316"
}

Contact Us