This topic describes how to change the root user password of a specified tenant by using the API.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| old_password | string | No | "****" | The old password of the root user of the tenant. |
| new_password | string | Yes | "******" | The new password of the root user of the tenant. |
Request path
PUT /api/v1/tenant/:name/password
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| old_password | string | No | "****" | The old password of the root user of the tenant. |
| new_password | string | Yes | "******" | The new password of the root user of the tenant. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Whether the request is successful. |
| timestamp | time.Time | The timestamp when the server completes the request. |
| duration | int | The time (in milliseconds) that the server takes to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| error | ApiError | The error returned by the request, which contains the following information:
|
Examples
Request example
PUT 10.10.10.1:2886/api/v1/tenant/t1/password
{
"old_password": "",
"new_password": "******"
}
Response example
{
"successful": true,
"timestamp": "2024-10-14T11:40:00.696664135+08:00",
"duration": 120,
"status": 200,
"traceId": "66b976ef15984730"
}
References
You can also call the API by using the SDK.
For more information about how to call the API by using obshell-sdk-python, see Change the tenant password.
For more information about how to call the API by using obshell-sdk-go, see Change the tenant password.