Adds one or more hosts to the specified host group.
Operation description
You can call this operation to add one or more hosts to a host group. You can add multiple hosts to a host group to manage and grant permissions on the hosts in a centralized manner.
Limits
You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds a limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limits when you call this operation.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the bastion host whose asset group you want to add hosts to. Note
You can call the DescribeInstances operation to query the bastion host ID.
| bastionhost-cn-st220aw**** |
RegionId | string | No | The region ID of the bastion host whose asset group you want to add hosts to. Note
For more information about the mapping between region IDs and region names, see Regions and zones.
| cn-hangzhou |
HostGroupId | string | Yes | The ID of the asset group to which you want to add hosts. Note
You can call the ListHostGroups operation to query the asset group ID.
| 1 |
HostIds | string | Yes | The IDs of the hosts that you want to add to the asset group. Specify a JSON string. You can specify up to 100 host IDs. Note
You can call the ListHosts operation to query the host IDs.
| ["1","2","3"] |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "81500666-d7f5-4143-8329-0223cc738105",
"Results": [
{
"Code": "OK",
"Message": "N/A\n",
"HostGroupId": "1",
"HostId": "1"
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter | The argument is invalid. | The argument is invalid. |
500 | InternalError | An unknown error occurred. | An unknown error occurred. |
For a list of error codes, visit the Service error codes.