云服务器内容精选

  • 报文样例 场景描述:创建用户 URL:https://域名/apiaccess/rest/sum/v1/tenantSpaces/users 请求头 x-app-key:953587d812f642998ee1f633b81212f3 Authorization:Bearer e3fca9398eaa5cef4b57b523b9c75fae Content-Type:application/json 请求消息: { "userAccount":"userAccount01", "userName":"userName01", "phone":"13012341234", "email":"test@huawei.com", "profile":"Operator" } 响应消息: { "message": "", "retcode": "0", "result": { "userId":"2461227935" } }
  • 请求说明 表1 请求头参数 序号 名称 参数类型 是否必选 说明 1 X-APP-Key string False appKey字段,用户标识,请联系运营人员获取appKey。 2 Authorization string True 鉴权字段,内容格式为: Bearer +tokenByAKSK接口的返回值中AccessToken(Bearer后有空格)。 生成方式参见文档C1 系统配置类接口鉴权方式式章节。 3 Content-Type string False "application/json" 表2 请求体参数 序号 参数 是否必选 类型 描述 1 requestBody [] 是 UserRoles 用户角色,支持批量处理,数组最大支持999。 1.1 actionType 是 String 操作类型: Grant:分配权限 Revoke:取消权限 1.2 userId 是 String 用户标识id。 1.3 roleId 是 String 角色标识id。
  • 报文样例 场景描述:同步角色 URL:https://域名/apiaccess/rest/sum/v1/tenantSpaces/roles/users 请求头 x-app-key:953587d812f642998ee1f633b81212f3 Authorization:Bearer e3fca9398eaa5cef4b57b523b9c75fae Content-Type:application/json 请求消息: { "requestBody": [{ "actionType": "Grant", "userId": "10gg0000015C8wfbgWbg", "roleId": "cH9k0000019M3qH6PKFM" }, { "actionType": "Grant", "userId": "10gg0000015C8wfbgWbg", "roleId": "cH9k0000019AIu9XwdHc" } ]} 响应消息: { "resCode": "0", "resMsg": "success", "result": { "agentRoleId": [] } }