summaryrefslogtreecommitdiff
path: root/third_party/googleapis/google/cloud/baremetalsolution/v2/network.proto
blob: 3f240de01ba23ac131dc3da70d3157ad0784b9e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
// 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.baremetalsolution.v2;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2;baremetalsolution";
option java_multiple_files = true;
option java_outer_classname = "NetworkProto";
option java_package = "com.google.cloud.baremetalsolution.v2";
option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
option ruby_package = "Google::Cloud::BareMetalSolution::V2";

// A Network.
message Network {
  option (google.api.resource) = {
    type: "baremetalsolution.googleapis.com/Network"
    pattern: "projects/{project}/locations/{location}/networks/{network}"
  };

  // Network type.
  enum Type {
    // Unspecified value.
    TYPE_UNSPECIFIED = 0;

    // Client network, a network peered to a Google Cloud VPC.
    CLIENT = 1;

    // Private network, a network local to the Bare Metal Solution environment.
    PRIVATE = 2;
  }

  // The possible states for this Network.
  enum State {
    // The Network is in an unknown state.
    STATE_UNSPECIFIED = 0;

    // The Network is provisioning.
    PROVISIONING = 1;

    // The Network has been provisioned.
    PROVISIONED = 2;
  }

  // Output only. The resource name of this `Network`.
  // Resource names are schemeless URIs that follow the conventions in
  // https://cloud.google.com/apis/design/resource_names.
  // Format:
  // `projects/{project}/locations/{location}/networks/{network}`
  string name = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // An identifier for the `Network`, generated by the backend.
  string id = 10;

  // The type of this network.
  Type type = 2;

  // IP address configured.
  string ip_address = 3;

  // List of physical interfaces.
  repeated string mac_address = 4;

  // The Network state.
  State state = 6;

  // The vlan id of the Network.
  string vlan_id = 7;

  // The cidr of the Network.
  string cidr = 8;

  // The vrf for the Network.
  VRF vrf = 9;

  // Labels as key value pairs.
  map<string, string> labels = 11;

  // IP range for reserved for services (e.g. NFS).
  string services_cidr = 12;

  // List of IP address reservations in this network.
  // When updating this field, an error will be generated if a reservation
  // conflicts with an IP address already allocated to a physical server.
  repeated NetworkAddressReservation reservations = 13;
}

// A reservation of one or more addresses in a network.
message NetworkAddressReservation {
  // The first address of this reservation block.
  // Must be specified as a single IPv4 address, e.g. 10.1.2.2.
  string start_address = 1;

  // The last address of this reservation block, inclusive. I.e., for cases when
  // reservations are only single addresses, end_address and start_address will
  // be the same.
  // Must be specified as a single IPv4 address, e.g. 10.1.2.2.
  string end_address = 2;

  // A note about this reservation, intended for human consumption.
  string note = 3;
}

// A network VRF.
message VRF {
  // The possible states for this VRF.
  enum State {
    // The unspecified state.
    STATE_UNSPECIFIED = 0;

    // The vrf is provisioning.
    PROVISIONING = 1;

    // The vrf is provisioned.
    PROVISIONED = 2;
  }

  // QOS policy parameters.
  message QosPolicy {
    // The bandwidth permitted by the QOS policy, in gbps.
    double bandwidth_gbps = 1;
  }

  // VLAN attachment details.
  message VlanAttachment {
    // The peer vlan ID of the attachment.
    int64 peer_vlan_id = 1;

    // The peer IP of the attachment.
    string peer_ip = 2;

    // The router IP of the attachment.
    string router_ip = 3;
  }

  // The name of the VRF.
  string name = 1;

  // The possible state of VRF.
  State state = 5;

  // The QOS policy applied to this VRF.
  QosPolicy qos_policy = 6;

  // The list of VLAN attachments for the VRF.
  repeated VlanAttachment vlan_attachments = 7;
}

// Each logical interface represents a logical abstraction of the underlying
// physical interface (for eg. bond, nic) of the instance. Each logical
// interface can effectively map to multiple network-IP pairs and still be
// mapped to one underlying physical interface.
message LogicalInterface {
  // Each logical network interface is effectively a network and IP pair.
  message LogicalNetworkInterface {
    // Name of the network
    string network = 1;

    // IP address in the network
    string ip_address = 2;

    // Whether this interface is the default gateway for the instance. Only
    // one interface can be the default gateway for the instance.
    bool default_gateway = 3;

    // Type of network.
    Network.Type network_type = 4;

    // An identifier for the `Network`, generated by the backend.
    string id = 5;
  }

  // List of logical network interfaces within a logical interface.
  repeated LogicalNetworkInterface logical_network_interfaces = 1;

  // Interface name. This is of syntax <bond><bond_mode> or <nic> and
  // forms part of the network template name.
  string name = 2;

  // The index of the logical interface mapping to the index of the hardware
  // bond or nic on the chosen network template.
  int32 interface_index = 3;
}

// Message for requesting network information.
message GetNetworkRequest {
  // Required. Name of the resource.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "baremetalsolution.googleapis.com/Network"
    }
  ];
}

// Message for requesting a list of networks.
message ListNetworksRequest {
  // Required. Parent value for ListNetworksRequest.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // Requested page size. The server might return fewer items than requested.
  // If unspecified, server will pick an appropriate default.
  int32 page_size = 2;

  // A token identifying a page of results from the server.
  string page_token = 3;

  // List filter.
  string filter = 4;
}

// Response message containing the list of networks.
message ListNetworksResponse {
  // The list of networks.
  repeated Network networks = 1;

  // A token identifying a page of results from the server.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Message requesting to updating a network.
message UpdateNetworkRequest {
  // Required. The network to update.
  //
  // The `name` field is used to identify the instance to update.
  // Format: projects/{project}/locations/{location}/networks/{network}
  Network network = 1 [(google.api.field_behavior) = REQUIRED];

  // The list of fields to update.
  // The only currently supported fields are:
  //   `labels`, `reservations`
  google.protobuf.FieldMask update_mask = 2;
}

// Network with all used IP addresses.
message NetworkUsage {
  // Network.
  Network network = 1;

  // All used IP addresses in this network.
  repeated string used_ips = 2;
}

// Request to get networks with IPs.
message ListNetworkUsageRequest {
  // Required. Parent value (project and location).
  string location = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];
}

// Response with Networks with IPs
message ListNetworkUsageResponse {
  // Networks with IPs.
  repeated NetworkUsage networks = 1;
}