Delete a replica of a tenant

2024-10-18 08:30:56  Updated

Description

You can call this operation to delete a replica of 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}/deleteReplica

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.

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"
  },
  {
    "zoneName": "zone2"
  }
]

Sample response

{
  "data": {
    "clusterId": 9,
    "context": {
      "listMap": {
        "zone_names": [
          "zone3"
        ]
      },
      "parallel": false,
      "parallelIdx": -1,
      "stringMap": {
        "tenant_id": "18",
        "cluster_id": "9"
      }
    },
    "creator": "admin",
    "executor": "xxx.xxx.xxx.xxx",
    "id": 239885,
    "name": "Delete tenant replica",
    "operation": "EXECUTE",
    "startTime": "2021-06-30T12:06:51.078+08:00",
    "status": "RUNNING",
    "subtasks": [
      {
        "className": "com.alipay.ocp.service.task.business.tenant.UpdateTenantStatusTask",
        "description": "Update tenant status",
        "downstreams": [
          
        ],
        "id": 305073,
        "name": "Update tenant status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 1,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          305072
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.PrepareResourcePoolTask",
        "description": "Prepare resource pool",
        "downstreams": [
          305070
        ],
        "id": 305074,
        "name": "Prepare resource pool",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 5,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          305071
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.DeleteResourcePoolTask",
        "description": "Delete resource pool",
        "downstreams": [
          305072
        ],
        "id": 305070,
        "name": "Delete resource pool",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "runTime": 1,
        "seriesId": 0,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          305074
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.WaitAlterLocalityTask",
        "description": "Wait alter locality",
        "downstreams": [
          305074
        ],
        "id": 305071,
        "name": "Wait alter locality",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 2,
        "status": "PENDING",
        "timeout": 3600,
        "upstreams": [
          305069
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.SyncTenantInfoTask",
        "description": "Sync tenant information",
        "downstreams": [
          305073
        ],
        "id": 305072,
        "name": "Sync tenant information",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 4,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          305070
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.PrepareAlterTenantTask",
        "description": "Prepare alter tenant",
        "downstreams": [
          305071
        ],
        "id": 305069,
        "name": "Prepare alter tenant",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 3,
        "status": "READY",
        "timeout": 300,
        "upstreams": [
          
        ]
      }
    ],
    "taskDefinitionId": -1,
    "tenantId": 18,
    "type": "MANUAL"
  },
  "duration": 104,
  "server": "xxx.xxx.xxx.xxx",
  "status": 200,
  "successful": true,
  "timestamp": "2021-06-30T12:06:51.103+08:00",
  "traceId": "55f85ba1c1db4b13"
}

Contact Us