Modifies the mapping between an asset and an asset group. For example, you can call this operation to modify the server group to which the asset belongs or the asset list of the asset group.
Operation Description
A server can belong only to one server group. If you call the CreateOrUpdateAssetGroup operation and the server specified in request parameters belongs to Server Group A, the server is removed from Server Group A and then added to the newly created or specified server group after the call is complete.
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Uuids | string | No | The UUID of the server in the server group that you want to create or the server group for which you want to add or remove servers. Separate multiple UUIDs with commas (,). NoteYou can call the DescribeCloudCenterInstances operation to query the UUIDs of servers. | aq12-***,s23*** |
GroupName | string | No | The name of the server group that you want to create or the server group for which you want to add or remove a server. NoteTo modify the mapping between a server and a server group, you must provide the name of the server group. You can call the DescribeAllGroups operation to query the names of server groups. If you do not configure GroupID when you call this operation, a server group is created. In this case, you must configure GroupName. | test |
GroupId | long | No | The ID of the server group for which you want to add to or remove servers. NoteTo modify the mapping between an asset and an asset group, you must provide the ID of the asset group. You can call the DescribeAllGroups to query the IDs of asset groups. If you do not configure this parameter when you call this operation, an asset group is created. | 55426 |
The following list describes the difference in the configurations of request parameters when you call the CreateOrUpdateAssetGroup operation to create a server group and add servers to or remove servers from a server group:
- Create a server group: You do not need to specify GroupId but must specify GroupName. The Uuids parameter is optional.
- Add servers to or remove servers from a server group: You must specify both GroupId and Uuids. The GroupName parameter is optional.
Response parameters
Example
Normal return example
JSON
Format
{
"GroupId": 9935302,
"RequestId": "E70074C8-DFB4-44C5-96C7-909DD231D68A"
}
Error codes
Http code | Error code | Error message |
---|---|---|
400 | GroupNameRepeated | group name repeated |
400 | IllegalParam | Illegal param |
500 | ServerError | ServerError |
For a list of error codes, visit the API error center.
Change history
Change time | Summary of changes | Operate | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2022-12-22 | API Description Update, The API operation is not deprecated., The error codes of the API operation has changed | |||||||||
| ||||||||||
2022-08-01 | The error codes of the API operation has changed | |||||||||
| ||||||||||
2022-08-01 | The error codes of the API operation has changed | |||||||||
|