Creating an ECS Group
Function
This API is used to create an ECS group.
Constraints
Only anti-affinity groups are supported.
URI
POST /v1/{project_id}/cloudservers/os-server-groups
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
Request
Table 2 describes the request parameters.
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
server_group |
Yes |
Object |
Definition Specifies the ECS group information. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition Specifies the ECS group name. Constraints N/A Range 1 to 255 characters Default Value N/A |
|
policies |
Yes |
Array of strings |
Definition Specifies the list of policies associated with the ECS group. Constraints N/A Range
Default Value N/A |
Response
Table 4 describes the response parameters.
|
Parameter |
Type |
Description |
|---|---|---|
|
server_group |
Object |
Definition Specifies the ECS group information. For details, see Table 5. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition Specifies the ECS group UUID. Range N/A |
|
name |
String |
Definition Specifies the ECS group name. Range N/A |
|
policies |
Array of strings |
Definition Specifies the list of policies associated with the ECS group. Range
|
|
members |
Array of strings |
Definition Specifies the IDs of the ECSs in an ECS group. Range N/A |
|
metadata |
Object |
Definition Specifies the ECS group metadata. Range N/A |
Example Request
Create an ECS group.
POST https://{endpoint}/v1/{project_id}/cloudservers/os-server-groups
{
"server_group": {
"name": "test",
"policies": ["anti-affinity"]
}
}
Example Response
{
"server_group": {
"id": "5bbcc3c4-1da2-4437-a48a-66f15b1b13f9",
"name": "test",
"policies": [
"anti-affinity"
],
"members": [],
"metadata": {}
}
}
Returned Values
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.