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.baremetalsolution.v2; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/field_mask.proto"; 22 23option csharp_namespace = "Google.Cloud.BareMetalSolution.V2"; 24option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb"; 25option java_multiple_files = true; 26option java_outer_classname = "NetworkProto"; 27option java_package = "com.google.cloud.baremetalsolution.v2"; 28option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2"; 29option ruby_package = "Google::Cloud::BareMetalSolution::V2"; 30option (google.api.resource_definition) = { 31 type: "compute.googleapis.com/InterconnectAttachment" 32 pattern: "projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}" 33}; 34 35// A Network. 36message Network { 37 option (google.api.resource) = { 38 type: "baremetalsolution.googleapis.com/Network" 39 pattern: "projects/{project}/locations/{location}/networks/{network}" 40 }; 41 42 // Network type. 43 enum Type { 44 // Unspecified value. 45 TYPE_UNSPECIFIED = 0; 46 47 // Client network, a network peered to a Google Cloud VPC. 48 CLIENT = 1; 49 50 // Private network, a network local to the Bare Metal Solution environment. 51 PRIVATE = 2; 52 } 53 54 // The possible states for this Network. 55 enum State { 56 // The Network is in an unknown state. 57 STATE_UNSPECIFIED = 0; 58 59 // The Network is provisioning. 60 PROVISIONING = 1; 61 62 // The Network has been provisioned. 63 PROVISIONED = 2; 64 65 // The Network is being deprovisioned. 66 DEPROVISIONING = 3; 67 68 // The Network is being updated. 69 UPDATING = 4; 70 } 71 72 // Output only. The resource name of this `Network`. 73 // Resource names are schemeless URIs that follow the conventions in 74 // https://cloud.google.com/apis/design/resource_names. 75 // Format: 76 // `projects/{project}/locations/{location}/networks/{network}` 77 string name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 78 79 // An identifier for the `Network`, generated by the backend. 80 string id = 10; 81 82 // The type of this network. 83 Type type = 2; 84 85 // IP address configured. 86 string ip_address = 3; 87 88 // List of physical interfaces. 89 repeated string mac_address = 4; 90 91 // The Network state. 92 State state = 6; 93 94 // The vlan id of the Network. 95 string vlan_id = 7; 96 97 // The cidr of the Network. 98 string cidr = 8; 99 100 // The vrf for the Network. 101 VRF vrf = 9; 102 103 // Labels as key value pairs. 104 map<string, string> labels = 11; 105 106 // IP range for reserved for services (e.g. NFS). 107 string services_cidr = 12; 108 109 // List of IP address reservations in this network. 110 // When updating this field, an error will be generated if a reservation 111 // conflicts with an IP address already allocated to a physical server. 112 repeated NetworkAddressReservation reservations = 13; 113 114 // Output only. Pod name. 115 string pod = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; 116 117 // Input only. List of mount points to attach the network to. 118 repeated NetworkMountPoint mount_points = 15 119 [(google.api.field_behavior) = INPUT_ONLY]; 120 121 // Whether network uses standard frames or jumbo ones. 122 bool jumbo_frames_enabled = 16; 123 124 // Output only. Gateway ip address. 125 string gateway_ip = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; 126} 127 128// A reservation of one or more addresses in a network. 129message NetworkAddressReservation { 130 // The first address of this reservation block. 131 // Must be specified as a single IPv4 address, e.g. 10.1.2.2. 132 string start_address = 1; 133 134 // The last address of this reservation block, inclusive. I.e., for cases when 135 // reservations are only single addresses, end_address and start_address will 136 // be the same. 137 // Must be specified as a single IPv4 address, e.g. 10.1.2.2. 138 string end_address = 2; 139 140 // A note about this reservation, intended for human consumption. 141 string note = 3; 142} 143 144// A network VRF. 145message VRF { 146 // The possible states for this VRF. 147 enum State { 148 // The unspecified state. 149 STATE_UNSPECIFIED = 0; 150 151 // The vrf is provisioning. 152 PROVISIONING = 1; 153 154 // The vrf is provisioned. 155 PROVISIONED = 2; 156 } 157 158 // QOS policy parameters. 159 message QosPolicy { 160 // The bandwidth permitted by the QOS policy, in gbps. 161 double bandwidth_gbps = 1; 162 } 163 164 // VLAN attachment details. 165 message VlanAttachment { 166 // The peer vlan ID of the attachment. 167 int64 peer_vlan_id = 1; 168 169 // The peer IP of the attachment. 170 string peer_ip = 2; 171 172 // The router IP of the attachment. 173 string router_ip = 3; 174 175 // Input only. Pairing key. 176 string pairing_key = 4 [(google.api.field_behavior) = INPUT_ONLY]; 177 178 // The QOS policy applied to this VLAN attachment. 179 // This value should be preferred to using qos at vrf level. 180 QosPolicy qos_policy = 5; 181 182 // Immutable. The identifier of the attachment within vrf. 183 string id = 6 [(google.api.field_behavior) = IMMUTABLE]; 184 185 // Optional. The name of the vlan attachment within vrf. This is of the form 186 // projects/{project_number}/regions/{region}/interconnectAttachments/{interconnect_attachment} 187 string interconnect_attachment = 7 [ 188 (google.api.field_behavior) = OPTIONAL, 189 (google.api.resource_reference) = { 190 type: "compute.googleapis.com/InterconnectAttachment" 191 } 192 ]; 193 } 194 195 // The name of the VRF. 196 string name = 1; 197 198 // The possible state of VRF. 199 State state = 5; 200 201 // The QOS policy applied to this VRF. 202 // The value is only meaningful when all the vlan attachments have the same 203 // QoS. This field should not be used for new integrations, use vlan 204 // attachment level qos instead. The field is left for backward-compatibility. 205 QosPolicy qos_policy = 6; 206 207 // The list of VLAN attachments for the VRF. 208 repeated VlanAttachment vlan_attachments = 7; 209} 210 211// Each logical interface represents a logical abstraction of the underlying 212// physical interface (for eg. bond, nic) of the instance. Each logical 213// interface can effectively map to multiple network-IP pairs and still be 214// mapped to one underlying physical interface. 215message LogicalInterface { 216 // Each logical network interface is effectively a network and IP pair. 217 message LogicalNetworkInterface { 218 // Name of the network 219 string network = 1; 220 221 // IP address in the network 222 string ip_address = 2; 223 224 // Whether this interface is the default gateway for the instance. Only 225 // one interface can be the default gateway for the instance. 226 bool default_gateway = 3; 227 228 // Type of network. 229 Network.Type network_type = 4; 230 231 // An identifier for the `Network`, generated by the backend. 232 string id = 5; 233 } 234 235 // List of logical network interfaces within a logical interface. 236 repeated LogicalNetworkInterface logical_network_interfaces = 1; 237 238 // Interface name. This is of syntax <bond><bond_mode> or <nic> and 239 // forms part of the network template name. 240 string name = 2; 241 242 // The index of the logical interface mapping to the index of the hardware 243 // bond or nic on the chosen network template. This field is deprecated. 244 int32 interface_index = 3 [deprecated = true]; 245} 246 247// Message for requesting network information. 248message GetNetworkRequest { 249 // Required. Name of the resource. 250 string name = 1 [ 251 (google.api.field_behavior) = REQUIRED, 252 (google.api.resource_reference) = { 253 type: "baremetalsolution.googleapis.com/Network" 254 } 255 ]; 256} 257 258// Message for requesting a list of networks. 259message ListNetworksRequest { 260 // Required. Parent value for ListNetworksRequest. 261 string parent = 1 [ 262 (google.api.field_behavior) = REQUIRED, 263 (google.api.resource_reference) = { 264 type: "locations.googleapis.com/Location" 265 } 266 ]; 267 268 // Requested page size. The server might return fewer items than requested. 269 // If unspecified, server will pick an appropriate default. 270 int32 page_size = 2; 271 272 // A token identifying a page of results from the server. 273 string page_token = 3; 274 275 // List filter. 276 string filter = 4; 277} 278 279// Response message containing the list of networks. 280message ListNetworksResponse { 281 // The list of networks. 282 repeated Network networks = 1; 283 284 // A token identifying a page of results from the server. 285 string next_page_token = 2; 286 287 // Locations that could not be reached. 288 repeated string unreachable = 3; 289} 290 291// Message requesting to updating a network. 292message UpdateNetworkRequest { 293 // Required. The network to update. 294 // 295 // The `name` field is used to identify the instance to update. 296 // Format: projects/{project}/locations/{location}/networks/{network} 297 Network network = 1 [(google.api.field_behavior) = REQUIRED]; 298 299 // The list of fields to update. 300 // The only currently supported fields are: 301 // `labels`, `reservations`, `vrf.vlan_attachments` 302 google.protobuf.FieldMask update_mask = 2; 303} 304 305// Network with all used IP addresses. 306message NetworkUsage { 307 // Network. 308 Network network = 1; 309 310 // All used IP addresses in this network. 311 repeated string used_ips = 2; 312} 313 314// Request to get networks with IPs. 315message ListNetworkUsageRequest { 316 // Required. Parent value (project and location). 317 string location = 1 [ 318 (google.api.field_behavior) = REQUIRED, 319 (google.api.resource_reference) = { 320 type: "locations.googleapis.com/Location" 321 } 322 ]; 323} 324 325// Response with Networks with IPs 326message ListNetworkUsageResponse { 327 // Networks with IPs. 328 repeated NetworkUsage networks = 1; 329} 330 331// Mount point for a network. 332message NetworkMountPoint { 333 // Instance to attach network to. 334 string instance = 1 [(google.api.resource_reference) = { 335 type: "baremetalsolution.googleapis.com/Instance" 336 }]; 337 338 // Logical interface to detach from. 339 string logical_interface = 2; 340 341 // Network should be a default gateway. 342 bool default_gateway = 3; 343 344 // Ip address of the server. 345 string ip_address = 4; 346} 347 348// Message requesting rename of a server. 349message RenameNetworkRequest { 350 // Required. The `name` field is used to identify the network. 351 // Format: projects/{project}/locations/{location}/networks/{network} 352 string name = 1 [ 353 (google.api.field_behavior) = REQUIRED, 354 (google.api.resource_reference) = { 355 type: "baremetalsolution.googleapis.com/Network" 356 } 357 ]; 358 359 // Required. The new `id` of the network. 360 string new_network_id = 2 [(google.api.field_behavior) = REQUIRED]; 361} 362