文档

DsgUserGroupAddOrUpdate

更新时间:

调用DsgUserGroupAddOrUpdate接口,新增或编辑数据保护伞中的用户组。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String DsgUserGroupAddOrUpdate

系统规定参数。取值:DsgUserGroupAddOrUpdate

UserGroups Array

用户组信息。

Id Long 123

用户组ID。

  • 不配置该参数:表示当前操作为新增用户组。
  • 配置该参数:表示编辑指定用户组信息。您可调用DsgUserGroupQueryList接口查询用户组ID。
Name String yun_group

用户组名称。

Owner String user1

用户组的负责人。

Accounts Array of String user1

输入用户名或MaxCompute角色。该参数需基于UserGroupType参数的取值配置。

ProjectName String dev_project

MaxCompute项目名称。创建MaxCompute用户组时必须配置该参数。

UserGroupType Integer 1

用户组类型。取值如下:

  • 1:阿里云用户
  • 2:RAM角色
  • 3:MaxCompute角色

返回数据

名称

类型

示例值

描述

Success Boolean true

调用是否成功。取值如下:

  • true:调用成功。
  • false:调用失败。
ErrorCode String 1029030003

错误码。

ErrorMessage String param error

错误信息。

HttpStatusCode Integer 400

HTTP状态码。

Data Boolean true

操作结果。取值如下:

  • true:操作成功。
  • false:操作失败。
RequestId String 102400001

请求的ID。用于定位日志,排查问题。

示例

请求示例

http(s)://[Endpoint]/?Action=DsgUserGroupAddOrUpdate
&UserGroups=[{"Id":123,"Name":"yun_group","Owner":"user1","Accounts":["user1"],"ProjectName":"dev_project","UserGroupType":1}]
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<DsgUserGroupAddOrUpdateResponse>
    <Success>true</Success>
    <ErrorCode>1029030003</ErrorCode>
    <ErrorMessage>param error</ErrorMessage>
    <HttpStatusCode>400</HttpStatusCode>
    <Data>true</Data>
    <RequestId>102400001</RequestId>
</DsgUserGroupAddOrUpdateResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Success" : true,
  "ErrorCode" : "1029030003",
  "ErrorMessage" : "param error",
  "HttpStatusCode" : 400,
  "Data" : true,
  "RequestId" : "102400001"
}

错误码

HttpCode

错误码

错误信息

描述

400 USERGROUP.ACCOUNTLISTSIZE.ERROR The number of account exceeds the limit. 用户数量超限。
400 USERGROUP.ID.ERROR The user group ID does not match the tenant or does not exist. 用户组ID不存在或不属于该租户。
400 USERGROUP.LISTSIZE.ERROR The number of user groups exceeds the limit. 用户组数量超限。
400 USERGROUP.PAGESIZE.ERROR Page size is too large, maximum of 100. 页大小超限,最大为100。
400 USERACCOUNT.OWNER.ERROR User list or owner user does not exist. 用户列表或负责人用户不存在。
400 PARAMS.ERROR param error. 参数错误。
403 PERMISSION.DENIED.ERROR Permission denied 权限不足。
500 UNKNOWN.ERROR unknown error. 未知错误。

访问错误中心查看更多错误码。

  • 本页导读 (1)