首批通过分布式安全可靠测评,为关键业务系统打造
设置节点密码
更新时间:2026-04-07 20:57:20
在部署 OBProxy 服务前,需要先设置 obshell 节点密码,本文介绍设置 obshell 节点密码的 API。
说明
自 obshell V4.2.6 起支持该 API。
调用说明
接口约束
当节点已经设置过 obshell 节点密码时,该 API 将根据原有节点密码进行安全校验。当节点未设置过密码时,若当前 obshell 节点有管理的 OceanBase 集群,该 API 将使用 root@sys 密码进行安全校验。
请求路径
POST /api/v1/agent/password
请求参数
| 参数 | 类型 | 必选 | 示例值 | 描述 |
|---|---|---|---|---|
| password | string | 是 | "****" | 节点密码 |
返回结果
| 参数 | 类型 | 说明 |
|---|---|---|
| successful | bool | 请求是否成功。 |
| timestamp | time.Time | 服务端完成请求的时间戳。 |
| duration | int | 服务端处理请求的时间(毫秒)。 |
| status | int | 符合 HTTP Status 规范的编码。 |
| traceId | string | 请求的 Trace ID。 |
| error | ApiError | 请求产生的 Error,包含如下信息:
|
示例
请求示例
POST 10.10.10.1:2886/api/v1/agent/password
{
"password": "*****"
}
返回示例
{
"successful": true,
"timestamp": "2025-03-24T16:58:38.543027516+08:00",
"duration": 1,
"status": 200,
"traceId": "a50243705b1f1997"
}
相关文档
除通过命令行调用 API 接口外,还可以通过 SDK 方法调用 API。通过 obshell-sdk-python 请求 API 方法的介绍可参见 设置节点密码。