Applicability
Password modification in a standby instance is not supported in the current version.
Overview
You can call this API to change the password of a database account in a tenant.
API details
Constraints
The caller must have an AccessKey for accessing APIs of OceanBase Cloud. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
GET /api/v2/instances/{instanceId}/tenants/{tenantId}/tenantUsers
Request parameters
Query
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantId | String | Yes | The ID of the tenant. | t4pnum**** |
| userName | String | Yes | The name of the database account. You cannot use reserved keywords, such as SYS and root. | test |
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantId | String | Yes | The ID of the tenant. | t4pnum**** |
| userName | String | Yes | The name of the database account. You cannot use reserved keywords, such as SYS and root. | test |
| userPassword | String | Yes | The password of the database account. The password must be 10 to 32 characters in length and contain any three of the following categories: uppercase letters, lowercase letters, digits, and special characters. The supported special characters are ! @ # $ % \ ^ & * ( ) _ + - =. |
ob********* |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| success | Boolean | Indicates whether the password is modified. | true |
Examples
Request example
curl -v --request PUT \
--digest -u 'ak:sk' \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/tenantUsers/{userName}/password' \
-H 'X-Ob-Project-Id: <Project ID>'
--data \ '{"instanceId":"ob******82yhuo","tenantId":"t******9nltds","userName":"xxx", "userPassword": "******"}'
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Response example
JSON format
{
"requestId":"c773fa32-****-****-b76e-cd428273dcbe",
"success":true
}