Skip to main content

service_lb_policies

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

Overview

Nameservice_lb_policies
TypeResource
Idgoogle.networkservices.service_lb_policies

Fields

NameDatatypeDescription
namestringRequired. Name of the ServiceLbPolicy resource. It matches pattern projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}.
descriptionstringOptional. A free-text description of the resource. Max length 1024 characters.
autoCapacityDrainobjectOption to specify if an unhealthy IG/NEG should be considered for global load balancing and traffic routing.
createTimestringOutput only. The timestamp when this resource was created.
failoverConfigobjectOption to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy.
labelsobjectOptional. Set of label tags associated with the ServiceLbPolicy resource.
loadBalancingAlgorithmstringOptional. The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
updateTimestringOutput only. The timestamp when this resource was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, serviceLbPoliciesIdGets details of a single ServiceLbPolicy.
listSELECTlocationsId, projectsIdLists ServiceLbPolicies in a given project and location.
createINSERTlocationsId, projectsIdCreates a new ServiceLbPolicy in a given project and location.
deleteDELETElocationsId, projectsId, serviceLbPoliciesIdDeletes a single ServiceLbPolicy.
patchUPDATElocationsId, projectsId, serviceLbPoliciesIdUpdates the parameters of a single ServiceLbPolicy.

SELECT examples

Lists ServiceLbPolicies in a given project and location.

SELECT
name,
description,
autoCapacityDrain,
createTime,
failoverConfig,
labels,
loadBalancingAlgorithm,
updateTime
FROM google.networkservices.service_lb_policies
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new service_lb_policies resource.

/*+ create */
INSERT INTO google.networkservices.service_lb_policies (
locationsId,
projectsId,
name,
labels,
description,
loadBalancingAlgorithm,
autoCapacityDrain,
failoverConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ loadBalancingAlgorithm }}',
'{{ autoCapacityDrain }}',
'{{ failoverConfig }}'
;

UPDATE example

Updates a service_lb_policies resource.

/*+ update */
UPDATE google.networkservices.service_lb_policies
SET
name = '{{ name }}',
labels = '{{ labels }}',
description = '{{ description }}',
loadBalancingAlgorithm = '{{ loadBalancingAlgorithm }}',
autoCapacityDrain = '{{ autoCapacityDrain }}',
failoverConfig = '{{ failoverConfig }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND serviceLbPoliciesId = '{{ serviceLbPoliciesId }}';

DELETE example

Deletes the specified service_lb_policies resource.

/*+ delete */
DELETE FROM google.networkservices.service_lb_policies
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND serviceLbPoliciesId = '{{ serviceLbPoliciesId }}';