Resource Center/Resource Pool/Affinity Group Operations
POSTAffinity Group OperationsSince 2.3SynchronousAuth Required
CreateAffinityGroup
CreateAffinityGroup
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
nameStringRequiredThe affinity group name.
descriptionStringOptional. The detailed description of the affinity group.
policyStringRequiredThe affinity group policy.
typeStringOptional. The affinity group type. The current type is host. In the future, network, router, data center, and rack affinity groups will be supported.
resourceUuidStringOptional. The resource UUID.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/affinity-groups
/zstack/v1/affinity-groups
Request Example
curl -X POST 'http://{host}/zstack/v1/affinity-groups' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","description":"<description>","policy":"<policy>","type":"<type>","resourceUuid":"<resourceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "05ad02be7c5f4a6a9b6d164cb2980be6", "name": "affinity-group-test", "description": "affinity group for test", "policy": "ANTISOFT", "version": "1.0", "type": "HOST" } }Change History
This API has no change history records yet.
