# Creating content forwarding strategy for traditional load balancing - CreatePolicy

## Overview

Creating VServer Content Forwarding Strategy in Traditional Load Balancing

 > 💡 Specifying forwarding rule priority currently only supports path rules, and does not temporarily support adjustments between domain name rules or between domain name and path rules.




## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreatePolicy`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |**Yes**|
| **ULBId** | string | ID of the traditional load balancing instance that requires adding content forwarding strategy |**Yes**|
| **VServerId** | string | The ID of the traditional load balancing VServer instance that requires the addition of content forwarding strategy. |**Yes**|
| **BackendId.N** | string | The ID of the traditional load balancing backend resource instance where the content forwarding strategy is applied, derived from the BackendId returned by AllocateBackend. |**Yes**|
| **Match** | string | Content Forwarding Matching Field |**Yes**|
| **DomainMatchMode** | string | The matching method of the domain name in the content forwarding rule, by default, is consistent with the original. Enumeration values: Regular, regular expression; Wildcard, wildcard domain name. |No|
| **Type** | string | Type of content forwarding matching field |No|
| **PolicyPriority** | int | Policy priority, 1-9999; Only effective for path rules. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **PolicyId** | string | Content Forwarding Strategy ID |No|




## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=CreatePolicy
&Region=cn-bj2
&ProjectId=project-XXX
&Match=ok
&Type=Domain
&ULBId=ulb-XXXXX
&VServerId=vserver-XXXX
&BackendId.0=backend-XXXX
&PolicyPriority=7
&DomainMatchMode=GxmqumOf
```

### Response Example
    
```json
{
  "Action": "CreatePolicyResponse",
  "PolicyId": "0a074d02-b7c9-4a5d-9acf-XXXXXXX",
  "RetCode": 0
}
```





