• Workspace

workspace
  1. Help Center
  2. Workspace
  3. API Reference
  4. Desktop Dedicated Hosts
  5. Creating Desktop Dedicated Hosts

Creating Desktop Dedicated Hosts

Function

This interface is used to create a desktop dedicated host.

URI

  • URI format

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

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    string

    Specifies the user ID.

Request

  • Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    string

    Specifies the name of a desktop dedicated host.

    auto_placement

    No

    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

    The default value is on.

    availability_zone

    Yes

    string

    Specifies the region to which the desktop dedicated host belongs. If the region to which the desktop dedicated host belongs is not specified, the system randomly selects an availability zone.

    host_type

    Yes

    string

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

    • general
    • hi (high performance)

    quantity

    Yes

    integer

    Specifies the number of created desktop dedicated hosts.

  • Request example
    POST /v1.0/9c53a566cb3443ab910cf0daebca90c4/workspace-dedicated-hosts 
    { 
         "availability_zone": "dc1.az1", 
         "name": "high performance servers1", 
         "auto_placement": "off", 
         "host_type": "h1", 
         "quantity": 2 
    }

Response

  • Description

    Name

    Type

    Description

    dedicated_host_ids

    List data structure [string]

    Specifies the ID list of desktop dedicated hosts.

  • Response example
    { 
        "dedicated_host_ids": [
           "xxxxxxx1",
           "xxxxxxx2"
     ] 
    }

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.