Description
You can call this operation to change the password of a database user.
Call description
Prerequisites
You have passed the authentication for the OCP application service.
You have the Update permission on the specified tenant.
Request path
POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/users/{username}/changePassword
Request parameters
path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The ID of the cluster. |
| tenantId | Integer | Yes | 5 | The ID of the tenant. |
| username | String | Yes | root | The username. |
Request body parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| newPassword | String | Yes | xxxxxx | The new password. |
| saveToCredential | Boolean | No | True | Specifies whether to save the user password in the password box of the current OCP user. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| 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
Change the password of user1 in Tenant 1000001 of Cluster 1.
POST /api/v2/ob/clusters/1/tenants/1000001/users/user1/changePassword?id=1&tenantId=1000001&username=user1
{
"newPassword":"******"
}
Sample response
{
"duration": 201,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-07T15:30:41.205+08:00",
"traceId": "f4783564b21746db"
}