You can call this operation to create an account in a tenant that has access to a database.
Debugging
Authorization information
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 |