1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.networkservices.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/field_mask.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.NetworkServices.V1"; 25option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; 26option java_multiple_files = true; 27option java_outer_classname = "GatewayProto"; 28option java_package = "com.google.cloud.networkservices.v1"; 29option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; 30option ruby_package = "Google::Cloud::NetworkServices::V1"; 31 32// Gateway represents the configuration for a proxy, typically a load balancer. 33// It captures the ip:port over which the services are exposed by the proxy, 34// along with any policy configurations. Routes have reference to to Gateways to 35// dictate how requests should be routed by this Gateway. 36message Gateway { 37 option (google.api.resource) = { 38 type: "networkservices.googleapis.com/Gateway" 39 pattern: "projects/{project}/locations/{location}/gateways/{gateway}" 40 }; 41 42 // The type of the customer-managed gateway. 43 // Possible values are: 44 // * OPEN_MESH 45 // * SECURE_WEB_GATEWAY 46 enum Type { 47 // The type of the customer managed gateway is unspecified. 48 TYPE_UNSPECIFIED = 0; 49 50 // The type of the customer managed gateway is TrafficDirector Open 51 // Mesh. 52 OPEN_MESH = 1; 53 54 // The type of the customer managed gateway is SecureWebGateway (SWG). 55 SECURE_WEB_GATEWAY = 2; 56 } 57 58 // Required. Name of the Gateway resource. It matches pattern 59 // `projects/*/locations/*/gateways/<gateway_name>`. 60 string name = 1 [(google.api.field_behavior) = REQUIRED]; 61 62 // Output only. Server-defined URL of this resource 63 string self_link = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; 64 65 // Output only. The timestamp when the resource was created. 66 google.protobuf.Timestamp create_time = 2 67 [(google.api.field_behavior) = OUTPUT_ONLY]; 68 69 // Output only. The timestamp when the resource was updated. 70 google.protobuf.Timestamp update_time = 3 71 [(google.api.field_behavior) = OUTPUT_ONLY]; 72 73 // Optional. Set of label tags associated with the Gateway resource. 74 map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL]; 75 76 // Optional. A free-text description of the resource. Max length 1024 77 // characters. 78 string description = 5 [(google.api.field_behavior) = OPTIONAL]; 79 80 // Immutable. The type of the customer managed gateway. 81 // This field is required. If unspecified, an error is returned. 82 Type type = 6 [(google.api.field_behavior) = IMMUTABLE]; 83 84 // Required. One or more ports that the Gateway must receive traffic on. The 85 // proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports 86 // specified below. 87 repeated int32 ports = 11 [(google.api.field_behavior) = REQUIRED]; 88 89 // Required. Immutable. Scope determines how configuration across multiple 90 // Gateway instances are merged. The configuration for multiple Gateway 91 // instances with the same scope will be merged as presented as a single 92 // coniguration to the proxy/load balancer. 93 // 94 // Max length 64 characters. 95 // Scope should start with a letter and can only have letters, numbers, 96 // hyphens. 97 string scope = 8 [ 98 (google.api.field_behavior) = REQUIRED, 99 (google.api.field_behavior) = IMMUTABLE 100 ]; 101 102 // Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how 103 // TLS traffic is terminated. If empty, TLS termination is disabled. 104 string server_tls_policy = 9 [(google.api.field_behavior) = OPTIONAL]; 105} 106 107// Request used with the ListGateways method. 108message ListGatewaysRequest { 109 // Required. The project and location from which the Gateways should be 110 // listed, specified in the format `projects/*/locations/*`. 111 string parent = 1 [ 112 (google.api.field_behavior) = REQUIRED, 113 (google.api.resource_reference) = { 114 child_type: "networkservices.googleapis.com/Gateway" 115 } 116 ]; 117 118 // Maximum number of Gateways to return per call. 119 int32 page_size = 2; 120 121 // The value returned by the last `ListGatewaysResponse` 122 // Indicates that this is a continuation of a prior `ListGateways` call, 123 // and that the system should return the next page of data. 124 string page_token = 3; 125} 126 127// Response returned by the ListGateways method. 128message ListGatewaysResponse { 129 // List of Gateway resources. 130 repeated Gateway gateways = 1; 131 132 // If there might be more results than those appearing in this response, then 133 // `next_page_token` is included. To get the next set of results, call this 134 // method again using the value of `next_page_token` as `page_token`. 135 string next_page_token = 2; 136} 137 138// Request used by the GetGateway method. 139message GetGatewayRequest { 140 // Required. A name of the Gateway to get. Must be in the format 141 // `projects/*/locations/*/gateways/*`. 142 string name = 1 [ 143 (google.api.field_behavior) = REQUIRED, 144 (google.api.resource_reference) = { 145 type: "networkservices.googleapis.com/Gateway" 146 } 147 ]; 148} 149 150// Request used by the CreateGateway method. 151message CreateGatewayRequest { 152 // Required. The parent resource of the Gateway. Must be in the 153 // format `projects/*/locations/*`. 154 string parent = 1 [ 155 (google.api.field_behavior) = REQUIRED, 156 (google.api.resource_reference) = { 157 child_type: "networkservices.googleapis.com/Gateway" 158 } 159 ]; 160 161 // Required. Short name of the Gateway resource to be created. 162 string gateway_id = 2 [(google.api.field_behavior) = REQUIRED]; 163 164 // Required. Gateway resource to be created. 165 Gateway gateway = 3 [(google.api.field_behavior) = REQUIRED]; 166} 167 168// Request used by the UpdateGateway method. 169message UpdateGatewayRequest { 170 // Optional. Field mask is used to specify the fields to be overwritten in the 171 // Gateway resource by the update. 172 // The fields specified in the update_mask are relative to the resource, not 173 // the full request. A field will be overwritten if it is in the mask. If the 174 // user does not provide a mask then all fields will be overwritten. 175 google.protobuf.FieldMask update_mask = 1 176 [(google.api.field_behavior) = OPTIONAL]; 177 178 // Required. Updated Gateway resource. 179 Gateway gateway = 2 [(google.api.field_behavior) = REQUIRED]; 180} 181 182// Request used by the DeleteGateway method. 183message DeleteGatewayRequest { 184 // Required. A name of the Gateway to delete. Must be in the format 185 // `projects/*/locations/*/gateways/*`. 186 string name = 1 [ 187 (google.api.field_behavior) = REQUIRED, 188 (google.api.resource_reference) = { 189 type: "networkservices.googleapis.com/Gateway" 190 } 191 ]; 192} 193