Skip to main content

nodes

Creates, updates, deletes, gets or lists a nodes resource.

Overview​

Namenodes
TypeResource
Idlinode.nodebalancers.nodes

Fields​

The following fields are returned by SELECT queries:

A paginated list of NodeBalancer nodes.

NameDatatypeDescription
idintegerRead-only This node's unique ID.
config_idintegerRead-only The NodeBalancer Config ID that this Node belongs to.
nodebalancer_idintegerRead-only The NodeBalancer ID that this Node belongs to.
vpc_config_idintegerRead-only For VPC backends, you can use the vpc_config_id to get VPC IDs and VPC subnet IDs. Returns a null value if the backend is not a VPC node. Included only in {apiVersion} v4beta.
addressstring (ip)The address and port where this backend can be reached: either the Linode’s private IPv4, public IPv6, or the VPC's IPv4 address. (example: 10.0.0.45:80)
labelstringThe label for this node. This is for display purposes only. (example: vpc-node, pattern: [a-zA-Z0-9-_.]{3,32})
modestringThe mode this NodeBalancer should use when sending traffic to this backend. - If set to accept this backend is accepting traffic. - If set to reject this backend will not receive traffic. - If set to drain this backend will not receive new traffic, but connections already pinned to it will continue to be routed to it. - If set to backup, this backend will only receive traffic if all accept nodes are down. (accept, reject, drain, backup) (example: accept)
statusstringRead-only The current status of this node, based on the configured checks of its NodeBalancer Config. (Unknown, UP, DOWN) (example: UP)
weightintegerUsed when picking a backend to serve a request and is not pinned to a single backend yet. Nodes with a higher weight will receive more traffic.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnodeBalancerId, configId, nodeIdReturns information about a single Node, a backend for this NodeBalancer's configured port.

Learn more...

Learn more...
listselectnodeBalancerId, configIdpage, page_sizeReturns a paginated list of NodeBalancer nodes associated with this Config. These are the backends that will be sent traffic for this port.

Learn more...

Learn more...
createinsertnodeBalancerId, configIdCreates a backend node that can receive traffic for the NodeBalancer configuration. Requests are routed to backend nodes on the specified port based on their status. The configurable fields for the backend node depend on the chosen protocol and whether the node is located within a Linode VPC.

> 🚧
>
> You can configure UDP on the same NodeBalancer that also uses TCP, HTTP, or HTTPS, but only when managing it through the API. If UDP is configured and you make changes to the TCP, HTTP or HTTPS settings in Cloud Manager, the existing UDP configuration will be overwritten. This is because Cloud Manager doesn't currently support UDP. CLI: TCP, HTTP, HTTPS.

<br /> linode-cli nodebalancers node-create \<br /> 12345 4567 \<br /> --address 10.0.0.45:80 \<br /> --label node54321 \<br /> --weight 50 \<br /> --mode accept \<br /> --subnet_id 1<br />

Learn more...

- CLI: UDP.

<br /> linode-cli nodebalancers node-create \<br /> 12345 4567 \<br /> --address 192.168.210.120:80 \<br /> --label node54321 \<br /> --weight 50<br />

Learn more...

Learn more...
updatereplacenodeBalancerId, configId, nodeIdUpdates information about a node, a backend for this NodeBalancer's configured port.

> 🚧
>
> You can configure UDP on the same NodeBalancer that also uses TCP, HTTP, or HTTPS, but only when managing it through the API. If UDP is configured and you make changes to the TCP, HTTP or HTTPS settings in Cloud Manager, the existing UDP configuration will be overwritten. This is because Cloud Manager doesn't currently support UDP. CLI: TCP, HTTP, HTTPS.

<br /> linode-cli nodebalancers node-update \<br /> 12345 4567 54321 \<br /> --address 192.168.210.120:80 \<br /> --label node54321 \<br /> --weight 50 \<br /> --mode accept<br />

Learn more...

- CLI: UDP.

<br /> linode-cli nodebalancers node-create \<br /> 12345 4567 \<br /> --address 192.168.210.120:80 \<br /> --label node54321 \<br /> --weight 50<br />

Learn more...

Learn more...
deletedeletenodeBalancerId, configId, nodeIdDeletes a Node from this Config. This backend will no longer receive traffic for the configured port of this NodeBalancer.

This does not change or remove the Linode whose address was used in the creation of this Node.

Learn more...

Learn more...

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
configIdstringThe ID of the Config to access.
nodeBalancerIdstringThe ID of the NodeBalancer. (example: {{nodeBalancerId}})
nodeIdstringThe ID of the Node to access. (example: {{nodeId}})
pageintegerThe page of a collection to return.
page_sizeintegerThe number of items to return per page.

SELECT examples​

Returns information about a single Node, a backend for this NodeBalancer's configured port.

Learn more...

Learn more...

SELECT
id,
config_id,
nodebalancer_id,
vpc_config_id,
address,
label,
mode,
status,
weight
FROM linode.nodebalancers.nodes
WHERE nodeBalancerId = '{{ nodeBalancerId }}' -- required
AND configId = '{{ configId }}' -- required
AND nodeId = '{{ nodeId }}' -- required
;

INSERT examples​

Creates a backend node that can receive traffic for the NodeBalancer configuration. Requests are routed to backend nodes on the specified port based on their status. The configurable fields for the backend node depend on the chosen protocol and whether the node is located within a Linode VPC.

> 🚧
>
> You can configure UDP on the same NodeBalancer that also uses TCP, HTTP, or HTTPS, but only when managing it through the API. If UDP is configured and you make changes to the TCP, HTTP or HTTPS settings in Cloud Manager, the existing UDP configuration will be overwritten. This is because Cloud Manager doesn't currently support UDP. CLI: TCP, HTTP, HTTPS.

<br /> linode-cli nodebalancers node-create \<br /> 12345 4567 \<br /> --address 10.0.0.45:80 \<br /> --label node54321 \<br /> --weight 50 \<br /> --mode accept \<br /> --subnet_id 1<br />

Learn more...

- CLI: UDP.

<br /> linode-cli nodebalancers node-create \<br /> 12345 4567 \<br /> --address 192.168.210.120:80 \<br /> --label node54321 \<br /> --weight 50<br />

Learn more...

Learn more...

INSERT INTO linode.nodebalancers.nodes (
address,
label,
subnet_id,
weight,
nodeBalancerId,
configId
)
SELECT
'{{ address }}',
'{{ label }}',
{{ subnet_id }},
{{ weight }},
'{{ nodeBalancerId }}',
'{{ configId }}'
RETURNING
id,
config_id,
nodebalancer_id,
vpc_config_id,
address,
label,
mode,
status,
weight
;

REPLACE examples​

Updates information about a node, a backend for this NodeBalancer's configured port.

> 🚧
>
> You can configure UDP on the same NodeBalancer that also uses TCP, HTTP, or HTTPS, but only when managing it through the API. If UDP is configured and you make changes to the TCP, HTTP or HTTPS settings in Cloud Manager, the existing UDP configuration will be overwritten. This is because Cloud Manager doesn't currently support UDP. CLI: TCP, HTTP, HTTPS.

<br /> linode-cli nodebalancers node-update \<br /> 12345 4567 54321 \<br /> --address 192.168.210.120:80 \<br /> --label node54321 \<br /> --weight 50 \<br /> --mode accept<br />

Learn more...

- CLI: UDP.

<br /> linode-cli nodebalancers node-create \<br /> 12345 4567 \<br /> --address 192.168.210.120:80 \<br /> --label node54321 \<br /> --weight 50<br />

Learn more...

Learn more...

REPLACE linode.nodebalancers.nodes
SET
address = '{{ address }}',
label = '{{ label }}',
subnet_id = {{ subnet_id }},
weight = {{ weight }}
WHERE
nodeBalancerId = '{{ nodeBalancerId }}' --required
AND configId = '{{ configId }}' --required
AND nodeId = '{{ nodeId }}' --required
RETURNING
id,
config_id,
nodebalancer_id,
vpc_config_id,
address,
label,
mode,
status,
weight;

DELETE examples​

Deletes a Node from this Config. This backend will no longer receive traffic for the configured port of this NodeBalancer.

This does not change or remove the Linode whose address was used in the creation of this Node.

Learn more...

Learn more...

DELETE FROM linode.nodebalancers.nodes
WHERE nodeBalancerId = '{{ nodeBalancerId }}' --required
AND configId = '{{ configId }}' --required
AND nodeId = '{{ nodeId }}' --required
;