tls_route.proto 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.networkservices.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/field_mask.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.NetworkServices.V1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1;networkservices";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "TlsRouteProto";
  24. option java_package = "com.google.cloud.networkservices.v1";
  25. option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
  26. option ruby_package = "Google::Cloud::NetworkServices::V1";
  27. // TlsRoute defines how traffic should be routed based on SNI and other matching
  28. // L3 attributes.
  29. message TlsRoute {
  30. option (google.api.resource) = {
  31. type: "networkservices.googleapis.com/TlsRoute"
  32. pattern: "projects/{project}/locations/{location}/tlsRoutes/{tls_route}"
  33. };
  34. // Specifies how to match traffic and how to route traffic when traffic is
  35. // matched.
  36. message RouteRule {
  37. // Required. RouteMatch defines the predicate used to match requests to a given
  38. // action. Multiple match types are "OR"ed for evaluation.
  39. repeated RouteMatch matches = 1 [(google.api.field_behavior) = REQUIRED];
  40. // Required. The detailed rule defining how to route matched traffic.
  41. RouteAction action = 2 [(google.api.field_behavior) = REQUIRED];
  42. }
  43. // RouteMatch defines the predicate used to match requests to a given action.
  44. // Multiple match types are "AND"ed for evaluation.
  45. // If no routeMatch field is specified, this rule will unconditionally match
  46. // traffic.
  47. message RouteMatch {
  48. // Optional. SNI (server name indicator) to match against.
  49. // SNI will be matched against all wildcard domains, i.e. www.example.com
  50. // will be first matched against www.example.com, then *.example.com, then
  51. // *.com.
  52. // Partial wildcards are not supported, and values like *w.example.com are
  53. // invalid.
  54. // At least one of sni_host and alpn is required.
  55. // Up to 5 sni hosts across all matches can be set.
  56. repeated string sni_host = 1 [(google.api.field_behavior) = OPTIONAL];
  57. // Optional. ALPN (Application-Layer Protocol Negotiation) to match against.
  58. // Examples: "http/1.1", "h2".
  59. // At least one of sni_host and alpn is required.
  60. // Up to 5 alpns across all matches can be set.
  61. repeated string alpn = 2 [(google.api.field_behavior) = OPTIONAL];
  62. }
  63. // The specifications for routing traffic and applying associated policies.
  64. message RouteAction {
  65. // Required. The destination services to which traffic should be forwarded. At least
  66. // one destination service is required.
  67. repeated RouteDestination destinations = 1 [(google.api.field_behavior) = REQUIRED];
  68. }
  69. // Describe the destination for traffic to be routed to.
  70. message RouteDestination {
  71. // Required. The URL of a BackendService to route traffic to.
  72. string service_name = 1 [
  73. (google.api.field_behavior) = REQUIRED,
  74. (google.api.resource_reference) = {
  75. type: "compute.googleapis.com/BackendService"
  76. }
  77. ];
  78. // Optional. Specifies the proportion of requests forwareded to the backend referenced
  79. // by the service_name field. This is computed as:
  80. // weight/Sum(weights in destinations)
  81. // Weights in all destinations does not need to sum up to 100.
  82. int32 weight = 2 [(google.api.field_behavior) = OPTIONAL];
  83. }
  84. // Required. Name of the TlsRoute resource. It matches pattern
  85. // `projects/*/locations/global/tlsRoutes/tls_route_name>`.
  86. string name = 1 [(google.api.field_behavior) = REQUIRED];
  87. // Output only. Server-defined URL of this resource
  88. string self_link = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  89. // Output only. The timestamp when the resource was created.
  90. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  91. // Output only. The timestamp when the resource was updated.
  92. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  93. // Optional. A free-text description of the resource. Max length 1024 characters.
  94. string description = 4 [(google.api.field_behavior) = OPTIONAL];
  95. // Required. Rules that define how traffic is routed and handled. At least one RouteRule
  96. // must be supplied. If there are multiple rules then the action taken will be
  97. // the first rule to match.
  98. repeated RouteRule rules = 5 [(google.api.field_behavior) = REQUIRED];
  99. // Optional. Meshes defines a list of meshes this TlsRoute is attached to, as one of the
  100. // routing rules to route the requests served by the mesh.
  101. //
  102. // Each mesh reference should match the pattern:
  103. // `projects/*/locations/global/meshes/<mesh_name>`
  104. //
  105. // The attached Mesh should be of a type SIDECAR
  106. repeated string meshes = 6 [
  107. (google.api.field_behavior) = OPTIONAL,
  108. (google.api.resource_reference) = {
  109. type: "networkservices.googleapis.com/Mesh"
  110. }
  111. ];
  112. // Optional. Gateways defines a list of gateways this TlsRoute is attached to, as one of
  113. // the routing rules to route the requests served by the gateway.
  114. //
  115. // Each gateway reference should match the pattern:
  116. // `projects/*/locations/global/gateways/<gateway_name>`
  117. repeated string gateways = 7 [
  118. (google.api.field_behavior) = OPTIONAL,
  119. (google.api.resource_reference) = {
  120. type: "networkservices.googleapis.com/Gateway"
  121. }
  122. ];
  123. }
  124. // Request used with the ListTlsRoutes method.
  125. message ListTlsRoutesRequest {
  126. // Required. The project and location from which the TlsRoutes should be
  127. // listed, specified in the format `projects/*/locations/global`.
  128. string parent = 1 [
  129. (google.api.field_behavior) = REQUIRED,
  130. (google.api.resource_reference) = {
  131. child_type: "networkservices.googleapis.com/TlsRoute"
  132. }
  133. ];
  134. // Maximum number of TlsRoutes to return per call.
  135. int32 page_size = 2;
  136. // The value returned by the last `ListTlsRoutesResponse`
  137. // Indicates that this is a continuation of a prior `ListTlsRoutes` call,
  138. // and that the system should return the next page of data.
  139. string page_token = 3;
  140. }
  141. // Response returned by the ListTlsRoutes method.
  142. message ListTlsRoutesResponse {
  143. // List of TlsRoute resources.
  144. repeated TlsRoute tls_routes = 1;
  145. // If there might be more results than those appearing in this response, then
  146. // `next_page_token` is included. To get the next set of results, call this
  147. // method again using the value of `next_page_token` as `page_token`.
  148. string next_page_token = 2;
  149. }
  150. // Request used by the GetTlsRoute method.
  151. message GetTlsRouteRequest {
  152. // Required. A name of the TlsRoute to get. Must be in the format
  153. // `projects/*/locations/global/tlsRoutes/*`.
  154. string name = 1 [
  155. (google.api.field_behavior) = REQUIRED,
  156. (google.api.resource_reference) = {
  157. type: "networkservices.googleapis.com/TlsRoute"
  158. }
  159. ];
  160. }
  161. // Request used by the TlsRoute method.
  162. message CreateTlsRouteRequest {
  163. // Required. The parent resource of the TlsRoute. Must be in the
  164. // format `projects/*/locations/global`.
  165. string parent = 1 [
  166. (google.api.field_behavior) = REQUIRED,
  167. (google.api.resource_reference) = {
  168. child_type: "networkservices.googleapis.com/TlsRoute"
  169. }
  170. ];
  171. // Required. Short name of the TlsRoute resource to be created. E.g. TODO(Add an
  172. // example).
  173. string tls_route_id = 2 [(google.api.field_behavior) = REQUIRED];
  174. // Required. TlsRoute resource to be created.
  175. TlsRoute tls_route = 3 [(google.api.field_behavior) = REQUIRED];
  176. }
  177. // Request used by the UpdateTlsRoute method.
  178. message UpdateTlsRouteRequest {
  179. // Optional. Field mask is used to specify the fields to be overwritten in the
  180. // TlsRoute resource by the update.
  181. // The fields specified in the update_mask are relative to the resource, not
  182. // the full request. A field will be overwritten if it is in the mask. If the
  183. // user does not provide a mask then all fields will be overwritten.
  184. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
  185. // Required. Updated TlsRoute resource.
  186. TlsRoute tls_route = 2 [(google.api.field_behavior) = REQUIRED];
  187. }
  188. // Request used by the DeleteTlsRoute method.
  189. message DeleteTlsRouteRequest {
  190. // Required. A name of the TlsRoute to delete. Must be in the format
  191. // `projects/*/locations/global/tlsRoutes/*`.
  192. string name = 1 [
  193. (google.api.field_behavior) = REQUIRED,
  194. (google.api.resource_reference) = {
  195. type: "networkservices.googleapis.com/TlsRoute"
  196. }
  197. ];
  198. }