调用CreateAggregator接口创建账号组。
每个企业管理账号最多创建5个账号组,每个账号组中最多包含200个成员账号。
配置审计支持的账号组类型如下:
- 全局账号组:全局账号组包含资源目录中的所有成员账号。每个企业管理账号只能创建一个全局账号组。
- 自定义账号组:企业管理账号创建自定义账号组时,主动从资源目录中选择所有或部分成员账号。
本文将提供一个示例,创建一个自定义账号组CUSTOM
,账号组名称为Test_Group
,账号组描述为测试组
,成员账号信息如下:
- 成员账号ID为
171322098523****
,成员账号名称为Alice
。 - 成员账号ID为
100532098349****
,成员账号名称为Tom
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateAggregator |
要执行的操作,取值:CreateAggregator。 |
AggregatorName | String | 是 | Test_Group |
账号组名称。 |
Description | String | 是 | 测试组 |
账号组描述。 |
AggregatorAccounts | Array | 否 |
账号组内的所有成员账号。示例如下:
说明 当
AggregatorType 为RD 时,该参数可以为空,表示将资源目录中的所有账号添加至全局账号组。
|
|
AccountId | Long | 否 | 171322098523**** |
成员账号ID。 关于如何获取成员账号ID,请参见ListAccounts。 |
AccountName | String | 否 | Alice |
成员账号名称。 关于如何获取成员账号名称,请参见ListAccounts。 |
AccountType | String | 否 | ResourceDirectory |
成员账号归属。仅支持ResourceDirectory(资源目录)。 |
ClientToken | String | 否 | 1594295238-f9361358-5843-4294-8d30-b5183fac**** |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。 |
AggregatorType | String | 否 | CUSTOM |
账号组类型。取值:
|
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 8195B664-9565-4685-89AC-8B5F04B44B92 |
请求ID。 |
AggregatorId | String | ca-dacf86d8314e00eb**** |
账号组ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateAggregator
&AggregatorName=Test_Group
&Description=测试组
&AggregatorAccounts=[{"accountId": 171322098523****,"accountType":"ResourceDirectory","accountName":"Alice"}, {"accountId": 100532098349****,"accountType":"ResourceDirectory","accountName":"Tom"}]
&AggregatorType=CUSTOM
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateAggregatorResponse>
<RequestId>0093E9C4-F871-4C1F-80C5-7534D287B023</RequestId>
<AggregatorId>ca-8bde626622af00a9****</AggregatorId>
</CreateAggregatorResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "0093E9C4-F871-4C1F-80C5-7534D287B023",
"AggregatorId" : "ca-8bde626622af00a9****"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Invalid.AggregatorAccounts.Empty | You must specify AggregatorAccounts. | 账号组内的成员账号列表不能为空。 |
400 | Invalid.AggregatorAccounts.Value | The specified AggregatorAccounts is invalid. | 账号组内成员账号信息错误。 |
400 | Invalid.AccountType.Value | The specified AccountType is invalid. | 账号来源类型不符合要求。 |
400 | AggregatorExceedMaxCount | The maximum number of aggregator is exceeded. | 创建的账号组数量超出限制。 |
400 | AggregatorAccountListDuplicated | The aggregator account list is duplicated. | 存在相同成员账号的账号组。 |
400 | AggregatorAccountListItemDuplicated | The aggregator account list item is duplicated. | 账号组内的成员账号重复。 |
400 | AggregatorNameDuplicated | The aggregator name is duplicated. | 账号组名称重复。 |
400 | Invalid.AggregatorAccounts.SizeExceed | The maximum number of AggregatorAccounts is 200. | 账号组内的成员账号不能超过200个。 |
403 | NoPermissionCreateAggregator | You are not authorized to create the aggregator. | 无权限创建账号组。 |
404 | AccountNotExisted | Your account does not exist. | 您的账号不存在。 |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服务不可用。 |
访问错误中心查看更多错误码。