Modifying a DDM Account

Function

This API is used to modify permissions of a DDM account or its relationships with the associated schemas.

URI

PUT /v1/{project_id}/instances/{instance_id}/users/{username}

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID of a tenant in a region

instance_id

Yes

DDM instance ID

username

Yes

Name of the target DDM account

Request

Request parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

user

Yes

Object

DDM account information

Table 3 Description of parameter user

Parameter

Mandatory

Type

Description

base_authority

No

array

Basic permissions of the DDM account. The default value is the current 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. The default value is the current extended permissions of the DDM account.

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

At least one of the following parameters must be configured: base_authority, description, or databases.

Table 4 Description of parameter databases

Parameter

Mandatory

Type

Description

name

No

String

Schema name, which is case-insensitive. The databases and name fields must be contained or not contained at the same time.

This parameter is left blank by default.

Response

Response parameters

Table 5 Parameter description

Parameter

Type

Mandatory

Description

name

String

true

Name of the DDM account

Example

  • Example request
    {
    	"user": {
                    "base_authority":["CREATE", "DROP", "ALTER", "INDEX", "INSERT", "DELETE", "UPDATE", "SELECT"],
                    "extend_authority":["fulltableSelect","fulltableDelete","fulltableUpdate"], 
    		"description": "test",
    		"databases": [{
    			"name": "db_7350"
    		}]
    	}
    }
  • Example response
    {
        "name":"infotest"
    }

For failure responses, see Abnormal Request Results.

Status Code

For details, see Status Codes.