• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Server Groups
  6. Querying an ECS Group List

Querying an ECS Group List

Function Description

This interface is used to query the ECS group list.

URI

  • URI format

    GET /v2/{tenant_id}/os-server-groups

    GET /v2.1/{tenant_id}/os-server-groups

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

Request

Fields in the following table can be used as URI parameters to filter the query results.

Usage: /v2/{tenant_id}/os-server-groups?all_projects=True

Parameter

Type

Mandatory

Description

all_projects

Boolean

No

Determines whether to query ECSs of all tenants.

The ECSs of all tenants can be queried only if this parameter is used, even if its value is not True.

  • Tenants can query only their server_group lists. A maximum of 1000 query results can be returned.

Response

Parameter

Type

Mandatory

Description

server_groups

List(Dict)

Yes

Specifies an ECS group.

Table 1 server_groups parameter information

Parameter

Type

Mandatory

Description

id

String

Yes

Specifies an ECS group UUID.

name

String

Yes

Specifies an ECS group name.

policies

List(String)

Yes

Specifies an ECS group type.

members

List(String)

Yes

Specifies the ECSs in an ECS group.

metadata

Dict

Yes

Specifies ECS group metadata.

project_id

String

Yes

Specifies the tenant ID in UUID format for the ECS group.

This field is newly added in version 2.13.

policies

List

Yes

Specifies the policies associated to the ECS group. The valid policies are as follows:

  • 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. This policy is newly added in version 2.15.
  • 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. This policy is newly added in version 2.15.

user_id

String

Yes

Specifies the user ID in UUID format for the ECS group.

This field is newly added in version 2.13.

Request Example

GET /v2/9c53a566cb3443ab910cf0daebca90c4/os-server-groups
GET /v2.1/9c53a566cb3443ab910cf0daebca90c4/os-server-groups

Response Example

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

Returned Values

See General Request Returned Values.