Before you deploy ODP, you must set the obshell node password. This topic describes how to set the node password using the API.
Note
This API is supported starting with obshell V4.2.6.
API details
Constraints
If the obshell node password has already been set, the API performs authentication using the existing password. If no password has been set and the current obshell node manages an OceanBase cluster, the API authenticates using the root@sys password.
Request path
POST /api/v1/agent/password
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| password | string | Yes | "****" | The node password. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request was successful. |
| timestamp | time.Time | The timestamp when the server finishes processing the request. |
| duration | int | The time taken by the server to process the request (in milliseconds). |
| status | int | The HTTP status code that conforms to the HTTP status specification. |
| traceId | string | The Trace ID of the request. |
| error | ApiError | Error details, including:
|
Examples
Request example
POST 10.10.10.1:2886/api/v1/agent/password
{
"password": "*****"
}
Response example
{
"successful": true,
"timestamp": "2025-03-24T16:58:38.543027516+08:00",
"duration": 1,
"status": 200,
"traceId": "a50243705b1f1997"
}
References
In addition to using the CLI to call the API, you can also use the SDK. For details about requesting the API using obshell-sdk-python, see Set node password.