xref: /aosp_15_r20/external/googleapis/google/cloud/baremetalsolution/v2/provisioning.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/network.proto";
23import "google/protobuf/field_mask.proto";
24import "google/protobuf/timestamp.proto";
25
26option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
27option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb";
28option java_multiple_files = true;
29option java_outer_classname = "ProvisioningProto";
30option java_package = "com.google.cloud.baremetalsolution.v2";
31option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
32option ruby_package = "Google::Cloud::BareMetalSolution::V2";
33
34// A provisioning configuration.
35message ProvisioningConfig {
36  option (google.api.resource) = {
37    type: "baremetalsolution.googleapis.com/ProvisioningConfig"
38    pattern: "projects/{project}/locations/{location}/provisioningConfigs/{provisioning_config}"
39  };
40
41  // The possible states for this ProvisioningConfig.
42  enum State {
43    // State wasn't specified.
44    STATE_UNSPECIFIED = 0;
45
46    // ProvisioningConfig is a draft and can be freely modified.
47    DRAFT = 1;
48
49    // ProvisioningConfig was already submitted and cannot be modified.
50    SUBMITTED = 2;
51
52    // ProvisioningConfig was in the provisioning state.  Initially this state
53    // comes from the work order table in big query when SNOW is used.  Later
54    // this field can be set by the work order API.
55    PROVISIONING = 3;
56
57    // ProvisioningConfig was provisioned, meaning the resources exist.
58    PROVISIONED = 4;
59
60    // ProvisioningConfig was validated.  A validation tool will be run to
61    // set this state.
62    VALIDATED = 5;
63
64    // ProvisioningConfig was canceled.
65    CANCELLED = 6;
66
67    // The request is submitted for provisioning, with error return.
68    FAILED = 7;
69  }
70
71  // Output only. The system-generated name of the provisioning config. This
72  // follows the UUID format.
73  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
74
75  // Instances to be created.
76  repeated InstanceConfig instances = 2;
77
78  // Networks to be created.
79  repeated NetworkConfig networks = 3;
80
81  // Volumes to be created.
82  repeated VolumeConfig volumes = 4;
83
84  // A generated ticket id to track provisioning request.
85  string ticket_id = 5;
86
87  // A service account to enable customers to access instance credentials upon
88  // handover.
89  string handover_service_account = 6;
90
91  // Email provided to send a confirmation with provisioning config to.
92  // Deprecated in favour of email field in request messages.
93  string email = 7 [deprecated = true];
94
95  // Output only. State of ProvisioningConfig.
96  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
97
98  // Optional. Location name of this ProvisioningConfig.
99  // It is optional only for Intake UI transition period.
100  string location = 9 [(google.api.field_behavior) = OPTIONAL];
101
102  // Output only. Last update timestamp.
103  google.protobuf.Timestamp update_time = 10
104      [(google.api.field_behavior) = OUTPUT_ONLY];
105
106  // Output only. URI to Cloud Console UI view of this provisioning config.
107  string cloud_console_uri = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
108
109  // If true, VPC SC is enabled for the cluster.
110  bool vpc_sc_enabled = 12;
111
112  // Optional status messages associated with the FAILED state.
113  string status_message = 13;
114
115  // Optional. The user-defined identifier of the provisioning config.
116  string custom_id = 14 [(google.api.field_behavior) = OPTIONAL];
117}
118
119// Request for SubmitProvisioningConfig.
120message SubmitProvisioningConfigRequest {
121  // Required. The parent project and location containing the
122  // ProvisioningConfig.
123  string parent = 1 [
124    (google.api.field_behavior) = REQUIRED,
125    (google.api.resource_reference) = {
126      type: "locations.googleapis.com/Location"
127    }
128  ];
129
130  // Required. The ProvisioningConfig to create.
131  ProvisioningConfig provisioning_config = 2
132      [(google.api.field_behavior) = REQUIRED];
133
134  // Optional. Email provided to send a confirmation with provisioning config
135  // to.
136  string email = 3 [(google.api.field_behavior) = OPTIONAL];
137}
138
139// Response for SubmitProvisioningConfig.
140message SubmitProvisioningConfigResponse {
141  // The submitted provisioning config.
142  ProvisioningConfig provisioning_config = 1;
143}
144
145// A provisioning quota for a given project.
146message ProvisioningQuota {
147  option (google.api.resource) = {
148    type: "baremetalsolution.googleapis.com/ProvisioningQuota"
149    pattern: "projects/{project}/locations/{location}/provisioningQuotas/{provisioning_quota}"
150  };
151
152  // The available asset types for intake.
153  enum AssetType {
154    // The unspecified type.
155    ASSET_TYPE_UNSPECIFIED = 0;
156
157    // The server asset type.
158    ASSET_TYPE_SERVER = 1;
159
160    // The storage asset type.
161    ASSET_TYPE_STORAGE = 2;
162
163    // The network asset type.
164    ASSET_TYPE_NETWORK = 3;
165  }
166
167  // Output only. The name of the provisioning quota.
168  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
169
170  // The asset type of this provisioning quota.
171  AssetType asset_type = 2;
172
173  // The gcp service of the provisioning quota.
174  string gcp_service = 3;
175
176  // The specific location of the provisioining quota.
177  string location = 4;
178
179  // The available count of the provisioning quota.
180  int32 available_count = 5;
181
182  // The quota of one asset type.
183  oneof quota {
184    // Instance quota.
185    InstanceQuota instance_quota = 6;
186  }
187
188  // Available quantity based on asset type.
189  oneof availability {
190    // Server count.
191    int64 server_count = 7;
192
193    // Network bandwidth, Gbps
194    int64 network_bandwidth = 8;
195
196    // Storage size (GB).
197    int64 storage_gib = 9;
198  }
199}
200
201// Message for requesting the list of provisioning quotas.
202message ListProvisioningQuotasRequest {
203  // Required. Parent value for ListProvisioningQuotasRequest.
204  string parent = 1 [
205    (google.api.field_behavior) = REQUIRED,
206    (google.api.resource_reference) = {
207      type: "locations.googleapis.com/Location"
208    }
209  ];
210
211  // Requested page size. The server might return fewer items than requested.
212  // If unspecified, server will pick an appropriate default.
213  // Notice that page_size field is not supported and won't be respected in
214  // the API request for now, will be updated when pagination is supported.
215  int32 page_size = 2;
216
217  // A token identifying a page of results from the server.
218  string page_token = 3;
219}
220
221// Response message for the list of provisioning quotas.
222message ListProvisioningQuotasResponse {
223  // The provisioning quotas registered in this project.
224  repeated ProvisioningQuota provisioning_quotas = 1;
225
226  // Token to retrieve the next page of results, or empty if there are no more
227  // results in the list.
228  string next_page_token = 2;
229}
230
231// Configuration parameters for a new instance.
232message InstanceConfig {
233  option (google.api.resource) = {
234    type: "baremetalsolution.googleapis.com/InstanceConfig"
235    pattern: "projects/{project}/locations/{location}/instanceConfigs/{instance_config}"
236  };
237
238  // A network.
239  message NetworkAddress {
240    // Id of the network to use, within the same ProvisioningConfig request.
241    string network_id = 1;
242
243    // IPv4 address to be assigned to the server.
244    string address = 2;
245
246    // Name of the existing network to use.
247    string existing_network_id = 3;
248  }
249
250  // The network configuration of the instance.
251  enum NetworkConfig {
252    // The unspecified network configuration.
253    NETWORKCONFIG_UNSPECIFIED = 0;
254
255    // Instance part of single client network and single private network.
256    SINGLE_VLAN = 1;
257
258    // Instance part of multiple (or single) client networks and private
259    // networks.
260    MULTI_VLAN = 2;
261  }
262
263  // Output only. The name of the instance config.
264  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
265
266  // A transient unique identifier to idenfity an instance within an
267  // ProvisioningConfig request.
268  string id = 2;
269
270  // Instance type.
271  // [Available
272  // types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
273  string instance_type = 3;
274
275  // Whether the instance should be provisioned with Hyperthreading enabled.
276  bool hyperthreading = 4;
277
278  // OS image to initialize the instance.
279  // [Available
280  // images](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
281  string os_image = 5;
282
283  // Client network address. Filled if InstanceConfig.multivlan_config is false.
284  NetworkAddress client_network = 6 [deprecated = true];
285
286  // Private network address, if any. Filled if InstanceConfig.multivlan_config
287  // is false.
288  NetworkAddress private_network = 7 [deprecated = true];
289
290  // User note field, it can be used by customers to add additional information
291  // for the BMS Ops team .
292  string user_note = 8;
293
294  // If true networks can be from different projects of the same vendor account.
295  bool account_networks_enabled = 9;
296
297  // The type of network configuration on the instance.
298  NetworkConfig network_config = 10;
299
300  // Server network template name. Filled if InstanceConfig.multivlan_config is
301  // true.
302  string network_template = 11;
303
304  // List of logical interfaces for the instance. The number of logical
305  // interfaces will be the same as number of hardware bond/nic on the chosen
306  // network template. Filled if InstanceConfig.multivlan_config is true.
307  repeated LogicalInterface logical_interfaces = 12;
308
309  // List of names of ssh keys used to provision the instance.
310  repeated string ssh_key_names = 13;
311}
312
313// Configuration parameters for a new volume.
314message VolumeConfig {
315  option (google.api.resource) = {
316    type: "baremetalsolution.googleapis.com/VolumeConfig"
317    pattern: "projects/{project}/locations/{location}/volumeConfigs/{volume_config}"
318  };
319
320  // The types of Volumes.
321  enum Type {
322    // The unspecified type.
323    TYPE_UNSPECIFIED = 0;
324
325    // This Volume is on flash.
326    FLASH = 1;
327
328    // This Volume is on disk.
329    DISK = 2;
330  }
331
332  // The protocol used to access the volume.
333  enum Protocol {
334    // Unspecified value.
335    PROTOCOL_UNSPECIFIED = 0;
336
337    // Fibre channel.
338    PROTOCOL_FC = 1;
339
340    // Network file system.
341    PROTOCOL_NFS = 2;
342  }
343
344  // A LUN(Logical Unit Number) range.
345  message LunRange {
346    // Number of LUNs to create.
347    int32 quantity = 1;
348
349    // The requested size of each LUN, in GB.
350    int32 size_gb = 2;
351  }
352
353  // A NFS export entry.
354  message NfsExport {
355    // Permissions that can granted for an export.
356    enum Permissions {
357      // Unspecified value.
358      PERMISSIONS_UNSPECIFIED = 0;
359
360      // Read-only permission.
361      READ_ONLY = 1;
362
363      // Read-write permission.
364      READ_WRITE = 2;
365    }
366
367    // Network to use to publish the export.
368    string network_id = 1;
369
370    // A client object.
371    oneof client {
372      // Either a single machine, identified by an ID, or a comma-separated
373      // list of machine IDs.
374      string machine_id = 2;
375
376      // A CIDR range.
377      string cidr = 3;
378    }
379
380    // Export permissions.
381    Permissions permissions = 4;
382
383    // Disable root squashing, which is a feature of NFS.
384    // Root squash is a special mapping of the remote superuser (root) identity
385    // when using identity authentication.
386    bool no_root_squash = 5;
387
388    // Allow the setuid flag.
389    bool allow_suid = 6;
390
391    // Allow dev flag in NfsShare AllowedClientsRequest.
392    bool allow_dev = 7;
393  }
394
395  // Output only. The name of the volume config.
396  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
397
398  // A transient unique identifier to identify a volume within an
399  // ProvisioningConfig request.
400  string id = 2;
401
402  // Whether snapshots should be enabled.
403  bool snapshots_enabled = 3;
404
405  // The type of this Volume.
406  Type type = 4;
407
408  // Volume protocol.
409  Protocol protocol = 5;
410
411  // The requested size of this volume, in GB.
412  int32 size_gb = 6;
413
414  // LUN ranges to be configured. Set only when protocol is PROTOCOL_FC.
415  repeated LunRange lun_ranges = 7;
416
417  // Machine ids connected to this volume. Set only when protocol is
418  // PROTOCOL_FC.
419  repeated string machine_ids = 8;
420
421  // NFS exports. Set only when protocol is PROTOCOL_NFS.
422  repeated NfsExport nfs_exports = 9;
423
424  // User note field, it can be used by customers to add additional information
425  // for the BMS Ops team .
426  string user_note = 10;
427
428  // The GCP service of the storage volume. Available gcp_service are in
429  // https://cloud.google.com/bare-metal/docs/bms-planning.
430  string gcp_service = 11;
431
432  // Performance tier of the Volume.
433  // Default is SHARED.
434  VolumePerformanceTier performance_tier = 12;
435}
436
437// Configuration parameters for a new network.
438message NetworkConfig {
439  option (google.api.resource) = {
440    type: "baremetalsolution.googleapis.com/NetworkConfig"
441    pattern: "projects/{project}/locations/{location}/networkConfigs/{network_config}"
442  };
443
444  // Network type.
445  enum Type {
446    // Unspecified value.
447    TYPE_UNSPECIFIED = 0;
448
449    // Client network, that is a network peered to a GCP VPC.
450    CLIENT = 1;
451
452    // Private network, that is a network local to the BMS POD.
453    PRIVATE = 2;
454  }
455
456  // Interconnect bandwidth.
457  enum Bandwidth {
458    // Unspecified value.
459    BANDWIDTH_UNSPECIFIED = 0;
460
461    // 1 Gbps.
462    BW_1_GBPS = 1;
463
464    // 2 Gbps.
465    BW_2_GBPS = 2;
466
467    // 5 Gbps.
468    BW_5_GBPS = 3;
469
470    // 10 Gbps.
471    BW_10_GBPS = 4;
472  }
473
474  // A GCP vlan attachment.
475  message IntakeVlanAttachment {
476    // Identifier of the VLAN attachment.
477    string id = 1;
478
479    // Attachment pairing key.
480    string pairing_key = 2;
481  }
482
483  // Service network block.
484  enum ServiceCidr {
485    // Unspecified value.
486    SERVICE_CIDR_UNSPECIFIED = 0;
487
488    // Services are disabled for the given network.
489    DISABLED = 1;
490
491    // Use the highest /26 block of the network to host services.
492    HIGH_26 = 2;
493
494    // Use the highest /27 block of the network to host services.
495    HIGH_27 = 3;
496
497    // Use the highest /28 block of the network to host services.
498    HIGH_28 = 4;
499  }
500
501  // Output only. The name of the network config.
502  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
503
504  // A transient unique identifier to identify a volume within an
505  // ProvisioningConfig request.
506  string id = 2;
507
508  // The type of this network, either Client or Private.
509  Type type = 3;
510
511  // Interconnect bandwidth. Set only when type is CLIENT.
512  Bandwidth bandwidth = 4;
513
514  // List of VLAN attachments. As of now there are always 2 attachments, but it
515  // is going to change in  the future (multi vlan).
516  repeated IntakeVlanAttachment vlan_attachments = 5;
517
518  // CIDR range of the network.
519  string cidr = 6;
520
521  // Service CIDR, if any.
522  ServiceCidr service_cidr = 7;
523
524  // User note field, it can be used by customers to add additional information
525  // for the BMS Ops team .
526  string user_note = 8;
527
528  // The GCP service of the network. Available gcp_service are in
529  // https://cloud.google.com/bare-metal/docs/bms-planning.
530  string gcp_service = 9;
531
532  // Whether the VLAN attachment pair is located in the same project.
533  bool vlan_same_project = 10;
534
535  // The JumboFramesEnabled option for customer to set.
536  bool jumbo_frames_enabled = 11;
537}
538
539// A resource budget.
540message InstanceQuota {
541  option (google.api.resource) = {
542    type: "baremetalsolution.googleapis.com/InstanceQuota"
543    pattern: "projects/{project}/locations/{location}/instanceQuotas/{instance_quota}"
544  };
545
546  // Output only. The name of the instance quota.
547  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
548
549  // Instance type.
550  // Deprecated: use gcp_service.
551  string instance_type = 2 [deprecated = true];
552
553  // The gcp service of the provisioning quota.
554  string gcp_service = 5;
555
556  // Location where the quota applies.
557  string location = 3;
558
559  // Number of machines than can be created for the given location and
560  // instance_type.
561  int32 available_machine_count = 4;
562}
563
564// Request for GetProvisioningConfig.
565message GetProvisioningConfigRequest {
566  // Required. Name of the ProvisioningConfig.
567  string name = 1 [
568    (google.api.field_behavior) = REQUIRED,
569    (google.api.resource_reference) = {
570      type: "baremetalsolution.googleapis.com/ProvisioningConfig"
571    }
572  ];
573}
574
575// Request for CreateProvisioningConfig.
576message CreateProvisioningConfigRequest {
577  // Required. The parent project and location containing the
578  // ProvisioningConfig.
579  string parent = 1 [
580    (google.api.field_behavior) = REQUIRED,
581    (google.api.resource_reference) = {
582      type: "locations.googleapis.com/Location"
583    }
584  ];
585
586  // Required. The ProvisioningConfig to create.
587  ProvisioningConfig provisioning_config = 2
588      [(google.api.field_behavior) = REQUIRED];
589
590  // Optional. Email provided to send a confirmation with provisioning config
591  // to.
592  string email = 3 [(google.api.field_behavior) = OPTIONAL];
593}
594
595// Message for updating a ProvisioningConfig.
596message UpdateProvisioningConfigRequest {
597  // Required. The ProvisioningConfig to update.
598  ProvisioningConfig provisioning_config = 1
599      [(google.api.field_behavior) = REQUIRED];
600
601  // Required. The list of fields to update.
602  google.protobuf.FieldMask update_mask = 2
603      [(google.api.field_behavior) = REQUIRED];
604
605  // Optional. Email provided to send a confirmation with provisioning config
606  // to.
607  string email = 3 [(google.api.field_behavior) = OPTIONAL];
608}
609