Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Updating Migrated User Information in Batches

Function

This API is used to set the users and roles to be migrated in batches.

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 API is supported only in migration scenarios and PostgreSQL synchronization.

URI

PUT /v3/{project_id}/jobs/batch-update-user

Table 1 Path parameters

Parameter

Mandatory

Type

Description

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
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

jobs

Yes

Array of objects

Requests for updating migrated users in batches.

For details, see Table 4.

Table 4 Data structure description of field jobs

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

password

No

String

Global password.

list

No

Array of objects

User migration information. This parameter is mandatory when a user is migrated.

For details, see Table 5.

user_roles

No

Array of objects

Role migration information. This parameter is mandatory when a user is migrated.

For details, see Table 6.

is_set_password

Yes

Boolean

Whether to set a password

is_migrate_user

Yes

Boolean

Whether to migrate users.

is_sync_object_privilege

No

Boolean

Whether to synchronize permissions. If this parameter is not specified, the default value is false. This parameter is used for PostgreSQL synchronization.

Table 5 Data structure description of field list

Name

Mandatory

Type

Description

id

Yes

String

User ID.

account

Yes

String

User.

comment

No

String

Description.

is_transfer

Yes

Boolean

Whether migration is supported.

privileges

No

Array of strings

Permissions.

password

No

String

Password.

is_set_password

No

Boolean

Whether to reset the password.

roles

Yes

Array of strings

Role.

selected

Yes

Boolean

Whether to select.

Table 6 Data structure description of field user_roles

Name

Mandatory

Type

Description

role

Yes

String

Role.

comment

No

String

Description.

is_transfer

Yes

Boolean

Whether migration is supported.

privileges

Yes

String

Permissions.

inherits_roles

No

Array of strings

Inherited roles.

selected

No

Boolean

Whether to select. If this parameter is left blank, migration is not performed by default.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

all_counts

Integer

Total number.

results

Array of objects

Migrate user information.

For details, see Table 8.

Table 8 Data structure description of field results

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 9.

roles_list

Array of objects

Role list data.

For details, see Table 10.

is_success

Boolean

Whether the request is successful.

Table 9 Data structure description of field user_list

Parameter

Type

Description

id

String

Account ID.

account

String

Account.

comment

String

Description.

is_transfer

Boolean

Whether to migrate.

privileges

Array of strings

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 10 Data structure description of field roles_list

Parameter

Type

Description

role

String

Role.

comment

String

Description.

is_transfer

Boolean

Whether to migrate.

privileges

String

Permissions.

inherits_roles

Array of strings

Inherited role.

selected

Boolean

Whether to select.

Example Request

  • Setting users to be migrated for a specified task
    https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-update-user
    
    {
    	"jobs": [{
    		"is_migrate_user": true,
    		"is_set_password": false,
    		"job_id": "36c368d7-c03f-46e1-839a-b5c5bddjb105",
    		"list": [{
    			"account": "admin.testuser2",
    			"comment": "",
    			"id": "admin.testuser2",
    			"is_set_password": true,
    			"is_transfer": true,
    			"password": null,
    			"privileges": null,
    			"roles": ["admin.clusterAdmin"],
    			"selected": true
    		}],
    		"password": "",
    		"user_roles": [{
    			"comment": "",
    			"inherits_roles": [
    				"admin.roletest1",
    				"admin.roletest3",
    				"fastunit.roletest1"
    			],
    			"is_transfer": true,
    			"privileges": "[{u'resource': {u'cluster': True}, u'actions': [u'addShard']}, {u'resource': {u'db': u'fastunit', u'collection': u'coll'}, u'actions': [u'find', u'insert', u'remove', u'update']}, {u'resource': {u'db': u'mgo', u'collection': u'mycollection3'}, u'actions': [u'insert', u'remove', u'update']}, {u'resource': {u'db': u'', u'collection': u''}, u'actions': [u'find']}, {u'resource': {u'db': u'admin', u'collection': u''}, u'actions': [u'find']}]",
    			"role": "admin.roletest4",
    			"selected": true
    		}]
    	}]
    }
  • Setting users that do not need to be migrated for a specified task
    https://{endpoint}/v3/0549a6a31000d4e82fd1c00c3d6f2d76/jobs/batch-update-user
    
    {
      "jobs" : [ {
        "is_migrate_user" : false,
        "is_set_password" : false,
        "job_id" : "a281f62f-4631-45d6-a2d3-679a9f4jb105"
      } ]
    }

Example Response

Status code: 200

OK

{
  "all_counts" : 1,
  "results" : [ {
    "job_id" : "71604be1-f441-42f1-a09f-c5a52f0djb15",
    "is_success" : true
  } ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback