3.1.5.5.5 loadBalancingRules

The loadBalancingRules resource is used to configure load balancing policies. The policies dictate the kind of traffic that is load-balanced, and port mapping between frontend IPs and backend IPs.

It is invoked through the following URI.

 https://<url>/networking/v1/loadBalancers/{parentResourceId}/loadBalancingRules/{resourceId}

url: The address or name of the REST server of the Network Controller.

parentResourceId: the identifier for the specific ancestor resource within the resource type. See section 2.2.3.3 for more details.

resourceId: the identifier for the specific descendant resource within the resource type. See section 2.2.3.4 for more details.

Note  The server MAY support additional versions, besides v1 in the URI.

The following HTTP methods can be performed on this resource.

HTTP method

Section

Description

PUT

3.1.5.5.5.1.1

Create a new loadBalancingRules resource or update an existing loadBalancingRules resource.

GET

3.1.5.5.5.1.2

Get one loadBalancingRules resource.

GET ALL

3.1.5.5.5.1.3

List all loadBalancingRules resources in the Network Controller.

DELETE

3.1.5.5.5.1.4

Deletes a loadBalancingRules resource.

The following property elements are valid.

Element name

Type

Description

etag

Read-only

Specified in Common JSON Elements, section 2.2.2.

provisioningState

Read-only

Specified in Common JSON Elements, section 2.2.2.

backendAddressPool

Optional

Indicates an array of references to a backendAddressPools resource. Inbound traffic is randomly load balanced across IPs in the backend pool.

backendPort

Optional

Indicates the port used for internal connections on the endpoint. The localPort attribute maps the external port on the endpoint to an internal port on a role. This is useful in scenarios where a role has to communicate to an internal component on a port that is different from the one that is exposed externally. If not specified, the value of localPort is the same as the port attribute. Set the value of localPort to asterisk (*) to automatically assign an unallocated port that is discoverable using the runtime API.

Possible values range between 1 and 65535, inclusive.

This parameter is required if the protocol is TCP or UDP.

frontendIPConfigurations

Required

Indicates an array of references to frontendIpAddress resources.

frontendPort

Optional

Indicates the port for the external endpoint. Possible values range between 1 and 65535, inclusive.  This value MUST be unique for the loadBalancers resource.

This parameter is required if the protocol is TCP or UDP.

idleTimeoutInMinutes

Optional

Indicates the timeout for the TCP idle connection in the inbound direction, i.e. a connection initiated by an internet client to a VIP. The value can be set between 4 and 30 minutes. The default value is 4 minutes.

protocol

Required

Indicates the inbound transport protocol for the external endpoint. Valid values include UDP, TCP, GRE, ESP, or ALL.

probe

Optional

Indicates a reference to the probe resource used by this loadBalancingRule.

EnableFloatingIP

Optional

This specifies that a floating IP (VIP) will be used on the available servers behind a loadBalancer. Floating IP will be forwarded by the loadBalancer to the backend server. The back-end server will be configured with that VIP, a datacenter IP and weakhost forwarding.

Floating IP configuration is required if you are using the SQL AlwaysOn Availability Group feature. This setting can't be changed after you create the endpoint.

LoadDistribution

Optional

This specifies the load balancing distribution type to be used by the loadBalancer. The loadBalancer uses a distribution algorithm which is a 5-tuple (source IP, source port, destination IP, destination port, protocol type) hash to map traffic to available servers. It provides stickiness only within a transport session, which is a feature that routes the requests for a specific session to the same physical machine that serviced the first request for that session. Packets in the same TCP or UDP session will be directed to the same datacenter IP instance behind the load balanced endpoint. When the client closes and re-opens the connection or starts a new session from the same source IP, the source port changes and causes the traffic to go to a different datacenter IP endpoint.

The loadBalancer can be configured to use a 2-tuple (Source IP, Destination IP) or 3-tuple (Source IP, Destination IP, Protocol) to map traffic to the available servers. By using SourceIPProtocol, connections initiated from the same client computer goes to the same datacenter IP endpoint.

Default – The loadBalancer is configured to use a 5-tuple hash to map traffic to available servers.

SourceIP – The loadBalancer is configured to use a 2-tuple hash to map traffic to available servers.

SourceIPProtocol – The loadBalancer is configured to use a 3-tuple hash to map traffic to available servers.

enableTcpReset

Optional

Enables TCP connection reset when the flow times out due to inactivity. The default value is false.

This property is supported with URI version v4 or later.