Add
Add Forwarding Rules to a Load Balancer
client.gpuDroplets.loadBalancers.forwardingRules.add(stringlbID, ForwardingRuleAddParams { forwarding_rules } body, RequestOptionsoptions?): void
/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
lbID: string
Add Forwarding Rules to a Load Balancer
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.loadBalancers.forwardingRules.add('4de7ac8b-495b-4884-9a69-1050c6793cd6', {
forwarding_rules: [{ entry_port: 443, entry_protocol: 'https', target_port: 80, target_protocol: 'http' }],
});