You can call this operation to create a policy.

Description

A policy is a collection of security rules and can control the permissions of regular users on cloud desktops. A policy specifies whether to enable USB redirection, read and write permissions on disks and clipboards, and whether to enable watermarking.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreatePolicyGroup

The operation that you want to perform. Set the value to CreatePolicyGroup.

RegionId String Yes cn-hangzhou

The ID of the region.

Clipboard String No off

The permission on clipboards. Valid values:

  • read: read-only. You can copy data from a local device to a cloud desktop, but cannot copy data from a cloud desktop to a local device.
  • readwrite: read and write. You can copy data from a local device to a cloud desktop and from a cloud desktop to a local device.
  • off: disabled. You cannot copy data between a cloud desktop and a local device.

Default value: off.

LocalDrive String No off

The permission on local disk mapping. Valid values:

  • read: read-only. Local disks are mapped to cloud desktops. You can only read (copy) local files but cannot modify them.
  • readwrite: read and write. Local disks are mapped to cloud desktops. You can read (copy) and modify local files.
  • off: disabled. Local disks are not mapped to cloud desktops.

Default value: off.

UsbRedirect String No off

Specifies whether to enable USB redirection. Valid values:

  • on: enables USB redirection.
  • off: disables USB redirection.

Default value: off.

Watermark String No off

Specifies whether to enable watermarking. Valid values:

  • on: enables watermarking.
  • off: disables watermarking.

Default value: off.

Name String No testPolicyGroupName

The name of the policy.

WatermarkType String No EndUserId

The type of the watermark. You can specify multiple watermark types at a time. Separate the watermark types with commas (,). Valid values:

  • EndUserId: username
  • HostName: the rightmost 15 characters of the cloud desktop ID
WatermarkTransparency String No LIGHT

The transparency of the watermark. Valid values:

  • LIGHT
  • MIDDLE
  • DARK

Default value: LIGHT.

Response parameters

Parameter Type Example Description
PolicyGroupId String pg-gx2x1dhsmthe9****

The ID of the policy.

RequestId String 1CBAFFAB-B697-4049-A9B1-67E1FC5FEB53

The ID of the request.

Examples

Sample requests

https://ecd.cn-hangzhou.aliyuncs.com/?Action=CreatePolicyGroup
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<CreatePolicyGroupResponse>
      <RequestId>1CBAFFAB-B697-4049-A9B1-67E1FC5FEB53</RequestId>
      <PolicyGroupId>pg-gx2x1dhsmthe9****</PolicyGroupId>
</CreatePolicyGroupResponse>

JSON format

{
  "RequestId":"1CBAFFAB-B697-4049-A9B1-67E1FC5FEB53",
  "PolicyGroupId":"pg-gx2x1dhsmthe9****"
}

Error codes

For a list of error codes, visit the API Error Center.