Skip to content

Commit

Permalink
feat: add additional values to the EventType enum
Browse files Browse the repository at this point in the history
fix!: `EventType` enum moved to the top level
docs: A comment for enum `LoadBalancingScheme` is changed
docs: A comment for field `cel_expression` in message `.google.cloud.networkservices.v1beta1.ExtensionChain` is changed
docs: A comment for field `authority` in message `.google.cloud.networkservices.v1beta1.ExtensionChain` is changed
docs: A comment for field `timeout` in message `.google.cloud.networkservices.v1beta1.ExtensionChain` is changed
docs: A comment for field `labels` in message `.google.cloud.networkservices.v1beta1.LbTrafficExtension` is changed
docs: A comment for field `labels` in message `.google.cloud.networkservices.v1beta1.LbRouteExtension` is changed

BREAKING CHANGE: EventType enum moved to the top level

PiperOrigin-RevId: 616136877
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 15, 2024
1 parent fea4a89 commit fe20507
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 39 deletions.
14 changes: 12 additions & 2 deletions google/cloud/networkservices/v1beta1/BUILD.bazel
Expand Up @@ -9,14 +9,17 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# buildifier: disable=load-on-top

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
# buildifier: disable=same-origin-load
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "networkservices_proto",
Expand Down Expand Up @@ -51,6 +54,7 @@ proto_library_with_info(
##############################################################################
# Java
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
Expand Down Expand Up @@ -115,6 +119,7 @@ java_gapic_assembly_gradle_pkg(
##############################################################################
# Go
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
Expand Down Expand Up @@ -167,6 +172,7 @@ go_gapic_assembly_pkg(
##############################################################################
# Python
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
Expand Down Expand Up @@ -206,6 +212,7 @@ py_gapic_assembly_pkg(
##############################################################################
# PHP
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
Expand Down Expand Up @@ -243,6 +250,7 @@ php_gapic_assembly_pkg(
##############################################################################
# Node.js
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
Expand Down Expand Up @@ -273,6 +281,7 @@ nodejs_gapic_assembly_pkg(
##############################################################################
# Ruby
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
Expand Down Expand Up @@ -319,6 +328,7 @@ ruby_gapic_assembly_pkg(
##############################################################################
# C#
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
Expand All @@ -329,7 +339,6 @@ load(

csharp_proto_library(
name = "networkservices_csharp_proto",
extra_opts = [],
deps = [":networkservices_proto"],
)

Expand Down Expand Up @@ -366,6 +375,7 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
Expand Down
79 changes: 42 additions & 37 deletions google/cloud/networkservices/v1beta1/dep.proto
Expand Up @@ -164,9 +164,38 @@ service DepService {
}
}

// The part of the request or response for which the extension is called.
enum EventType {
// Unspecified value. Do not use.
EVENT_TYPE_UNSPECIFIED = 0;

// If included in `supported_events`,
// the extension is called when the HTTP request headers arrive.
REQUEST_HEADERS = 1;

// If included in `supported_events`,
// the extension is called when the HTTP request body arrives.
REQUEST_BODY = 2;

// If included in `supported_events`,
// the extension is called when the HTTP response headers arrive.
RESPONSE_HEADERS = 3;

// If included in `supported_events`,
// the extension is called when the HTTP response body arrives.
RESPONSE_BODY = 4;

// If included in `supported_events`,
// the extension is called when the HTTP request trailers arrives.
REQUEST_TRAILERS = 5;

// If included in `supported_events`,
// the extension is called when the HTTP response trailers arrives.
RESPONSE_TRAILERS = 6;
}

// Load balancing schemes supported by the `LbTrafficExtension` resource and
// `LbRouteExtension` resource. The valid values are `INTERNAL_MANAGED` and
// `EXTERNAL_MANAGED`.
// `LbRouteExtension` resource.
// For more information, refer to [Choosing a load
// balancer](https://cloud.google.com/load-balancing/docs/backend-service).
enum LoadBalancingScheme {
Expand All @@ -189,39 +218,13 @@ message ExtensionChain {
// Required. A Common Expression Language (CEL) expression that is used to
// match requests for which the extension chain is executed.
//
// For more information, see
// [CEL matcher language
// reference](/service-extensions/docs/cel-matcher-language-reference).
// For more information, see [CEL matcher language
// reference](https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference).
string cel_expression = 1 [(google.api.field_behavior) = REQUIRED];
}

// A single extension in the chain to execute for the matching request.
message Extension {
// The part of the request or response for which this extension
// is called.
// The valid values are:
// `REQUEST_HEADERS`, `REQUEST_BODY`, `RESPONSE_HEADERS`, `RESPONSE_BODY`.
enum EventType {
// Unspecified value. Do not use.
EVENT_TYPE_UNSPECIFIED = 0;

// If included in `supported_events`,
// the extension is called when the HTTP request headers arrive.
REQUEST_HEADERS = 1;

// If included in `supported_events`,
// the extension is called when the HTTP request body arrives.
REQUEST_BODY = 2;

// If included in `supported_events`,
// the extension is called when the HTTP response headers arrive.
RESPONSE_HEADERS = 3;

// If included in `supported_events`,
// the extension is called when the HTTP response body arrives.
RESPONSE_BODY = 4;
}

// Required. 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
Expand All @@ -232,6 +235,7 @@ message ExtensionChain {

// Optional. The `:authority` header in the gRPC request sent from Envoy
// to the extension service.
// Required for Callout extensions.
string authority = 2 [(google.api.field_behavior) = OPTIONAL];

// Required. The reference to the service that runs the extension.
Expand All @@ -255,10 +259,11 @@ message ExtensionChain {
repeated EventType supported_events = 4
[(google.api.field_behavior) = OPTIONAL];

// Required. Specifies the timeout for each individual message on the
// stream. The timeout must be between 10-1000 milliseconds.
// Optional. Specifies the timeout for each individual message on the
// stream. The timeout must be between 10-1000 milliseconds. Required for
// Callout extensions.
google.protobuf.Duration timeout = 5
[(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = OPTIONAL];

// Optional. Determines how the proxy behaves if the call to the extension
// fails or times out.
Expand Down Expand Up @@ -335,8 +340,8 @@ message LbTrafficExtension {
// Optional. Set of labels associated with the `LbTrafficExtension` resource.
//
// The format must comply with [the requirements for
// labels](/compute/docs/labeling-resources#requirements) for Google Cloud
// resources.
// labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
// for Google Cloud resources.
map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];

// Required. A list of references to the forwarding rules to which this
Expand Down Expand Up @@ -547,8 +552,8 @@ message LbRouteExtension {
// Optional. Set of labels associated with the `LbRouteExtension` resource.
//
// The format must comply with [the requirements for
// labels](/compute/docs/labeling-resources#requirements) for Google Cloud
// resources.
// labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
// for Google Cloud resources.
map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];

// Required. A list of references to the forwarding rules to which this
Expand Down

0 comments on commit fe20507

Please sign in to comment.