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/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/notebooks/v1/diagnostic_config.proto"; 24import "google/cloud/notebooks/v1/environment.proto"; 25import "google/cloud/notebooks/v1/execution.proto"; 26import "google/cloud/notebooks/v1/instance.proto"; 27import "google/cloud/notebooks/v1/instance_config.proto"; 28import "google/cloud/notebooks/v1/schedule.proto"; 29import "google/longrunning/operations.proto"; 30import "google/protobuf/timestamp.proto"; 31 32option csharp_namespace = "Google.Cloud.Notebooks.V1"; 33option go_package = "cloud.google.com/go/notebooks/apiv1/notebookspb;notebookspb"; 34option java_multiple_files = true; 35option java_outer_classname = "NotebooksProto"; 36option java_package = "com.google.cloud.notebooks.v1"; 37option php_namespace = "Google\\Cloud\\Notebooks\\V1"; 38option ruby_package = "Google::Cloud::Notebooks::V1"; 39 40// API v1 service for Cloud AI Platform Notebooks. 41service NotebookService { 42 option (google.api.default_host) = "notebooks.googleapis.com"; 43 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; 44 45 // Lists instances in a given project and location. 46 rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { 47 option (google.api.http) = { 48 get: "/v1/{parent=projects/*/locations/*}/instances" 49 }; 50 option (google.api.method_signature) = "parent"; 51 } 52 53 // Gets details of a single Instance. 54 rpc GetInstance(GetInstanceRequest) returns (Instance) { 55 option (google.api.http) = { 56 get: "/v1/{name=projects/*/locations/*/instances/*}" 57 }; 58 option (google.api.method_signature) = "name"; 59 } 60 61 // Creates a new Instance in a given project and location. 62 rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { 63 option (google.api.http) = { 64 post: "/v1/{parent=projects/*/locations/*}/instances" 65 body: "instance" 66 }; 67 option (google.api.method_signature) = "parent,instance,instance_id"; 68 option (google.longrunning.operation_info) = { 69 response_type: "Instance" 70 metadata_type: "OperationMetadata" 71 }; 72 } 73 74 // Registers an existing legacy notebook instance to the Notebooks API server. 75 // Legacy instances are instances created with the legacy Compute Engine 76 // calls. They are not manageable by the Notebooks API out of the box. This 77 // call makes these instances manageable by the Notebooks API. 78 rpc RegisterInstance(RegisterInstanceRequest) returns (google.longrunning.Operation) { 79 option (google.api.http) = { 80 post: "/v1/{parent=projects/*/locations/*}/instances:register" 81 body: "*" 82 }; 83 option (google.longrunning.operation_info) = { 84 response_type: "Instance" 85 metadata_type: "OperationMetadata" 86 }; 87 } 88 89 // Updates the guest accelerators of a single Instance. 90 rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest) returns (google.longrunning.Operation) { 91 option (google.api.http) = { 92 patch: "/v1/{name=projects/*/locations/*/instances/*}:setAccelerator" 93 body: "*" 94 }; 95 option (google.longrunning.operation_info) = { 96 response_type: "Instance" 97 metadata_type: "OperationMetadata" 98 }; 99 } 100 101 // Updates the machine type of a single Instance. 102 rpc SetInstanceMachineType(SetInstanceMachineTypeRequest) returns (google.longrunning.Operation) { 103 option (google.api.http) = { 104 patch: "/v1/{name=projects/*/locations/*/instances/*}:setMachineType" 105 body: "*" 106 }; 107 option (google.longrunning.operation_info) = { 108 response_type: "Instance" 109 metadata_type: "OperationMetadata" 110 }; 111 } 112 113 // Update Notebook Instance configurations. 114 rpc UpdateInstanceConfig(UpdateInstanceConfigRequest) returns (google.longrunning.Operation) { 115 option (google.api.http) = { 116 patch: "/v1/{name=projects/*/locations/*/instances/*}:updateConfig" 117 body: "*" 118 }; 119 option (google.longrunning.operation_info) = { 120 response_type: "Instance" 121 metadata_type: "OperationMetadata" 122 }; 123 } 124 125 // Updates the Shielded instance configuration of a single Instance. 126 rpc UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigRequest) returns (google.longrunning.Operation) { 127 option (google.api.http) = { 128 patch: "/v1/{name=projects/*/locations/*/instances/*}:updateShieldedInstanceConfig" 129 body: "*" 130 }; 131 option (google.longrunning.operation_info) = { 132 response_type: "Instance" 133 metadata_type: "OperationMetadata" 134 }; 135 } 136 137 // Replaces all the labels of an Instance. 138 rpc SetInstanceLabels(SetInstanceLabelsRequest) returns (google.longrunning.Operation) { 139 option (google.api.http) = { 140 patch: "/v1/{name=projects/*/locations/*/instances/*}:setLabels" 141 body: "*" 142 }; 143 option (google.longrunning.operation_info) = { 144 response_type: "Instance" 145 metadata_type: "OperationMetadata" 146 }; 147 } 148 149 // Add/update metadata items for an instance. 150 rpc UpdateInstanceMetadataItems(UpdateInstanceMetadataItemsRequest) returns (UpdateInstanceMetadataItemsResponse) { 151 option (google.api.http) = { 152 patch: "/v1/{name=projects/*/locations/*/instances/*}:updateMetadataItems" 153 body: "*" 154 }; 155 } 156 157 // Deletes a single Instance. 158 rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { 159 option (google.api.http) = { 160 delete: "/v1/{name=projects/*/locations/*/instances/*}" 161 }; 162 option (google.api.method_signature) = "name"; 163 option (google.longrunning.operation_info) = { 164 response_type: "google.protobuf.Empty" 165 metadata_type: "OperationMetadata" 166 }; 167 } 168 169 // Starts a notebook instance. 170 rpc StartInstance(StartInstanceRequest) returns (google.longrunning.Operation) { 171 option (google.api.http) = { 172 post: "/v1/{name=projects/*/locations/*/instances/*}:start" 173 body: "*" 174 }; 175 option (google.longrunning.operation_info) = { 176 response_type: "Instance" 177 metadata_type: "OperationMetadata" 178 }; 179 } 180 181 // Stops a notebook instance. 182 rpc StopInstance(StopInstanceRequest) returns (google.longrunning.Operation) { 183 option (google.api.http) = { 184 post: "/v1/{name=projects/*/locations/*/instances/*}:stop" 185 body: "*" 186 }; 187 option (google.longrunning.operation_info) = { 188 response_type: "Instance" 189 metadata_type: "OperationMetadata" 190 }; 191 } 192 193 // Resets a notebook instance. 194 rpc ResetInstance(ResetInstanceRequest) returns (google.longrunning.Operation) { 195 option (google.api.http) = { 196 post: "/v1/{name=projects/*/locations/*/instances/*}:reset" 197 body: "*" 198 }; 199 option (google.longrunning.operation_info) = { 200 response_type: "Instance" 201 metadata_type: "OperationMetadata" 202 }; 203 } 204 205 // Allows notebook instances to 206 // report their latest instance information to the Notebooks 207 // API server. The server will merge the reported information to 208 // the instance metadata store. Do not use this method directly. 209 rpc ReportInstanceInfo(ReportInstanceInfoRequest) returns (google.longrunning.Operation) { 210 option (google.api.http) = { 211 post: "/v1/{name=projects/*/locations/*/instances/*}:report" 212 body: "*" 213 }; 214 option (google.longrunning.operation_info) = { 215 response_type: "Instance" 216 metadata_type: "OperationMetadata" 217 }; 218 } 219 220 // Check if a notebook instance is upgradable. 221 rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest) returns (IsInstanceUpgradeableResponse) { 222 option (google.api.http) = { 223 get: "/v1/{notebook_instance=projects/*/locations/*/instances/*}:isUpgradeable" 224 }; 225 } 226 227 // Check if a notebook instance is healthy. 228 rpc GetInstanceHealth(GetInstanceHealthRequest) returns (GetInstanceHealthResponse) { 229 option (google.api.http) = { 230 get: "/v1/{name=projects/*/locations/*/instances/*}:getInstanceHealth" 231 }; 232 option (google.api.method_signature) = "name"; 233 } 234 235 // Upgrades a notebook instance to the latest version. 236 rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) { 237 option (google.api.http) = { 238 post: "/v1/{name=projects/*/locations/*/instances/*}:upgrade" 239 body: "*" 240 }; 241 option (google.longrunning.operation_info) = { 242 response_type: "Instance" 243 metadata_type: "OperationMetadata" 244 }; 245 } 246 247 // Rollbacks a notebook instance to the previous version. 248 rpc RollbackInstance(RollbackInstanceRequest) returns (google.longrunning.Operation) { 249 option (google.api.http) = { 250 post: "/v1/{name=projects/*/locations/*/instances/*}:rollback" 251 body: "*" 252 }; 253 option (google.longrunning.operation_info) = { 254 response_type: "Instance" 255 metadata_type: "OperationMetadata" 256 }; 257 } 258 259 // Creates a Diagnostic File and runs Diagnostic Tool given an Instance. 260 rpc DiagnoseInstance(DiagnoseInstanceRequest) returns (google.longrunning.Operation) { 261 option (google.api.http) = { 262 post: "/v1/{name=projects/*/locations/*/instances/*}:diagnose" 263 body: "*" 264 }; 265 option (google.api.method_signature) = "name,diagnostic_config"; 266 option (google.longrunning.operation_info) = { 267 response_type: "Instance" 268 metadata_type: "OperationMetadata" 269 }; 270 } 271 272 // Allows notebook instances to 273 // call this endpoint to upgrade themselves. Do not use this method directly. 274 rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) returns (google.longrunning.Operation) { 275 option (google.api.http) = { 276 post: "/v1/{name=projects/*/locations/*/instances/*}:upgradeInternal" 277 body: "*" 278 }; 279 option (google.longrunning.operation_info) = { 280 response_type: "Instance" 281 metadata_type: "OperationMetadata" 282 }; 283 } 284 285 // Lists environments in a project. 286 rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { 287 option (google.api.http) = { 288 get: "/v1/{parent=projects/*/locations/*}/environments" 289 }; 290 option (google.api.method_signature) = "parent"; 291 } 292 293 // Gets details of a single Environment. 294 rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { 295 option (google.api.http) = { 296 get: "/v1/{name=projects/*/locations/*/environments/*}" 297 }; 298 option (google.api.method_signature) = "name"; 299 } 300 301 // Creates a new Environment. 302 rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { 303 option (google.api.http) = { 304 post: "/v1/{parent=projects/*/locations/*}/environments" 305 body: "environment" 306 }; 307 option (google.api.method_signature) = "parent,environment,environment_id"; 308 option (google.longrunning.operation_info) = { 309 response_type: "Environment" 310 metadata_type: "OperationMetadata" 311 }; 312 } 313 314 // Deletes a single Environment. 315 rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { 316 option (google.api.http) = { 317 delete: "/v1/{name=projects/*/locations/*/environments/*}" 318 }; 319 option (google.api.method_signature) = "name"; 320 option (google.longrunning.operation_info) = { 321 response_type: "google.protobuf.Empty" 322 metadata_type: "OperationMetadata" 323 }; 324 } 325 326 // Lists schedules in a given project and location. 327 rpc ListSchedules(ListSchedulesRequest) returns (ListSchedulesResponse) { 328 option (google.api.http) = { 329 get: "/v1/{parent=projects/*/locations/*}/schedules" 330 }; 331 option (google.api.method_signature) = "parent"; 332 } 333 334 // Gets details of schedule 335 rpc GetSchedule(GetScheduleRequest) returns (Schedule) { 336 option (google.api.http) = { 337 get: "/v1/{name=projects/*/locations/*/schedules/*}" 338 }; 339 option (google.api.method_signature) = "name"; 340 } 341 342 // Deletes schedule and all underlying jobs 343 rpc DeleteSchedule(DeleteScheduleRequest) returns (google.longrunning.Operation) { 344 option (google.api.http) = { 345 delete: "/v1/{name=projects/*/locations/*/schedules/*}" 346 }; 347 option (google.api.method_signature) = "name"; 348 option (google.longrunning.operation_info) = { 349 response_type: "google.protobuf.Empty" 350 metadata_type: "OperationMetadata" 351 }; 352 } 353 354 // Creates a new Scheduled Notebook in a given project and location. 355 rpc CreateSchedule(CreateScheduleRequest) returns (google.longrunning.Operation) { 356 option (google.api.http) = { 357 post: "/v1/{parent=projects/*/locations/*}/schedules" 358 body: "schedule" 359 }; 360 option (google.api.method_signature) = "parent,schedule,schedule_id"; 361 option (google.longrunning.operation_info) = { 362 response_type: "Schedule" 363 metadata_type: "OperationMetadata" 364 }; 365 } 366 367 // Triggers execution of an existing schedule. 368 rpc TriggerSchedule(TriggerScheduleRequest) returns (google.longrunning.Operation) { 369 option (google.api.http) = { 370 post: "/v1/{name=projects/*/locations/*/schedules/*}:trigger" 371 body: "*" 372 }; 373 option (google.longrunning.operation_info) = { 374 response_type: "Schedule" 375 metadata_type: "OperationMetadata" 376 }; 377 } 378 379 // Lists executions in a given project and location 380 rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { 381 option (google.api.http) = { 382 get: "/v1/{parent=projects/*/locations/*}/executions" 383 }; 384 option (google.api.method_signature) = "parent"; 385 } 386 387 // Gets details of executions 388 rpc GetExecution(GetExecutionRequest) returns (Execution) { 389 option (google.api.http) = { 390 get: "/v1/{name=projects/*/locations/*/executions/*}" 391 }; 392 option (google.api.method_signature) = "name"; 393 } 394 395 // Deletes execution 396 rpc DeleteExecution(DeleteExecutionRequest) returns (google.longrunning.Operation) { 397 option (google.api.http) = { 398 delete: "/v1/{name=projects/*/locations/*/executions/*}" 399 }; 400 option (google.api.method_signature) = "name"; 401 option (google.longrunning.operation_info) = { 402 response_type: "google.protobuf.Empty" 403 metadata_type: "OperationMetadata" 404 }; 405 } 406 407 // Creates a new Execution in a given project and location. 408 rpc CreateExecution(CreateExecutionRequest) returns (google.longrunning.Operation) { 409 option (google.api.http) = { 410 post: "/v1/{parent=projects/*/locations/*}/executions" 411 body: "execution" 412 }; 413 option (google.api.method_signature) = "parent,execution,execution_id"; 414 option (google.longrunning.operation_info) = { 415 response_type: "Execution" 416 metadata_type: "OperationMetadata" 417 }; 418 } 419} 420 421// Represents the metadata of the long-running operation. 422message OperationMetadata { 423 // The time the operation was created. 424 google.protobuf.Timestamp create_time = 1; 425 426 // The time the operation finished running. 427 google.protobuf.Timestamp end_time = 2; 428 429 // Server-defined resource path for the target of the operation. 430 string target = 3; 431 432 // Name of the verb executed by the operation. 433 string verb = 4; 434 435 // Human-readable status of the operation, if any. 436 string status_message = 5; 437 438 // Identifies whether the user has requested cancellation 439 // of the operation. Operations that have successfully been cancelled 440 // have [Operation.error][] value with a 441 // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. 442 bool requested_cancellation = 6; 443 444 // API version used to start the operation. 445 string api_version = 7; 446 447 // API endpoint name of this operation. 448 string endpoint = 8; 449} 450 451// Request for listing notebook instances. 452message ListInstancesRequest { 453 // Required. Format: 454 // `parent=projects/{project_id}/locations/{location}` 455 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 456 457 // Maximum return size of the list call. 458 int32 page_size = 2; 459 460 // A previous returned page token that can be used to continue listing 461 // from the last result. 462 string page_token = 3; 463} 464 465// Response for listing notebook instances. 466message ListInstancesResponse { 467 // A list of returned instances. 468 repeated Instance instances = 1; 469 470 // Page token that can be used to continue listing from the last result in the 471 // next list call. 472 string next_page_token = 2; 473 474 // Locations that could not be reached. For example, 475 // `['us-west1-a', 'us-central1-b']`. 476 // A ListInstancesResponse will only contain either instances or unreachables, 477 repeated string unreachable = 3; 478} 479 480// Request for getting a notebook instance. 481message GetInstanceRequest { 482 // Required. Format: 483 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 484 string name = 1 [(google.api.field_behavior) = REQUIRED]; 485} 486 487// Request for creating a notebook instance. 488message CreateInstanceRequest { 489 // Required. Format: 490 // `parent=projects/{project_id}/locations/{location}` 491 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 492 493 // Required. User-defined unique ID of this instance. 494 string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; 495 496 // Required. The instance to be created. 497 Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; 498} 499 500// Request for registering a notebook instance. 501message RegisterInstanceRequest { 502 // Required. Format: 503 // `parent=projects/{project_id}/locations/{location}` 504 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 505 506 // Required. User defined unique ID of this instance. The `instance_id` must 507 // be 1 to 63 characters long and contain only lowercase letters, 508 // numeric characters, and dashes. The first character must be a lowercase 509 // letter and the last character cannot be a dash. 510 string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; 511} 512 513// Request for setting instance accelerator. 514message SetInstanceAcceleratorRequest { 515 // Required. Format: 516 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 517 string name = 1 [(google.api.field_behavior) = REQUIRED]; 518 519 // Required. Type of this accelerator. 520 Instance.AcceleratorType type = 2 [(google.api.field_behavior) = REQUIRED]; 521 522 // Required. Count of cores of this accelerator. Note that not all combinations 523 // of `type` and `core_count` are valid. Check [GPUs on 524 // Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to 525 // find a valid combination. TPUs are not supported. 526 int64 core_count = 3 [(google.api.field_behavior) = REQUIRED]; 527} 528 529// Request for setting instance machine type. 530message SetInstanceMachineTypeRequest { 531 // Required. Format: 532 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 533 string name = 1 [(google.api.field_behavior) = REQUIRED]; 534 535 // Required. The [Compute Engine machine 536 // type](https://cloud.google.com/compute/docs/machine-types). 537 string machine_type = 2 [(google.api.field_behavior) = REQUIRED]; 538} 539 540// Request for updating instance configurations. 541message UpdateInstanceConfigRequest { 542 // Required. Format: 543 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 544 string name = 1 [(google.api.field_behavior) = REQUIRED]; 545 546 // The instance configurations to be updated. 547 InstanceConfig config = 2; 548} 549 550// Request for setting instance labels. 551message SetInstanceLabelsRequest { 552 // Required. Format: 553 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 554 string name = 1 [(google.api.field_behavior) = REQUIRED]; 555 556 // Labels to apply to this instance. 557 // These can be later modified by the setLabels method 558 map<string, string> labels = 2; 559} 560 561// Request for adding/changing metadata items for an instance. 562message UpdateInstanceMetadataItemsRequest { 563 // Required. Format: 564 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 565 string name = 1 [(google.api.field_behavior) = REQUIRED]; 566 567 // Metadata items to add/update for the instance. 568 map<string, string> items = 2; 569} 570 571// Response for adding/changing metadata items for an instance. 572message UpdateInstanceMetadataItemsResponse { 573 // Map of items that were added/updated to/in the metadata. 574 map<string, string> items = 1; 575} 576 577// Request for updating the Shielded Instance config for a notebook instance. 578// You can only use this method on a stopped instance 579message UpdateShieldedInstanceConfigRequest { 580 // Required. Format: 581 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 582 string name = 1 [(google.api.field_behavior) = REQUIRED]; 583 584 // ShieldedInstance configuration to be updated. 585 Instance.ShieldedInstanceConfig shielded_instance_config = 2; 586} 587 588// Request for deleting a notebook instance. 589message DeleteInstanceRequest { 590 // Required. Format: 591 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 592 string name = 1 [(google.api.field_behavior) = REQUIRED]; 593} 594 595// Request for starting a notebook instance 596message StartInstanceRequest { 597 // Required. Format: 598 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 599 string name = 1 [(google.api.field_behavior) = REQUIRED]; 600} 601 602// Request for stopping a notebook instance 603message StopInstanceRequest { 604 // Required. Format: 605 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 606 string name = 1 [(google.api.field_behavior) = REQUIRED]; 607} 608 609// Request for resetting a notebook instance 610message ResetInstanceRequest { 611 // Required. Format: 612 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 613 string name = 1 [(google.api.field_behavior) = REQUIRED]; 614} 615 616// Request for notebook instances to report information to Notebooks API. 617message ReportInstanceInfoRequest { 618 // Required. Format: 619 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 620 string name = 1 [(google.api.field_behavior) = REQUIRED]; 621 622 // Required. The VM hardware token for authenticating the VM. 623 // https://cloud.google.com/compute/docs/instances/verifying-instance-identity 624 string vm_id = 2 [(google.api.field_behavior) = REQUIRED]; 625 626 // The metadata reported to Notebooks API. This will be merged to the instance 627 // metadata store 628 map<string, string> metadata = 3; 629} 630 631// Request for checking if a notebook instance is upgradeable. 632message IsInstanceUpgradeableRequest { 633 // Required. Format: 634 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 635 string notebook_instance = 1 [(google.api.field_behavior) = REQUIRED]; 636 637 // Optional. The optional UpgradeType. Setting this field will search for additional 638 // compute images to upgrade this instance. 639 UpgradeType type = 2 [(google.api.field_behavior) = OPTIONAL]; 640} 641 642// Response for checking if a notebook instance is upgradeable. 643message IsInstanceUpgradeableResponse { 644 // If an instance is upgradeable. 645 bool upgradeable = 1; 646 647 // The version this instance will be upgraded to if calling the upgrade 648 // endpoint. This field will only be populated if field upgradeable is true. 649 string upgrade_version = 2; 650 651 // Additional information about upgrade. 652 string upgrade_info = 3; 653 654 // The new image self link this instance will be upgraded to if calling the 655 // upgrade endpoint. This field will only be populated if field upgradeable 656 // is true. 657 string upgrade_image = 4; 658} 659 660// Request for checking if a notebook instance is healthy. 661message GetInstanceHealthRequest { 662 // Required. Format: 663 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 664 string name = 1 [ 665 (google.api.field_behavior) = REQUIRED, 666 (google.api.resource_reference) = { 667 type: "notebooks.googleapis.com/Instance" 668 } 669 ]; 670} 671 672// Response for checking if a notebook instance is healthy. 673message GetInstanceHealthResponse { 674 // If an instance is healthy or not. 675 enum HealthState { 676 // The instance substate is unknown. 677 HEALTH_STATE_UNSPECIFIED = 0; 678 679 // The instance is known to be in an healthy state 680 // (for example, critical daemons are running) 681 // Applies to ACTIVE state. 682 HEALTHY = 1; 683 684 // The instance is known to be in an unhealthy state 685 // (for example, critical daemons are not running) 686 // Applies to ACTIVE state. 687 UNHEALTHY = 2; 688 689 // The instance has not installed health monitoring agent. 690 // Applies to ACTIVE state. 691 AGENT_NOT_INSTALLED = 3; 692 693 // The instance health monitoring agent is not running. 694 // Applies to ACTIVE state. 695 AGENT_NOT_RUNNING = 4; 696 } 697 698 // Output only. Runtime health_state. 699 HealthState health_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 700 701 // Output only. Additional information about instance health. 702 // Example: 703 // healthInfo": { 704 // "docker_proxy_agent_status": "1", 705 // "docker_status": "1", 706 // "jupyterlab_api_status": "-1", 707 // "jupyterlab_status": "-1", 708 // "updated": "2020-10-18 09:40:03.573409" 709 // } 710 map<string, string> health_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 711} 712 713// Request for upgrading a notebook instance 714message UpgradeInstanceRequest { 715 // Required. Format: 716 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 717 string name = 1 [(google.api.field_behavior) = REQUIRED]; 718 719 // Optional. The optional UpgradeType. Setting this field will search for additional 720 // compute images to upgrade this instance. 721 UpgradeType type = 2 [(google.api.field_behavior) = OPTIONAL]; 722} 723 724// Request for rollbacking a notebook instance 725message RollbackInstanceRequest { 726 // Required. Format: 727 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 728 string name = 1 [(google.api.field_behavior) = REQUIRED]; 729 730 // Required. The snapshot for rollback. 731 // Example: `projects/test-project/global/snapshots/krwlzipynril`. 732 string target_snapshot = 2 [(google.api.field_behavior) = REQUIRED]; 733} 734 735// Request for upgrading a notebook instance from within the VM 736message UpgradeInstanceInternalRequest { 737 // Required. Format: 738 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 739 string name = 1 [(google.api.field_behavior) = REQUIRED]; 740 741 // Required. The VM hardware token for authenticating the VM. 742 // https://cloud.google.com/compute/docs/instances/verifying-instance-identity 743 string vm_id = 2 [(google.api.field_behavior) = REQUIRED]; 744 745 // Optional. The optional UpgradeType. Setting this field will search for additional 746 // compute images to upgrade this instance. 747 UpgradeType type = 3 [(google.api.field_behavior) = OPTIONAL]; 748} 749 750// Request for listing environments. 751message ListEnvironmentsRequest { 752 // Required. Format: `projects/{project_id}/locations/{location}` 753 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 754 755 // Maximum return size of the list call. 756 int32 page_size = 2; 757 758 // A previous returned page token that can be used to continue listing from 759 // the last result. 760 string page_token = 3; 761} 762 763// Request for creating a notebook instance diagnostic file. 764message DiagnoseInstanceRequest { 765 // Required. Format: 766 // `projects/{project_id}/locations/{location}/instances/{instance_id}` 767 string name = 1 [ 768 (google.api.field_behavior) = REQUIRED, 769 (google.api.resource_reference) = { 770 type: "notebooks.googleapis.com/Instance" 771 } 772 ]; 773 774 // Required. Defines flags that are used to run the diagnostic tool 775 DiagnosticConfig diagnostic_config = 2 [(google.api.field_behavior) = REQUIRED]; 776} 777 778// Response for listing environments. 779message ListEnvironmentsResponse { 780 // A list of returned environments. 781 repeated Environment environments = 1; 782 783 // A page token that can be used to continue listing from the last result 784 // in the next list call. 785 string next_page_token = 2; 786 787 // Locations that could not be reached. 788 repeated string unreachable = 3; 789} 790 791// Request for getting a notebook environment. 792message GetEnvironmentRequest { 793 // Required. Format: 794 // `projects/{project_id}/locations/{location}/environments/{environment_id}` 795 string name = 1 [(google.api.field_behavior) = REQUIRED]; 796} 797 798// Request for creating a notebook environment. 799message CreateEnvironmentRequest { 800 // Required. Format: `projects/{project_id}/locations/{location}` 801 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 802 803 // Required. User-defined unique ID of this environment. The `environment_id` must 804 // be 1 to 63 characters long and contain only lowercase letters, 805 // numeric characters, and dashes. The first character must be a lowercase 806 // letter and the last character cannot be a dash. 807 string environment_id = 2 [(google.api.field_behavior) = REQUIRED]; 808 809 // Required. The environment to be created. 810 Environment environment = 3 [(google.api.field_behavior) = REQUIRED]; 811} 812 813// Request for deleting a notebook environment. 814message DeleteEnvironmentRequest { 815 // Required. Format: 816 // `projects/{project_id}/locations/{location}/environments/{environment_id}` 817 string name = 1 [(google.api.field_behavior) = REQUIRED]; 818} 819 820// Request for listing scheduled notebook job. 821message ListSchedulesRequest { 822 // Required. Format: 823 // `parent=projects/{project_id}/locations/{location}` 824 string parent = 1 [ 825 (google.api.field_behavior) = REQUIRED, 826 (google.api.resource_reference) = { 827 type: "notebooks.googleapis.com/Schedule" 828 } 829 ]; 830 831 // Maximum return size of the list call. 832 int32 page_size = 2; 833 834 // A previous returned page token that can be used to continue listing 835 // from the last result. 836 string page_token = 3; 837 838 // Filter applied to resulting schedules. 839 string filter = 4; 840 841 // Field to order results by. 842 string order_by = 5; 843} 844 845// Response for listing scheduled notebook job. 846message ListSchedulesResponse { 847 // A list of returned instances. 848 repeated Schedule schedules = 1; 849 850 // Page token that can be used to continue listing from the last result in the 851 // next list call. 852 string next_page_token = 2; 853 854 // Schedules that could not be reached. For example: 855 // 856 // ['projects/{project_id}/location/{location}/schedules/monthly_digest', 857 // 'projects/{project_id}/location/{location}/schedules/weekly_sentiment'] 858 repeated string unreachable = 3; 859} 860 861// Request for getting scheduled notebook. 862message GetScheduleRequest { 863 // Required. Format: 864 // `projects/{project_id}/locations/{location}/schedules/{schedule_id}` 865 string name = 1 [ 866 (google.api.field_behavior) = REQUIRED, 867 (google.api.resource_reference) = { 868 type: "notebooks.googleapis.com/Schedule" 869 } 870 ]; 871} 872 873// Request for deleting an Schedule 874message DeleteScheduleRequest { 875 // Required. Format: 876 // `projects/{project_id}/locations/{location}/schedules/{schedule_id}` 877 string name = 1 [ 878 (google.api.field_behavior) = REQUIRED, 879 (google.api.resource_reference) = { 880 type: "notebooks.googleapis.com/Schedule" 881 } 882 ]; 883} 884 885// Request for created scheduled notebooks 886message CreateScheduleRequest { 887 // Required. Format: 888 // `parent=projects/{project_id}/locations/{location}` 889 string parent = 1 [ 890 (google.api.field_behavior) = REQUIRED, 891 (google.api.resource_reference) = { 892 type: "notebooks.googleapis.com/Schedule" 893 } 894 ]; 895 896 // Required. User-defined unique ID of this schedule. 897 string schedule_id = 2 [(google.api.field_behavior) = REQUIRED]; 898 899 // Required. The schedule to be created. 900 Schedule schedule = 3 [(google.api.field_behavior) = REQUIRED]; 901} 902 903// Request for created scheduled notebooks 904message TriggerScheduleRequest { 905 // Required. Format: 906 // `parent=projects/{project_id}/locations/{location}/schedules/{schedule_id}` 907 string name = 1 [ 908 (google.api.field_behavior) = REQUIRED, 909 (google.api.resource_reference) = { 910 type: "notebooks.googleapis.com/Schedule" 911 } 912 ]; 913} 914 915// Request for listing scheduled notebook executions. 916message ListExecutionsRequest { 917 // Required. Format: 918 // `parent=projects/{project_id}/locations/{location}` 919 string parent = 1 [ 920 (google.api.field_behavior) = REQUIRED, 921 (google.api.resource_reference) = { 922 type: "notebooks.googleapis.com/Execution" 923 } 924 ]; 925 926 // Maximum return size of the list call. 927 int32 page_size = 2; 928 929 // A previous returned page token that can be used to continue listing 930 // from the last result. 931 string page_token = 3; 932 933 // Filter applied to resulting executions. Currently only supports filtering 934 // executions by a specified `schedule_id`. 935 // Format: `schedule_id=<Schedule_ID>` 936 string filter = 4; 937 938 // Sort by field. 939 string order_by = 5; 940} 941 942// Response for listing scheduled notebook executions 943message ListExecutionsResponse { 944 // A list of returned instances. 945 repeated Execution executions = 1; 946 947 // Page token that can be used to continue listing from the last result in the 948 // next list call. 949 string next_page_token = 2; 950 951 // Executions IDs that could not be reached. For example: 952 // 953 // ['projects/{project_id}/location/{location}/executions/imagenet_test1', 954 // 'projects/{project_id}/location/{location}/executions/classifier_train1'] 955 repeated string unreachable = 3; 956} 957 958// Request for getting scheduled notebook execution 959message GetExecutionRequest { 960 // Required. Format: 961 // `projects/{project_id}/locations/{location}/executions/{execution_id}` 962 string name = 1 [ 963 (google.api.field_behavior) = REQUIRED, 964 (google.api.resource_reference) = { 965 type: "notebooks.googleapis.com/Execution" 966 } 967 ]; 968} 969 970// Request for deleting a scheduled notebook execution 971message DeleteExecutionRequest { 972 // Required. Format: 973 // `projects/{project_id}/locations/{location}/executions/{execution_id}` 974 string name = 1 [ 975 (google.api.field_behavior) = REQUIRED, 976 (google.api.resource_reference) = { 977 type: "notebooks.googleapis.com/Execution" 978 } 979 ]; 980} 981 982// Request to create notebook execution 983message CreateExecutionRequest { 984 // Required. Format: 985 // `parent=projects/{project_id}/locations/{location}` 986 string parent = 1 [ 987 (google.api.field_behavior) = REQUIRED, 988 (google.api.resource_reference) = { 989 type: "notebooks.googleapis.com/Execution" 990 } 991 ]; 992 993 // Required. User-defined unique ID of this execution. 994 string execution_id = 2 [(google.api.field_behavior) = REQUIRED]; 995 996 // Required. The execution to be created. 997 Execution execution = 3 [(google.api.field_behavior) = REQUIRED]; 998} 999 1000// Definition of the types of upgrade that can be used on this 1001// instance. 1002enum UpgradeType { 1003 // Upgrade type is not specified. 1004 UPGRADE_TYPE_UNSPECIFIED = 0; 1005 1006 // Upgrade ML framework. 1007 UPGRADE_FRAMEWORK = 1; 1008 1009 // Upgrade Operating System. 1010 UPGRADE_OS = 2; 1011 1012 // Upgrade CUDA. 1013 UPGRADE_CUDA = 3; 1014 1015 // Upgrade All (OS, Framework and CUDA). 1016 UPGRADE_ALL = 4; 1017} 1018