network.proto 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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.baremetalsolution.v2;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/field_mask.proto";
  19. option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2;baremetalsolution";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "NetworkProto";
  23. option java_package = "com.google.cloud.baremetalsolution.v2";
  24. option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
  25. option ruby_package = "Google::Cloud::BareMetalSolution::V2";
  26. // A Network.
  27. message Network {
  28. option (google.api.resource) = {
  29. type: "baremetalsolution.googleapis.com/Network"
  30. pattern: "projects/{project}/locations/{location}/networks/{network}"
  31. };
  32. // Network type.
  33. enum Type {
  34. // Unspecified value.
  35. TYPE_UNSPECIFIED = 0;
  36. // Client network, a network peered to a Google Cloud VPC.
  37. CLIENT = 1;
  38. // Private network, a network local to the Bare Metal Solution environment.
  39. PRIVATE = 2;
  40. }
  41. // The possible states for this Network.
  42. enum State {
  43. // The Network is in an unknown state.
  44. STATE_UNSPECIFIED = 0;
  45. // The Network is provisioning.
  46. PROVISIONING = 1;
  47. // The Network has been provisioned.
  48. PROVISIONED = 2;
  49. }
  50. // Output only. The resource name of this `Network`.
  51. // Resource names are schemeless URIs that follow the conventions in
  52. // https://cloud.google.com/apis/design/resource_names.
  53. // Format:
  54. // `projects/{project}/locations/{location}/networks/{network}`
  55. string name = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  56. // An identifier for the `Network`, generated by the backend.
  57. string id = 10;
  58. // The type of this network.
  59. Type type = 2;
  60. // IP address configured.
  61. string ip_address = 3;
  62. // List of physical interfaces.
  63. repeated string mac_address = 4;
  64. // The Network state.
  65. State state = 6;
  66. // The vlan id of the Network.
  67. string vlan_id = 7;
  68. // The cidr of the Network.
  69. string cidr = 8;
  70. // The vrf for the Network.
  71. VRF vrf = 9;
  72. // Labels as key value pairs.
  73. map<string, string> labels = 11;
  74. // IP range for reserved for services (e.g. NFS).
  75. string services_cidr = 12;
  76. // List of IP address reservations in this network.
  77. // When updating this field, an error will be generated if a reservation
  78. // conflicts with an IP address already allocated to a physical server.
  79. repeated NetworkAddressReservation reservations = 13;
  80. }
  81. // A reservation of one or more addresses in a network.
  82. message NetworkAddressReservation {
  83. // The first address of this reservation block.
  84. // Must be specified as a single IPv4 address, e.g. 10.1.2.2.
  85. string start_address = 1;
  86. // The last address of this reservation block, inclusive. I.e., for cases when
  87. // reservations are only single addresses, end_address and start_address will
  88. // be the same.
  89. // Must be specified as a single IPv4 address, e.g. 10.1.2.2.
  90. string end_address = 2;
  91. // A note about this reservation, intended for human consumption.
  92. string note = 3;
  93. }
  94. // A network VRF.
  95. message VRF {
  96. // The possible states for this VRF.
  97. enum State {
  98. // The unspecified state.
  99. STATE_UNSPECIFIED = 0;
  100. // The vrf is provisioning.
  101. PROVISIONING = 1;
  102. // The vrf is provisioned.
  103. PROVISIONED = 2;
  104. }
  105. // QOS policy parameters.
  106. message QosPolicy {
  107. // The bandwidth permitted by the QOS policy, in gbps.
  108. double bandwidth_gbps = 1;
  109. }
  110. // VLAN attachment details.
  111. message VlanAttachment {
  112. // The peer vlan ID of the attachment.
  113. int64 peer_vlan_id = 1;
  114. // The peer IP of the attachment.
  115. string peer_ip = 2;
  116. // The router IP of the attachment.
  117. string router_ip = 3;
  118. }
  119. // The name of the VRF.
  120. string name = 1;
  121. // The possible state of VRF.
  122. State state = 5;
  123. // The QOS policy applied to this VRF.
  124. QosPolicy qos_policy = 6;
  125. // The list of VLAN attachments for the VRF.
  126. repeated VlanAttachment vlan_attachments = 7;
  127. }
  128. // Each logical interface represents a logical abstraction of the underlying
  129. // physical interface (for eg. bond, nic) of the instance. Each logical
  130. // interface can effectively map to multiple network-IP pairs and still be
  131. // mapped to one underlying physical interface.
  132. message LogicalInterface {
  133. // Each logical network interface is effectively a network and IP pair.
  134. message LogicalNetworkInterface {
  135. // Name of the network
  136. string network = 1;
  137. // IP address in the network
  138. string ip_address = 2;
  139. // Whether this interface is the default gateway for the instance. Only
  140. // one interface can be the default gateway for the instance.
  141. bool default_gateway = 3;
  142. // Type of network.
  143. Network.Type network_type = 4;
  144. // An identifier for the `Network`, generated by the backend.
  145. string id = 5;
  146. }
  147. // List of logical network interfaces within a logical interface.
  148. repeated LogicalNetworkInterface logical_network_interfaces = 1;
  149. // Interface name. This is of syntax <bond><bond_mode> or <nic> and
  150. // forms part of the network template name.
  151. string name = 2;
  152. // The index of the logical interface mapping to the index of the hardware
  153. // bond or nic on the chosen network template.
  154. int32 interface_index = 3;
  155. }
  156. // Message for requesting network information.
  157. message GetNetworkRequest {
  158. // Required. Name of the resource.
  159. string name = 1 [
  160. (google.api.field_behavior) = REQUIRED,
  161. (google.api.resource_reference) = {
  162. type: "baremetalsolution.googleapis.com/Network"
  163. }
  164. ];
  165. }
  166. // Message for requesting a list of networks.
  167. message ListNetworksRequest {
  168. // Required. Parent value for ListNetworksRequest.
  169. string parent = 1 [
  170. (google.api.field_behavior) = REQUIRED,
  171. (google.api.resource_reference) = {
  172. type: "locations.googleapis.com/Location"
  173. }
  174. ];
  175. // Requested page size. The server might return fewer items than requested.
  176. // If unspecified, server will pick an appropriate default.
  177. int32 page_size = 2;
  178. // A token identifying a page of results from the server.
  179. string page_token = 3;
  180. // List filter.
  181. string filter = 4;
  182. }
  183. // Response message containing the list of networks.
  184. message ListNetworksResponse {
  185. // The list of networks.
  186. repeated Network networks = 1;
  187. // A token identifying a page of results from the server.
  188. string next_page_token = 2;
  189. // Locations that could not be reached.
  190. repeated string unreachable = 3;
  191. }
  192. // Message requesting to updating a network.
  193. message UpdateNetworkRequest {
  194. // Required. The network to update.
  195. //
  196. // The `name` field is used to identify the instance to update.
  197. // Format: projects/{project}/locations/{location}/networks/{network}
  198. Network network = 1 [(google.api.field_behavior) = REQUIRED];
  199. // The list of fields to update.
  200. // The only currently supported fields are:
  201. // `labels`, `reservations`
  202. google.protobuf.FieldMask update_mask = 2;
  203. }
  204. // Network with all used IP addresses.
  205. message NetworkUsage {
  206. // Network.
  207. Network network = 1;
  208. // All used IP addresses in this network.
  209. repeated string used_ips = 2;
  210. }
  211. // Request to get networks with IPs.
  212. message ListNetworkUsageRequest {
  213. // Required. Parent value (project and location).
  214. string location = 1 [
  215. (google.api.field_behavior) = REQUIRED,
  216. (google.api.resource_reference) = {
  217. type: "locations.googleapis.com/Location"
  218. }
  219. ];
  220. }
  221. // Response with Networks with IPs
  222. message ListNetworkUsageResponse {
  223. // Networks with IPs.
  224. repeated NetworkUsage networks = 1;
  225. }