Restart a zone in an OceanBase cluster

2023-08-22 02:51:01  Updated

Description

You can call this operation to restart a zone in an OceanBase cluster.

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}/zones/{zoneName}/restart

Path parameters

Parameter Type Required Example value Description
id Integer Yes 1 The ID of the OceanBase cluster in which a zone needs to be restarted.
zoneName String Yes 1 The name of the zone to be restarted.

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/zones/zone2/restart

Sample response

{
  "data": {
    "clusterId": 12000001,
    "context": {
      "listMap": {
        "server_ids": [
          "13000001"
        ]
      },
      "parallel": false,
      "parallelIdx": -1,
      "stringMap": {
        "cluster_name": "protoss",
        "cluster_id": "12000001",
        "ocpagent_service_name": "agent",
        "prohibit_rollback": "false",
        "former_cluster_status": "RUNNING",
        "zone_name": "zone2",
        "target_cluster_status": "RUNNING"
      }
    },
    "creator": "admin",
    "executor": "xxx.xxx.xxx.xxx",
    "id": 89026581,
    "name": "Restart OB zone",
    "operation": "EXECUTE",
    "startTime": "2021-09-05T22:25:59.164+08:00",
    "status": "RUNNING",
    "subtasks": [
      {
        "className": "com.alipay.ocp.service.task.business.server.UpdateObServerStatusTask",
        "description": "Update observer status",
        "downstreams": [
          89029953
        ],
        "id": 89029965,
        "name": "Update observer status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 10,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          89029961
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.zone.StopObZoneTask",
        "description": "Stop zone",
        "downstreams": [
          89029954
        ],
        "id": 89029960,
        "name": "Stop zone",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 3,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89029952
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.obagent.StartOcpAgentServiceTask",
        "description": "Start ocp agent service",
        "downstreams": [
          89029961
        ],
        "id": 89029964,
        "name": "Start ocp agent service",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 0,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89029962
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.WaitNode",
        "description": "Wait node",
        "downstreams": [
          89029955
        ],
        "id": 89029959,
        "name": "Wait node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 4,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89029954
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.zone.StartObZoneTask",
        "description": "Start zone",
        "downstreams": [
          89029956
        ],
        "id": 89029953,
        "name": "Start zone",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 11,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89029965
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.WaitNode",
        "description": "Wait node",
        "downstreams": [
          89029957
        ],
        "id": 89029963,
        "name": "Wait node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 13,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89029955
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.cluster.UpdateObClusterStatusTask",
        "description": "Update OB cluster status",
        "downstreams": [
          
        ],
        "id": 89029966,
        "name": "Update OB cluster status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 14,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89029958
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.WaitNode",
        "description": "Wait node",
        "downstreams": [
          89029965
        ],
        "id": 89029961,
        "name": "Wait node",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 8,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89029964
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.PrepareRestartObServerTask",
        "description": "Prepare restart observer",
        "downstreams": [
          89029959
        ],
        "id": 89029954,
        "name": "Prepare restart observer",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 9,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          89029960
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.zone.UpdateObZoneStatusTask",
        "description": "Update zone status",
        "downstreams": [
          89029958
        ],
        "id": 89029956,
        "name": "Update zone status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 12,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89029953
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.WaitObServerActiveTask",
        "description": "Wait observer active",
        "downstreams": [
          89029964
        ],
        "id": 89029962,
        "name": "Wait observer active",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 5,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89029957
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.StartObServerProcessTask",
        "description": "Start observer process",
        "downstreams": [
          89029962
        ],
        "id": 89029957,
        "name": "Start observer process",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 7,
        "status": "PENDING",
        "timeout": 1200,
        "upstreams": [
          89029963
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.zone.PrepareRestartObZoneTask",
        "description": "Prepare restart OB zone",
        "downstreams": [
          89029960
        ],
        "id": 89029952,
        "name": "Prepare restart OB zone",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 6,
        "status": "READY",
        "timeout": 1800,
        "upstreams": [
          
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.cluster.SyncClusterInfoTask",
        "description": "Sync cluster info",
        "downstreams": [
          89029966
        ],
        "id": 89029958,
        "name": "Sync cluster info",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 2,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89029956
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.StopObServerProcessTask",
        "description": "Stop observer process",
        "downstreams": [
          89029963
        ],
        "id": 89029955,
        "name": "Stop observer process",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": 0,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 1,
        "status": "PENDING",
        "timeout": 1200,
        "upstreams": [
          89029959
        ]
      }
    ],
    "taskDefinitionId": -1,
    "type": "MANUAL"
  },
  "duration": 144,
  "server": "xxx.xxx.xxx.xxx",
  "status": 200,
  "successful": true,
  "timestamp": "2021-09-05T22:25:59.226+08:00",
  "traceId": "80d78099a9984126"
}

Contact Us