Description
Change the password of a database user.
Call instructions
Interface constraints
The caller needs to be authenticated through the OCP application service.
The caller must have the permission to modify 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 | Cluster ID |
| tenantId | Integer | Yes | 5 | Tenant ID |
| username | String | Yes | root | Username |
| hostName | String | No | 33.47.251.% | Host name |
Body parameters
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| newPassword | String | Yes | xxxxxx | New password |
Return result
Parameter |
Type |
Description |
|---|---|---|
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes the request. |
| duration | Integer | The time the server takes to process the request, in milliseconds. |
| status | Integer | An HTTP status code that conforms to the HTTP Status specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot issues. |
| server | String | The address of the application service that responds to the request. |
Examples
Request example
Change the password of user user1 in cluster 1, tenant 1000001.
POST /api/v2/ob/clusters/1/tenants/1000001/users/user1/changePassword?id=1&tenantId=1000001&username=user1
{
"newPassword":"******"
}
Return example
{
"duration": 201,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-07T15:30:41.205+08:00",
"traceId": "f4783564b21746db"
}
