diff --git a/google/cloud/networkservices/v1/BUILD.bazel b/google/cloud/networkservices/v1/BUILD.bazel index 235fd2b8b68a9..1c412df129685 100644 --- a/google/cloud/networkservices/v1/BUILD.bazel +++ b/google/cloud/networkservices/v1/BUILD.bazel @@ -39,7 +39,6 @@ proto_library( "//google/api:resource_proto", "//google/longrunning:operations_proto", "@com_google_protobuf//:duration_proto", - "@com_google_protobuf//:empty_proto", "@com_google_protobuf//:field_mask_proto", "@com_google_protobuf//:timestamp_proto", ], @@ -86,9 +85,9 @@ java_gapic_library( rest_numeric_enums = True, service_yaml = "networkservices_v1.yaml", test_deps = [ - ":networkservices_java_grpc", "//google/cloud/location:location_java_grpc", "//google/iam/v1:iam_java_grpc", + ":networkservices_java_grpc", ], transport = "grpc+rest", deps = [ @@ -182,6 +181,7 @@ load( "@com_google_googleapis_imports//:imports.bzl", "py_gapic_assembly_pkg", "py_gapic_library", + "py_test", ) py_gapic_library( @@ -238,10 +238,13 @@ php_gapic_library( name = "networkservices_php_gapic", srcs = [":networkservices_proto_with_info"], grpc_service_config = "networkservices_grpc_service_config.json", + migration_mode = "PRE_MIGRATION_SURFACE_ONLY", rest_numeric_enums = True, service_yaml = "networkservices_v1.yaml", transport = "grpc+rest", - deps = [":networkservices_php_proto"], + deps = [ + ":networkservices_php_proto", + ], ) # Open Source Packages diff --git a/google/cloud/networkservices/v1beta1/BUILD.bazel b/google/cloud/networkservices/v1beta1/BUILD.bazel index 8392f5ed29950..2d05a5060e9cd 100644 --- a/google/cloud/networkservices/v1beta1/BUILD.bazel +++ b/google/cloud/networkservices/v1beta1/BUILD.bazel @@ -22,6 +22,7 @@ proto_library( name = "networkservices_proto", srcs = [ "common.proto", + "dep.proto", "endpoint_policy.proto", "network_services.proto", ], @@ -31,6 +32,7 @@ proto_library( "//google/api:field_behavior_proto", "//google/api:resource_proto", "//google/longrunning:operations_proto", + "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:empty_proto", "@com_google_protobuf//:field_mask_proto", "@com_google_protobuf//:timestamp_proto", @@ -88,6 +90,8 @@ java_gapic_library( java_gapic_test( name = "networkservices_java_gapic_test_suite", test_classes = [ + "com.google.cloud.networkservices.v1beta1.DepServiceClientHttpJsonTest", + "com.google.cloud.networkservices.v1beta1.DepServiceClientTest", "com.google.cloud.networkservices.v1beta1.NetworkServicesClientHttpJsonTest", "com.google.cloud.networkservices.v1beta1.NetworkServicesClientTest", ], @@ -143,6 +147,7 @@ go_gapic_library( "//google/longrunning:longrunning_go_proto", "@com_google_cloud_go_longrunning//:go_default_library", "@com_google_cloud_go_longrunning//autogen:go_default_library", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", ], ) @@ -175,6 +180,8 @@ py_gapic_library( rest_numeric_enums = True, service_yaml = "networkservices_v1beta1.yaml", transport = "grpc+rest", + deps = [ + ], ) py_test( @@ -214,10 +221,13 @@ php_gapic_library( name = "networkservices_php_gapic", srcs = [":networkservices_proto_with_info"], grpc_service_config = "networkservices_v1beta1_grpc_service_config.json", + migration_mode = "PRE_MIGRATION_SURFACE_ONLY", rest_numeric_enums = True, service_yaml = "networkservices_v1beta1.yaml", transport = "grpc+rest", - deps = [":networkservices_php_proto"], + deps = [ + ":networkservices_php_proto", + ], ) # Open Source Packages diff --git a/google/cloud/networkservices/v1beta1/common.proto b/google/cloud/networkservices/v1beta1/common.proto index c60e129af477d..210c43528df64 100644 --- a/google/cloud/networkservices/v1beta1/common.proto +++ b/google/cloud/networkservices/v1beta1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,10 +30,12 @@ option ruby_package = "Google::Cloud::NetworkServices::V1beta1"; // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -46,8 +48,9 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. diff --git a/google/cloud/networkservices/v1beta1/dep.proto b/google/cloud/networkservices/v1beta1/dep.proto new file mode 100644 index 0000000000000..b7387ebd5449e --- /dev/null +++ b/google/cloud/networkservices/v1beta1/dep.proto @@ -0,0 +1,702 @@ +// Copyright 2023 Google LLC +// +// 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. + +syntax = "proto3"; + +package google.cloud.networkservices.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1Beta1"; +option go_package = "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "DepProto"; +option java_package = "com.google.cloud.networkservices.v1beta1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1beta1"; +option ruby_package = "Google::Cloud::NetworkServices::V1beta1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/BackendService" + pattern: "projects/{project}/regions/{region}/backendServices/{backend_service}" + pattern: "projects/{project}/global/backendServices/{backend_service}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ForwardingRule" + pattern: "projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" + pattern: "projects/{project}/global/forwardingRules/{forwarding_rule}" +}; + +// Service describing handlers for resources. +service DepService { + option (google.api.default_host) = "networkservices.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists `LbTrafficExtension` resources in a given project and location. + rpc ListLbTrafficExtensions(ListLbTrafficExtensionsRequest) + returns (ListLbTrafficExtensionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/lbTrafficExtensions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified `LbTrafficExtension` resource. + rpc GetLbTrafficExtension(GetLbTrafficExtensionRequest) + returns (LbTrafficExtension) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/lbTrafficExtensions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new `LbTrafficExtension` resource in a given project and + // location. + rpc CreateLbTrafficExtension(CreateLbTrafficExtensionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/lbTrafficExtensions" + body: "lb_traffic_extension" + }; + option (google.api.method_signature) = + "parent,lb_traffic_extension,lb_traffic_extension_id"; + option (google.longrunning.operation_info) = { + response_type: "LbTrafficExtension" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of the specified `LbTrafficExtension` resource. + rpc UpdateLbTrafficExtension(UpdateLbTrafficExtensionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{lb_traffic_extension.name=projects/*/locations/*/lbTrafficExtensions/*}" + body: "lb_traffic_extension" + }; + option (google.api.method_signature) = "lb_traffic_extension,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "LbTrafficExtension" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified `LbTrafficExtension` resource. + rpc DeleteLbTrafficExtension(DeleteLbTrafficExtensionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/lbTrafficExtensions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists `LbRouteExtension` resources in a given project and location. + rpc ListLbRouteExtensions(ListLbRouteExtensionsRequest) + returns (ListLbRouteExtensionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/lbRouteExtensions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified `LbRouteExtension` resource. + rpc GetLbRouteExtension(GetLbRouteExtensionRequest) + returns (LbRouteExtension) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/lbRouteExtensions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new `LbRouteExtension` resource in a given project and location. + rpc CreateLbRouteExtension(CreateLbRouteExtensionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/lbRouteExtensions" + body: "lb_route_extension" + }; + option (google.api.method_signature) = + "parent,lb_route_extension,lb_route_extension_id"; + option (google.longrunning.operation_info) = { + response_type: "LbRouteExtension" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of the specified `LbRouteExtension` resource. + rpc UpdateLbRouteExtension(UpdateLbRouteExtensionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{lb_route_extension.name=projects/*/locations/*/lbRouteExtensions/*}" + body: "lb_route_extension" + }; + option (google.api.method_signature) = "lb_route_extension,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "LbRouteExtension" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified `LbRouteExtension` resource. + rpc DeleteLbRouteExtension(DeleteLbRouteExtensionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/lbRouteExtensions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// Load balancing schemes supported by the `LbTrafficExtension` resource and +// `LbRouteExtension` resource. The valid values are: `INTERNAL_MANAGED`, +// `EXTERNAL_MANAGED`. +enum LoadBalancingScheme { + // Default value. Do not use. + LOAD_BALANCING_SCHEME_UNSPECIFIED = 0; + + // Signifies that this is used for Internal HTTP(S) Load Balancing. + INTERNAL_MANAGED = 1; + + // Signifies that this is used for External Managed HTTP(S) Load + // Balancing. + EXTERNAL_MANAGED = 2; +} + +// A single extension chain wrapper that contains the match conditions and +// extensions to execute. +message ExtensionChain { + // Conditions under which this chain is invoked for a request. + message MatchCondition { + // Required. A Common Expression Language (CEL) expression that is used to + // match requests for which the extension chain is executed. + string cel_expression = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A single extension in the chain to execute for the matching request. + message Extension { + // Defines 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 + // 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. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `:authority` header in the gRPC request sent from Envoy + // to the extension service. + string authority = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The reference to the service that runs the extension. + // Must be a reference to a [backend + // service](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices). + string service = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/BackendService" + } + ]; + + // Optional. A set of events during request or response processing for which + // this extension is called. This field is required for the + // `LbTrafficExtension` resource. It's not relevant for the + // `LbRouteExtension` resource. + 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. + google.protobuf.Duration timeout = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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. + // + // * If response headers have been delivered, then the HTTP stream to + // the downstream client is reset. + // Default is `FALSE`. + bool fail_open = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + repeated string forward_headers = 7 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. 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 a letter or + // a number. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Conditions under which this chain is invoked for a request. + MatchCondition match_condition = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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. + repeated Extension extensions = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `LbTrafficExtension` is a resource that lets the extension service modify the +// headers and payloads of both requests and responses without impacting the +// choice of backend services or any other security policies associated with the +// backend service. +message LbTrafficExtension { + option (google.api.resource) = { + type: "networkservices.googleapis.com/LbTrafficExtension" + pattern: "projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}" + }; + + // Required. Name of the `LbTrafficExtension` resource in the following + // format: + // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A human-readable description of the resource. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set of labels associated with the `LbTrafficExtension` resource. + // + // The format must comply with [the following + // requirements](/compute/docs/labeling-resources#requirements). + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A list of references to the forwarding rules to which this + // service extension is attach to. At least one forwarding rule is required. + // There can be only one `LBTrafficExtension` resource per forwarding rule. + repeated string forwarding_rules = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Required. 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. + repeated ExtensionChain extension_chains = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Required. All backend services and forwarding rules referenced by this + // extension must share the same load balancing scheme. Supported values: + // `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more information, refer to + // [Choosing a load + // balancer](https://cloud.google.com/load-balancing/docs/backend-service). + LoadBalancingScheme load_balancing_scheme = 8 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for requesting list of `LbTrafficExtension` resources. +message ListLbTrafficExtensionsRequest { + // Required. The project and location from which the `LbTrafficExtension` + // resources are listed, specified in the following format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/LbTrafficExtension" + } + ]; + + // Optional. Requested page size. The server might return fewer items than + // requested. If unspecified, the server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results that the server returns. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing `LbTrafficExtension` resources. +message ListLbTrafficExtensionsResponse { + // The list of `LbTrafficExtension` resources. + repeated LbTrafficExtension lb_traffic_extensions = 1; + + // A token identifying a page of results that the server returns. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a `LbTrafficExtension` resource. +message GetLbTrafficExtensionRequest { + // Required. A name of the `LbTrafficExtension` resource to get. Must be in + // the format + // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/LbTrafficExtension" + } + ]; +} + +// Message for creating a `LbTrafficExtension` resource. +message CreateLbTrafficExtensionRequest { + // Required. The parent resource of the `LbTrafficExtension` resource. Must be + // in the format `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/LbTrafficExtension" + } + ]; + + // Required. User-provided ID of the `LbTrafficExtension` resource to be + // created. + string lb_traffic_extension_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. `LbTrafficExtension` resource to be created. + LbTrafficExtension lb_traffic_extension = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a `LbTrafficExtension` resource. +message UpdateLbTrafficExtensionRequest { + // Required. Used to specify the fields to be overwritten in the + // `LbTrafficExtension` resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field is overwritten if it is in the mask. If the + // user does not specify a mask, then all fields are overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. `LbTrafficExtension` resource being updated. + LbTrafficExtension lb_traffic_extension = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a `LbTrafficExtension` resource. +message DeleteLbTrafficExtensionRequest { + // Required. The name of the `LbTrafficExtension` resource to delete. Must be + // in the format + // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/LbTrafficExtension" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `LbRouteExtension` is a resource that lets you control where traffic is +// routed to for a given request. +message LbRouteExtension { + option (google.api.resource) = { + type: "networkservices.googleapis.com/LbRouteExtension" + pattern: "projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}" + }; + + // Required. Name of the `LbRouteExtension` resource in the following format: + // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A human-readable description of the resource. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set of labels associated with the `LbRouteExtension` resource. + // + // The format must comply with [the following + // requirements](/compute/docs/labeling-resources#requirements). + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A list of references to the forwarding rules to which this + // service extension is attach to. At least one forwarding rule is required. + // There can be only one `LbRouteExtension` resource per forwarding rule. + repeated string forwarding_rules = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Required. 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. + repeated ExtensionChain extension_chains = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Required. All backend services and forwarding rules referenced by this + // extension must share the same load balancing scheme. Supported values: + // `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. + LoadBalancingScheme load_balancing_scheme = 8 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for requesting list of `LbRouteExtension` resources. +message ListLbRouteExtensionsRequest { + // Required. The project and location from which the `LbRouteExtension` + // resources are listed, specified in the following format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/LbRouteExtension" + } + ]; + + // Optional. Requested page size. The server might return fewer items than + // requested. If unspecified, the server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results that the server returns. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing `LbRouteExtension` resources. +message ListLbRouteExtensionsResponse { + // The list of `LbRouteExtension` resources. + repeated LbRouteExtension lb_route_extensions = 1; + + // A token identifying a page of results that the server returns. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a `LbRouteExtension` resource. +message GetLbRouteExtensionRequest { + // Required. A name of the `LbRouteExtension` resource to get. Must be in the + // format + // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/LbRouteExtension" + } + ]; +} + +// Message for creating a `LbRouteExtension` resource. +message CreateLbRouteExtensionRequest { + // Required. The parent resource of the `LbRouteExtension` resource. Must be + // in the format `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/LbRouteExtension" + } + ]; + + // Required. User-provided ID of the `LbRouteExtension` resource to be + // created. + string lb_route_extension_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. `LbRouteExtension` resource to be created. + LbRouteExtension lb_route_extension = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a `LbRouteExtension` resource. +message UpdateLbRouteExtensionRequest { + // Required. Used to specify the fields to be overwritten in the + // `LbRouteExtension` resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field is overwritten if it is in the mask. If the + // user does not specify a mask, then all fields are overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. `LbRouteExtension` resource being updated. + LbRouteExtension lb_route_extension = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a `LbRouteExtension` resource. +message DeleteLbRouteExtensionRequest { + // Required. The name of the `LbRouteExtension` resource to delete. Must be in + // the format + // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extension}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/LbRouteExtension" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/google/cloud/networkservices/v1beta1/endpoint_policy.proto b/google/cloud/networkservices/v1beta1/endpoint_policy.proto index be5ca01a95366..12f20c65cd26d 100644 --- a/google/cloud/networkservices/v1beta1/endpoint_policy.proto +++ b/google/cloud/networkservices/v1beta1/endpoint_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -69,10 +69,12 @@ message EndpointPolicy { string name = 1 [(google.api.field_behavior) = REQUIRED]; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Set of label tags associated with the EndpointPolicy resource. map labels = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -85,8 +87,7 @@ message EndpointPolicy { // applies authorization policies to the inbound traffic at the // matched endpoints. Refer to Authorization. If this field is not // specified, authorization is disabled(no authz checks) for this - // endpoint. Applicable only when EndpointPolicyType is - // SIDECAR_PROXY. + // endpoint. string authorization_policy = 7 [ (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { @@ -94,19 +95,22 @@ message EndpointPolicy { } ]; - // Required. A matcher that selects endpoints to which the policies should be applied. + // Required. A matcher that selects endpoints to which the policies should be + // applied. EndpointMatcher endpoint_matcher = 9 [(google.api.field_behavior) = REQUIRED]; // Optional. Port selector for the (matched) endpoints. If no port selector is // provided, the matched config is applied to all ports. - TrafficPortSelector traffic_port_selector = 10 [(google.api.field_behavior) = OPTIONAL]; + TrafficPortSelector traffic_port_selector = 10 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. A free-text description of the resource. Max length 1024 characters. + // Optional. A free-text description of the resource. Max length 1024 + // characters. string description = 11 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to - // determine the authentication policy to be applied to terminate the inbound - // traffic at the identified backends. If this field is not set, + // Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is + // used to determine the authentication policy to be applied to terminate the + // inbound traffic at the identified backends. If this field is not set, // authentication is disabled(open) for this endpoint. string server_tls_policy = 12 [ (google.api.field_behavior) = OPTIONAL, @@ -115,14 +119,14 @@ message EndpointPolicy { } ]; - // Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set - // to specify the authentication for traffic from the proxy to the actual - // endpoints. More specifically, it is applied to the outgoing traffic from - // the proxy to the endpoint. This is typically used for sidecar model where - // the proxy identifies itself as endpoint to the control plane, with the - // connection between sidecar and endpoint requiring authentication. If this - // field is not set, authentication is disabled(open). Applicable only when - // EndpointPolicyType is SIDECAR_PROXY. + // Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy + // can be set to specify the authentication for traffic from the proxy to the + // actual endpoints. More specifically, it is applied to the outgoing traffic + // from the proxy to the endpoint. This is typically used for sidecar model + // where the proxy identifies itself as endpoint to the control plane, with + // the connection between sidecar and endpoint requiring authentication. If + // this field is not set, authentication is disabled(open). Applicable only + // when EndpointPolicyType is SIDECAR_PROXY. string client_tls_policy = 13 [ (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { @@ -133,8 +137,8 @@ message EndpointPolicy { // Request used with the ListEndpointPolicies method. message ListEndpointPoliciesRequest { - // Required. The project and location from which the EndpointPolicies should be - // listed, specified in the format `projects/*/locations/global`. + // Required. The project and location from which the EndpointPolicies should + // be listed, specified in the format `projects/*/locations/global`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -201,7 +205,8 @@ message UpdateEndpointPolicyRequest { // The fields specified in the update_mask are relative to the resource, not // the full request. A field will be overwritten if it is in the mask. If the // user does not provide a mask then all fields will be overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated EndpointPolicy resource. EndpointPolicy endpoint_policy = 2 [(google.api.field_behavior) = REQUIRED]; diff --git a/google/cloud/networkservices/v1beta1/networkservices_v1beta1.yaml b/google/cloud/networkservices/v1beta1/networkservices_v1beta1.yaml index ef4af592481b5..2533a91ced9a5 100644 --- a/google/cloud/networkservices/v1beta1/networkservices_v1beta1.yaml +++ b/google/cloud/networkservices/v1beta1/networkservices_v1beta1.yaml @@ -5,6 +5,7 @@ title: Network Services API apis: - name: google.cloud.networkservices.v1beta1.NetworkServices +- name: google.cloud.networkservices.v1beta1.DepService types: - name: google.cloud.networkservices.v1beta1.OperationMetadata @@ -87,6 +88,10 @@ authentication: oauth: canonical_scopes: |- https://www.googleapis.com/auth/cloud-platform + - selector: 'google.cloud.networkservices.v1beta1.DepService.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform - selector: 'google.cloud.networkservices.v1beta1.NetworkServices.*' oauth: canonical_scopes: |- diff --git a/google/cloud/networkservices/v1beta1/networkservices_v1beta1_grpc_service_config.json b/google/cloud/networkservices/v1beta1/networkservices_v1beta1_grpc_service_config.json index 32d44787d0022..7ffd85c4e43c4 100644 --- a/google/cloud/networkservices/v1beta1/networkservices_v1beta1_grpc_service_config.json +++ b/google/cloud/networkservices/v1beta1/networkservices_v1beta1_grpc_service_config.json @@ -4,6 +4,9 @@ "name": [ { "service": "google.cloud.networkservices.v1beta1.NetworkServices" + }, + { + "service": "google.cloud.networkservices.v1beta1.DepService" } ], "timeout": "60s"