Updated on 2024-08-08 GMT+08:00

Starting or Stopping a Node

Function

This API is used to stop a node and enable other nodes to take over services after a node cannot work properly due to an underlying fault.

Constraints

This API supports the following instances:

  • GeminiDB Redis

URI

PUT /v3/{project_id}/instances/{instance_id}/nodes

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Operation type. shutdown indicates stopping a node and startup indicates starting a node.

node_ids

Yes

Array of strings

Node ID list. A maximum of 10 node IDs are supported.

Response Parameters

Status code: 202

Table 4 Response body parameters

Parameter

Type

Description

job_id

String

Task ID.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

PUT https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/b31f6915c8be45e38958eac14e96a5d2in12/nodes 
 
{ 
  "action" : "shutdown", 
  "node_ids" : [ "d96eaf85e4b44b2aa800dcf2a5981711no12", "e76f07fb1dae420791af867fc2ac4c35no12" ] 
}

Example Responses

Status code: 202

Success.

{ 
  "job_id" : "e20eae83-1e77-4d58-8d92-c195e6372b0b" 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.