-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
instance.proto
288 lines (237 loc) · 9.08 KB
/
instance.proto
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
285
286
287
288
// 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/cloud/baremetalsolution/v2/lun.proto";
import "google/cloud/baremetalsolution/v2/network.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb";
option java_multiple_files = true;
option java_outer_classname = "InstanceProto";
option java_package = "com.google.cloud.baremetalsolution.v2";
option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
option ruby_package = "Google::Cloud::BareMetalSolution::V2";
// A server.
message Instance {
option (google.api.resource) = {
type: "baremetalsolution.googleapis.com/Instance"
pattern: "projects/{project}/locations/{location}/instances/{instance}"
};
// The possible states for this server.
enum State {
// The server is in an unknown state.
STATE_UNSPECIFIED = 0;
// The server is being provisioned.
PROVISIONING = 1;
// The server is running.
RUNNING = 2;
// The server has been deleted.
DELETED = 3;
}
// Output only. The resource name of this `Instance`.
// Resource names are schemeless URIs that follow the conventions in
// https://cloud.google.com/apis/design/resource_names.
// Format:
// `projects/{project}/locations/{location}/instances/{instance}`
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// An identifier for the `Instance`, generated by the backend.
string id = 11;
// Output only. Create a time stamp.
google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Update a time stamp.
google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// The server type.
// [Available server
// types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
string machine_type = 4;
// The state of the server.
State state = 5;
// True if you enable hyperthreading for the server, otherwise false.
// The default value is false.
bool hyperthreading_enabled = 6;
// Labels as key value pairs.
map<string, string> labels = 7;
// List of LUNs associated with this server.
repeated Lun luns = 8;
// List of networks associated with this server.
repeated Network networks = 9;
// True if the interactive serial console feature is enabled for the instance,
// false otherwise.
// The default value is false.
bool interactive_serial_console_enabled = 10;
// The OS image currently installed on the server.
string os_image = 12;
// Immutable. Pod name.
// Pod is an independent part of infrastructure.
// Instance can be connected to the assets (networks, volumes) allocated
// in the same pod only.
string pod = 13 [(google.api.field_behavior) = IMMUTABLE];
// Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
// Generally, the template name follows the syntax of
// "bond<bond_mode>" or "nic".
string network_template = 14 [(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/ServerNetworkTemplate"
}];
// List of logical interfaces for the instance. The number of logical
// interfaces will be the same as number of hardware bond/nic on the chosen
// network template. For the non-multivlan configurations (for eg, existing
// servers) that use existing default network template (bondaa-bondaa), both
// the Instance.networks field and the Instance.logical_interfaces fields will
// be filled to ensure backward compatibility. For the others, only
// Instance.logical_interfaces will be filled.
repeated LogicalInterface logical_interfaces = 15;
}
// Message for requesting server information.
message GetInstanceRequest {
// Required. Name of the resource.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/Instance"
}
];
}
// Message for requesting the list of servers.
message ListInstancesRequest {
// Required. Parent value for ListInstancesRequest.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Requested page size. Server may return fewer items than requested.
// If unspecified, the 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 for the list of servers.
message ListInstancesResponse {
// The list of servers.
repeated Instance instances = 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 server.
message UpdateInstanceRequest {
// Required. The server to update.
//
// The `name` field is used to identify the instance to update.
// Format: projects/{project}/locations/{location}/instances/{instance}
Instance instance = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to update.
// The currently supported fields are:
// `labels`
// `hyperthreading_enabled`
// `os_image`
google.protobuf.FieldMask update_mask = 2;
}
// Message requesting to reset a server.
message ResetInstanceRequest {
// Required. Name of the resource.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/Instance"
}
];
}
// Message requesting to start a server.
message StartInstanceRequest {
// Required. Name of the resource.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/Instance"
}
];
}
// Message requesting to stop a server.
message StopInstanceRequest {
// Required. Name of the resource.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/Instance"
}
];
}
// Message for detach specific LUN from an Instance.
message DetachLunRequest {
// Required. Name of the instance.
string instance = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/Instance"
}
];
// Required. Name of the Lun to detach.
string lun = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "baremetalsolution.googleapis.com/Lun"
}
];
}
// Network template.
message ServerNetworkTemplate {
option (google.api.resource) = {
type: "baremetalsolution.googleapis.com/ServerNetworkTemplate"
pattern: "projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}"
};
// Logical interface.
message LogicalInterface {
// Interface type.
enum InterfaceType {
// Unspecified value.
INTERFACE_TYPE_UNSPECIFIED = 0;
// Bond interface type.
BOND = 1;
// NIC interface type.
NIC = 2;
}
// Interface name.
// This is not a globally unique identifier.
// Name is unique only inside the ServerNetworkTemplate. This is of syntax
// <bond><interface_type_index><bond_mode> or <nic><interface_type_index>
// and forms part of the network template name.
string name = 1;
// Interface type.
InterfaceType type = 2;
// If true, interface must have network connected.
bool required = 3;
}
// Output only. Template's unique name. The full resource name follows the pattern:
// `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}`
// Generally, the {server_network_template} follows the syntax of
// "bond<interface_type_index><bond_mode>" or "nic<interface_type_index>".
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Instance types this template is applicable to.
repeated string applicable_instance_types = 2;
// Logical interfaces.
repeated LogicalInterface logical_interfaces = 3;
}
// Response message from starting a server.
message StartInstanceResponse {}
// Response message from stopping a server.
message StopInstanceResponse {}