• Workspace

workspace
  1. Help Center
  2. Workspace
  3. API Reference
  4. Desktop Dedicated Hosts
  5. Querying the Desktop Dedicated Host List

Querying the Desktop Dedicated Host List

Function

This interface is used to query a user's desktop dedicated host list.

URI

  • URI format

    GET /v1.0/{project_id}/workspace-dedicated-hosts

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    string

    Specifies the user ID.

The following table lists the parameters for querying the desktop dedicated host list.

Parameter

Mandatory

Type

Description

dedicated_host_id

No

string

Specifies the ID of a desktop dedicated host.

name

No

string

Specifies the name of a desktop dedicated host.

host_type

No

string

Specifies the type of a desktop dedicated host. Possible values are:

  • general
  • h1

host_type_name

No

string

Specifies the type name of a desktop dedicated host. Possible values are:

  • General computing
  • High performance

product_id

No

string

Specifies the desktop package ID.

For the package information, see Querying the Product List.

state

No

string

Specifies the status of a desktop dedicated host. Possible values are available, fault, and released.

availability_zone

No

string

Specifies the region to which the desktop dedicated host belongs.

limit

No

string

Specifies the limits on the number of desktop dedicated hosts that will be returned during query by page. If the parameter is not specified, all desktop dedicated hosts that meet the search criteria are returned.

marker

No

string

Starts from the next record of the desktop dedicated host ID specified by marker during query by page. If the ID is invalid, error code 400 is returned.

changes-since

No

string

Specifies filtering of desktop dedicated hosts whose status is changed after the specified time.

The time format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

±hh:mm indicates the UTC offset, for example,

2015-08-27T09:49:58-05:00

Request

  • Request example
    GET /v1.0/29dfe82ada564ac2b927e1ff036d9a9b/workspace-dedicated-hosts?state=available

Response

  • Description

    Name

    Type

    Description

    dedicated_hosts

    List data structure [1]

    Specifies the information list of desktop dedicated hosts.

    total

    integer

    Specifies the number of desktop dedicated hosts that meet the search criteria.

[1] dedicated_hosts field data structure description

Name

Type

Description

dedicated_host_id

string

Specifies the ID of a desktop dedicated host.

name

string

Specifies the name of a desktop dedicated host.

auto_placement

string

If a desktop dedicated host is not specified during desktop creation, the desktop can be run on any dedicated host whose auto_placement is on.

Value range: on and off

availability_zone

string

Specifies the region to which the desktop dedicated host belongs.

project_id

string

Specifies the user to which the desktop dedicated host belongs.

host_properties

Dictionary data structure [2]

Specifies the attribute of a desktop dedicated host.

state

string

Specifies the status of a desktop dedicated host.

available_vcpus

integer

Specifies the available vCPUs of a desktop dedicated host.

available_memory

integer

Specifies the available memory size of a desktop dedicated host.

allocated_at

string

Specifies the creation time of a desktop dedicated host.

released_at

string

Specifies the release time of a desktop dedicated host.

instance_total

integer

Specifies the number of desktops running on a dedicated host.

[2] host_properties field data structure description

Name

Type

Description

host_type

string

Specifies the type of a desktop dedicated host.

host_type_name

string

Specifies the type name of a desktop dedicated host.

vcpus

integer

Specifies the number of vCPUs

cores

integer

Specifies the number of physical CPU cores.

sockets

integer

Specifies the number of slots.

memory

integer

Specifies the memory capacity (MB).

available_instance_capacities

List data structure [3]

Specifies the package list of desktops running on a dedicated host.

[3] available_instance_capacities field data structure description

Name

Type

Description

product_id

string

Specifies the desktop package.

  • Response example
    { 
     "dedicated_hosts": [ 
           { 
                  "dedicated_host_id": "ab910cf0daebca90c4001", 
                  "name": "high performance servers1", 
                  "auto_placement": "off", 
                  "availability_zone": "az1", 
                  "host_properties": { 
                         "vcpus": 36, 
                         "cores": 12, 
                         "sockets": 2, 
                         "memory": 1073741824, 
                         "host_type":  "h1", 
                         "host_type_name":  "High performance", 
                         "available_instance_capacities": [ 
                                {"flavor": "h1.large"}, 
                                {"flavor": "h1.2large"}, 
                                {"flavor": "h1.4large"}, 
                                {"flavor": "h1.8large"} 
                         ] 
                  }, 
                  "state": "available", 
                  "project_id": "9c53a566cb3443ab910cf0daebca90c4", 
                  "available_vcpus": 20, 
                  "available_memory": 1073201821, 
                  "instance_total ": 2, 
                  "allocated_at": "2016-10-10T14:35:47Z", 
                  "released_at": null 
           }, 
           { 
                  "dedicated_host_id": "ab910cf0daebca90c4002", 
                  "name": "high performance servers2", 
                  "auto_placement": "off", 
                  "availability_zone": "az1", 
                  "host_properties": { 
                         "vcpus": 36, 
                         "cores": 12, 
                         "sockets": 2, 
                         "host_type":  "h1", 
                         "host_type_name":  "High performance", 
                         "memory": 1073741824, 
                         "available_instance_capacities": [ 
                                {" product_id": "h1.large"}, 
                                {" product_id": "h1.2large"}, 
                                {" product_id": "h1.4large"}, 
                                {" product_id": "h1.8large"} 
                         ] 
                  }, 
                  "state": "available", 
                  "project_id": "9c53a566cb3443ab910cf0daebca90c4", 
                  "available_vcpus": 20, 
                  "available_memory": 1073101821, 
                  "instance_total ": 3, 
                  "allocated_at": "2016-10-10T14:35:47Z", 
                  "released_at": null 
           }, 
     ], 
           "total": 25 
    }

Returned Values

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The request syntax is incorrect and cannot be understood by the server.

    401 Unauthorized

    Authentication fails.

    403 Forbidden

    You are not authorized to perform the operation.

    404 Not Found

    The requested resource is not found.

    405 Method Not Allowed

    The method specified in the request is not allowed.

    500 Internal Server Error

    Internal service error. For details about error codes, see Error Code Description.

    503 Service Unavailable

    The service is unavailable.