All Products
Search
Document Center

Cloud Governance Center:BatchEnrollAccounts

Last Updated:Oct 25, 2024

Applies an account baseline to multiple existing resource accounts at a time.

Operation description

You can call this operation to apply an account baseline to existing resource accounts.

Accounts are enrolled in the account factory in asynchronous mode. After a resource account is created, an account baseline is applied to the account. You can call the GetEnrolledAccount operation to query the details of the account enrolled in the account factory and check whether the account baseline is applied to the account.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
governance:BatchEnrollAccountscreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
Accountsarray<object>No

The resource accounts.

AccountobjectNo

The information about the resource account.

AccountUidlongNo

The account ID. This parameter is required.

12868156179****
BaselineItemsarray<object>No

The baseline items.

If this parameter is specified, the configurations of the baseline items are merged with the baseline applied to the specified account. The configurations of the same baseline items are subject to the configurations of this parameter. We recommend that you leave this parameter empty and configure the BaselineId parameter to specify an account baseline and apply the configurations of the account baseline to the account.

BaselineItemobjectNo

The configurations of the baseline item.

ConfigstringNo

The configurations of the baseline item.

{\"Notifications\":[{\"GroupKey\":\"account_msg\",\"Contacts\":[{\"Name\":\"aa\"}],\"PmsgStatus\":1,\"EmailStatus\":1,\"SmsStatus\":1}]}
NamestringNo

The name of the baseline item.

ACS-BP_ACCOUNT_FACTORY_VPC
SkipbooleanNo

Specifies whether to skip the baseline item. Valid values:

  • false
  • true
false
VersionstringNo

The version of the baseline item.

1.0
BaselineIdstringNo

The baseline ID.

If this parameter is left empty, the default baseline is used.

afb-bp1durvn3lgqe28v****
RegionIdstringNo

The region ID.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

16B208DD-86BD-5E7D-AC93-FFD44B6FBDF1

Examples

Sample success responses

JSONformat

{
  "RequestId": "16B208DD-86BD-5E7D-AC93-FFD44B6FBDF1"
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidEnterpriseRealName.NotFoundThe specified account has not passed enterprise real name verification. Please complete the verification for the account first.The specified account has not passed enterprise real-name verification. Please complete the verification for the account first.
500InternalErrorA system error occurred.A system error occurred.

For a list of error codes, visit the Service error codes.