Skip to content

Commit 9117f23

Browse files
authored
chore: updates to networkservices (googleapis#14077)
This splits the changes that were joined together in googleapis#14063 so that releases can have proper release notes. BEGIN_COMMIT_OVERRIDE feat: Add isolation support to prevent cross-region overflow by adding a new field "isolation_config" to message "ServiceLbPolicy" END_COMMIT_OVERRIDE
1 parent 112a27a commit 9117f23

5 files changed

Lines changed: 72 additions & 3 deletions

File tree

packages/google-cloud-network-services/google/cloud/network_services/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.5.23" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-network-services/google/cloud/network_services_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.5.23" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-network-services/google/cloud/network_services_v1/types/service_lb_policy.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ class ServiceLbPolicy(proto.Message):
6767
failover_config (google.cloud.network_services_v1.types.ServiceLbPolicy.FailoverConfig):
6868
Optional. Configuration related to health
6969
based failover.
70+
isolation_config (google.cloud.network_services_v1.types.ServiceLbPolicy.IsolationConfig):
71+
Optional. Configuration to provide isolation
72+
support for the associated Backend Service.
7073
"""
7174

7275
class LoadBalancingAlgorithm(proto.Enum):
@@ -101,6 +104,41 @@ class LoadBalancingAlgorithm(proto.Enum):
101104
WATERFALL_BY_REGION = 5
102105
WATERFALL_BY_ZONE = 6
103106

107+
class IsolationGranularity(proto.Enum):
108+
r"""The granularity of this isolation restriction.
109+
110+
Values:
111+
ISOLATION_GRANULARITY_UNSPECIFIED (0):
112+
No isolation is configured for the backend
113+
service. Traffic can overflow based on the load
114+
balancing algorithm.
115+
REGION (1):
116+
Traffic for this service will be isolated at
117+
the cloud region level.
118+
"""
119+
ISOLATION_GRANULARITY_UNSPECIFIED = 0
120+
REGION = 1
121+
122+
class IsolationMode(proto.Enum):
123+
r"""The mode of this isolation restriction, defining whether
124+
clients in a given region are allowed to reach out to another
125+
region.
126+
127+
Values:
128+
ISOLATION_MODE_UNSPECIFIED (0):
129+
No isolation mode is configured for the
130+
backend service.
131+
NEAREST (1):
132+
Traffic will be sent to the nearest region.
133+
STRICT (2):
134+
Traffic will fail if no serving backends are
135+
available in the same region as the load
136+
balancer.
137+
"""
138+
ISOLATION_MODE_UNSPECIFIED = 0
139+
NEAREST = 1
140+
STRICT = 2
141+
104142
class AutoCapacityDrain(proto.Message):
105143
r"""Option to specify if an unhealthy IG/NEG should be considered
106144
for global load balancing and traffic routing.
@@ -146,6 +184,30 @@ class FailoverConfig(proto.Message):
146184
number=1,
147185
)
148186

187+
class IsolationConfig(proto.Message):
188+
r"""Configuration to provide isolation support for the associated
189+
Backend Service.
190+
191+
Attributes:
192+
isolation_granularity (google.cloud.network_services_v1.types.ServiceLbPolicy.IsolationGranularity):
193+
Optional. The isolation granularity of the
194+
load balancer.
195+
isolation_mode (google.cloud.network_services_v1.types.ServiceLbPolicy.IsolationMode):
196+
Optional. The isolation mode of the load
197+
balancer.
198+
"""
199+
200+
isolation_granularity: "ServiceLbPolicy.IsolationGranularity" = proto.Field(
201+
proto.ENUM,
202+
number=1,
203+
enum="ServiceLbPolicy.IsolationGranularity",
204+
)
205+
isolation_mode: "ServiceLbPolicy.IsolationMode" = proto.Field(
206+
proto.ENUM,
207+
number=2,
208+
enum="ServiceLbPolicy.IsolationMode",
209+
)
210+
149211
name: str = proto.Field(
150212
proto.STRING,
151213
number=1,
@@ -184,6 +246,11 @@ class FailoverConfig(proto.Message):
184246
number=10,
185247
message=FailoverConfig,
186248
)
249+
isolation_config: IsolationConfig = proto.Field(
250+
proto.MESSAGE,
251+
number=11,
252+
message=IsolationConfig,
253+
)
187254

188255

189256
class ListServiceLbPoliciesRequest(proto.Message):

packages/google-cloud-network-services/samples/generated_samples/snippet_metadata_google.cloud.networkservices.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-network-services",
11-
"version": "0.5.23"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-network-services/tests/unit/gapic/network_services_v1/test_network_services.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47285,6 +47285,7 @@ def test_create_service_lb_policy_rest_call_success(request_type):
4728547285
"load_balancing_algorithm": 3,
4728647286
"auto_capacity_drain": {"enable": True},
4728747287
"failover_config": {"failover_health_threshold": 2649},
47288+
"isolation_config": {"isolation_granularity": 1, "isolation_mode": 1},
4728847289
}
4728947290
# The version of a generated dependency at test runtime may differ from the version used during generation.
4729047291
# Delete any fields which are not present in the current runtime dependency
@@ -47496,6 +47497,7 @@ def test_update_service_lb_policy_rest_call_success(request_type):
4749647497
"load_balancing_algorithm": 3,
4749747498
"auto_capacity_drain": {"enable": True},
4749847499
"failover_config": {"failover_health_threshold": 2649},
47500+
"isolation_config": {"isolation_granularity": 1, "isolation_mode": 1},
4749947501
}
4750047502
# The version of a generated dependency at test runtime may differ from the version used during generation.
4750147503
# Delete any fields which are not present in the current runtime dependency

0 commit comments

Comments
 (0)