Creating a DDM Account

Function

This API is used to create a DDM account. DDM accounts are used to connect to and manage schemas. One DDM account can be associated with multiple schemas.

URI

POST /v1/{project_id}/instances/{instance_id}/users

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID of a tenant in a region

instance_id

Yes

DDM instance ID

Request

Request parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

users

Yes

Array

DDM account information

Table 3 Description of parameter users

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the DDM account, which:

  • Consists of 6 to 32 characters.
  • Must start with a letter.
  • Contains only letters, digits, and underscores (_).

password

Yes

String

DDM account password

base_authority

Yes

Array

Basic permissions of the DDM account

The value can be CREATE, DROP, ALTER, INDEX, INSERT, DELETE, UPDATE, and SELECT.

extend_authority

No

Array

Extended permissions of the DDM account. This parameter is left blank by default.

The value can be fulltableDelete, fulltableSelect, and fulltableUpdate.

NOTE:

Observe the following rules when configuring permissions:

Select at least one basic permission. The mappings between basic permissions and extended permissions are as follows:
  • If base_authority is set to SELECT, set extend_authority to fulltableSelect.
  • If base_authority is set to DELETE, set extend_authority to fulltableDelete.
  • If base_authority is set to UPDATE, set extend_authority to fulltableUpdate.

description

No

String

Description of the DDM account, which cannot exceed 256 characters.

This parameter is left blank by default.

NOTE:

The backslash (\) and quotation mark (") are special characters for JSON messages. When using these characters in a parameter value, add the escape character (\) before the characters, for example, \\ and \".

databases

No

Array

Associated schemas

The databases field is optional. You can create a DDM account without associating it with any schema.

Table 4 Description of parameter databases

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the associated schema

Response

Response parameters

Table 5 Parameter description

Parameter

Type

Mandatory

Description

users

Array

true

DDM account information

Table 6 Description of parameter users

Parameter

Type

Mandatory

Description

name

String

true

Name of the DDM account

Example

  • Example request
    { 
            "users": [{ 
                   "name": "DDMuser1", 
                   "password": "Axejs@98a", 
                   "base_authority":["CREATE", "DROP", "ALTER", "INDEX", "INSERT", "DELETE", "UPDATE", "SELECT"],
                   "extend_authority":["fulltableSelect","fulltableDelete","fulltableUpdate"], 
                   "description": "",
                   "databases": [{ 
                          "name": "DDMdb1" 
                   }] 
            }] 
     }
  • Example response
    {
        "users":
        [
            {
                "name":"DDMuser1"
            }
        ]
    }
    

For failure responses, see Abnormal Request Results.

Status Code

For details, see Status Codes.