fbpx
PUThttps://api.spotinst.io/loadBalancer/routingRule/{ROUTING_RULE_ID}?accountId={ACCOUNT_ID}

Update one or more parameters in your routing rule. Only the specified fields will be affected. Please notice that targetSetIds and middlewareIds are optional and will override the exiting mappings. If you want to add / remove mapping you need to send the complete up to date mapping list.

Parameter Type Description
ROUTING_RULE_ID * String

The routing rule id you want to update

Example: rr-12345
ACCOUNT_ID String

Account ID from Spotinst console

Example: act-12345
Request

Headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "routingRule":{
    "route": "HeaderRegexp(`User-Defined-Header`, `application1`)"
  }
}

Body Attributes


  • routingRule.route String
    Route defines a simple language for matching HTTP requests and route the traffic accordingly. Route provides series of matchers that follow the syntax: Path matcher: — Path("/foo/bar") // trie-based PathRegexp(“/foo/.*”) // regexp-based Method matcher: — Method(“GET”) // trie-based MethodRegexp(“POST|PUT”) // regexp based Header matcher: — Header(“Content-Type”, “application/json”) // trie-based HeaderRegexp(“Content-Type”, “application/.*”) // regexp based Matchers can be combined using && operator: — Method(“POST”) && Path("/v1")
  • routingRule.priority Integer
    The priority of the created Routing Rule
    Example: 2
    Default: 1
  • routingRule.strategy String
    Balancing strategy. Could be one of the following: ROUNDROBIN, RANDOM, LEASTCONN, IPHASH
    Example: LEASTCONN
    Default: ROUNDROBIN
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "status": {
        "code": 200,
        "message": "OK"
    }
}