Add
Add Forwarding Rules to a Load Balancer
gpu_droplets.load_balancers.forwarding_rules.add(strlb_id, ForwardingRuleAddParams**kwargs)
/v2/load_balancers/{lb_id}/forwarding_rules
To add an additional forwarding rule to a load balancer instance, send a POST
request to /v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules
. In the body
of the request, there should be a forwarding_rules
attribute containing an
array of rules to be added.
No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.
Parameters
lb_id: str
Add Forwarding Rules to a Load Balancer
from gradient import Gradient
client = Gradient()
client.gpu_droplets.load_balancers.forwarding_rules.add(
lb_id="4de7ac8b-495b-4884-9a69-1050c6793cd6",
forwarding_rules=[{
"entry_port": 443,
"entry_protocol": "https",
"target_port": 80,
"target_protocol": "http",
}],
)