xref: /aosp_15_r20/external/googleapis/google/cloud/notebooks/v1/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.notebooks.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/notebooks/v1/environment.proto";
22import "google/protobuf/timestamp.proto";
23
24option csharp_namespace = "Google.Cloud.Notebooks.V1";
25option go_package = "cloud.google.com/go/notebooks/apiv1/notebookspb;notebookspb";
26option java_multiple_files = true;
27option java_outer_classname = "InstanceProto";
28option java_package = "com.google.cloud.notebooks.v1";
29option php_namespace = "Google\\Cloud\\Notebooks\\V1";
30option ruby_package = "Google::Cloud::Notebooks::V1";
31
32// Reservation Affinity for consuming Zonal reservation.
33message ReservationAffinity {
34  // Indicates whether to consume capacity from an reservation or not.
35  enum Type {
36    // Default type.
37    TYPE_UNSPECIFIED = 0;
38
39    // Do not consume from any allocated capacity.
40    NO_RESERVATION = 1;
41
42    // Consume any reservation available.
43    ANY_RESERVATION = 2;
44
45    // Must consume from a specific reservation. Must specify key value fields
46    // for specifying the reservations.
47    SPECIFIC_RESERVATION = 3;
48  }
49
50  // Optional. Type of reservation to consume
51  Type consume_reservation_type = 1 [(google.api.field_behavior) = OPTIONAL];
52
53  // Optional. Corresponds to the label key of reservation resource.
54  string key = 2 [(google.api.field_behavior) = OPTIONAL];
55
56  // Optional. Corresponds to the label values of reservation resource.
57  repeated string values = 3 [(google.api.field_behavior) = OPTIONAL];
58}
59
60// The definition of a notebook instance.
61message Instance {
62  option (google.api.resource) = {
63    type: "notebooks.googleapis.com/Instance"
64    pattern: "projects/{project}/instances/{instance}"
65  };
66
67  // Definition of the types of hardware accelerators that can be used on this
68  // instance.
69  enum AcceleratorType {
70    // Accelerator type is not specified.
71    ACCELERATOR_TYPE_UNSPECIFIED = 0;
72
73    // Accelerator type is Nvidia Tesla K80.
74    NVIDIA_TESLA_K80 = 1;
75
76    // Accelerator type is Nvidia Tesla P100.
77    NVIDIA_TESLA_P100 = 2;
78
79    // Accelerator type is Nvidia Tesla V100.
80    NVIDIA_TESLA_V100 = 3;
81
82    // Accelerator type is Nvidia Tesla P4.
83    NVIDIA_TESLA_P4 = 4;
84
85    // Accelerator type is Nvidia Tesla T4.
86    NVIDIA_TESLA_T4 = 5;
87
88    // Accelerator type is Nvidia Tesla A100.
89    NVIDIA_TESLA_A100 = 11;
90
91    // Accelerator type is NVIDIA Tesla T4 Virtual Workstations.
92    NVIDIA_TESLA_T4_VWS = 8;
93
94    // Accelerator type is NVIDIA Tesla P100 Virtual Workstations.
95    NVIDIA_TESLA_P100_VWS = 9;
96
97    // Accelerator type is NVIDIA Tesla P4 Virtual Workstations.
98    NVIDIA_TESLA_P4_VWS = 10;
99
100    // (Coming soon) Accelerator type is TPU V2.
101    TPU_V2 = 6;
102
103    // (Coming soon) Accelerator type is TPU V3.
104    TPU_V3 = 7;
105  }
106
107  // Definition of a hardware accelerator. Note that not all combinations
108  // of `type` and `core_count` are valid. Check [GPUs on Compute
109  // Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
110  // valid combination. TPUs are not supported.
111  message AcceleratorConfig {
112    // Type of this accelerator.
113    AcceleratorType type = 1;
114
115    // Count of cores of this accelerator.
116    int64 core_count = 2;
117  }
118
119  // The definition of the states of this instance.
120  enum State {
121    // State is not specified.
122    STATE_UNSPECIFIED = 0;
123
124    // The control logic is starting the instance.
125    STARTING = 1;
126
127    // The control logic is installing required frameworks and registering the
128    // instance with notebook proxy
129    PROVISIONING = 2;
130
131    // The instance is running.
132    ACTIVE = 3;
133
134    // The control logic is stopping the instance.
135    STOPPING = 4;
136
137    // The instance is stopped.
138    STOPPED = 5;
139
140    // The instance is deleted.
141    DELETED = 6;
142
143    // The instance is upgrading.
144    UPGRADING = 7;
145
146    // The instance is being created.
147    INITIALIZING = 8;
148
149    // The instance is getting registered.
150    REGISTERING = 9;
151
152    // The instance is suspending.
153    SUSPENDING = 10;
154
155    // The instance is suspended.
156    SUSPENDED = 11;
157  }
158
159  // Possible disk types for notebook instances.
160  enum DiskType {
161    // Disk type not set.
162    DISK_TYPE_UNSPECIFIED = 0;
163
164    // Standard persistent disk type.
165    PD_STANDARD = 1;
166
167    // SSD persistent disk type.
168    PD_SSD = 2;
169
170    // Balanced persistent disk type.
171    PD_BALANCED = 3;
172
173    // Extreme persistent disk type.
174    PD_EXTREME = 4;
175  }
176
177  // Definition of the disk encryption options.
178  enum DiskEncryption {
179    // Disk encryption is not specified.
180    DISK_ENCRYPTION_UNSPECIFIED = 0;
181
182    // Use Google managed encryption keys to encrypt the boot disk.
183    GMEK = 1;
184
185    // Use customer managed encryption keys to encrypt the boot disk.
186    CMEK = 2;
187  }
188
189  // An instance-attached disk resource.
190  message Disk {
191    // Guest OS features for boot disk.
192    message GuestOsFeature {
193      // The ID of a supported feature. Read  Enabling guest operating system
194      // features to see a list of available options.
195      // Valid values:
196      //
197      // * `FEATURE_TYPE_UNSPECIFIED`
198      // * `MULTI_IP_SUBNET`
199      // * `SECURE_BOOT`
200      // * `UEFI_COMPATIBLE`
201      // * `VIRTIO_SCSI_MULTIQUEUE`
202      // * `WINDOWS`
203      string type = 1;
204    }
205
206    // Indicates whether the disk will be auto-deleted when the instance is
207    // deleted (but not when the disk is detached from the instance).
208    bool auto_delete = 1;
209
210    // Indicates that this is a boot disk. The virtual machine will use the
211    // first partition of the disk for its root filesystem.
212    bool boot = 2;
213
214    // Indicates a unique device name of your choice that is reflected into the
215    // `/dev/disk/by-id/google-*` tree of a Linux operating system running
216    // within the instance. This name can be used to reference the device for
217    // mounting, resizing, and so on, from within the instance.
218    //
219    // If not specified, the server chooses a default device name to apply to
220    // this disk, in the form persistent-disk-x, where x is a number assigned by
221    // Google Compute Engine.This field is only applicable for persistent disks.
222    string device_name = 3;
223
224    // Indicates the size of the disk in base-2 GB.
225    int64 disk_size_gb = 4;
226
227    // Indicates a list of features to enable on the guest operating system.
228    // Applicable only for bootable images. Read  Enabling guest operating
229    // system features to see a list of available options.
230    repeated GuestOsFeature guest_os_features = 5;
231
232    // A zero-based index to this disk, where 0 is reserved for the
233    // boot disk. If you have many disks attached to an instance, each disk
234    // would have a unique index number.
235    int64 index = 6;
236
237    // Indicates the disk interface to use for attaching this disk, which is
238    // either SCSI or NVME. The default is SCSI. Persistent disks must always
239    // use SCSI and the request will fail if you attempt to attach a persistent
240    // disk in any other format than SCSI. Local SSDs can use either NVME or
241    // SCSI. For performance characteristics of SCSI over NVMe, see Local SSD
242    // performance.
243    // Valid values:
244    //
245    // * `NVME`
246    // * `SCSI`
247    string interface = 7;
248
249    // Type of the resource. Always compute#attachedDisk for attached
250    // disks.
251    string kind = 8;
252
253    // A list of publicly visible licenses. Reserved for Google's use.
254    // A License represents billing and aggregate usage data for public
255    // and marketplace images.
256    repeated string licenses = 9;
257
258    // The mode in which to attach this disk, either `READ_WRITE` or
259    // `READ_ONLY`. If not specified, the default is to attach the disk in
260    // `READ_WRITE` mode. Valid values:
261    //
262    // * `READ_ONLY`
263    // * `READ_WRITE`
264    string mode = 10;
265
266    // Indicates a valid partial or full URL to an existing Persistent Disk
267    // resource.
268    string source = 11;
269
270    // Indicates the type of the disk, either `SCRATCH` or `PERSISTENT`.
271    // Valid values:
272    //
273    // * `PERSISTENT`
274    // * `SCRATCH`
275    string type = 12;
276  }
277
278  // A set of Shielded Instance options.
279  // Check [Images using supported Shielded VM
280  // features](https://cloud.google.com/compute/docs/instances/modifying-shielded-vm).
281  // Not all combinations are valid.
282  message ShieldedInstanceConfig {
283    // Defines whether the instance has Secure Boot enabled.
284    //
285    // Secure Boot helps ensure that the system only runs authentic software by
286    // verifying the digital signature of all boot components, and halting the
287    // boot process if signature verification fails. Disabled by default.
288    bool enable_secure_boot = 1;
289
290    // Defines whether the instance has the vTPM enabled. Enabled by default.
291    bool enable_vtpm = 2;
292
293    // Defines whether the instance has integrity monitoring enabled.
294    //
295    // Enables monitoring and attestation of the boot integrity of the instance.
296    // The attestation is performed against the integrity policy baseline. This
297    // baseline is initially derived from the implicitly trusted boot image when
298    // the instance is created. Enabled by default.
299    bool enable_integrity_monitoring = 3;
300  }
301
302  // The entry of VM image upgrade history.
303  message UpgradeHistoryEntry {
304    // The definition of the states of this upgrade history entry.
305    enum State {
306      // State is not specified.
307      STATE_UNSPECIFIED = 0;
308
309      // The instance upgrade is started.
310      STARTED = 1;
311
312      // The instance upgrade is succeeded.
313      SUCCEEDED = 2;
314
315      // The instance upgrade is failed.
316      FAILED = 3;
317    }
318
319    // The definition of operations of this upgrade history entry.
320    enum Action {
321      // Operation is not specified.
322      ACTION_UNSPECIFIED = 0;
323
324      // Upgrade.
325      UPGRADE = 1;
326
327      // Rollback.
328      ROLLBACK = 2;
329    }
330
331    // The snapshot of the boot disk of this notebook instance before upgrade.
332    string snapshot = 1;
333
334    // The VM image before this instance upgrade.
335    string vm_image = 2;
336
337    // The container image before this instance upgrade.
338    string container_image = 3;
339
340    // The framework of this notebook instance.
341    string framework = 4;
342
343    // The version of the notebook instance before this upgrade.
344    string version = 5;
345
346    // The state of this instance upgrade history entry.
347    State state = 6;
348
349    // The time that this instance upgrade history entry is created.
350    google.protobuf.Timestamp create_time = 7;
351
352    // Target VM Image. Format: `ainotebooks-vm/project/image-name/name`.
353    string target_image = 8 [deprecated = true];
354
355    // Action. Rolloback or Upgrade.
356    Action action = 9;
357
358    // Target VM Version, like m63.
359    string target_version = 10;
360  }
361
362  // The type of vNIC driver.
363  // Default should be UNSPECIFIED_NIC_TYPE.
364  enum NicType {
365    // No type specified.
366    UNSPECIFIED_NIC_TYPE = 0;
367
368    // VIRTIO
369    VIRTIO_NET = 1;
370
371    // GVNIC
372    GVNIC = 2;
373  }
374
375  // Output only. The name of this notebook instance. Format:
376  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
377  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
378
379  // Type of the environment; can be one of VM image, or container image.
380  oneof environment {
381    // Use a Compute Engine VM image to start the notebook instance.
382    VmImage vm_image = 2;
383
384    // Use a container image to start the notebook instance.
385    ContainerImage container_image = 3;
386  }
387
388  // Path to a Bash script that automatically runs after a notebook instance
389  // fully boots up. The path must be a URL or
390  // Cloud Storage path (`gs://path-to-file/file-name`).
391  string post_startup_script = 4;
392
393  // Output only. The proxy endpoint that is used to access the Jupyter notebook.
394  string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
395
396  // Input only. The owner of this instance after creation. Format: `[email protected]`
397  //
398  // Currently supports one owner only. If not specified, all of the service
399  // account users of your VM instance's service account can use
400  // the instance.
401  repeated string instance_owners = 6 [(google.api.field_behavior) = INPUT_ONLY];
402
403  // The service account on this instance, giving access to other Google
404  // Cloud services.
405  // You can use any service account within the same project, but you
406  // must have the service account user permission to use the instance.
407  //
408  // If not specified, the [Compute Engine default service
409  // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account)
410  // is used.
411  string service_account = 7;
412
413  // Optional. The URIs of service account scopes to be included in
414  // Compute Engine instances.
415  //
416  // If not specified, the following
417  // [scopes](https://cloud.google.com/compute/docs/access/service-accounts#accesscopesiam)
418  // are defined:
419  //  - https://www.googleapis.com/auth/cloud-platform
420  //  - https://www.googleapis.com/auth/userinfo.email
421  // If not using default scopes, you need at least:
422  //    https://www.googleapis.com/auth/compute
423  repeated string service_account_scopes = 31 [(google.api.field_behavior) = OPTIONAL];
424
425  // Required. The [Compute Engine machine
426  // type](https://cloud.google.com/compute/docs/machine-types) of this
427  // instance.
428  string machine_type = 8 [(google.api.field_behavior) = REQUIRED];
429
430  // The hardware accelerator used on this instance. If you use
431  // accelerators, make sure that your configuration has
432  // [enough vCPUs and memory to support the `machine_type` you have
433  // selected](https://cloud.google.com/compute/docs/gpus/#gpus-list).
434  AcceleratorConfig accelerator_config = 9;
435
436  // Output only. The state of this instance.
437  State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
438
439  // Whether the end user authorizes Google Cloud to install GPU driver
440  // on this instance.
441  // If this field is empty or set to false, the GPU driver won't be installed.
442  // Only applicable to instances with GPUs.
443  bool install_gpu_driver = 11;
444
445  // Specify a custom Cloud Storage path where the GPU driver is stored.
446  // If not specified, we'll automatically choose from official GPU drivers.
447  string custom_gpu_driver_path = 12;
448
449  // Input only. The type of the boot disk attached to this instance, defaults to
450  // standard persistent disk (`PD_STANDARD`).
451  DiskType boot_disk_type = 13 [(google.api.field_behavior) = INPUT_ONLY];
452
453  // Input only. The size of the boot disk in GB attached to this instance, up to a maximum
454  // of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not
455  // specified, this defaults to 100.
456  int64 boot_disk_size_gb = 14 [(google.api.field_behavior) = INPUT_ONLY];
457
458  // Input only. The type of the data disk attached to this instance, defaults to
459  // standard persistent disk (`PD_STANDARD`).
460  DiskType data_disk_type = 25 [(google.api.field_behavior) = INPUT_ONLY];
461
462  // Input only. The size of the data disk in GB attached to this instance, up to a maximum
463  // of 64000 GB (64 TB). You can choose the size of the data disk based on how
464  // big your notebooks and data are. If not specified, this defaults to 100.
465  int64 data_disk_size_gb = 26 [(google.api.field_behavior) = INPUT_ONLY];
466
467  // Input only. If true, the data disk will not be auto deleted when deleting the instance.
468  bool no_remove_data_disk = 27 [(google.api.field_behavior) = INPUT_ONLY];
469
470  // Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
471  DiskEncryption disk_encryption = 15 [(google.api.field_behavior) = INPUT_ONLY];
472
473  // Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
474  // is CMEK.
475  // Format:
476  // `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
477  //
478  // Learn more about [using your own encryption keys](/kms/docs/quickstart).
479  string kms_key = 16 [(google.api.field_behavior) = INPUT_ONLY];
480
481  // Output only. Attached disks to notebook instance.
482  repeated Disk disks = 28 [(google.api.field_behavior) = OUTPUT_ONLY];
483
484  // Optional. Shielded VM configuration.
485  // [Images using supported Shielded VM
486  // features](https://cloud.google.com/compute/docs/instances/modifying-shielded-vm).
487  ShieldedInstanceConfig shielded_instance_config = 30 [(google.api.field_behavior) = OPTIONAL];
488
489  // If true, no public IP will be assigned to this instance.
490  bool no_public_ip = 17;
491
492  // If true, the notebook instance will not register with the proxy.
493  bool no_proxy_access = 18;
494
495  // The name of the VPC that this instance is in.
496  // Format:
497  // `projects/{project_id}/global/networks/{network_id}`
498  string network = 19;
499
500  // The name of the subnet that this instance is in.
501  // Format:
502  // `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`
503  string subnet = 20;
504
505  // Labels to apply to this instance.
506  // These can be later modified by the setLabels method.
507  map<string, string> labels = 21;
508
509  // Custom metadata to apply to this instance.
510  map<string, string> metadata = 22;
511
512  // Optional. The Compute Engine tags to add to runtime (see [Tagging
513  // instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)).
514  repeated string tags = 32 [(google.api.field_behavior) = OPTIONAL];
515
516  // The upgrade history of this instance.
517  repeated UpgradeHistoryEntry upgrade_history = 29;
518
519  // Optional. The type of vNIC to be used on this interface. This may be gVNIC or
520  // VirtioNet.
521  NicType nic_type = 33 [(google.api.field_behavior) = OPTIONAL];
522
523  // Optional. The optional reservation affinity. Setting this field will apply
524  // the specified [Zonal Compute
525  // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
526  // to this notebook instance.
527  ReservationAffinity reservation_affinity = 34 [(google.api.field_behavior) = OPTIONAL];
528
529  // Output only. Email address of entity that sent original CreateInstance request.
530  string creator = 36 [(google.api.field_behavior) = OUTPUT_ONLY];
531
532  // Optional. Flag to enable ip forwarding or not, default false/off.
533  // https://cloud.google.com/vpc/docs/using-routes#canipforward
534  bool can_ip_forward = 39 [(google.api.field_behavior) = OPTIONAL];
535
536  // Output only. Instance creation time.
537  google.protobuf.Timestamp create_time = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
538
539  // Output only. Instance update time.
540  google.protobuf.Timestamp update_time = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
541}
542