Skip to main content

load_balancers

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

Overview​

Nameload_balancers
TypeResource
Idoci.load_balancer.load_balancers

Fields​

The following fields are returned by SELECT queries:

The configuration information is being retrieved.

NameDatatypeDescription
idstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the load balancer.
backendSetsobject
certificatesobject
compartmentIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
displayNamestringA user-friendly name. It does not have to be unique, and it is changeable. Example: example_load_balancer
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
hostnamesobject
ipAddressesarrayAn array of IP addresses.
ipModestringWhether the load balancer has an IPv4 or IPv6 IP address. If "IPV4", the service assigns an IPv4 address and the load balancer supports IPv4 traffic. If "IPV6", the service assigns an IPv6 address and the load balancer supports IPv6 traffic. Example: "ipMode":"IPV6" (IPV4, IPV6) (default: IPV4)
isDeleteProtectionEnabledbooleanWhether or not the load balancer has delete protection enabled. If "true", the loadbalancer will be protected against deletion if configured to accept traffic. If "false", the loadbalancer will not be protected against deletion. Delete protection is not be enabled unless this field is set to "true". Example: true
isPrivatebooleanWhether the load balancer has a VCN-local (private) IP address. If "true", the service assigns a private IP address to the load balancer. If "false", the service assigns a public IP address to the load balancer. A public load balancer is accessible from the internet, depending on your VCN's [security list rules](/Content/Network/Concepts/securitylists.htm). For more information about public and private load balancers, see [How Load Balancing Works](/Content/Balance/Concepts/balanceoverview.htm#how-load-balancing-works). Example: true
isRequestIdEnabledbooleanWhether or not the load balancer has the Request Id feature enabled for HTTP listeners. If "true", the load balancer will attach a unique request id header to every request passed through from the load balancer to load balancer backends. This same request id header also will be added to the response the lb received from the backend handling the request before the load balancer returns the response to the requestor. The name of the unique request id header is set the by value of requestIdHeader. If "false", the loadbalancer not add this unique request id header to either the request passed through to the load balancer backends nor to the reponse returned to the user. Example: true
lifecycleStatestringThe current state of the load balancer. (CREATING, FAILED, ACTIVE, DELETING, DELETED)
listenersobject
networkSecurityGroupIdsarrayAn array of NSG [OCIDs](/Content/General/Concepts/identifiers.htm) associated with the load balancer. During the load balancer's creation, the service adds the new load balancer to the specified NSGs. The benefits of associating the load balancer with NSGs include: * NSGs define network security rules to govern ingress and egress traffic for the load balancer. * The network security rules of other resources can reference the NSGs associated with the load balancer to ensure access. Example: ["ocid1.nsg.oc1.phx.unique_ID"]
pathRouteSetsobject
requestIdHeaderstringIf isRequestIdEnabled is true then this field contains the name of the header field that contains the unique request id that is attached to every request from the load balancer to the load balancer backends and to every response from the load balancer. If a request to the load balancer already contains a header with same name as specified in requestIdHeader then the load balancer will not change the value of that field. If this field is set to "" this field defaults to X-Request-Id. (pattern: <code>^(X-(-?[a-zA-Z_0-9])*)?$</code>)
routingPoliciesobject
ruleSetsobject
securityAttributesobjectExtended Defined tags for ZPR for this resource. Each key is predefined and scoped to a namespace. Example: &#123;"Oracle-ZPR": &#123;"MaxEgressCount": &#123;"value":"42","mode":"audit", "usagetype" : "zpr"&#125;&#125;&#125;
shapeDetailsobjectThe configuration details to update load balancer to a different shape. (x-example: {<br /> "minimumBandwidthInMbps": 150,<br /> "maximumBandwidthInMbps": 1500<br />}<br />)
shapeNamestringA template that determines the total pre-provisioned bandwidth (ingress plus egress). To get a list of available shapes, use the [ListShapes](#/en/loadbalancer/20170115/LoadBalancerShape/ListShapes) operation. Example: 100Mbps
sslCipherSuitesobject
subnetIdsarrayAn array of subnet [OCIDs](/Content/General/Concepts/identifiers.htm).
systemTagsobjectSystem tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: &#123;"orcl-cloud": &#123;"free-tier-retained": "true"&#125;&#125;
timeCreatedstring (date-time)The date and time the load balancer was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectloadBalancerId, regionopc-request-idGets the specified load balancer's configuration information.
listselectcompartmentId, regionopc-request-id, limit, page, detail, sortBy, sortOrder, displayName, lifecycleStateLists all load balancers in the specified compartment.
createinsertregion, compartmentId, displayName, shapeName, subnetIdsopc-request-id, opc-retry-tokenCreates a new load balancer in the specified compartment. For general information about load balancers,<br />see [Overview of the Load Balancing Service](/Content/Balance/Concepts/balanceoverview.htm).<br /><br />For the purposes of access control, you must provide the OCID of the compartment where you want<br />the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN<br />or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN.<br />For information about access control and compartments, see<br />[Overview of the IAM Service](/Content/Identity/Concepts/overview.htm).<br /><br />You must specify a display name for the load balancer. It does not have to be unique, and you can change it.<br /><br />For information about Availability Domains, see<br />[Regions and Availability Domains](/Content/General/Concepts/regions.htm).<br />To get a list of Availability Domains, use the ListAvailabilityDomains operation<br />in the Identity and Access Management Service API.<br /><br />All Oracle Cloud Infrastructure resources, including load balancers, get an Oracle-assigned,<br />unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID<br />in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type,<br />or by viewing the resource in the Console. Fore more information, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br /><br />After you send your request, the new object's state will temporarily be PROVISIONING. Before using the<br />object, first make sure its state has changed to RUNNING.<br /><br />When you create a load balancer, the system assigns an IP address.<br />To get the IP address, use the [GetLoadBalancer](#/en/loadbalancer/20170115/LoadBalancer/GetLoadBalancer) operation.<br />
updateupdateloadBalancerId, regionopc-request-id, opc-retry-tokenUpdates a load balancer's configuration.
deletedeleteloadBalancerId, regionopc-request-idStops a load balancer and removes it from service.
change_compartmentexecloadBalancerId, region, compartmentIdopc-request-id, opc-retry-tokenMoves a load balancer into a different compartment within the same tenancy. For information about moving resources<br />between compartments, see [Moving Resources to a Different Compartment](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br />

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
compartmentIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancers to list.
loadBalancerIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the load balancer to move.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
detailstringThe level of detail to return for each result. Can be full or simple. Example: full
displayNamestringA filter to return only resources that match the given display name exactly. Example: example_load_balancer
lifecycleStatestringA filter to return only resources that match the given lifecycle state. Example: SUCCEEDED
limitinteger (int64)For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 50
opc-request-idstringThe unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringFor list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 3
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC). The DISPLAYNAME sort order is case sensitive.

SELECT examples​

Gets the specified load balancer's configuration information.

SELECT
id,
backendSets,
certificates,
compartmentId,
definedTags,
displayName,
freeformTags,
hostnames,
ipAddresses,
ipMode,
isDeleteProtectionEnabled,
isPrivate,
isRequestIdEnabled,
lifecycleState,
listeners,
networkSecurityGroupIds,
pathRouteSets,
requestIdHeader,
routingPolicies,
ruleSets,
securityAttributes,
shapeDetails,
shapeName,
sslCipherSuites,
subnetIds,
systemTags,
timeCreated
FROM oci.load_balancer.load_balancers
WHERE loadBalancerId = '{{ loadBalancerId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Creates a new load balancer in the specified compartment. For general information about load balancers,<br />see [Overview of the Load Balancing Service](/Content/Balance/Concepts/balanceoverview.htm).<br /><br />For the purposes of access control, you must provide the OCID of the compartment where you want<br />the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN<br />or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN.<br />For information about access control and compartments, see<br />[Overview of the IAM Service](/Content/Identity/Concepts/overview.htm).<br /><br />You must specify a display name for the load balancer. It does not have to be unique, and you can change it.<br /><br />For information about Availability Domains, see<br />[Regions and Availability Domains](/Content/General/Concepts/regions.htm).<br />To get a list of Availability Domains, use the ListAvailabilityDomains operation<br />in the Identity and Access Management Service API.<br /><br />All Oracle Cloud Infrastructure resources, including load balancers, get an Oracle-assigned,<br />unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID<br />in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type,<br />or by viewing the resource in the Console. Fore more information, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br /><br />After you send your request, the new object's state will temporarily be PROVISIONING. Before using the<br />object, first make sure its state has changed to RUNNING.<br /><br />When you create a load balancer, the system assigns an IP address.<br />To get the IP address, use the [GetLoadBalancer](#/en/loadbalancer/20170115/LoadBalancer/GetLoadBalancer) operation.<br />

INSERT INTO oci.load_balancer.load_balancers (
backendSets,
certificates,
compartmentId,
definedTags,
displayName,
freeformTags,
hostnames,
ipMode,
ipv6SubnetCidr,
isDeleteProtectionEnabled,
isPrivate,
isRequestIdEnabled,
listeners,
networkSecurityGroupIds,
pathRouteSets,
requestIdHeader,
reservedIps,
ruleSets,
securityAttributes,
shapeDetails,
shapeName,
sslCipherSuites,
subnetIds,
region,
opc-request-id,
opc-retry-token
)
SELECT
'{{ backendSets }}',
'{{ certificates }}',
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ displayName }}' /* required */,
'{{ freeformTags }}',
'{{ hostnames }}',
'{{ ipMode }}',
'{{ ipv6SubnetCidr }}',
{{ isDeleteProtectionEnabled }},
{{ isPrivate }},
{{ isRequestIdEnabled }},
'{{ listeners }}',
'{{ networkSecurityGroupIds }}',
'{{ pathRouteSets }}',
'{{ requestIdHeader }}',
'{{ reservedIps }}',
'{{ ruleSets }}',
'{{ securityAttributes }}',
'{{ shapeDetails }}',
'{{ shapeName }}' /* required */,
'{{ sslCipherSuites }}',
'{{ subnetIds }}' /* required */,
'{{ region }}',
'{{ opc-request-id }}',
'{{ opc-retry-token }}'
;

UPDATE examples​

Updates a load balancer's configuration.

UPDATE oci.load_balancer.load_balancers
SET
definedTags = '{{ definedTags }}',
displayName = '{{ displayName }}',
freeformTags = '{{ freeformTags }}',
ipMode = '{{ ipMode }}',
isDeleteProtectionEnabled = {{ isDeleteProtectionEnabled }},
isRequestIdEnabled = {{ isRequestIdEnabled }},
requestIdHeader = '{{ requestIdHeader }}',
securityAttributes = '{{ securityAttributes }}'
WHERE
loadBalancerId = '{{ loadBalancerId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id}}'
AND opc-retry-token = '{{ opc-retry-token}}';

DELETE examples​

Stops a load balancer and removes it from service.

DELETE FROM oci.load_balancer.load_balancers
WHERE loadBalancerId = '{{ loadBalancerId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id }}'
;

Lifecycle Methods​

Moves a load balancer into a different compartment within the same tenancy. For information about moving resources<br />between compartments, see [Moving Resources to a Different Compartment](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br />

EXEC oci.load_balancer.load_balancers.change_compartment
@loadBalancerId='{{ loadBalancerId }}' --required,
@region='{{ region }}' --required,
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"compartmentId": "{{ compartmentId }}"
}'
;