Files
doc-exports/docs/ecs/api-ref/en-us_topic_0175597846.html
Artem Goncharov 3196b64bfc move doc sources to other location (#3)
move doc sources to other location

Reviewed-by: OpenTelekomCloud Bot <None>
2022-04-27 16:24:25 +00:00

18 KiB

Querying ECS Groups

Function

This API is used to query ECS groups.

URI

GET /v1/{project_id}/cloudservers/os-server-groups?limit={limit}&marker={marker}

Table 1 describes the parameters in the URI.
Table 1 Path parameters

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Specifies the upper limit on the number of returned server groups. The maximum value is 1000.

marker

No

String

Specifies the marker that points to the ECS group. The query starts from the next piece of data indexed by this parameter.

Parameters marker and limit must be used together.

Request

None

Response

Table 3 describes the response parameters.
Table 3 Response parameters

Parameter

Type

Description

server_groups

Array of objects

Specifies ECS groups. For details, see Table 4.

page_info

Object

If the pagination function is enabled, the UUID of the last ECS group on the current page is returned. For details, see Table 5.

Table 4 server_groups parameter information

Parameter

Type

Description

id

String

Specifies the ECS group UUID.

name

String

Specifies the ECS group name.

members

Array of strings

Specifies the ECSs contained in an ECS group.

metadata

Object

Specifies the ECS group metadata.

policies

Array of strings

Specifies the policies associated with the ECS group. Options:
  • anti-affinity: ECSs in this group must be deployed on different hosts.
  • affinity: ECSs in this group must be deployed on the same host.
  • soft-anti-affinity: ECSs in this group are deployed on different hosts if possible. If the ECSs cannot be deployed on different hosts, deploy them based on the actual condition for successful ECS creation.
  • soft-affinity: ECSs in this group are deployed on the same host if possible. If the ECSs cannot be deployed on the same host, deploy them based on the actual condition for successful ECS creation.
NOTE:

Only anti-affinity policies are supported. You are not advised to use other policies. If other policies are used, creating the ECS group will fail.

Table 5 page_info field description

Parameter

Type

Description

next_marker

String

Specifies an ECS group UUID.

Example Request

GET https://{endpoint}/v1/{project_id}/cloudservers/os-server-groups

Example Response

{
    "server_groups": [
        {
            "id": "616fb98f-46ca-475e-917e-2563e5a8cd19",
            "name": "test",
            "policies": ["anti-affinity"],
            "members": [],
            "metadata": {}
        }
    ],
    "page_info": {
        "next_marker": "616fb98f-46ca-475e-917e-2563e5a8cd19"
    }
}

Error Codes

See Error Codes.