Skip to content
  • Auto
  • Light
  • Dark

Remove

Remove Forwarding Rules from a Load Balancer
client.gpuDroplets.loadBalancers.forwardingRules.remove(stringlbID, ForwardingRuleRemoveParams { forwarding_rules } body, RequestOptionsoptions?): void
delete/v2/load_balancers/{lb_id}/forwarding_rules

To remove forwarding rules from a load balancer instance, send a DELETE 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 removed.

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.

ParametersExpand Collapse
lbID: string
body: ForwardingRuleRemoveParams { forwarding_rules }
forwarding_rules: Array<ForwardingRule { entry_port, entry_protocol, target_port, 3 more } >
entry_port: number

An integer representing the port on which the load balancer instance will listen.

entry_protocol: "http" | "https" | "http2" | 3 more

The protocol used for traffic to the load balancer. The possible values are: http, https, http2, http3, tcp, or udp. If you set the entry_protocol to udp, the target_protocol must be set to udp. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly.

Accepts one of the following:
"http"
"https"
"http2"
"http3"
"tcp"
"udp"
target_port: number

An integer representing the port on the backend Droplets to which the load balancer will send traffic.

target_protocol: "http" | "https" | "http2" | 2 more

The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: http, https, http2, tcp, or udp. If you set the target_protocol to udp, the entry_protocol must be set to udp. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly.

Accepts one of the following:
"http"
"https"
"http2"
"tcp"
"udp"
certificate_id?: string

The ID of the TLS certificate used for SSL termination if enabled.

tls_passthrough?: boolean

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets.

Remove Forwarding Rules from a Load Balancer
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

await client.gpuDroplets.loadBalancers.forwardingRules.remove('4de7ac8b-495b-4884-9a69-1050c6793cd6', {
  forwarding_rules: [{ entry_port: 443, entry_protocol: 'https', target_port: 80, target_protocol: 'http' }],
});
Returns Examples