Description
Adds a replica for the specified tenant.
Call instructions
Interface constraints
The caller must be authenticated through OCP.
Request path
POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/addReplica
path:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| id | Long | Yes | 1000001 | The cluster ID of the target tenant in OCP. |
| tenantId | Long | Yes | 1000005 | The tenant ID of the target tenant in OCP. |
Request parameters
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| zoneName | String | Yes | foo | The tenant name, which must be unique in the cluster. |
| replicaType | String | Yes | FULL | The replica type. Valid values: |
| resourcePool | Object | Yes | -- | The resource pool information. |
| ├─unitSpecName | Object | Yes | S1 | The unit specification name. You can view the specification list on the “Unit Specification Management” page. |
| ├─unitCount | Integer | Yes | 1 | The number of units. |
Return results
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | Asynchronous task information. For more information, see Task information. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes processing the request. |
| duration | Integer | The time taken by the server to process the request in milliseconds. |
| status | Integer | An HTTP status code that conforms to the HTTP status code specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot issues. |
| server | String | The address of the application service that responds to the request. |
Examples
Request example
POST /api/v2/ob/clusters/1000001/tenants/1000005/addReplica
[
{
"zoneName": "zone1",
"replicaType": "FULL",
"resourcePool": {
"unitSpecName": "S0",
"unitCount": 1
}
}
]
Return example
{
"data": {
"clusterId": 1000001,
"context": {
"listMap": {
},
"parallel": false,
"parallelIdx": -1,
"stringMap": {
"tenant_id": "1000005",
"cluster_id": "1000001",
"zone_name": "zone2"
}
},
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"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": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-06-30T11:33:14.316+08:00",
"traceId": "3c390d0597744316"
}
