You can call this operation to create an account in a tenant that has access to a database.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
oceanbase:CreateTenantUser | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TenantId | string | Yes | The ID of the tenant. | ob2mr3oae0**** |
UserName | string | Yes | The name of the database account. You cannot use reserved keywords, such as SYS and root. | pay_test |
UserType | string | Yes | The type of the database account. Valid values: Admin: the super administrator account. Normal: a general account. | Normal |
UserPassword | string | Yes | The password of the database account. It must be 10 to 32 characters in length and contain three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. The special characters are ! @ # $ % \ ^ \ & \ * ( ) _ + - = | !Aliyun4Oceanbase |
Roles | string | No | The role of the user account. In Oracle mode, this parameter unspecified is left unspecified. In MySQL mode, the super administrator account has ALL PRIVILEGES, and you can leave this parameter unspecified. You need to specify the account information for a general user account. By default, the account information is a JSON array that contains the information of the role and the schema (Oracle mode) or database (MySQL mode). Valid values: ReadWrite: a role that has the read and write privileges, namely ALL PRIVILEGES. ReadOnly: a role that has only the read-only privilege SELECT. DDL: a role that has DDL privileges such as CREATE, DROP, ALTER, SHOW VIEW, and CREATE VIEW. DML: a role that has DML privileges such as SELECT, INSERT, UPDATE, DELETE, and SHOW VIEW. | [{"Database":"oceanbase1","Role":"readwrite"},{"Database":"oceanbase2","Role":"readonly"}] |
InstanceId | string | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
Description | string | No | The description of the database. | this is a test database |
You can call this operation to create an account in a tenant that has access to a database.
Response parameters
Examples
Sample success responses
JSON
format
{
"TenantUser": [
{
"UserType": "Normal",
"Roles": [
{
"Database": "db_pay1",
"Role": "ReadOnly"
}
],
"UserStatus": "ONLINE",
"UserName": "pay_test"
}
],
"RequestId": "EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
500 | InternalError | The request processing has failed due to some unknown error. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-12-26 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-07-04 | The Error code has changed | View Change Details |
2023-04-06 | The Error code has changed. The request parameters of the API has changed | View Change Details |