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.v2; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/notebooks/v2/gce_setup.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.Notebooks.V2"; 25option go_package = "cloud.google.com/go/notebooks/apiv2/notebookspb;notebookspb"; 26option java_multiple_files = true; 27option java_outer_classname = "InstanceProto"; 28option java_package = "com.google.cloud.notebooks.v2"; 29option php_namespace = "Google\\Cloud\\Notebooks\\V2"; 30option ruby_package = "Google::Cloud::Notebooks::V2"; 31 32// The entry of VM image upgrade history. 33message UpgradeHistoryEntry { 34 // The definition of the states of this upgrade history entry. 35 enum State { 36 // State is not specified. 37 STATE_UNSPECIFIED = 0; 38 39 // The instance upgrade is started. 40 STARTED = 1; 41 42 // The instance upgrade is succeeded. 43 SUCCEEDED = 2; 44 45 // The instance upgrade is failed. 46 FAILED = 3; 47 } 48 49 // The definition of operations of this upgrade history entry. 50 enum Action { 51 // Operation is not specified. 52 ACTION_UNSPECIFIED = 0; 53 54 // Upgrade. 55 UPGRADE = 1; 56 57 // Rollback. 58 ROLLBACK = 2; 59 } 60 61 // Optional. The snapshot of the boot disk of this notebook instance before 62 // upgrade. 63 string snapshot = 1 [(google.api.field_behavior) = OPTIONAL]; 64 65 // Optional. The VM image before this instance upgrade. 66 string vm_image = 2 [(google.api.field_behavior) = OPTIONAL]; 67 68 // Optional. The container image before this instance upgrade. 69 string container_image = 3 [(google.api.field_behavior) = OPTIONAL]; 70 71 // Optional. The framework of this notebook instance. 72 string framework = 4 [(google.api.field_behavior) = OPTIONAL]; 73 74 // Optional. The version of the notebook instance before this upgrade. 75 string version = 5 [(google.api.field_behavior) = OPTIONAL]; 76 77 // Output only. The state of this instance upgrade history entry. 78 State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 79 80 // Immutable. The time that this instance upgrade history entry is created. 81 google.protobuf.Timestamp create_time = 7 82 [(google.api.field_behavior) = IMMUTABLE]; 83 84 // Optional. Action. Rolloback or Upgrade. 85 Action action = 8 [(google.api.field_behavior) = OPTIONAL]; 86 87 // Optional. Target VM Version, like m63. 88 string target_version = 9 [(google.api.field_behavior) = OPTIONAL]; 89} 90 91// The definition of a notebook instance. 92message Instance { 93 option (google.api.resource) = { 94 type: "notebooks.googleapis.com/Instance" 95 pattern: "projects/{project}/locations/{location}/instances/{instance}" 96 plural: "instances" 97 singular: "instance" 98 }; 99 100 // Output only. The name of this notebook instance. Format: 101 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 102 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 103 104 // Setup for the Notebook instance. 105 oneof infrastructure { 106 // Optional. Compute Engine setup for the notebook. Uses notebook-defined 107 // fields. 108 GceSetup gce_setup = 2 [(google.api.field_behavior) = OPTIONAL]; 109 } 110 111 // Output only. The proxy endpoint that is used to access the Jupyter 112 // notebook. 113 string proxy_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 114 115 // Optional. Input only. The owner of this instance after creation. Format: 116 // `[email protected]` 117 // 118 // Currently supports one owner only. If not specified, all of the service 119 // account users of your VM instance's service account can use 120 // the instance. 121 repeated string instance_owners = 4 [ 122 (google.api.field_behavior) = INPUT_ONLY, 123 (google.api.field_behavior) = OPTIONAL 124 ]; 125 126 // Output only. Email address of entity that sent original CreateInstance 127 // request. 128 string creator = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 129 130 // Output only. The state of this instance. 131 State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 132 133 // Output only. The upgrade history of this instance. 134 repeated UpgradeHistoryEntry upgrade_history = 7 135 [(google.api.field_behavior) = OUTPUT_ONLY]; 136 137 // Output only. Unique ID of the resource. 138 string id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 139 140 // Output only. Instance health_state. 141 HealthState health_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; 142 143 // Output only. Additional information about instance health. 144 // Example: 145 // 146 // healthInfo": { 147 // "docker_proxy_agent_status": "1", 148 // "docker_status": "1", 149 // "jupyterlab_api_status": "-1", 150 // "jupyterlab_status": "-1", 151 // "updated": "2020-10-18 09:40:03.573409" 152 // } 153 map<string, string> health_info = 10 154 [(google.api.field_behavior) = OUTPUT_ONLY]; 155 156 // Output only. Instance creation time. 157 google.protobuf.Timestamp create_time = 11 158 [(google.api.field_behavior) = OUTPUT_ONLY]; 159 160 // Output only. Instance update time. 161 google.protobuf.Timestamp update_time = 12 162 [(google.api.field_behavior) = OUTPUT_ONLY]; 163 164 // Optional. If true, the notebook instance will not register with the proxy. 165 bool disable_proxy_access = 13 [(google.api.field_behavior) = OPTIONAL]; 166 167 // Optional. Labels to apply to this instance. 168 // These can be later modified by the UpdateInstance method. 169 map<string, string> labels = 14 [(google.api.field_behavior) = OPTIONAL]; 170} 171 172// The definition of the states of this instance. 173enum State { 174 // State is not specified. 175 STATE_UNSPECIFIED = 0; 176 177 // The control logic is starting the instance. 178 STARTING = 1; 179 180 // The control logic is installing required frameworks and registering the 181 // instance with notebook proxy 182 PROVISIONING = 2; 183 184 // The instance is running. 185 ACTIVE = 3; 186 187 // The control logic is stopping the instance. 188 STOPPING = 4; 189 190 // The instance is stopped. 191 STOPPED = 5; 192 193 // The instance is deleted. 194 DELETED = 6; 195 196 // The instance is upgrading. 197 UPGRADING = 7; 198 199 // The instance is being created. 200 INITIALIZING = 8; 201 202 // The instance is suspending. 203 SUSPENDING = 9; 204 205 // The instance is suspended. 206 SUSPENDED = 10; 207} 208 209// The instance health state. 210enum HealthState { 211 // The instance substate is unknown. 212 HEALTH_STATE_UNSPECIFIED = 0; 213 214 // The instance is known to be in an healthy state 215 // (for example, critical daemons are running) 216 // Applies to ACTIVE state. 217 HEALTHY = 1; 218 219 // The instance is known to be in an unhealthy state 220 // (for example, critical daemons are not running) 221 // Applies to ACTIVE state. 222 UNHEALTHY = 2; 223 224 // The instance has not installed health monitoring agent. 225 // Applies to ACTIVE state. 226 AGENT_NOT_INSTALLED = 3; 227 228 // The instance health monitoring agent is not running. 229 // Applies to ACTIVE state. 230 AGENT_NOT_RUNNING = 4; 231} 232