xref: /aosp_15_r20/external/googleapis/google/cloud/baremetalsolution/v2/instance.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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/cloud/baremetalsolution/v2/common.proto";
22import "google/cloud/baremetalsolution/v2/lun.proto";
23import "google/cloud/baremetalsolution/v2/network.proto";
24import "google/cloud/baremetalsolution/v2/volume.proto";
25import "google/protobuf/field_mask.proto";
26import "google/protobuf/timestamp.proto";
27
28option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
29option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb";
30option java_multiple_files = true;
31option java_outer_classname = "InstanceProto";
32option java_package = "com.google.cloud.baremetalsolution.v2";
33option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
34option ruby_package = "Google::Cloud::BareMetalSolution::V2";
35
36// A server.
37message Instance {
38  option (google.api.resource) = {
39    type: "baremetalsolution.googleapis.com/Instance"
40    pattern: "projects/{project}/locations/{location}/instances/{instance}"
41  };
42
43  // The possible states for this server.
44  enum State {
45    // The server is in an unknown state.
46    STATE_UNSPECIFIED = 0;
47
48    // The server is being provisioned.
49    PROVISIONING = 1;
50
51    // The server is running.
52    RUNNING = 2;
53
54    // The server has been deleted.
55    DELETED = 3;
56
57    // The server is being updated.
58    UPDATING = 4;
59
60    // The server is starting.
61    STARTING = 5;
62
63    // The server is stopping.
64    STOPPING = 6;
65
66    // The server is shutdown.
67    SHUTDOWN = 7;
68  }
69
70  // Immutable. The resource name of this `Instance`.
71  // Resource names are schemeless URIs that follow the conventions in
72  // https://cloud.google.com/apis/design/resource_names.
73  // Format:
74  // `projects/{project}/locations/{location}/instances/{instance}`
75  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
76
77  // Output only. An identifier for the `Instance`, generated by the backend.
78  string id = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
79
80  // Output only. Create a time stamp.
81  google.protobuf.Timestamp create_time = 2
82      [(google.api.field_behavior) = OUTPUT_ONLY];
83
84  // Output only. Update a time stamp.
85  google.protobuf.Timestamp update_time = 3
86      [(google.api.field_behavior) = OUTPUT_ONLY];
87
88  // Immutable. The server type.
89  // [Available server
90  // types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
91  string machine_type = 4 [(google.api.field_behavior) = IMMUTABLE];
92
93  // Output only. The state of the server.
94  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
95
96  // True if you enable hyperthreading for the server, otherwise false.
97  // The default value is false.
98  bool hyperthreading_enabled = 6;
99
100  // Labels as key value pairs.
101  map<string, string> labels = 7;
102
103  // Immutable. List of LUNs associated with this server.
104  repeated Lun luns = 8 [(google.api.field_behavior) = IMMUTABLE];
105
106  // Input only. List of Volumes to attach to this Instance on creation.
107  // This field won't be populated in Get/List responses.
108  repeated Volume volumes = 16 [(google.api.field_behavior) = INPUT_ONLY];
109
110  // Output only. List of networks associated with this server.
111  repeated Network networks = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
112
113  // Output only. True if the interactive serial console feature is enabled for
114  // the instance, false otherwise. The default value is false.
115  bool interactive_serial_console_enabled = 10
116      [(google.api.field_behavior) = OUTPUT_ONLY];
117
118  // The OS image currently installed on the server.
119  string os_image = 12;
120
121  // Immutable. Pod name.
122  // Pod is an independent part of infrastructure.
123  // Instance can be connected to the assets (networks, volumes) allocated
124  // in the same pod only.
125  string pod = 13 [(google.api.field_behavior) = IMMUTABLE];
126
127  // Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
128  // Generally, the template name follows the syntax of
129  // "bond<bond_mode>" or "nic".
130  string network_template = 14 [(google.api.resource_reference) = {
131    type: "baremetalsolution.googleapis.com/ServerNetworkTemplate"
132  }];
133
134  // List of logical interfaces for the instance. The number of logical
135  // interfaces will be the same as number of hardware bond/nic on the chosen
136  // network template. For the non-multivlan configurations (for eg, existing
137  // servers) that use existing default network template (bondaa-bondaa), both
138  // the Instance.networks field and the Instance.logical_interfaces fields will
139  // be filled to ensure backward compatibility. For the others, only
140  // Instance.logical_interfaces will be filled.
141  repeated LogicalInterface logical_interfaces = 15;
142
143  // Output only. Text field about info for logging in.
144  string login_info = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
145
146  // The workload profile for the instance.
147  WorkloadProfile workload_profile = 18;
148
149  // Output only. The firmware version for the instance.
150  string firmware_version = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
151}
152
153// Message for requesting server information.
154message GetInstanceRequest {
155  // Required. Name of the resource.
156  string name = 1 [
157    (google.api.field_behavior) = REQUIRED,
158    (google.api.resource_reference) = {
159      type: "baremetalsolution.googleapis.com/Instance"
160    }
161  ];
162}
163
164// Message for requesting the list of servers.
165message ListInstancesRequest {
166  // Required. Parent value for ListInstancesRequest.
167  string parent = 1 [
168    (google.api.field_behavior) = REQUIRED,
169    (google.api.resource_reference) = {
170      type: "locations.googleapis.com/Location"
171    }
172  ];
173
174  // Requested page size. Server may return fewer items than requested.
175  // If unspecified, the server will pick an appropriate default.
176  int32 page_size = 2;
177
178  // A token identifying a page of results from the server.
179  string page_token = 3;
180
181  // List filter.
182  string filter = 4;
183}
184
185// Response message for the list of servers.
186message ListInstancesResponse {
187  // The list of servers.
188  repeated Instance instances = 1;
189
190  // A token identifying a page of results from the server.
191  string next_page_token = 2;
192
193  // Locations that could not be reached.
194  repeated string unreachable = 3;
195}
196
197// Message requesting to updating a server.
198message UpdateInstanceRequest {
199  // Required. The server to update.
200  //
201  // The `name` field is used to identify the instance to update.
202  // Format: projects/{project}/locations/{location}/instances/{instance}
203  Instance instance = 1 [(google.api.field_behavior) = REQUIRED];
204
205  // The list of fields to update.
206  // The currently supported fields are:
207  //   `labels`
208  //   `hyperthreading_enabled`
209  //   `os_image`
210  google.protobuf.FieldMask update_mask = 2;
211}
212
213// Message requesting rename of a server.
214message RenameInstanceRequest {
215  // Required. The `name` field is used to identify the instance.
216  // Format: projects/{project}/locations/{location}/instances/{instance}
217  string name = 1 [
218    (google.api.field_behavior) = REQUIRED,
219    (google.api.resource_reference) = {
220      type: "baremetalsolution.googleapis.com/Instance"
221    }
222  ];
223
224  // Required. The new `id` of the instance.
225  string new_instance_id = 2 [(google.api.field_behavior) = REQUIRED];
226}
227
228// Message requesting to reset a server.
229message ResetInstanceRequest {
230  // Required. Name of the resource.
231  string name = 1 [
232    (google.api.field_behavior) = REQUIRED,
233    (google.api.resource_reference) = {
234      type: "baremetalsolution.googleapis.com/Instance"
235    }
236  ];
237}
238
239// Message requesting to start a server.
240message StartInstanceRequest {
241  // Required. Name of the resource.
242  string name = 1 [
243    (google.api.field_behavior) = REQUIRED,
244    (google.api.resource_reference) = {
245      type: "baremetalsolution.googleapis.com/Instance"
246    }
247  ];
248}
249
250// Response message from starting a server.
251message StartInstanceResponse {}
252
253// Message requesting to stop a server.
254message StopInstanceRequest {
255  // Required. Name of the resource.
256  string name = 1 [
257    (google.api.field_behavior) = REQUIRED,
258    (google.api.resource_reference) = {
259      type: "baremetalsolution.googleapis.com/Instance"
260    }
261  ];
262}
263
264// Response message from stopping a server.
265message StopInstanceResponse {}
266
267// Message for enabling the interactive serial console on an instance.
268message EnableInteractiveSerialConsoleRequest {
269  // Required. Name of the resource.
270  string name = 1 [
271    (google.api.field_behavior) = REQUIRED,
272    (google.api.resource_reference) = {
273      type: "baremetalsolution.googleapis.com/Instance"
274    }
275  ];
276}
277
278// Message for response of EnableInteractiveSerialConsole.
279message EnableInteractiveSerialConsoleResponse {}
280
281// Message for disabling the interactive serial console on an instance.
282message DisableInteractiveSerialConsoleRequest {
283  // Required. Name of the resource.
284  string name = 1 [
285    (google.api.field_behavior) = REQUIRED,
286    (google.api.resource_reference) = {
287      type: "baremetalsolution.googleapis.com/Instance"
288    }
289  ];
290}
291
292// Message for response of DisableInteractiveSerialConsole.
293message DisableInteractiveSerialConsoleResponse {}
294
295// Message for detach specific LUN from an Instance.
296message DetachLunRequest {
297  // Required. Name of the instance.
298  string instance = 1 [
299    (google.api.field_behavior) = REQUIRED,
300    (google.api.resource_reference) = {
301      type: "baremetalsolution.googleapis.com/Instance"
302    }
303  ];
304
305  // Required. Name of the Lun to detach.
306  string lun = 2 [
307    (google.api.field_behavior) = REQUIRED,
308    (google.api.resource_reference) = {
309      type: "baremetalsolution.googleapis.com/Lun"
310    }
311  ];
312
313  // If true, performs lun unmapping without instance reboot.
314  bool skip_reboot = 3;
315}
316
317// Network template.
318message ServerNetworkTemplate {
319  option (google.api.resource) = {
320    type: "baremetalsolution.googleapis.com/ServerNetworkTemplate"
321    pattern: "projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}"
322  };
323
324  // Logical interface.
325  message LogicalInterface {
326    // Interface type.
327    enum InterfaceType {
328      // Unspecified value.
329      INTERFACE_TYPE_UNSPECIFIED = 0;
330
331      // Bond interface type.
332      BOND = 1;
333
334      // NIC interface type.
335      NIC = 2;
336    }
337
338    // Interface name.
339    // This is not a globally unique identifier.
340    // Name is unique only inside the ServerNetworkTemplate. This is of syntax
341    // <bond><interface_type_index><bond_mode> or <nic><interface_type_index>
342    // and forms part of the network template name.
343    string name = 1;
344
345    // Interface type.
346    InterfaceType type = 2;
347
348    // If true, interface must have network connected.
349    bool required = 3;
350  }
351
352  // Output only. Template's unique name. The full resource name follows the
353  // pattern:
354  // `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}`
355  // Generally, the {server_network_template} follows the syntax of
356  // "bond<interface_type_index><bond_mode>" or "nic<interface_type_index>".
357  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
358
359  // Instance types this template is applicable to.
360  repeated string applicable_instance_types = 2;
361
362  // Logical interfaces.
363  repeated LogicalInterface logical_interfaces = 3;
364}
365