instance.proto 18 KB

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