数据复制服务 DRS-批量更新迁移用户信息:请求示例

时间:2024-12-17 15:48:49

请求示例

  • 指定任务设置需要迁移的用户
    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
    		}]
    	}]
    }
  • 指定任务设置不迁移用户
    https://{endpoint}/v3/0549a6a31000d4e82fd1c00c3d6f2d76/jobs/batch-update-user
    
    {
      "jobs" : [ {
        "is_migrate_user" : false,
        "is_set_password" : false,
        "job_id" : "a281f62f-4631-45d6-a2d3-679a9f4jb105"
      } ]
    }
support.huaweicloud.com/api-drs/drs_03_0108.html