Skip to content

Commit

Permalink
Add lb route extension resource (GoogleCloudPlatform#10119)
Browse files Browse the repository at this point in the history
Co-authored-by: pweiber <[email protected]>
  • Loading branch information
2 people authored and pengq-google committed May 21, 2024
1 parent 5ef769a commit ef7e817
Show file tree
Hide file tree
Showing 4 changed files with 1,402 additions and 4 deletions.
179 changes: 179 additions & 0 deletions mmv1/products/networkservices/LbRouteExtension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Copyright 2024 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Api::Resource
name: 'LbRouteExtension'
description: |
LbRouteExtension is a resource that lets you control where traffic is routed to for a given request.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Configure a route extension': 'https://cloud.google.com/service-extensions/docs/configure-callout#configure_a_route_extension'
api: 'https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.lbRouteExtensions'
base_url: 'projects/{{project}}/locations/{{location}}/lbRouteExtensions'
self_link: 'projects/{{project}}/locations/{{location}}/lbRouteExtensions/{{name}}'
timeouts: !ruby/object:Api::Timeouts
insert_minutes: 20
update_minutes: 20
delete_minutes: 20
create_url: 'projects/{{project}}/locations/{{location}}/lbRouteExtensions?lbRouteExtensionId={{name}}'
update_verb: :PATCH
update_mask: true
autogen_async: true
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
base_url: '{{op_id}}'
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'network_services_lb_route_extension_basic'
primary_resource_id: 'default'
vars:
ilb_network_name: 'l7-ilb-network'
proxy_subnet_name: 'l7-ilb-proxy-subnet'
backend_subnet_name: 'l7-ilb-subnet'
forwarding_rule_name: 'l7-ilb-forwarding-rule'
target_http_proxy_name: 'l7-ilb-target-http-proxy'
regional_url_map_name: 'l7-ilb-regional-url-map'
backend_service_name: 'l7-ilb-backend-subnet'
mig_template_name: 'l7-ilb-mig-template'
hc_name: 'l7-ilb-hc'
mig_name: 'l7-ilb-mig1'
fw_allow_iap_hc_name: 'l7-ilb-fw-allow-iap-hc'
fw_allow_ilb_to_backends_name: 'l7-ilb-fw-allow-ilb-to-backends'
vm_test_name: 'l7-ilb-test-vm'
lb_route_extension_name: 'l7-ilb-route-ext'
callouts_instance_name: 'l7-ilb-callouts-ins'
callouts_instance_group: 'l7-ilb-callouts-ins-group'
callouts_hc_name: 'l7-ilb-callouts-hc'
callouts_backend_name: 'l7-ilb-callouts-backend'
ignore_read_extra:
- 'port_range'
- 'target'
parameters:
- !ruby/object:Api::Type::String
name: 'location'
required: true
immutable: true
url_param_only: true
description: |
The location of the route extension
- !ruby/object:Api::Type::String
name: 'name'
required: true
immutable: true
url_param_only: true
description: |
Name of the LbRouteExtension resource in the following format: projects/{project}/locations/{location}/lbRouteExtensions/{lbRouteExtension}
properties:
- !ruby/object:Api::Type::String
name: 'description'
description: |
A human-readable description of the resource.
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: 'Set of labels associated with the LbRouteExtension resource.'
- !ruby/object:Api::Type::Array
name: forwardingRules
description: |
A list of references to the forwarding rules to which this service extension is attached to.
At least one forwarding rule is required. There can be only one LbRouteExtension resource per forwarding rule.
required: true
item_type: Api::Type::String
diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress'
- !ruby/object:Api::Type::Array
name: extensionChains
description: |
A set of ordered extension chains that contain the match conditions and extensions to execute.
Match conditions for each extension chain are evaluated in sequence for a given request.
The first extension chain that has a condition that matches the request is executed.
Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
required: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The name for this extension chain. The name is logged as part of the HTTP request logs.
The name must conform with RFC-1034, is restricted to lower-cased letters, numbers and hyphens,
and can have a maximum length of 63 characters. Additionally, the first character must be a letter
and the last character must be a letter or a number.
required: true
- !ruby/object:Api::Type::NestedObject
name: 'matchCondition'
description: |
Conditions under which this chain is invoked for a request.
required: true
properties:
- !ruby/object:Api::Type::String
name: 'celExpression'
description: |
A Common Expression Language (CEL) expression that is used to match requests for which the extension chain is executed.
required: true
- !ruby/object:Api::Type::Array
name: 'extensions'
description: |
A set of extensions to execute for the matching request.
At least one extension is required. Up to 3 extensions can be defined for each extension chain for
LbTrafficExtension resource. LbRouteExtension chains are limited to 1 extension per extension chain.
required: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The name for this extension. The name is logged as part of the HTTP request logs.
The name must conform with RFC-1034, is restricted to lower-cased letters, numbers and hyphens,
and can have a maximum length of 63 characters. Additionally, the first character must be a letter
and the last a letter or a number.
required: true
- !ruby/object:Api::Type::String
name: 'authority'
description: |
The :authority header in the gRPC request sent from Envoy to the extension service.
- !ruby/object:Api::Type::String
name: 'service'
description: |
The reference to the service that runs the extension. Must be a reference to a backend service
required: true
diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress'
- !ruby/object:Api::Type::String
name: 'timeout'
description: |
Specifies the timeout for each individual message on the stream. The timeout must be between 10-1000 milliseconds.
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
diff_suppress_func: 'tpgresource.DurationDiffSuppress'
- !ruby/object:Api::Type::Boolean
name: 'failOpen'
description: |
Determines how the proxy behaves if the call to the extension fails or times out.
When set to TRUE, request or response processing continues without error.
Any subsequent extensions in the extension chain are also executed.
When set to FALSE: * If response headers have not been delivered to the downstream client,
a generic 500 error is returned to the client. The error response can be tailored by
configuring a custom error response in the load balancer.
- !ruby/object:Api::Type::Array
name: 'forwardHeaders'
description: |
List of the HTTP headers to forward to the extension (from the client or backend).
If omitted, all headers are sent. Each element is a string indicating the header name.
item_type: Api::Type::String
- !ruby/object:Api::Type::Enum
name: 'loadBalancingScheme'
required: true
immutable: true
description: |
All backend services and forwarding rules referenced by this extension must share the same load balancing scheme.
For more information, refer to [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service) and
[Supported application load balancers](https://cloud.google.com/service-extensions/docs/callouts-overview#supported-lbs).
values:
- :INTERNAL_MANAGED
- :EXTERNAL_MANAGED
7 changes: 3 additions & 4 deletions mmv1/products/networkservices/LbTrafficExtension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ properties:
name: 'authority'
description: |
The :authority header in the gRPC request sent from Envoy to the extension service.
required: true
- !ruby/object:Api::Type::String
name: 'service'
description: |
Expand All @@ -148,7 +147,6 @@ properties:
description: |
Specifies the timeout for each individual message on the stream. The timeout must be between 10-1000 milliseconds.
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
required: true
diff_suppress_func: 'tpgresource.DurationDiffSuppress'
- !ruby/object:Api::Type::Boolean
name: 'failOpen'
Expand Down Expand Up @@ -176,10 +174,11 @@ properties:
item_type: Api::Type::String
- !ruby/object:Api::Type::Enum
name: 'loadBalancingScheme'
immutable: true
description: |
All backend services and forwarding rules referenced by this extension must share the same load balancing scheme.
For more information, refer to Choosing a load balancer.
For more information, refer to [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service) and
[Supported application load balancers](https://cloud.google.com/service-extensions/docs/callouts-overview#supported-lbs).
values:
- :LOAD_BALANCING_SCHEME_UNSPECIFIED
- :INTERNAL_MANAGED
- :EXTERNAL_MANAGED
Loading

0 comments on commit ef7e817

Please sign in to comment.