Updated on 2023-11-15 GMT+08:00

Obtaining Migration Users of the Source Database

Function

This API is used to query the user information of the source database.

Debugging

You can debug the API in API Explorer to support automatic authentication. API Explorer can automatically generate and debug example SDK code.

Constraints

This parameter is available only in the migration scenario and PostgreSQL synchronization.

URI

GET /v3/{project_id}/jobs/{job_id}/get-src-user

Table 1 Path parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

project_id

Yes

String

Project ID of a tenant in a region

For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type

Default value: en-us

Values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

job_id

String

Task ID.

is_global_password

String

Whether to use the global password.

message

String

Error code.

user_list

Array of objects

User list data.

For details, see Table 4.

roles_list

Array of objects

Role list data.

For details, see Table 5.

is_success

Boolean

Whether the request is successful.

Table 4 Data structure description of field user_list

Parameter

Type

Description

id

String

Account ID.

account

String

Account.

comment

String

Description.

is_transfer

Boolean

Whether migration is supported.

privileges

String

Permissions.

password

String

Password.

roles

Array of strings

Role of the user.

selected

Boolean

Whether to select.

no_privileges

String

User permissions cannot be synchronized.

parent_account

String

Parent user

no_parent_account

String

The parent user with the parent-child relationship cannot be synchronized.

Table 5 Data structure description of field roles_list

Parameter

Type

Description

role

String

Role.

comment

String

Description.

is_transfer

Boolean

Whether migration is supported.

privileges

String

Permissions.

inherits_roles

Array of strings

Inherited role.

selected

Boolean

Whether to select.

Example Request

https://{endpoint}/v3/0549a6a31000d4e82fd1c00c3d6f2d76/jobs/7f3aaf02-b994-4450-b3fb-6314aa9jb105/get-src-user

Example Response

Status code: 200

OK

{
  "message" : "SUCCESS",
  "user_list" : [ {
    "id" : "admin.testuser2",
    "account" : "admin.testuser2",
    "comment" : "",
    "privileges" : null,
    "password" : null,
    "roles" : [ "admin.clusterAdmin" ],
    "selected" : null,
    "is_transfer" : true
  }, {
    "id" : "admin.test_inc_admin_mgo",
    "account" : "admin.test_inc_admin_mgo",
    "comment" : "",
    "privileges" : null,
    "password" : null,
    "roles" : [ "mgo.read", "admin.readAnyDatabase", "local.read" ],
    "selected" : null,
    "is_transfer" : true
  }, {
    "id" : "fastunit.test_full_fastunit_noread",
    "account" : "fastunit.test_full_fastunit_noread",
    "comment" : "",
    "privileges" : null,
    "password" : null,
    "roles" : [ "admin.readAnyDatabase" ],
    "selected" : null,
    "is_transfer" : true
  }, {
    "id" : "admin.test_full",
    "account" : "admin.test_full",
    "comment" : "",
    "privileges" : null,
    "password" : null,
    "roles" : [ "fastunit.read", "admin.readAnyDatabase" ],
    "selected" : null,
    "is_transfer" : true
  } ],
  "roles_list" : [ {
    "role" : "admin.roletest4",
    "comment" : "",
    "privileges" : "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* GRANT XA_RECOVER_ADMIN ON *.*",
    "selected" : null,
    "is_transfer" : true,
    "inherits_roles" : [ "admin.roletest1", "admin.roletest3", "fastunit.roletest1" ]
  } ]
}

Status Code

Status Code

Description

200

OK

Error Code

For details, see Error Code.