Help Center/ Workspace/ API Reference/ Workspace APIs/ Huawei Cloud Workspace/ Subscribes to Huawei Cloud Workspace
Updated on 2026-02-10 GMT+08:00

Subscribes to Huawei Cloud Workspace

Function

Subscribes to Huawei Cloud Workspace.

An asynchronous API. If this API can be called, the background receives the request for subscribing to Huawei Cloud Workspace. However, you need to call the GET /v2/{project_id}/workspace-sub-jobs API to query the task execution status.

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:tenants:open

    Write

    -

    workspace:AccessMode

    -

    • eip:bandwidths:create
    • eip:publicIps:create
    • elb:availability-zones:list
    • elb:healthmonitors:create
    • elb:healthmonitors:show
    • elb:listeners:create
    • elb:listeners:update
    • elb:listeners:show
    • elb:listeners:list
    • elb:loadbalancers:create
    • elb:loadbalancers:update
    • elb:loadbalancers:show
    • elb:members:create
    • elb:members:list
    • elb:members:update
    • elb:pools:create
    • elb:pools:update
    • elb:pools:show
    • vpc:ports:create
    • vpc:ports:delete
    • vpc:securityGroupRules:create
    • vpc:securityGroupRules:delete
    • vpc:securityGroupRules:get
    • vpc:securityGroups:create
    • vpc:subnets:get
    • vpc:subnets:update
    • vpc:vpcs:get
    • vpcep:endpoints:create
    • vpcep:endpoints:get

URI

POST /v2/{project_id}/workspaces

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

ad_domains

Yes

ApplyWorkspaceAdDomain object

Domain information.

enterprise_id

No

String

Enterprise ID.

An enterprise ID is your unique identifier on Workspace. End users need to enter an enterprise ID upon login. If an enterprise ID is not customized, the system automatically generates one. The value contains a maximum of 32 characters and can only include digits, letters, hyphens (-), and underscores (_).

vpc_id

No

String

VPC ID.

subnet_ids

No

Array of Subnet objects

Network ID of the service subnet. The subnet ID cannot be the same as that of 172.16.0.0/12.

manage_subnet_cidr

No

String

Management subnet CIDR.

Note: The value cannot be the same as the subnet CIDR of 172.16.0.0/12 or that specified by subnet_ids.

access_mode

No

String

Access mode.

  • INTERNET: access through Internet

  • DEDICATED: access through Direct Connect

  • BOTH: access through Internet or Direct Connect

apply_shared_vpc_dedicated_param

No

ApplySharedVpcDedicatedParam object

Input parameter of the shared VPC Direct Connect.

dedicated_subnets

No

String

List of Direct Connect access network segments. Multiple network segments are separated by semicolons (;). The list contains a maximum of five network segments.

is_send_email

No

Boolean

Whether to send a notification email upon desktop unsubscription.

Table 3 ApplyWorkspaceAdDomain

Parameter

Mandatory

Type

Description

domain_type

Yes

String

Domain type.

  • LITE_AS: local authentication

  • LOCAL_AD: local AD

When domain_type is set to LOCAL_AD, ensure that the selected VPC can be connected to the network to which the AD belongs.

domain_name

No

String

Domain name. This parameter is mandatory when the domain type is set to LOCAL_AD.

The domain name must be an existing domain name on the Windows AD server and can contain a maximum of 55 characters.

domain_admin_account

No

String

Domain administrator account. This parameter is mandatory when the domain type is set to LOCAL_AD.

The domain administrator account must be available on the AD server.

domain_password

No

String

Domain administrator account and password. This parameter is mandatory when the domain type is set to LOCAL_AD.

active_domain_ip

No

String

IP address of the primary domain controller. This parameter is mandatory when the domain type is set to LOCAL_AD.

active_domain_name

No

String

Name of the primary domain controller. This parameter is mandatory when the domain type is set to LOCAL_AD.

standby_domain_ip

No

String

IP address of the backup domain controller. This parameter is mandatory when domain type is set to LOCAL_AD and the standby node is configured.

standby_domain_name

No

String

Name of the backup domain controller. This parameter is mandatory when domain type is set to LOCAL_AD and the standby node is configured.

active_dns_ip

No

String

IP address of the primary DNS. This parameter is mandatory when the domain type is set to LOCAL_AD.

standby_dns_ip

No

String

IP address of the backup DNS. This parameter is mandatory when domain type is set to LOCAL_AD and the standby node is configured.

delete_computer_object

No

Integer

Whether to delete the corresponding computer object from the AD when deleting the desktop. The value 0 indicates that the computer object is not deleted, and the value 1 indicates that the computer object is deleted.

use_ldaps

No

Boolean

Whether to enable LDAPS.

tls_config

No

TlsConfig object

TLS information.

Table 4 TlsConfig

Parameter

Mandatory

Type

Description

cert_pem

No

String

PEM content. If the content exists, update it. Otherwise, upload it. The query result is not returned.

cert_start_time

No

String

Time when the certificate starts to take effect, for example, 2022-01-25T09:24:27.

cert_end_time

No

String

Time when the certificate expires, for example, 2022-01-25T09:24:27.

Table 5 Subnet

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

Subnet network ID.

Table 6 ApplySharedVpcDedicatedParam

Parameter

Mandatory

Type

Description

address

No

String

Shared VPC Direct Connect address specified by the tenant.

port

No

Integer

Shared VPC Direct Connect address port specified by the tenant.

availability_zone

No

Array of strings

AZ used for subscribing to service resources. By default, two AZs are randomly used.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

job_id

String

ID of the task for subscribing to Huawei Cloud Workspace.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

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 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

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 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

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 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

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 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

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

  • POST /v2/fb2e5ec048384c8f9469d22db0037908/workspaces
    
    {
      "ad_domains" : {
        "domain_type" : "LITE_AS"
      },
      "vpc_id" : "e8f985fa-5161-4cb8-bf5a-155058ea58c9",
      "subnet_ids" : [ {
        "subnet_id" : "067b30a9-1b73-4804-a808-699c5f6c4e09"
      } ],
      "access_mode" : "INTERNET",
      "is_send_email" : true
    }
  • {
      "ad_domains" : {
        "domain_type" : "LOCAL_AD",
        "domain_admin_account" : "vdsadmin",
        "active_domain_ip" : "192.161.43.66",
        "standby_domain_ip" : "192.161.43.67",
        "domain_name" : "xxxx.xxxx.com",
        "domain_password" : "xxxxxxxxxx@",
        "active_domain_name" : "AD-xxx-0001.vdesktop.huawei.com",
        "active_dns_ip" : "192.161.43.66",
        "standby_domain_name" : "AD-xxx-0002.vdesktop.huawei.com",
        "standby_dns_ip" : "192.161.43.67",
        "cba_enabled" : true,
        "certificate_id" : "xxxxxxxxxxx"
      },
      "vpc_id" : "27823fc4-5808-4f3b-a5bc-24c7a80742b8",
      "subnet_ids" : [ {
        "subnet_id" : "598d4599-059f-40ca-9cce-841b784d13e6"
      } ],
      "access_mode" : "INTERNET",
      "is_send_email" : true
    }
  • {
      "ad_domains" : {
        "domain_type" : "LOCAL_AD",
        "domain_admin_account" : "vdsadmin",
        "active_domain_ip" : "192.161.43.66",
        "standby_domain_ip" : "192.161.43.67",
        "domain_name" : "xxxx.xxxx.com",
        "domain_password" : "xxxxxxxxxx@",
        "active_domain_name" : "AD-xxx-0001.vdesktop.huawei.com",
        "active_dns_ip" : "192.161.43.66",
        "standby_domain_name" : "AD-xxx-0002.vdesktop.huawei.com",
        "standby_dns_ip" : "192.161.43.67",
        "cba_enabled" : false,
        "certificate_id" : null
      },
      "vpc_id" : "27823fc4-5808-4f3b-a5bc-24c7a80742b8",
      "subnet_ids" : [ {
        "subnet_id" : "598d4599-059f-40ca-9cce-841b784d13e6"
      } ],
      "access_mode" : "DEDICATED",
      "is_send_email" : true,
      "dedicated_subnets" : "192.168.0.0/24;10.0.0.0/16"
    }

Example Responses

Status code: 200

Response to the request for subscribing to Huawei Cloud Workspace.

{
  "job_id" : "0000000059071dbc01591661d3990019"
}

Status Codes

Status Code

Description

200

Response to the request for subscribing to Huawei Cloud Workspace.

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

An internal service error occurred. For details about the error code, see the error code description.

Error Codes

See Error Codes.