• Workspace

workspace
  1. Help Center
  2. Workspace
  3. API Reference
  4. Workspace
  5. Applying for Workspace

Applying for Workspace

Function

This interface is used to apply for Workspace. If this asynchronous interface is successfully invoked, the Workspace background receives the application request. If you want to check whether you have successfully applied for Workspace, query the task execution status using the asynchronous job query interface. For details, see Asynchronous Job Query.

URI

  • URI format

    POST /v1.0/{project_id}/workspaces

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    string

    Specifies the user ID.

Request

  • Request body parameter description

    Name

    Mandatory

    Type

    Description

    ad_domains

    Yes

    Dictionary data structure [1]

    Specifies the domain information used by Workspace.

    vpc_id

    Yes

    string

    Specifies the unique VPC ID.

    subnet_ids

    Yes

    List data structure [2]

    Specifies the subnet ID set.

    access_mode

    Yes

    string

    Specifies the access mode. Possible values are:

    • INTERNET: indicates the Internet access mode.
    • DEDICATED: indicates the DirectConnect access mode.
    • BOTH: indicates both modes.

    availability_zone

    No

    string

    Specifies the availability zone. Desktops are created in the specified availability zone. If it is not specified, a ramdom availability zone is used. Information about availability zones can be obtained from Regions and Endpoints.

[1] ad_domains field data structure description

Name

Mandatory

Type

Description

domain_type

Yes

string

Specifies the domain type. Possible values are:

  • LITE_AD: indicates the lightweight AD that is deployed on the cloud.
  • LOCAL_AD: indicates the local AD, namely, the user's existing AD.
    NOTE:

    When the domain type is LOCAL_AD, ensure that the selected VPC network can connect to the network to which LOCAL_AD belongs.

domain_name

Yes

string

Specifies the domain name.

When the domain type is LITE_AD, domain names must comply with the following rules:

  • Contains 4 to 63 characters.
  • Contains only letters, digits, hyphens (-), and periods (.)
  • Cannot start or end with a hyphen (-) or a period (.). A period (.) and a hyphen (-) cannot be neighbors.
  • Contains at least one period (.). The length before the first period (.) must be within 15 characters. At least two characters must be reserved after the last period (.) and the characters must contain at least one letter, for example, v-Desk1.xxx.com.

When the domain type is LOCAL_AD, the domain name must exist and the length cannot exceed 255 characters.

domain_admin_account

Yes

string

Specifies the domain administrator account.

When the domain type is LITE_AD, the domain administrator account must comply with the following rules:

  • Contains only letters, digits, hyphens (-), and underscores (_). It must start with a letter.
  • Cannot be the sensitive accounts listed in LITE_AD Sensitive Accounts.

When the domain type is LOCAL_AD, the account must be an existing domain administrator account on the AD server.

domain_password

Yes

string

Specifies the password of a domain administrator account.

When the domain type is LITE_AD, the password must comply with the following rules:

  • Consists of at least four types of the following: uppercase letters, lowercase letters, digits, and special characters (~!@#$%^&*_-+=`|(){}[]:;"'<>,.?/). It begins with a letter and contains 8 to 64 characters.
  • Cannot be the same as the domain administrator account or in the reverse order of it.
  • Cannot contain more than two consecutive identical characters (for example, 111 is not allowed).
  • Weak passwords can be added based on site requirements. This document does not list those weak passwords. For details, contact the administrator.

When the domain type is LOCAL_AD, the password must be the password of an existing domain administrator account on the AD server.

active_domain_ip

No

string

Specifies the IP address of the active domain controller. This parameter is mandatory when the domain type is LOCAL_AD.

standby_domain_ip

No

string

Specifies the IP address of the standby domain controller. This parameter is optional when the domain type is LOCAL_AD.

active_dns_ip

No

string

Specifies the IP address of the active DNS. This parameter is mandatory when the domain type is LOCAL_AD.

standby_dns_ip

No

string

Specifies the IP address of the standby DNS. This parameter is optional when the domain type is LOCAL_AD.

[2] subnet_ids  field data structure description

Name

Mandatory

Type

Description

subnet_id

Yes

string

Specifies the subnet ID.

  • Request example
POST /v1.0/fb2e5ec048384c8f9469d22db0037908/workspaces
LITE_AD request example:
Request Body:
{
        "ad_domains":{
                "domain_type":"LITE_AD",
                "domain_name":"testapi.litead.com",
                "domain_admin_account":"vdsadmin",
                "domain_password":"Testabc!23"
        },
        "vpc_id":"e8f985fa-5161-4cb8-bf5a-155058ea58c9",
        "subnet_ids":[
                {
                   "subnet_id":"067b30a9-1b73-4804-a808-699c5f6c4e09"
                },
                {
                   "subnet_id":"47c39964-4a32-4fb9-acc8-fac4355848d0"
                }
        ],
        "access_mode":"INTERNET",
        "availability_zone": "az01"
}
LOCAL_AD request example:
{
        "ad_domains": {
                "domain_type": "LOCAL_AD",
                "domain_name": "devdesktop.test.com",
                "domain_admin_account": "vdsadmin",
                "domain_password": "Testabc123!",
                "active_domain_ip": "10.0.0.9",
                "active_dns_ip": "10.0.0.9"
        },
        "vpc_id": "bd92e362-4806-46c7-99c2-6a8a30afbc4b",
        "subnet_ids": [{
                  "subnet_id": "d8863831-af9b-4585-b954-b7f5121ab4d2"
        }],
        "access_mode": "BOTH",
        "availability_zone": "az01"
}

Response

  • Description

    Name

    Type

    Description

    job_id

    string

    Specifies the job ID for applying for Workspace. Users can use this ID to query the job execution status.

  • Response example
    {
       "job_id": "0000000058fd65560159004bd2490005"
    }

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.