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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Name of the ServiceLbPolicy resource. It matches pattern projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}.
autoCapacityDrainobjectOptional. Configuration to automatically move traffic away for unhealthy IG/NEG for the associated Backend Service. (id: ServiceLbPolicyAutoCapacityDrain)
createTimestring (google-datetime)Output only. The timestamp when this resource was created.
descriptionstringOptional. A free-text description of the resource. Max length 1024 characters.
failoverConfigobjectOptional. Configuration related to health based failover. (id: ServiceLbPolicyFailoverConfig)
isolationConfigobjectOptional. Configuration to provide isolation support for the associated Backend Service. (id: ServiceLbPolicyIsolationConfig)
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.
updateTimestring (google-datetime)Output only. The timestamp when this resource was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, serviceLbPoliciesIdGets details of a single ServiceLbPolicy.
listselectprojectsId, locationsIdpageSize, pageTokenLists ServiceLbPolicies in a given project and location.
createinsertprojectsId, locationsIdserviceLbPolicyIdCreates a new ServiceLbPolicy in a given project and location.
patchupdateprojectsId, locationsId, serviceLbPoliciesIdupdateMaskUpdates the parameters of a single ServiceLbPolicy.
deletedeleteprojectsId, locationsId, serviceLbPoliciesIdDeletes a single ServiceLbPolicy.

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
locationsIdstring
projectsIdstring
serviceLbPoliciesIdstring
pageSizeinteger (int32)
pageTokenstring
serviceLbPolicyIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single ServiceLbPolicy.

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

INSERT examples

Creates a new ServiceLbPolicy in a given project and location.

INSERT INTO google.networkservices.service_lb_policies (
data__name,
data__labels,
data__description,
data__loadBalancingAlgorithm,
data__autoCapacityDrain,
data__failoverConfig,
data__isolationConfig,
projectsId,
locationsId,
serviceLbPolicyId
)
SELECT
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ loadBalancingAlgorithm }}',
'{{ autoCapacityDrain }}',
'{{ failoverConfig }}',
'{{ isolationConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ serviceLbPolicyId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single ServiceLbPolicy.

UPDATE google.networkservices.service_lb_policies
SET
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__loadBalancingAlgorithm = '{{ loadBalancingAlgorithm }}',
data__autoCapacityDrain = '{{ autoCapacityDrain }}',
data__failoverConfig = '{{ failoverConfig }}',
data__isolationConfig = '{{ isolationConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND serviceLbPoliciesId = '{{ serviceLbPoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single ServiceLbPolicy.

DELETE FROM google.networkservices.service_lb_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND serviceLbPoliciesId = '{{ serviceLbPoliciesId }}' --required;