Updated on 2026-02-10 GMT+08:00

Listing Workspace Hosts

Function

Lists Workspace hosts.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    workspace:wdh:get

    Read

    wdh *

    g:EnterpriseProjectId

    -

    -

URI

GET /v2/{project_id}/hosts

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

name

No

String

Workspace host name.

availability_zone

No

String

Workspace host region.

host_id

No

String

Workspace host ID.

enterprise_project_id

No

String

Enterprise project ID.

host_type

No

String

Type.

host_type_name

No

String

Name of the Workspace host type.

state

No

String

Workspace host status. The value can be available, fault, or released.

limit

No

Integer

Number of records displayed on each page.

offset

No

Integer

Where the pagination query starts. The value starts from 0.

marker

No

String

ID of the last record on the previous page. This parameter does not take effect when it is used together with offset.

changes_since

No

String

Filters dedicated hosts whose status changes after a specified time.

The date and timestamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm.

If the hh:mm value is included, the time zone is returned as the UTC offset, for example, 2015-08-27T09:49:58-05:00. If you omit the time zone, the UTC time zone is assumed.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

dedicated_hosts

Array of dedicated_hosts objects

Workspace host list.

total

Integer

Total number of records.

Table 4 dedicated_hosts

Parameter

Type

Description

dedicated_host_id

String

Workspace host ID.

name

String

Workspace host name.

auto_placement

String

Whether to allow a cloud server to be automatically assigned to any available Workspace host when the server is created without a dedicated host ID specified. The value can be on or off.

host_properties

host_properties object

Workspace host properties.

product_id

String

Product ID of the Workspace host.

state

String

Workspace host status. The value can be available, fault, or released.

available_vcpus

Integer

Number of available vCPU cores on the Workspace host.

available_memory

Integer

Available memory size of the Workspace host.

instance_total

Integer

Total number of instances on the Workspace host.

allocated_at

String

Time when the Workspace host is assigned.

released_at

String

Time when the Workspace host is released.

instance_uuids

Array of strings

UUID of the instance on the dedicated host.

enterprise_project_id

String

Enterprise project ID.

project_id

String

Project ID.

Table 5 host_properties

Parameter

Type

Description

vcpus

Integer

Number of vCPUs of the Workspace host.

cores

Integer

Number of physical cores on the Workspace host.

sockets

Integer

Number of physical sockets on the Workspace host.

memory

Integer

Physical memory size of the Workspace host.

host_type

String

Workspace host type.

host_type_name

String

Name of the Workspace host type.

available_instance_capacities

Array of available_instance_capacities objects

Specifications that can be created.

Table 6 available_instance_capacities

Parameter

Type

Description

flavor

String

Specification ID.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Example Requests

/v2/9c53a566cb3443ab910cf0daebca90c4/hosts?state=available

Example Responses

Status code: 200

Response body of the Workspace host list.

{
  "dedicated_hosts" : [ {
    "dedicated_host_id" : "ab910cf0daebca90c4001",
    "name" : "high performance servers1",
    "auto_placement" : "off",
    "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"
      } ]
    },
    "product_id" : "workspace.wdh.dg1.p02",
    "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",
    "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"
      } ]
    },
    "product_id" : "workspace.wdh.dg1.p02",
    "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" : 2
}

Status Codes

Status Code

Description

200

Response body of the Workspace host list.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

No operation permissions.

404

No resources found.

500

Internal server error.

Error Codes

See Error Codes.