feat: Add traffic director API to cloud network services v1 client library

feat: Add Service Directory Service API to cloud network services v1 client library

PiperOrigin-RevId: 460259279
pull/726/head
Google APIs 3 years ago committed by Copybara-Service
parent 21ef8485aa
commit c894ed4e62
  1. 27
      google/cloud/networkservices/v1/BUILD.bazel
  2. 3
      google/cloud/networkservices/v1/common.proto
  3. 3
      google/cloud/networkservices/v1/endpoint_policy.proto
  4. 188
      google/cloud/networkservices/v1/gateway.proto
  5. 413
      google/cloud/networkservices/v1/grpc_route.proto
  6. 616
      google/cloud/networkservices/v1/http_route.proto
  7. 153
      google/cloud/networkservices/v1/mesh.proto
  8. 374
      google/cloud/networkservices/v1/network_services.proto
  9. 18
      google/cloud/networkservices/v1/networkservices_v1.yaml
  10. 131
      google/cloud/networkservices/v1/service_binding.proto
  11. 251
      google/cloud/networkservices/v1/tcp_route.proto
  12. 230
      google/cloud/networkservices/v1/tls_route.proto

@ -23,7 +23,14 @@ proto_library(
srcs = [
"common.proto",
"endpoint_policy.proto",
"gateway.proto",
"grpc_route.proto",
"http_route.proto",
"mesh.proto",
"network_services.proto",
"service_binding.proto",
"tcp_route.proto",
"tls_route.proto",
],
deps = [
"//google/api:annotations_proto",
@ -31,6 +38,7 @@ proto_library(
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/longrunning:operations_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
@ -41,6 +49,8 @@ proto_library_with_info(
deps = [
":networkservices_proto",
"//google/cloud:common_resources_proto",
"//google/cloud/location:location_proto",
"//google/iam/v1:iam_policy_proto",
],
)
@ -75,11 +85,15 @@ java_gapic_library(
service_yaml = "networkservices_v1.yaml",
test_deps = [
":networkservices_java_grpc",
"//google/cloud/location:location_java_grpc",
"//google/iam/v1:iam_java_grpc",
],
transport = "grpc+rest",
deps = [
":networkservices_java_proto",
"//google/api:api_java_proto",
"//google/cloud/location:location_java_proto",
"//google/iam/v1:iam_java_proto",
],
)
@ -137,9 +151,12 @@ go_gapic_library(
transport = "grpc+rest",
deps = [
":networkservices_go_proto",
"//google/cloud/location:location_go_proto",
"//google/iam/v1:iam_go_proto",
"//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,10 +192,11 @@ py_gapic_library(
srcs = [":networkservices_proto"],
grpc_service_config = "networkservices_grpc_service_config.json",
opt_args = [
"warehouse-package-name=google-cloud-network-services",
"python-gapic-namespace=google.cloud",
"python-gapic-name=network_services",
"python-gapic-namespace=google.cloud",
"warehouse-package-name=google-cloud-network-services",
],
service_yaml = "networkservices_v1.yaml",
)
# Open Source Packages
@ -285,10 +303,9 @@ ruby_grpc_library(
ruby_cloud_gapic_library(
name = "networkservices_ruby_gapic",
srcs = [":networkservices_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-networkservices-v1",
],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-networkservices-v1"],
grpc_service_config = "networkservices_grpc_service_config.json",
service_yaml = "networkservices_v1.yaml",
deps = [
":networkservices_ruby_grpc",
":networkservices_ruby_proto",

@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -18,7 +18,6 @@ package google.cloud.networkservices.v1;
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";

@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,7 +21,6 @@ import "google/api/resource.proto";
import "google/cloud/networkservices/v1/common.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";

@ -0,0 +1,188 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "GatewayProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
// Gateway represents the configuration for a proxy, typically a load balancer.
// It captures the ip:port over which the services are exposed by the proxy,
// along with any policy configurations. Routes have reference to to Gateways to
// dictate how requests should be routed by this Gateway.
message Gateway {
option (google.api.resource) = {
type: "networkservices.googleapis.com/Gateway"
pattern: "projects/{project}/locations/{location}/gateways/{gateway}"
};
// The type of the customer-managed gateway.
// Possible values are:
// * OPEN_MESH
// * SECURE_WEB_GATEWAY
enum Type {
// The type of the customer managed gateway is unspecified.
TYPE_UNSPECIFIED = 0;
// The type of the customer managed gateway is TrafficDirector Open
// Mesh.
OPEN_MESH = 1;
// The type of the customer managed gateway is SecureWebGateway (SWG).
SECURE_WEB_GATEWAY = 2;
}
// Required. Name of the Gateway resource. It matches pattern
// `projects/*/locations/*/gateways/<gateway_name>`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Output only. Server-defined URL of this resource
string self_link = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
// 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. Set of label tags associated with the Gateway resource.
map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. A free-text description of the resource. Max length 1024 characters.
string description = 5 [(google.api.field_behavior) = OPTIONAL];
// Immutable. The type of the customer managed gateway.
// This field is required. If unspecified, an error is returned.
Type type = 6 [(google.api.field_behavior) = IMMUTABLE];
// Required. One or more ports that the Gateway must receive traffic on. The proxy binds
// to the ports specified. Gateway listen on 0.0.0.0 on the ports specified
// below.
repeated int32 ports = 11 [(google.api.field_behavior) = REQUIRED];
// Required. Immutable. Scope determines how configuration across multiple Gateway instances are
// merged. The configuration for multiple Gateway instances with the same
// scope will be merged as presented as a single coniguration to the
// proxy/load balancer.
//
// Max length 64 characters.
// Scope should start with a letter and can only have letters, numbers,
// hyphens.
string scope = 8 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
// Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how TLS
// traffic is terminated. If empty, TLS termination is disabled.
string server_tls_policy = 9 [(google.api.field_behavior) = OPTIONAL];
}
// Request used with the ListGateways method.
message ListGatewaysRequest {
// Required. The project and location from which the Gateways should be
// listed, specified in the format `projects/*/locations/*`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/Gateway"
}
];
// Maximum number of Gateways to return per call.
int32 page_size = 2;
// The value returned by the last `ListGatewaysResponse`
// Indicates that this is a continuation of a prior `ListGateways` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListGateways method.
message ListGatewaysResponse {
// List of Gateway resources.
repeated Gateway gateways = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetGateway method.
message GetGatewayRequest {
// Required. A name of the Gateway to get. Must be in the format
// `projects/*/locations/*/gateways/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Gateway"
}
];
}
// Request used by the CreateGateway method.
message CreateGatewayRequest {
// Required. The parent resource of the Gateway. Must be in the
// format `projects/*/locations/*`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/Gateway"
}
];
// Required. Short name of the Gateway resource to be created.
string gateway_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Gateway resource to be created.
Gateway gateway = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the UpdateGateway method.
message UpdateGatewayRequest {
// Optional. Field mask is used to specify the fields to be overwritten in the
// Gateway resource by the update.
// 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];
// Required. Updated Gateway resource.
Gateway gateway = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteGateway method.
message DeleteGatewayRequest {
// Required. A name of the Gateway to delete. Must be in the format
// `projects/*/locations/*/gateways/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Gateway"
}
];
}

@ -0,0 +1,413 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "GrpcRouteProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
// GrpcRoute is the resource defining how gRPC traffic routed by a Mesh
// or Gateway resource is routed.
message GrpcRoute {
option (google.api.resource) = {
type: "networkservices.googleapis.com/GrpcRoute"
pattern: "projects/{project}/locations/{location}/grpcRoutes/{grpc_route}"
};
// Specifies a match against a method.
message MethodMatch {
// The type of the match.
enum Type {
// Unspecified.
TYPE_UNSPECIFIED = 0;
// Will only match the exact name provided.
EXACT = 1;
// Will interpret grpc_method and grpc_service as regexes. RE2 syntax is
// supported.
REGULAR_EXPRESSION = 2;
}
// Optional. Specifies how to match against the name. If not specified, a default
// value of "EXACT" is used.
Type type = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Name of the service to match against. If unspecified, will match all
// services.
string grpc_service = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Name of the method to match against. If unspecified, will match all
// methods.
string grpc_method = 3 [(google.api.field_behavior) = REQUIRED];
// Optional. Specifies that matches are case sensitive. The default value is true.
// case_sensitive must not be used with a type of REGULAR_EXPRESSION.
optional bool case_sensitive = 4 [(google.api.field_behavior) = OPTIONAL];
}
// A match against a collection of headers.
message HeaderMatch {
// The type of match.
enum Type {
// Unspecified.
TYPE_UNSPECIFIED = 0;
// Will only match the exact value provided.
EXACT = 1;
// Will match paths conforming to the prefix specified by value. RE2
// syntax is supported.
REGULAR_EXPRESSION = 2;
}
// Optional. Specifies how to match against the value of the header. If not
// specified, a default value of EXACT is used.
Type type = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. The key of the header.
string key = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The value of the header.
string value = 3 [(google.api.field_behavior) = REQUIRED];
}
// Criteria for matching traffic. A RouteMatch will be considered to match
// when all supplied fields match.
message RouteMatch {
// Optional. A gRPC method to match against. If this field is empty or omitted, will
// match all methods.
optional MethodMatch method = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. Specifies a collection of headers to match.
repeated HeaderMatch headers = 2 [(google.api.field_behavior) = OPTIONAL];
}
// The destination to which traffic will be routed.
message Destination {
// Specifies the kind of destination to which traffic will be routed.
oneof destination_type {
// Required. The URL of a destination service to which to route traffic. Must refer
// to either a BackendService or ServiceDirectoryService.
string service_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "compute.googleapis.com/BackendService"
}
];
}
// Optional. Specifies the proportion of requests forwarded to the backend referenced
// by the serviceName field. This is computed as:
// weight/Sum(weights in this destination list).
// For non-zero values, there may be some epsilon from the exact proportion
// defined here depending on the precision an implementation supports.
//
// If only one serviceName is specified and it has a weight greater than 0,
// 100% of the traffic is forwarded to that backend.
//
// If weights are specified for any one service name, they need to be
// specified for all of them.
//
// If weights are unspecified for all services, then, traffic is distributed
// in equal proportions to all of them.
optional int32 weight = 2 [(google.api.field_behavior) = OPTIONAL];
}
// The specification for fault injection introduced into traffic to test the
// resiliency of clients to destination service failure. As part of fault
// injection, when clients send requests to a destination, delays can be
// introduced on a percentage of requests before sending those requests to the
// destination service. Similarly requests from clients can be aborted by for
// a percentage of requests.
message FaultInjectionPolicy {
// Specification of how client requests are delayed as part of fault
// injection before being sent to a destination.
message Delay {
// Specify a fixed delay before forwarding the request.
optional google.protobuf.Duration fixed_delay = 1;
// The percentage of traffic on which delay will be injected.
//
// The value must be between [0, 100]
optional int32 percentage = 2;
}
// Specification of how client requests are aborted as part of fault
// injection before being sent to a destination.
message Abort {
// The HTTP status code used to abort the request.
//
// The value must be between 200 and 599 inclusive.
optional int32 http_status = 1;
// The percentage of traffic which will be aborted.
//
// The value must be between [0, 100]
optional int32 percentage = 2;
}
// The specification for injecting delay to client requests.
optional Delay delay = 1;
// The specification for aborting to client requests.
optional Abort abort = 2;
}
// The specifications for retries.
message RetryPolicy {
// - connect-failure: Router will retry on failures connecting to Backend
// Services, for example due to connection timeouts.
// - refused-stream: Router will retry if the backend service resets the
// stream
// with a REFUSED_STREAM error code. This reset type indicates that it is
// safe to retry.
// - cancelled: Router will retry if the gRPC status code in the response
// header
// is set to cancelled
// - deadline-exceeded: Router will retry if the gRPC status code in the
// response
// header is set to deadline-exceeded
// - resource-exhausted: Router will retry if the gRPC status code in the
// response header is set to resource-exhausted
// - unavailable: Router will retry if the gRPC status code in the response
// header is set to unavailable
repeated string retry_conditions = 1;
// Specifies the allowed number of retries. This number must be > 0. If not
// specified, default to 1.
uint32 num_retries = 2;
}
// Specifies how to route matched traffic.
message RouteAction {
// Optional. The destination services to which traffic should be forwarded. If
// multiple destinations are specified, traffic will be split between
// Backend Service(s) according to the weight field of these destinations.
repeated Destination destinations = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. The specification for fault injection introduced into traffic to test the
// resiliency of clients to destination service failure. As part of fault
// injection, when clients send requests to a destination, delays can be
// introduced on a percentage of requests before sending those requests to
// the destination service. Similarly requests from clients can be aborted
// by for a percentage of requests.
//
// timeout and retry_policy will be ignored by clients that are configured
// with a fault_injection_policy
FaultInjectionPolicy fault_injection_policy = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. Specifies the timeout for selected route. Timeout is computed from the
// time the request has been fully processed (i.e. end of stream) up until
// the response has been completely processed. Timeout includes all retries.
google.protobuf.Duration timeout = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. Specifies the retry policy associated with this route.
RetryPolicy retry_policy = 8 [(google.api.field_behavior) = OPTIONAL];
}
// Describes how to route traffic.
message RouteRule {
// Optional. Matches define conditions used for matching the rule against incoming
// gRPC requests. Each match is independent, i.e. this rule will be matched
// if ANY one of the matches is satisfied. If no matches field is
// specified, this rule will unconditionally match traffic.
repeated RouteMatch matches = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. A detailed rule defining how to route traffic. This field is required.
RouteAction action = 2 [(google.api.field_behavior) = REQUIRED];
}
// Required. Name of the GrpcRoute resource. It matches pattern
// `projects/*/locations/global/grpcRoutes/<grpc_route_name>`
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Output only. Server-defined URL of this resource
string self_link = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
// 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. Set of label tags associated with the GrpcRoute resource.
map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. A free-text description of the resource. Max length 1024 characters.
string description = 5 [(google.api.field_behavior) = OPTIONAL];
// Required. Service hostnames with an optional port for which this route describes
// traffic.
//
// Format: <hostname>[:<port>]
//
// Hostname is the fully qualified domain name of a network host. This matches
// the RFC 1123 definition of a hostname with 2 notable exceptions:
// - IPs are not allowed.
// - A hostname may be prefixed with a wildcard label (*.). The wildcard
// label must appear by itself as the first label.
//
// Hostname can be "precise" which is a domain name without the terminating
// dot of a network host (e.g. "foo.example.com") or "wildcard", which is a
// domain name prefixed with a single wildcard label (e.g. *.example.com).
//
// Note that as per RFC1035 and RFC1123, a label must consist of lower case
// alphanumeric characters or '-', and must start and end with an alphanumeric
// character. No other punctuation is allowed.
//
// The routes associated with a Mesh or Gateway must have unique hostnames. If
// you attempt to attach multiple routes with conflicting hostnames, the
// configuration will be rejected.
//
// For example, while it is acceptable for routes for the hostnames
// "*.foo.bar.com" and "*.bar.com" to be associated with the same route, it is
// not possible to associate two routes both with "*.bar.com" or both with
// "bar.com".
//
// If a port is specified, then gRPC clients must use the channel URI with the
// port to match this rule (i.e. "xds:///service:123"), otherwise they must
// supply the URI without a port (i.e. "xds:///service").
repeated string hostnames = 6 [(google.api.field_behavior) = REQUIRED];
// Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of
// the routing rules to route the requests served by the mesh.
//
// Each mesh reference should match the pattern:
// `projects/*/locations/global/meshes/<mesh_name>`
repeated string meshes = 9 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Mesh"
}
];
// Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one
// of the routing rules to route the requests served by the gateway.
//
// Each gateway reference should match the pattern:
// `projects/*/locations/global/gateways/<gateway_name>`
repeated string gateways = 10 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Gateway"
}
];
// Required. A list of detailed rules defining how to route traffic.
//
// Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the
// first matching GrpcRoute.RouteRule will be executed. At least one rule
// must be supplied.
repeated RouteRule rules = 7 [(google.api.field_behavior) = REQUIRED];
}
// Request used with the ListGrpcRoutes method.
message ListGrpcRoutesRequest {
// Required. The project and location from which the GrpcRoutes should be
// listed, specified in the format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/GrpcRoute"
}
];
// Maximum number of GrpcRoutes to return per call.
int32 page_size = 2;
// The value returned by the last `ListGrpcRoutesResponse`
// Indicates that this is a continuation of a prior `ListGrpcRoutes` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListGrpcRoutes method.
message ListGrpcRoutesResponse {
// List of GrpcRoute resources.
repeated GrpcRoute grpc_routes = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetGrpcRoute method.
message GetGrpcRouteRequest {
// Required. A name of the GrpcRoute to get. Must be in the format
// `projects/*/locations/global/grpcRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/GrpcRoute"
}
];
}
// Request used by the CreateGrpcRoute method.
message CreateGrpcRouteRequest {
// Required. The parent resource of the GrpcRoute. Must be in the
// format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/GrpcRoute"
}
];
// Required. Short name of the GrpcRoute resource to be created.
string grpc_route_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. GrpcRoute resource to be created.
GrpcRoute grpc_route = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the UpdateGrpcRoute method.
message UpdateGrpcRouteRequest {
// Optional. Field mask is used to specify the fields to be overwritten in the
// GrpcRoute resource by the update.
// 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];
// Required. Updated GrpcRoute resource.
GrpcRoute grpc_route = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteGrpcRoute method.
message DeleteGrpcRouteRequest {
// Required. A name of the GrpcRoute to delete. Must be in the format
// `projects/*/locations/global/grpcRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/GrpcRoute"
}
];
}

@ -0,0 +1,616 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "HttpRouteProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
// HttpRoute is the resource defining how HTTP traffic should be routed by a
// Mesh or Gateway resource.
message HttpRoute {
option (google.api.resource) = {
type: "networkservices.googleapis.com/HttpRoute"
pattern: "projects/{project}/locations/{location}/httpRoutes/{http_route}"
};
// Specifies how to select a route rule based on HTTP request headers.
message HeaderMatch {
// Represents an integer value range.
message IntegerRange {
// Start of the range (inclusive)
int32 start = 1;
// End of the range (exclusive)
int32 end = 2;
}
oneof MatchType {
// The value of the header should match exactly the content of
// exact_match.
string exact_match = 2;
// The value of the header must match the regular expression specified in
// regex_match. For regular expression grammar, please see:
// https://github.com/google/re2/wiki/Syntax
string regex_match = 3;
// The value of the header must start with the contents of prefix_match.
string prefix_match = 4;
// A header with header_name must exist. The match takes place whether or
// not the header has a value.
bool present_match = 5;
// The value of the header must end with the contents of suffix_match.
string suffix_match = 6;
// If specified, the rule will match if the request header value is within
// the range.
IntegerRange range_match = 7;
}
// The name of the HTTP header to match against.
string header = 1;
// If specified, the match result will be inverted before checking. Default
// value is set to false.
bool invert_match = 8;
}
// Specifications to match a query parameter in the request.
message QueryParameterMatch {
oneof MatchType {
// The value of the query parameter must exactly match the contents of
// exact_match.
//
// Only one of exact_match, regex_match, or present_match must be set.
string exact_match = 2;
// The value of the query parameter must match the regular expression
// specified by regex_match. For regular expression grammar, please see
// https://github.com/google/re2/wiki/Syntax
//
// Only one of exact_match, regex_match, or present_match must be set.
string regex_match = 3;
// Specifies that the QueryParameterMatcher matches if request contains
// query parameter, irrespective of whether the parameter has a value or
// not.
//
// Only one of exact_match, regex_match, or present_match must be set.
bool present_match = 4;
}
// The name of the query parameter to match.
string query_parameter = 1;
}
// RouteMatch defines specifications used to match requests. If multiple match
// types are set, this RouteMatch will match if ALL type of matches are
// matched.
message RouteMatch {
oneof PathMatch {
// The HTTP request path value should exactly match this value.
//
// Only one of full_path_match, prefix_match, or regex_match should be
// used.
string full_path_match = 1;
// The HTTP request path value must begin with specified prefix_match.
// prefix_match must begin with a /.
//
// Only one of full_path_match, prefix_match, or regex_match should be
// used.
string prefix_match = 2;
// The HTTP request path value must satisfy the regular expression
// specified by regex_match after removing any query parameters and anchor
// supplied with the original URL. For regular expression grammar, please
// see https://github.com/google/re2/wiki/Syntax
//
// Only one of full_path_match, prefix_match, or regex_match should be
// used.
string regex_match = 3;
}
// Specifies if prefix_match and full_path_match matches are case sensitive.
// The default value is false.
bool ignore_case = 4;
// Specifies a list of HTTP request headers to match against. ALL of the
// supplied headers must be matched.
repeated HeaderMatch headers = 5;
// Specifies a list of query parameters to match against. ALL of the query
// parameters must be matched.
repeated QueryParameterMatch query_parameters = 6;
}
// Specifications of a destination to which the request should be routed to.
message Destination {
// The URL of a BackendService to route traffic to.
string service_name = 1 [(google.api.resource_reference) = {
type: "compute.googleapis.com/BackendService"
}];
// Specifies the proportion of requests forwarded to the backend referenced
// by the serviceName field. This is computed as:
// weight/Sum(weights in this destination list).
// For non-zero values, there may be some epsilon from the exact proportion
// defined here depending on the precision an implementation supports.
//
// If only one serviceName is specified and it has a weight greater than 0,
// 100% of the traffic is forwarded to that backend.
//
// If weights are specified for any one service name, they need to be
// specified for all of them.
//
// If weights are unspecified for all services, then, traffic is distributed
// in equal proportions to all of them.
int32 weight = 2;
}
// The specification for redirecting traffic.
message Redirect {
// Supported HTTP response code.
enum ResponseCode {
// Default value
RESPONSE_CODE_UNSPECIFIED = 0;
// Corresponds to 301.
MOVED_PERMANENTLY_DEFAULT = 1;
// Corresponds to 302.
FOUND = 2;
// Corresponds to 303.
SEE_OTHER = 3;
// Corresponds to 307. In this case, the request method will be retained.
TEMPORARY_REDIRECT = 4;
// Corresponds to 308. In this case, the request method will be retained.
PERMANENT_REDIRECT = 5;
}
// The host that will be used in the redirect response instead of the one
// that was supplied in the request.
string host_redirect = 1;
// The path that will be used in the redirect response instead of the one
// that was supplied in the request.
// path_redirect can not be supplied together with prefix_redirect. Supply
// one alone or neither. If neither is supplied, the path of the original
// request will be used for the redirect.
string path_redirect = 2;
// Indicates that during redirection, the matched prefix (or path) should be
// swapped with this value. This option allows URLs be dynamically created
// based on the request.
string prefix_rewrite = 3;
// The HTTP Status code to use for the redirect.
ResponseCode response_code = 4;
// If set to true, the URL scheme in the redirected request is set to https.
// If set to false, the URL scheme of the redirected request will remain the
// same as that of the request.
//
// The default is set to false.
bool https_redirect = 5;
// if set to true, any accompanying query portion of the original URL is
// removed prior to redirecting the request. If set to false, the query
// portion of the original URL is retained.
//
// The default is set to false.
bool strip_query = 6;
// The port that will be used in the redirected request instead of the one
// that was supplied in the request.
int32 port_redirect = 7;
}
// The specification for fault injection introduced into traffic to test the
// resiliency of clients to destination service failure. As part of fault
// injection, when clients send requests to a destination, delays can be
// introduced by client proxy on a percentage of requests before sending those
// requests to the destination service. Similarly requests can be aborted by
// client proxy for a percentage of requests.
message FaultInjectionPolicy {
// Specification of how client requests are delayed as part of fault
// injection before being sent to a destination.
message Delay {
// Specify a fixed delay before forwarding the request.
google.protobuf.Duration fixed_delay = 1;
// The percentage of traffic on which delay will be injected.
//
// The value must be between [0, 100]
int32 percentage = 2;
}
// Specification of how client requests are aborted as part of fault
// injection before being sent to a destination.
message Abort {
// The HTTP status code used to abort the request.
//
// The value must be between 200 and 599 inclusive.
int32 http_status = 1;
// The percentage of traffic which will be aborted.
//
// The value must be between [0, 100]
int32 percentage = 2;
}
// The specification for injecting delay to client requests.
Delay delay = 1;
// The specification for aborting to client requests.
Abort abort = 2;
}
// The specification for modifying HTTP header in HTTP request and HTTP
// response.
message HeaderModifier {
// Completely overwrite/replace the headers with given map where key is the
// name of the header, value is the value of the header.
map<string, string> set = 1;
// Add the headers with given map where key is the name of the header, value
// is the value of the header.
map<string, string> add = 2;
// Remove headers (matching by header names) specified in the list.
repeated string remove = 3;
}
// The specification for modifying the URL of the request, prior to forwarding
// the request to the destination.
message URLRewrite {
// Prior to forwarding the request to the selected destination, the matching
// portion of the requests path is replaced by this value.
string path_prefix_rewrite = 1;
// Prior to forwarding the request to the selected destination, the requests
// host header is replaced by this value.
string host_rewrite = 2;
}
// The specifications for retries.
message RetryPolicy {
// Specifies one or more conditions when this retry policy applies. Valid
// values are:
// 5xx: Proxy will attempt a retry if the destination service responds
// with any 5xx response code, of if the destination service does not
// respond at all, example: disconnect, reset, read timeout, connection
// failure and refused streams.
//
// gateway-error: Similar to 5xx, but only applies to response codes 502,
// 503, 504.
//
// reset: Proxy will attempt a retry if the destination service does not
// respond at all (disconnect/reset/read timeout)
//
// connect-failure: Proxy will retry on failures connecting to destination
// for example due to connection timeouts.
//
// retriable-4xx: Proxy will retry fro retriable 4xx response codes.
// Currently the only retriable error supported is 409.
//
// refused-stream: Proxy will retry if the destination resets the stream
// with a REFUSED_STREAM error code. This reset type indicates that it
// is safe to retry.
repeated string retry_conditions = 1;
// Specifies the allowed number of retries. This number must be > 0. If not
// specified, default to 1.
int32 num_retries = 2;
// Specifies a non-zero timeout per retry attempt.
google.protobuf.Duration per_try_timeout = 3;
}
// Specifies the policy on how requests are shadowed to a separate mirrored
// destination service. The proxy does not wait for responses from the
// shadow service. Prior to sending traffic to the shadow service, the
// host/authority header is suffixed with -shadow.
message RequestMirrorPolicy {
// The destination the requests will be mirrored to. The weight of the
// destination will be ignored.
Destination destination = 1;
}
// The Specification for allowing client side cross-origin requests.
message CorsPolicy {
// Specifies the list of origins that will be allowed to do CORS requests.
// An origin is allowed if it matches either an item in allow_origins or
// an item in allow_origin_regexes.
repeated string allow_origins = 1;
// Specifies the regular expression patterns that match allowed origins. For
// regular expression grammar, please see
// https://github.com/google/re2/wiki/Syntax.
repeated string allow_origin_regexes = 2;
// Specifies the content for Access-Control-Allow-Methods header.
repeated string allow_methods = 3;
// Specifies the content for Access-Control-Allow-Headers header.
repeated string allow_headers = 4;
// Specifies the content for Access-Control-Expose-Headers header.
repeated string expose_headers = 5;
// Specifies how long result of a preflight request can be cached in
// seconds. This translates to the Access-Control-Max-Age header.
string max_age = 6;
// In response to a preflight request, setting this to true indicates that
// the actual request can include user credentials. This translates to the
// Access-Control-Allow-Credentials header.
//
// Default value is false.
bool allow_credentials = 7;
// If true, the CORS policy is disabled. The default value is false, which
// indicates that the CORS policy is in effect.
bool disabled = 8;
}
// The specifications for routing traffic and applying associated policies.
message RouteAction {
// The destination to which traffic should be forwarded.
repeated Destination destinations = 1;
// If set, the request is directed as configured by this field.
Redirect redirect = 2;
// The specification for fault injection introduced into traffic to test the
// resiliency of clients to backend service failure. As part of fault
// injection, when clients send requests to a backend service, delays can be
// introduced on a percentage of requests before sending those requests to
// the backend service. Similarly requests from clients can be aborted for a
// percentage of requests.
//
// timeout and retry_policy will be ignored by clients that are configured
// with a fault_injection_policy
FaultInjectionPolicy fault_injection_policy = 4;
// The specification for modifying the headers of a matching request prior
// to delivery of the request to the destination.
HeaderModifier request_header_modifier = 5;
// The specification for modifying the headers of a response prior to
// sending the response back to the client.
HeaderModifier response_header_modifier = 6;
// The specification for rewrite URL before forwarding requests to the
// destination.
URLRewrite url_rewrite = 7;
// Specifies the timeout for selected route. Timeout is computed from the
// time the request has been fully processed (i.e. end of stream) up until
// the response has been completely processed. Timeout includes all retries.
google.protobuf.Duration timeout = 8;
// Specifies the retry policy associated with this route.
RetryPolicy retry_policy = 9;
// Specifies the policy on how requests intended for the routes destination
// are shadowed to a separate mirrored destination. Proxy will not wait for
// the shadow destination to respond before returning the response. Prior to
// sending traffic to the shadow service, the host/authority header is
// suffixed with -shadow.
RequestMirrorPolicy request_mirror_policy = 10;
// The specification for allowing client side cross-origin requests.
CorsPolicy cors_policy = 11;
}
// Specifies how to match traffic and how to route traffic when traffic is
// matched.
message RouteRule {
// A list of matches define conditions used for matching the rule against
// incoming HTTP requests. Each match is independent, i.e. this rule will be
// matched if ANY one of the matches is satisfied.
//
// If no matches field is specified, this rule will unconditionally match
// traffic.
//
// If a default rule is desired to be configured, add a rule with no matches
// specified to the end of the rules list.
repeated RouteMatch matches = 1;
// The detailed rule defining how to route matched traffic.
RouteAction action = 2;
}
// Required. Name of the HttpRoute resource. It matches pattern
// `projects/*/locations/global/httpRoutes/http_route_name>`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Output only. Server-defined URL of this resource
string self_link = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. A free-text description of the resource. Max length 1024 characters.
string description = 2 [(google.api.field_behavior) = OPTIONAL];
// Output only. The timestamp when the resource was created.
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The timestamp when the resource was updated.
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Required. Hostnames define a set of hosts that should match against the HTTP host
// header to select a HttpRoute to process the request. Hostname is the fully
// qualified domain name of a network host, as defined by RFC 1123 with the
// exception that:
// - IPs are not allowed.
// - A hostname may be prefixed with a wildcard label (*.). The wildcard
// label must appear by itself as the first label.
//
// Hostname can be "precise" which is a domain name without the terminating
// dot of a network host (e.g. "foo.example.com") or "wildcard", which is a
// domain name prefixed with a single wildcard label (e.g. *.example.com).
//
// Note that as per RFC1035 and RFC1123, a label must consist of lower case
// alphanumeric characters or '-', and must start and end with an alphanumeric
// character. No other punctuation is allowed.
//
// The routes associated with a Mesh or Gateways must have unique hostnames.
// If you attempt to attach multiple routes with conflicting hostnames,
// the configuration will be rejected.
//
// For example, while it is acceptable for routes for the hostnames
// "*.foo.bar.com" and "*.bar.com" to be associated with the same Mesh (or
// Gateways under the same scope), it is not possible to associate two routes
// both with "*.bar.com" or both with "bar.com".
repeated string hostnames = 5 [(google.api.field_behavior) = REQUIRED];
// Optional. Meshes defines a list of meshes this HttpRoute is attached to, as one of
// the routing rules to route the requests served by the mesh.
//
// Each mesh reference should match the pattern:
// `projects/*/locations/global/meshes/<mesh_name>`
//
// The attached Mesh should be of a type SIDECAR
repeated string meshes = 8 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Mesh"
}
];
// Optional. Gateways defines a list of gateways this HttpRoute is attached to, as one
// of the routing rules to route the requests served by the gateway.
//
// Each gateway reference should match the pattern:
// `projects/*/locations/global/gateways/<gateway_name>`
repeated string gateways = 9 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Gateway"
}
];
// Optional. Set of label tags associated with the HttpRoute resource.
map<string, string> labels = 10 [(google.api.field_behavior) = OPTIONAL];
// Required. Rules that define how traffic is routed and handled.
// Rules will be matched sequentially based on the RouteMatch specified for
// the rule.
repeated RouteRule rules = 6 [(google.api.field_behavior) = REQUIRED];
}
// Request used with the ListHttpRoutes method.
message ListHttpRoutesRequest {
// Required. The project and location from which the HttpRoutes should be
// listed, specified in the format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/HttpRoute"
}
];
// Maximum number of HttpRoutes to return per call.
int32 page_size = 2;
// The value returned by the last `ListHttpRoutesResponse`
// Indicates that this is a continuation of a prior `ListHttpRoutes` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListHttpRoutes method.
message ListHttpRoutesResponse {
// List of HttpRoute resources.
repeated HttpRoute http_routes = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetHttpRoute method.
message GetHttpRouteRequest {
// Required. A name of the HttpRoute to get. Must be in the format
// `projects/*/locations/global/httpRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/HttpRoute"
}
];
}
// Request used by the HttpRoute method.
message CreateHttpRouteRequest {
// Required. The parent resource of the HttpRoute. Must be in the
// format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/HttpRoute"
}
];
// Required. Short name of the HttpRoute resource to be created.
string http_route_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. HttpRoute resource to be created.
HttpRoute http_route = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the UpdateHttpRoute method.
message UpdateHttpRouteRequest {
// Optional. Field mask is used to specify the fields to be overwritten in the
// HttpRoute resource by the update.
// 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];
// Required. Updated HttpRoute resource.
HttpRoute http_route = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteHttpRoute method.
message DeleteHttpRouteRequest {
// Required. A name of the HttpRoute to delete. Must be in the format
// `projects/*/locations/global/httpRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/HttpRoute"
}
];
}

@ -0,0 +1,153 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "MeshProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
// Mesh represents a logical configuration grouping for workload to workload
// communication within a service mesh. Routes that point to mesh dictate how
// requests are routed within this logical mesh boundary.
message Mesh {
option (google.api.resource) = {
type: "networkservices.googleapis.com/Mesh"
pattern: "projects/{project}/locations/{location}/meshes/{mesh}"
};
// Required. Name of the Mesh resource. It matches pattern
// `projects/*/locations/global/meshes/<mesh_name>`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Output only. Server-defined URL of this resource
string self_link = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
// 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. Set of label tags associated with the Mesh resource.
map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. A free-text description of the resource. Max length 1024 characters.
string description = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. If set to a valid TCP port (1-65535), instructs the SIDECAR proxy to listen
// on the specified port of localhost (127.0.0.1) address. The SIDECAR proxy
// will expect all traffic to be redirected to this port regardless of its
// actual ip:port destination. If unset, a port '15001' is used as the
// interception port. This will is applicable only for sidecar proxy
// deployments.
int32 interception_port = 8 [(google.api.field_behavior) = OPTIONAL];
}
// Request used with the ListMeshes method.
message ListMeshesRequest {
// Required. The project and location from which the Meshes should be
// listed, specified in the format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/Mesh"
}
];
// Maximum number of Meshes to return per call.
int32 page_size = 2;
// The value returned by the last `ListMeshesResponse`
// Indicates that this is a continuation of a prior `ListMeshes` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListMeshes method.
message ListMeshesResponse {
// List of Mesh resources.
repeated Mesh meshes = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetMesh method.
message GetMeshRequest {
// Required. A name of the Mesh to get. Must be in the format
// `projects/*/locations/global/meshes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Mesh"
}
];
}
// Request used by the CreateMesh method.
message CreateMeshRequest {
// Required. The parent resource of the Mesh. Must be in the
// format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/Mesh"
}
];
// Required. Short name of the Mesh resource to be created.
string mesh_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Mesh resource to be created.
Mesh mesh = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the UpdateMesh method.
message UpdateMeshRequest {
// Optional. Field mask is used to specify the fields to be overwritten in the
// Mesh resource by the update.
// 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];
// Required. Updated Mesh resource.
Mesh mesh = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteMesh method.
message DeleteMeshRequest {
// Required. A name of the Mesh to delete. Must be in the format
// `projects/*/locations/global/meshes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Mesh"
}
];
}

@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -19,6 +19,13 @@ package google.cloud.networkservices.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/cloud/networkservices/v1/endpoint_policy.proto";
import "google/cloud/networkservices/v1/gateway.proto";
import "google/cloud/networkservices/v1/grpc_route.proto";
import "google/cloud/networkservices/v1/http_route.proto";
import "google/cloud/networkservices/v1/mesh.proto";
import "google/cloud/networkservices/v1/service_binding.proto";
import "google/cloud/networkservices/v1/tcp_route.proto";
import "google/cloud/networkservices/v1/tls_route.proto";
import "google/longrunning/operations.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
@ -85,4 +92,369 @@ service NetworkServices {
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists Gateways in a given project and location.
rpc ListGateways(ListGatewaysRequest) returns (ListGatewaysResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/gateways"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single Gateway.
rpc GetGateway(GetGatewayRequest) returns (Gateway) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/gateways/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new Gateway in a given project and location.
rpc CreateGateway(CreateGatewayRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/gateways"
body: "gateway"
};
option (google.api.method_signature) = "parent,gateway,gateway_id";
option (google.longrunning.operation_info) = {
response_type: "Gateway"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Updates the parameters of a single Gateway.
rpc UpdateGateway(UpdateGatewayRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{gateway.name=projects/*/locations/*/gateways/*}"
body: "gateway"
};
option (google.api.method_signature) = "gateway,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Gateway"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single Gateway.
rpc DeleteGateway(DeleteGatewayRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/gateways/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists GrpcRoutes in a given project and location.
rpc ListGrpcRoutes(ListGrpcRoutesRequest) returns (ListGrpcRoutesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/grpcRoutes"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single GrpcRoute.
rpc GetGrpcRoute(GetGrpcRouteRequest) returns (GrpcRoute) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/grpcRoutes/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new GrpcRoute in a given project and location.
rpc CreateGrpcRoute(CreateGrpcRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/grpcRoutes"
body: "grpc_route"
};
option (google.api.method_signature) = "parent,grpc_route,grpc_route_id";
option (google.longrunning.operation_info) = {
response_type: "GrpcRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Updates the parameters of a single GrpcRoute.
rpc UpdateGrpcRoute(UpdateGrpcRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{grpc_route.name=projects/*/locations/*/grpcRoutes/*}"
body: "grpc_route"
};
option (google.api.method_signature) = "grpc_route,update_mask";
option (google.longrunning.operation_info) = {
response_type: "GrpcRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single GrpcRoute.
rpc DeleteGrpcRoute(DeleteGrpcRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/grpcRoutes/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists HttpRoute in a given project and location.
rpc ListHttpRoutes(ListHttpRoutesRequest) returns (ListHttpRoutesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/httpRoutes"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single HttpRoute.
rpc GetHttpRoute(GetHttpRouteRequest) returns (HttpRoute) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/httpRoutes/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new HttpRoute in a given project and location.
rpc CreateHttpRoute(CreateHttpRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/httpRoutes"
body: "http_route"
};
option (google.api.method_signature) = "parent,http_route,http_route_id";
option (google.longrunning.operation_info) = {
response_type: "HttpRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Updates the parameters of a single HttpRoute.
rpc UpdateHttpRoute(UpdateHttpRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{http_route.name=projects/*/locations/*/httpRoutes/*}"
body: "http_route"
};
option (google.api.method_signature) = "http_route,update_mask";
option (google.longrunning.operation_info) = {
response_type: "HttpRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single HttpRoute.
rpc DeleteHttpRoute(DeleteHttpRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/httpRoutes/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists TcpRoute in a given project and location.
rpc ListTcpRoutes(ListTcpRoutesRequest) returns (ListTcpRoutesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/tcpRoutes"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single TcpRoute.
rpc GetTcpRoute(GetTcpRouteRequest) returns (TcpRoute) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/tcpRoutes/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new TcpRoute in a given project and location.
rpc CreateTcpRoute(CreateTcpRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/tcpRoutes"
body: "tcp_route"
};
option (google.api.method_signature) = "parent,tcp_route,tcp_route_id";
option (google.longrunning.operation_info) = {
response_type: "TcpRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Updates the parameters of a single TcpRoute.
rpc UpdateTcpRoute(UpdateTcpRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{tcp_route.name=projects/*/locations/*/tcpRoutes/*}"
body: "tcp_route"
};
option (google.api.method_signature) = "tcp_route,update_mask";
option (google.longrunning.operation_info) = {
response_type: "TcpRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single TcpRoute.
rpc DeleteTcpRoute(DeleteTcpRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/tcpRoutes/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists TlsRoute in a given project and location.
rpc ListTlsRoutes(ListTlsRoutesRequest) returns (ListTlsRoutesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/tlsRoutes"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single TlsRoute.
rpc GetTlsRoute(GetTlsRouteRequest) returns (TlsRoute) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/tlsRoutes/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new TlsRoute in a given project and location.
rpc CreateTlsRoute(CreateTlsRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/tlsRoutes"
body: "tls_route"
};
option (google.api.method_signature) = "parent,tls_route,tls_route_id";
option (google.longrunning.operation_info) = {
response_type: "TlsRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Updates the parameters of a single TlsRoute.
rpc UpdateTlsRoute(UpdateTlsRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{tls_route.name=projects/*/locations/*/tlsRoutes/*}"
body: "tls_route"
};
option (google.api.method_signature) = "tls_route,update_mask";
option (google.longrunning.operation_info) = {
response_type: "TlsRoute"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single TlsRoute.
rpc DeleteTlsRoute(DeleteTlsRouteRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/tlsRoutes/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists ServiceBinding in a given project and location.
rpc ListServiceBindings(ListServiceBindingsRequest) returns (ListServiceBindingsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/serviceBindings"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single ServiceBinding.
rpc GetServiceBinding(GetServiceBindingRequest) returns (ServiceBinding) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/serviceBindings/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new ServiceBinding in a given project and location.
rpc CreateServiceBinding(CreateServiceBindingRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/serviceBindings"
body: "service_binding"
};
option (google.api.method_signature) = "parent,service_binding,service_binding_id";
option (google.longrunning.operation_info) = {
response_type: "ServiceBinding"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single ServiceBinding.
rpc DeleteServiceBinding(DeleteServiceBindingRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/serviceBindings/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Lists Meshes in a given project and location.
rpc ListMeshes(ListMeshesRequest) returns (ListMeshesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/meshes"
};
option (google.api.method_signature) = "parent";
}
// Gets details of a single Mesh.
rpc GetMesh(GetMeshRequest) returns (Mesh) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/meshes/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new Mesh in a given project and location.
rpc CreateMesh(CreateMeshRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/meshes"
body: "mesh"
};
option (google.api.method_signature) = "parent,mesh,mesh_id";
option (google.longrunning.operation_info) = {
response_type: "Mesh"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Updates the parameters of a single Mesh.
rpc UpdateMesh(UpdateMeshRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{mesh.name=projects/*/locations/*/meshes/*}"
body: "mesh"
};
option (google.api.method_signature) = "mesh,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Mesh"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
// Deletes a single Mesh.
rpc DeleteMesh(DeleteMeshRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/meshes/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkservices.v1.OperationMetadata"
};
}
}

@ -4,7 +4,10 @@ name: networkservices.googleapis.com
title: Network Services API
apis:
- name: google.cloud.location.Locations
- name: google.cloud.networkservices.v1.NetworkServices
- name: google.iam.v1.IAMPolicy
- name: google.longrunning.Operations
types:
- name: google.cloud.networkservices.v1.OperationMetadata
@ -65,6 +68,9 @@ http:
- get: '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/locations/*/serviceBindings/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/locations/*/meshes/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/locations/*/gateways/*}:getIamPolicy'
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
post: '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:setIamPolicy'
body: '*'
@ -75,6 +81,12 @@ http:
body: '*'
- post: '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/locations/*/serviceBindings/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/locations/*/meshes/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/locations/*/gateways/*}:setIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
post: '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:testIamPermissions'
body: '*'
@ -85,6 +97,12 @@ http:
body: '*'
- post: '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/locations/*/serviceBindings/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/locations/*/meshes/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/locations/*/gateways/*}:testIamPermissions'
body: '*'
- selector: google.longrunning.Operations.CancelOperation
post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'
body: '*'

@ -0,0 +1,131 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "ServiceBindingProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
// ServiceBinding is the resource that defines a Service Directory Service to
// be used in a BackendService resource.
message ServiceBinding {
option (google.api.resource) = {
type: "networkservices.googleapis.com/ServiceBinding"
pattern: "projects/{project}/locations/{location}/serviceBindings/{service_binding}"
};
// Required. Name of the ServiceBinding resource. It matches pattern
// `projects/*/locations/global/serviceBindings/service_binding_name>`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. A free-text description of the resource. Max length 1024 characters.
string description = 2 [(google.api.field_behavior) = OPTIONAL];
// Output only. The timestamp when the resource was created.
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The timestamp when the resource was updated.
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Required. The full service directory service name of the format
// /projects/*/locations/*/namespaces/*/services/*
string service = 5 [(google.api.field_behavior) = REQUIRED];
// Optional. Set of label tags associated with the ServiceBinding resource.
map<string, string> labels = 7 [(google.api.field_behavior) = OPTIONAL];
}
// Request used with the ListServiceBindings method.
message ListServiceBindingsRequest {
// Required. The project and location from which the ServiceBindings should be
// listed, specified in the format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/ServiceBinding"
}
];
// Maximum number of ServiceBindings to return per call.
int32 page_size = 2;
// The value returned by the last `ListServiceBindingsResponse`
// Indicates that this is a continuation of a prior `ListRouters` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListServiceBindings method.
message ListServiceBindingsResponse {
// List of ServiceBinding resources.
repeated ServiceBinding service_bindings = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetServiceBinding method.
message GetServiceBindingRequest {
// Required. A name of the ServiceBinding to get. Must be in the format
// `projects/*/locations/global/serviceBindings/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/ServiceBinding"
}
];
}
// Request used by the ServiceBinding method.
message CreateServiceBindingRequest {
// Required. The parent resource of the ServiceBinding. Must be in the
// format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/ServiceBinding"
}
];
// Required. Short name of the ServiceBinding resource to be created.
string service_binding_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. ServiceBinding resource to be created.
ServiceBinding service_binding = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteServiceBinding method.
message DeleteServiceBindingRequest {
// Required. A name of the ServiceBinding to delete. Must be in the format
// `projects/*/locations/global/serviceBindings/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/ServiceBinding"
}
];
}

@ -0,0 +1,251 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "TcpRouteProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
option (google.api.resource_definition) = {
type: "compute.googleapis.com/BackendService"
pattern: "projects/{project}/locations/{location}/backendServices/{backend_service}"
};
// TcpRoute is the resource defining how TCP traffic should be routed by a
// Mesh/Gateway resource.
message TcpRoute {
option (google.api.resource) = {
type: "networkservices.googleapis.com/TcpRoute"
pattern: "projects/{project}/locations/{location}/tcpRoutes/{tcp_route}"
};
// Specifies how to match traffic and how to route traffic when traffic is
// matched.
message RouteRule {
// Optional. RouteMatch defines the predicate used to match requests to a given
// action. Multiple match types are "OR"ed for evaluation.
// If no routeMatch field is specified, this rule will unconditionally match
// traffic.
repeated RouteMatch matches = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. The detailed rule defining how to route matched traffic.
RouteAction action = 2 [(google.api.field_behavior) = REQUIRED];
}
// RouteMatch defines the predicate used to match requests to a given action.
// Multiple match types are "OR"ed for evaluation.
// If no routeMatch field is specified, this rule will unconditionally match
// traffic.
message RouteMatch {
// Required. Must be specified in the CIDR range format. A CIDR range consists of an
// IP Address and a prefix length to construct the subnet mask. By default,
// the prefix length is 32 (i.e. matches a single IP address). Only IPV4
// addresses are supported.
// Examples:
// "10.0.0.1" - matches against this exact IP address.
// "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet
// and 255.255.255.0 mask.
// "0.0.0.0/0" - matches against any IP address'.
string address = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Specifies the destination port to match against.
string port = 2 [(google.api.field_behavior) = REQUIRED];
}
// The specifications for routing traffic and applying associated policies.
message RouteAction {
// Optional. The destination services to which traffic should be forwarded. At least
// one destination service is required.
repeated RouteDestination destinations = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. If true, Router will use the destination IP and port of the original
// connection as the destination of the request. Default is false.
bool original_destination = 3 [(google.api.field_behavior) = OPTIONAL];
}
// Describe the destination for traffic to be routed to.
message RouteDestination {
// Required. The URL of a BackendService to route traffic to.
string service_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "compute.googleapis.com/BackendService"
}
];
// Optional. Specifies the proportion of requests forwarded to the backend referenced
// by the serviceName field. This is computed as:
// weight/Sum(weights in this destination list).
// For non-zero values, there may be some epsilon from the exact proportion
// defined here depending on the precision an implementation supports.
//
// If only one serviceName is specified and it has a weight greater than 0,
// 100% of the traffic is forwarded to that backend.
//
// If weights are specified for any one service name, they need to be
// specified for all of them.
//
// If weights are unspecified for all services, then, traffic is distributed
// in equal proportions to all of them.
int32 weight = 2 [(google.api.field_behavior) = OPTIONAL];
}
// Required. Name of the TcpRoute resource. It matches pattern
// `projects/*/locations/global/tcpRoutes/tcp_route_name>`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Output only. Server-defined URL of this resource
string self_link = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// 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 free-text description of the resource. Max length 1024 characters.
string description = 4 [(google.api.field_behavior) = OPTIONAL];
// Required. Rules that define how traffic is routed and handled. At least one RouteRule
// must be supplied. If there are multiple rules then the action taken will be
// the first rule to match.
repeated RouteRule rules = 5 [(google.api.field_behavior) = REQUIRED];
// Optional. Meshes defines a list of meshes this TcpRoute is attached to, as one of the
// routing rules to route the requests served by the mesh.
//
// Each mesh reference should match the pattern:
// `projects/*/locations/global/meshes/<mesh_name>`
//
// The attached Mesh should be of a type SIDECAR
repeated string meshes = 8 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Mesh"
}
];
// Optional. Gateways defines a list of gateways this TcpRoute is attached to, as one of
// the routing rules to route the requests served by the gateway.
//
// Each gateway reference should match the pattern:
// `projects/*/locations/global/gateways/<gateway_name>`
repeated string gateways = 9 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Gateway"
}
];
// Optional. Set of label tags associated with the TcpRoute resource.
map<string, string> labels = 10 [(google.api.field_behavior) = OPTIONAL];
}
// Request used with the ListTcpRoutes method.
message ListTcpRoutesRequest {
// Required. The project and location from which the TcpRoutes should be
// listed, specified in the format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/TcpRoute"
}
];
// Maximum number of TcpRoutes to return per call.
int32 page_size = 2;
// The value returned by the last `ListTcpRoutesResponse`
// Indicates that this is a continuation of a prior `ListTcpRoutes` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListTcpRoutes method.
message ListTcpRoutesResponse {
// List of TcpRoute resources.
repeated TcpRoute tcp_routes = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetTcpRoute method.
message GetTcpRouteRequest {
// Required. A name of the TcpRoute to get. Must be in the format
// `projects/*/locations/global/tcpRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/TcpRoute"
}
];
}
// Request used by the TcpRoute method.
message CreateTcpRouteRequest {
// Required. The parent resource of the TcpRoute. Must be in the
// format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/TcpRoute"
}
];
// Required. Short name of the TcpRoute resource to be created. E.g. TODO(Add an
// example).
string tcp_route_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. TcpRoute resource to be created.
TcpRoute tcp_route = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the UpdateTcpRoute method.
message UpdateTcpRouteRequest {
// Optional. Field mask is used to specify the fields to be overwritten in the
// TcpRoute resource by the update.
// 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];
// Required. Updated TcpRoute resource.
TcpRoute tcp_route = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteTcpRoute method.
message DeleteTcpRouteRequest {
// Required. A name of the TcpRoute to delete. Must be in the format
// `projects/*/locations/global/tcpRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/TcpRoute"
}
];
}

@ -0,0 +1,230 @@
// Copyright 2022 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.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
option java_multiple_files = true;
option java_outer_classname = "TlsRouteProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";
// TlsRoute defines how traffic should be routed based on SNI and other matching
// L3 attributes.
message TlsRoute {
option (google.api.resource) = {
type: "networkservices.googleapis.com/TlsRoute"
pattern: "projects/{project}/locations/{location}/tlsRoutes/{tls_route}"
};
// Specifies how to match traffic and how to route traffic when traffic is
// matched.
message RouteRule {
// Required. RouteMatch defines the predicate used to match requests to a given
// action. Multiple match types are "OR"ed for evaluation.
repeated RouteMatch matches = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The detailed rule defining how to route matched traffic.
RouteAction action = 2 [(google.api.field_behavior) = REQUIRED];
}
// RouteMatch defines the predicate used to match requests to a given action.
// Multiple match types are "AND"ed for evaluation.
// If no routeMatch field is specified, this rule will unconditionally match
// traffic.
message RouteMatch {
// Optional. SNI (server name indicator) to match against.
// SNI will be matched against all wildcard domains, i.e. www.example.com
// will be first matched against www.example.com, then *.example.com, then
// *.com.
// Partial wildcards are not supported, and values like *w.example.com are
// invalid.
// At least one of sni_host and alpn is required.
// Up to 5 sni hosts across all matches can be set.
repeated string sni_host = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. ALPN (Application-Layer Protocol Negotiation) to match against.
// Examples: "http/1.1", "h2".
// At least one of sni_host and alpn is required.
// Up to 5 alpns across all matches can be set.
repeated string alpn = 2 [(google.api.field_behavior) = OPTIONAL];
}
// The specifications for routing traffic and applying associated policies.
message RouteAction {
// Required. The destination services to which traffic should be forwarded. At least
// one destination service is required.
repeated RouteDestination destinations = 1 [(google.api.field_behavior) = REQUIRED];
}
// Describe the destination for traffic to be routed to.
message RouteDestination {
// Required. The URL of a BackendService to route traffic to.
string service_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "compute.googleapis.com/BackendService"
}
];
// Optional. Specifies the proportion of requests forwareded to the backend referenced
// by the service_name field. This is computed as:
// weight/Sum(weights in destinations)
// Weights in all destinations does not need to sum up to 100.
int32 weight = 2 [(google.api.field_behavior) = OPTIONAL];
}
// Required. Name of the TlsRoute resource. It matches pattern
// `projects/*/locations/global/tlsRoutes/tls_route_name>`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Output only. Server-defined URL of this resource
string self_link = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
// 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 free-text description of the resource. Max length 1024 characters.
string description = 4 [(google.api.field_behavior) = OPTIONAL];
// Required. Rules that define how traffic is routed and handled. At least one RouteRule
// must be supplied. If there are multiple rules then the action taken will be
// the first rule to match.
repeated RouteRule rules = 5 [(google.api.field_behavior) = REQUIRED];
// Optional. Meshes defines a list of meshes this TlsRoute is attached to, as one of the
// routing rules to route the requests served by the mesh.
//
// Each mesh reference should match the pattern:
// `projects/*/locations/global/meshes/<mesh_name>`
//
// The attached Mesh should be of a type SIDECAR
repeated string meshes = 6 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Mesh"
}
];
// Optional. Gateways defines a list of gateways this TlsRoute is attached to, as one of
// the routing rules to route the requests served by the gateway.
//
// Each gateway reference should match the pattern:
// `projects/*/locations/global/gateways/<gateway_name>`
repeated string gateways = 7 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/Gateway"
}
];
}
// Request used with the ListTlsRoutes method.
message ListTlsRoutesRequest {
// Required. The project and location from which the TlsRoutes should be
// listed, specified in the format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/TlsRoute"
}
];
// Maximum number of TlsRoutes to return per call.
int32 page_size = 2;
// The value returned by the last `ListTlsRoutesResponse`
// Indicates that this is a continuation of a prior `ListTlsRoutes` call,
// and that the system should return the next page of data.
string page_token = 3;
}
// Response returned by the ListTlsRoutes method.
message ListTlsRoutesResponse {
// List of TlsRoute resources.
repeated TlsRoute tls_routes = 1;
// If there might be more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token`.
string next_page_token = 2;
}
// Request used by the GetTlsRoute method.
message GetTlsRouteRequest {
// Required. A name of the TlsRoute to get. Must be in the format
// `projects/*/locations/global/tlsRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/TlsRoute"
}
];
}
// Request used by the TlsRoute method.
message CreateTlsRouteRequest {
// Required. The parent resource of the TlsRoute. Must be in the
// format `projects/*/locations/global`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkservices.googleapis.com/TlsRoute"
}
];
// Required. Short name of the TlsRoute resource to be created. E.g. TODO(Add an
// example).
string tls_route_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. TlsRoute resource to be created.
TlsRoute tls_route = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the UpdateTlsRoute method.
message UpdateTlsRouteRequest {
// Optional. Field mask is used to specify the fields to be overwritten in the
// TlsRoute resource by the update.
// 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];
// Required. Updated TlsRoute resource.
TlsRoute tls_route = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request used by the DeleteTlsRoute method.
message DeleteTlsRouteRequest {
// Required. A name of the TlsRoute to delete. Must be in the format
// `projects/*/locations/global/tlsRoutes/*`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkservices.googleapis.com/TlsRoute"
}
];
}
Loading…
Cancel
Save