Delete multiple OBServers at a time

2023-08-15 02:30:55  Updated

Description

You can call this operation to delete multiple OBServers in an OceanBase cluster at a time.

Call description

Prerequisites

  • You have the permissions to manage the OceanBase cluster.

    For more information about the permissions, see Security overview.

  • You have passed the authentication for the OCP application service.

Request path

POST /api/v2/ob/clusters/{id}/servers/batchDelete

Path parameters

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

Request parameters

Parameter Type Required Example value Description
servers Array Yes [1,2] The list of host IDs.

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/servers/batchDelete

body:

{
  "servers": [
    1
  ]
}

Sample response

{
  "data": {
    "clusterId": 12000001,
    "context": {
      "listMap": {
        "server_ids": [
          "13000001"
        ],
        "host_ids": [
          "4000005"
        ],
        "zone_names": [
          "zone2"
        ]
      },
      "parallel": false,
      "parallelIdx": -1,
      "stringMap": {
        "cluster_name": "protoss",
        "prohibit_rollback": "false",
        "service_name": "protoss:22",
        "former_cluster_status": "RUNNING",
        "target_zone_status": "RUNNING",
        "ob_log_disk_path": "/data/log1",
        "former_zone_status": "RUNNING",
        "service_version": "3.1.0",
        "ob_install_path": "/home/admin/oceanbase",
        "cluster_id": "12000001",
        "service_type": "OB_CLUSTER",
        "target_cluster_status": "RUNNING",
        "former_server_status": "RUNNING",
        "ob_data_disk_path": "/data/1"
      }
    },
    "creator": "admin",
    "executor": "192.168.0.1",
    "id": 89026760,
    "name": "Delete OB server",
    "operation": "EXECUTE",
    "startTime": "2021-09-05T22:34:05.608+08:00",
    "status": "RUNNING",
    "subtasks": [
      {
        "className": "com.alipay.ocp.service.task.business.obagent.StopOcpAgentServiceTask",
        "description": "Stop ocp agent service",
        "downstreams": [
          89030168
        ],
        "id": 89030160,
        "name": "Stop ocp agent service",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 5,
        "status": "PENDING",
        "timeout": 3600,
        "upstreams": [
          89030157
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.CleanObServerTask",
        "description": "Clean observer host",
        "downstreams": [
          89030162
        ],
        "id": 89030158,
        "name": "Clean observer host",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 7,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030168
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.WaitNode",
        "description": "Wait node",
        "downstreams": [
          89030167
        ],
        "id": 89030165,
        "name": "Wait node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 8,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030155
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.zone.UpdateObZoneStatusTask",
        "description": "Update zone status",
        "downstreams": [
          89030156
        ],
        "id": 89030154,
        "name": "Update zone status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 1,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030163
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.cluster.UpdateObClusterStatusTask",
        "description": "Update OB cluster status",
        "downstreams": [
          
        ],
        "id": 89030161,
        "name": "Update OB cluster status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 2,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030156
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.WaitNode",
        "description": "Wait node",
        "downstreams": [
          89030158
        ],
        "id": 89030168,
        "name": "Wait node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 13,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030160
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.cluster.SyncClusterInfoTask",
        "description": "Sync cluster info",
        "downstreams": [
          89030161
        ],
        "id": 89030156,
        "name": "Sync cluster info",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 11,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030154
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.DeleteObServerTask",
        "description": "Delete observer",
        "downstreams": [
          89030157
        ],
        "id": 89030167,
        "name": "Delete observer",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 3,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030165
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.PrepareDeleteObServerTask",
        "description": "Prepare delete observer",
        "downstreams": [
          89030165
        ],
        "id": 89030155,
        "name": "Prepare delete observer",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 9,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          89030164
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.host.UnReserveHostTask",
        "description": "Unreserve host",
        "downstreams": [
          89030159
        ],
        "id": 89030162,
        "name": "Unreserve host",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 12,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030158
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.WaitNode",
        "description": "Wait node",
        "downstreams": [
          89030154
        ],
        "id": 89030163,
        "name": "Wait node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 10,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030159
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.WaitObServerDeleteTask",
        "description": "Wait observer delete",
        "downstreams": [
          89030160
        ],
        "id": 89030157,
        "name": "Wait observer delete",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 6,
        "status": "PENDING",
        "timeout": 604800,
        "upstreams": [
          89030167
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.DeleteObServerInfoTask",
        "description": "Delete observer meta info",
        "downstreams": [
          89030163
        ],
        "id": 89030159,
        "name": "Delete observer meta info",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 0,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030162
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.StartNode",
        "description": "Start node",
        "downstreams": [
          89030155
        ],
        "id": 89030164,
        "name": "Start node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 4,
        "status": "READY",
        "timeout": 30,
        "upstreams": [
          
        ]
      }
    ],
    "taskDefinitionId": -1,
    "type": "MANUAL"
  },
  "duration": 259,
  "server": "192.168.0.1",
  "status": 200,
  "successful": true,
  "timestamp": "2021-09-05T22:34:05.688+08:00",
  "traceId": "36708bd8420847c3"
}

Contact Us