curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/rules/{rule_id}/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "route_name": "api-rule", "routing_strategy": "Weight-Based", "status": "Active", "rules": { "name": "API traffic", "priority": 1, "match": { "path": { "type": "prefix", "value": "/api" }, "methods": [ "GET", "POST" ] }, "groups": [ { "target_group_id": 7, "weight": 90 }, { "target_group_id": 8, "weight": 10 } ] }}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/rules/{rule_id}/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "route_name": "api-rule", "routing_strategy": "Weight-Based", "status": "Active", "rules": { "name": "API traffic", "priority": 1, "match": { "path": { "type": "prefix", "value": "/api", }, "methods": [ "GET", "POST", ], }, "groups": [ { "target_group_id": 7, "weight": 90, }, { "target_group_id": 8, "weight": 10, }, ], }, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/rules/{rule_id}/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "route_name": "api-rule", "routing_strategy": "Weight-Based", "status": "Active", "rules": { "name": "API traffic", "priority": 1, "match": { "path": { "type": "prefix", "value": "/api" }, "methods": [ "GET", "POST" ] }, "groups": [ { "target_group_id": 7, "weight": 90 }, { "target_group_id": 8, "weight": 10 } ] } }),});console.log(await response.json());Changes a Rule. Send only the fields to change. If you send rules, it replaces the whole stored object, so send the match and groups together. The change is applied to the Load Balancer, and traffic follows the new Rule once it is. Needs the Update permission for Load Balancers.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Load Balancer ID
Rule ID
Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
The Rule’s name, up to 255 characters, not used by another Rule of this Load Balancer. The name of a Rule you deleted counts as used.
Example
api-ruleLeave this field out.
Example
Weight-BasedActive to apply the Rule, Inactive to keep it without applying it. Leave out to keep the current value.
Example
ActiveWhat the Rule matches and where it sends traffic. Every part is optional; a Rule with no match conditions matches every request.
object
A display name for the Rule. Leave out to keep the current value.
Example
API trafficA number that breaks a tie between two equally specific Rules: the lower number is tried first. A Rule with no priority comes last among equals. A more specific match always wins over a less specific one, whatever the priority.
Example
1Conditions that must all hold for the Rule to apply.
object
Match on the request path.
object
How value is compared with the request path.
Example
prefixThe path to match, for example /api.
Example
/apiHeader conditions. All of them must match.
object
Header name.
Example
x-tierExact compares the whole value, RegularExpression matches a pattern, Present only needs the header to exist. Defaults to Exact.
Example
ExactValue to compare. Required unless type is Present.
Example
premiumQuery parameter conditions. All of them must match.
object
Query parameter name.
Example
versionExact or RegularExpression. Defaults to Exact.
Example
ExactValue to compare. Required.
Example
2HTTP methods to match: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE or CONNECT. The request must use one of them.
One HTTP method, as an alternative to methods.
Example
GETThe backend groups the Rule sends traffic to. With more than one, traffic is split by weight. All groups of one Rule must use the same protocol (HTTP, HTTPS or gRPC).
object
ID of a backend group of this Load Balancer. Required.
Example
7Share of the traffic sent to this group, relative to the other groups of the Rule: a whole number, 0 or more, default 1.
Example
90Example
{ "name": "API traffic", "priority": 1, "match": { "path": { "type": "prefix", "value": "/api" }, "methods": [ "GET", "POST" ] }, "groups": [ { "target_group_id": 7, "weight": 90 }, { "target_group_id": 8, "weight": 10 } ]}Responses
Section titled “Responses”The Rule after the change
object
object
The Rule’s name.
Weight-Based for a Rule made without this field.
What the Rule matches and where it sends traffic. Every part is optional; a Rule with no match conditions matches every request.
object
A display name for the Rule. Not set unless you send it.
A number that breaks a tie between two equally specific Rules: the lower number is tried first. A Rule with no priority comes last among equals. A more specific match always wins over a less specific one, whatever the priority.
Conditions that must all hold for the Rule to apply.
object
Match on the request path.
object
How value is compared with the request path.
The path to match, for example /api.
Header conditions. All of them must match.
object
Header name.
Exact compares the whole value, RegularExpression matches a pattern, Present only needs the header to exist. Defaults to Exact.
Value to compare. Required unless type is Present.
Query parameter conditions. All of them must match.
object
Query parameter name.
Exact or RegularExpression. Defaults to Exact.
Value to compare. Required.
HTTP methods to match: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE or CONNECT. The request must use one of them.
One HTTP method, as an alternative to methods.
The backend groups the Rule sends traffic to. With more than one, traffic is split by weight. All groups of one Rule must use the same protocol (HTTP, HTTPS or gRPC).
object
ID of a backend group of this Load Balancer. Required.
Share of the traffic sent to this group, relative to the other groups of the Rule: a whole number, 0 or more, default 1.
Active or Inactive.
Who created it.
object
object
Example
{ "code": 200, "message": "Success", "data": { "id": 12, "route_name": "api-rule", "routing_strategy": "Weight-Based", "rules": { "name": "API traffic", "priority": 1, "match": { "path": { "type": "prefix", "value": "/api" }, "methods": [ "GET", "POST" ] }, "groups": [ { "target_group_id": 7, "weight": 90 }, { "target_group_id": 8, "weight": 10 } ] }, "status": "Active", "created_by": { "id": 101, "name": "A User", "email": "user@example.com", "username": "auser" }, "created_at": "2026-10-21T11:17:29Z", "updated_at": "2026-10-21T11:17:29Z" }, "errors": {}}A field is wrong, the name is taken, or the change could not be applied (“Failed to update routing rule. Please try again later.”). errors is a message, or an object keyed by field, each holding a list of messages (non_field_errors for a check across fields): “Each forward group requires a ‘target_group_id’.”, “A forward group weight must be a non-negative integer.”, “Target group ‘route_name, or a message that the name is already used. The same 400 is returned, with the project’s own text, when project_id is missing or not a number.
object
object
Example
{ "code": 400, "message": "Bad Request", "data": {}, "errors": "Failed to update routing rule. Please try again later."}No Load Balancer, or no Rule on it, with those IDs in the project and region. errors says which was not found.
object
object
Example
{ "code": 404, "message": "Bad Request", "data": {}, "errors": "Rule not found"}