All Products
Search
Document Center

Security Center:CreateOrUpdateAssetGroup

Last Updated:Feb 20, 2024

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.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
yundun-sas:CreateOrUpdateAssetGroupWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
UuidsstringNo

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 (,).

Note You can call the DescribeCloudCenterInstances operation to query the UUIDs of servers.
aq12-***,s23***
GroupNamestringNo

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.

Note To 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
GroupIdlongNo

The ID of the server group for which you want to add to or remove servers.

Note To 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

ParameterTypeDescriptionExample
object
GroupIdlong

The ID of the server group.

9935302
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

E70074C8-DFB4-44C5-96C7-909DD231D68A

Examples

Sample success responses

JSONformat

{
  "GroupId": 9935302,
  "RequestId": "E70074C8-DFB4-44C5-96C7-909DD231D68A"
}

Error codes

HTTP status codeError codeError messageDescription
400GroupNameRepeatedgroup name repeated-
400IllegalParamIllegal param-
403NoPermissioncaller has no permissionYou are not authorized to do this operation.
500ServerErrorServerError-

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

Change history

Change timeSummary of changesOperation
2022-12-22API Description Update. The API operation is not deprecated.. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
API Deprecation DescriptionThe API operation is not deprecated..
Error CodesThe Error code has changed.
    delete Error Codes: 400
2022-08-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
2022-08-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400