# Modify Routing Policy - UpdateRoutePolicy

## Overview

Modify Routing Policy






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `UpdateRoutePolicy`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.tnqacloud.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 |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID. Leave it blank for the default project. Sub-accounts must fill in. Please refer to the [GetProjectList API](/docs/api/summary/get_project_list) |**Yes**|
| **UGNID** | string | UGN Instance ID |**Yes**|
| **Policy.PolicyId** | string | Routing Policy ID |**Yes**|
| **Policy.Name** | string | Policy Name, limited to 255 characters |No|
| **Policy.Direction** | string | Policy direction, limited values: "In"/"Out |No|
| **Policy.Priority** | int | Policy priority, range: [1,255], the smaller the value, the higher the priority. In the same direction, policy priorities cannot be duplicated. |No|
| **Policy.RouteAction** | string | Policy execution actions, restricted values: "Permit"/"Deny" |No|
| **Policy.RoutePriority** | int | When the action is "Permit", set the routing priority for the matched routes, range: [1,255], with smaller values indicating higher priority. |No|
| **Policy.SrcRegions.N** | string | The array of regions where the routes to be matched by the routing policy are located |No|
| **Policy.SrcNetworkTypes.N** | string | The array of network instance types for routes that need to match the routing policy, limited to the value: "VPC |No|
| **Policy.SrcNetworks.N.NetworkId** | string | Array of network instance IDs for the routing policy to match |No|
| **Policy.SrcNetworks.N.Prefixes.N** | string | The array of network segments under the network instance of the route that needs to be matched by the routing policy |No|
| **Policy.DstNetworkTypes.N** | string | Array of network instance types that the routing policy needs to apply to, limited to the value: "VPC |No|
| **Policy.DstNetworks.N.NetworkId** | string | Array of network instance IDs that the routing policy needs to apply to |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|




## Example

### Request Example
    
```
https://api.tnqacloud.com/?Action=UpdateRoutePolicy
&ProjectId=org-1jzytw
&UGNID=ugn-1nnk7s9fw238
&Policy.PolicyId=policy-lsssp0x5j6
&Policy.Direction=Out
&Policy.Priority=100
&Policy.Action=Deny
&Policy.RoutePriority=90
&Policy.SrcRegions.n=cn-bj2
&Policy.SrcNetworkTypes.n=VPC
&Policy.SrcNetworks.n.NetworkId=uvnet-1ohmq6nnapc2
&Policy.SrcNetworks.n.Prefixes.n=192.168.30.0/24
&Policy.DstNetworkTypes.n=VPC
&Policy.DstNetworks.n.NetworkId=uvnet-1ohmq6nnapc1
&Policy.Name=test
```

### Response Example
    
```json
{
  "Action": "UpdateRoutePolicyResponse",
  "Message": "ok",
  "RetCode": 0
}
```





