docs
api
Cloud Network(UGN)
AddRoutePolicy

Add Routing Policy - AddRoutePolicy

Overview

Add Routing Policy

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is AddRoutePolicy.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
ProjectIdstringProject ID. Leave it blank for the default project. Sub-accounts must fill in. Please refer to the GetProjectList APIYes
UGNIDstringUGN Instance IDYes
Policy.DirectionstringPolicy direction, limited values: "In"/"OutYes
Policy.PriorityintPolicy priority, range: [1,255], the smaller the value, the higher the priority. In the same direction, policy priorities cannot be duplicated.Yes
Policy.ActionstringPolicy execution action, limited values: "Permit"/"DenyYes
Policy.NamestringPolicy Name, limited to 255 charactersNo
SrcNetworks.N.NetworkIdstringArray of network instance IDs for the routing policy to matchNo
Prefixes.NstringThe subnet array under the network instance of the route that the routing policy needs to matchNo
Policy.RoutePriorityintWhen the action is set to "Permit", assign a routing priority to the matched routes, with a range of [1,255]. The smaller the value, the higher the priority.No
SrcRegions.NstringArray of regions where the routing strategy needs to match the routeNo
SrcNetworkTypes.NstringThe array of network instance types of the routes that need to match the routing policy, limited to the value: "VPC""".No
DstNetworkTypes.NstringThe array of network instance types that the routing policy needs to apply to, limited to the value: "VPCNo
DstNetworks.N.NetworkIdstringArray of Network Instance IDs that the Routing Policy Needs to ApplyNo

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No

Example

Request Example

https://api.surfercloud.com/?Action=AddRoutePolicy
&ProjectId=uZbfBYYQ
&UGNID=vZHhDhPb
&Policy.Direction=bpBuXVOn
&Policy.Priority=2
&Policy.Action=tMgmjHyq
&Policy.SrcNetworks.n.NetworkId=VPYkZPLu
&Policy.RoutePriority=3
&Policy.SrcRegions.n=4
&Policy.SrcNetworkTypes.n=onIVXCWs
&Policy.SrcNetworks.n.Prefixes.n=JPChaqlb
&Policy.DstNetworkTypes.n=cPCdfaeP
&Policy.DstNetworks.n.NetworkId=qUmfspqL
&Policy.Name=QIfUhxHX

Response Example

{
  "Action": "AddRoutePolicyResponse",
  "Policies": [
    {
      "Action": "mGfXwdfC",
      "Direction": "AASlctBC",
      "DstNetworkTypes": [
        "DeFacVGH"
      ],
      "DstNetworks": [
        {
          "NetworkId": "SRLUbPjC",
          "Prefixes": [
            "uhLHTWeo"
          ]
        }
      ],
      "Enabled": true,
      "PolicyId": "KYcefSPo",
      "Priority": 4,
      "Region": 8,
      "RoutePriority": 7,
      "SrcNetworkTypes": [
        "IERCMZjO"
      ],
      "SrcNetworks": [
        {
          "NetworkId": "szhHfNEi",
          "Prefixes": [
            "EUDzQIrc"
          ]
        }
      ],
      "SrcRegions": [
        5
      ]
    }
  ],
  "RetCode": 0
}
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved