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.aiplatform.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/aiplatform/v1/notebook_runtime.proto"; 24import "google/cloud/aiplatform/v1/operation.proto"; 25import "google/longrunning/operations.proto"; 26import "google/protobuf/empty.proto"; 27import "google/protobuf/field_mask.proto"; 28 29option csharp_namespace = "Google.Cloud.AIPlatform.V1"; 30option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; 31option java_multiple_files = true; 32option java_outer_classname = "NotebookServiceProto"; 33option java_package = "com.google.cloud.aiplatform.v1"; 34option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; 35option ruby_package = "Google::Cloud::AIPlatform::V1"; 36 37// The interface for Vertex Notebook service (a.k.a. Colab on Workbench). 38service NotebookService { 39 option (google.api.default_host) = "aiplatform.googleapis.com"; 40 option (google.api.oauth_scopes) = 41 "https://www.googleapis.com/auth/cloud-platform"; 42 43 // Creates a NotebookRuntimeTemplate. 44 rpc CreateNotebookRuntimeTemplate(CreateNotebookRuntimeTemplateRequest) 45 returns (google.longrunning.Operation) { 46 option (google.api.http) = { 47 post: "/v1/{parent=projects/*/locations/*}/notebookRuntimeTemplates" 48 body: "notebook_runtime_template" 49 }; 50 option (google.api.method_signature) = 51 "parent,notebook_runtime_template,notebook_runtime_template_id"; 52 option (google.longrunning.operation_info) = { 53 response_type: "NotebookRuntimeTemplate" 54 metadata_type: "CreateNotebookRuntimeTemplateOperationMetadata" 55 }; 56 } 57 58 // Gets a NotebookRuntimeTemplate. 59 rpc GetNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest) 60 returns (NotebookRuntimeTemplate) { 61 option (google.api.http) = { 62 get: "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}" 63 }; 64 option (google.api.method_signature) = "name"; 65 } 66 67 // Lists NotebookRuntimeTemplates in a Location. 68 rpc ListNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest) 69 returns (ListNotebookRuntimeTemplatesResponse) { 70 option (google.api.http) = { 71 get: "/v1/{parent=projects/*/locations/*}/notebookRuntimeTemplates" 72 }; 73 option (google.api.method_signature) = "parent"; 74 } 75 76 // Deletes a NotebookRuntimeTemplate. 77 rpc DeleteNotebookRuntimeTemplate(DeleteNotebookRuntimeTemplateRequest) 78 returns (google.longrunning.Operation) { 79 option (google.api.http) = { 80 delete: "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}" 81 }; 82 option (google.api.method_signature) = "name"; 83 option (google.longrunning.operation_info) = { 84 response_type: "google.protobuf.Empty" 85 metadata_type: "DeleteOperationMetadata" 86 }; 87 } 88 89 // Assigns a NotebookRuntime to a user for a particular Notebook file. This 90 // method will either returns an existing assignment or generates a new one. 91 rpc AssignNotebookRuntime(AssignNotebookRuntimeRequest) 92 returns (google.longrunning.Operation) { 93 option (google.api.http) = { 94 post: "/v1/{parent=projects/*/locations/*}/notebookRuntimes:assign" 95 body: "*" 96 }; 97 option (google.api.method_signature) = 98 "parent,notebook_runtime_template,notebook_runtime,notebook_runtime_id"; 99 option (google.longrunning.operation_info) = { 100 response_type: "NotebookRuntime" 101 metadata_type: "AssignNotebookRuntimeOperationMetadata" 102 }; 103 } 104 105 // Gets a NotebookRuntime. 106 rpc GetNotebookRuntime(GetNotebookRuntimeRequest) returns (NotebookRuntime) { 107 option (google.api.http) = { 108 get: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}" 109 }; 110 option (google.api.method_signature) = "name"; 111 } 112 113 // Lists NotebookRuntimes in a Location. 114 rpc ListNotebookRuntimes(ListNotebookRuntimesRequest) 115 returns (ListNotebookRuntimesResponse) { 116 option (google.api.http) = { 117 get: "/v1/{parent=projects/*/locations/*}/notebookRuntimes" 118 }; 119 option (google.api.method_signature) = "parent"; 120 } 121 122 // Deletes a NotebookRuntime. 123 rpc DeleteNotebookRuntime(DeleteNotebookRuntimeRequest) 124 returns (google.longrunning.Operation) { 125 option (google.api.http) = { 126 delete: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}" 127 }; 128 option (google.api.method_signature) = "name"; 129 option (google.longrunning.operation_info) = { 130 response_type: "google.protobuf.Empty" 131 metadata_type: "DeleteOperationMetadata" 132 }; 133 } 134 135 // Upgrades a NotebookRuntime. 136 rpc UpgradeNotebookRuntime(UpgradeNotebookRuntimeRequest) 137 returns (google.longrunning.Operation) { 138 option (google.api.http) = { 139 post: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}:upgrade" 140 body: "*" 141 }; 142 option (google.api.method_signature) = "name"; 143 option (google.longrunning.operation_info) = { 144 response_type: "UpgradeNotebookRuntimeResponse" 145 metadata_type: "UpgradeNotebookRuntimeOperationMetadata" 146 }; 147 } 148 149 // Starts a NotebookRuntime. 150 rpc StartNotebookRuntime(StartNotebookRuntimeRequest) 151 returns (google.longrunning.Operation) { 152 option (google.api.http) = { 153 post: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}:start" 154 body: "*" 155 }; 156 option (google.api.method_signature) = "name"; 157 option (google.longrunning.operation_info) = { 158 response_type: "StartNotebookRuntimeResponse" 159 metadata_type: "StartNotebookRuntimeOperationMetadata" 160 }; 161 } 162} 163 164// Request message for 165// [NotebookService.CreateNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.CreateNotebookRuntimeTemplate]. 166message CreateNotebookRuntimeTemplateRequest { 167 // Required. The resource name of the Location to create the 168 // NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}` 169 string parent = 1 [ 170 (google.api.field_behavior) = REQUIRED, 171 (google.api.resource_reference) = { 172 type: "locations.googleapis.com/Location" 173 } 174 ]; 175 176 // Required. The NotebookRuntimeTemplate to create. 177 NotebookRuntimeTemplate notebook_runtime_template = 2 178 [(google.api.field_behavior) = REQUIRED]; 179 180 // Optional. User specified ID for the notebook runtime template. 181 string notebook_runtime_template_id = 3 182 [(google.api.field_behavior) = OPTIONAL]; 183} 184 185// Metadata information for 186// [NotebookService.CreateNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.CreateNotebookRuntimeTemplate]. 187message CreateNotebookRuntimeTemplateOperationMetadata { 188 // The operation generic information. 189 GenericOperationMetadata generic_metadata = 1; 190} 191 192// Request message for 193// [NotebookService.GetNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.GetNotebookRuntimeTemplate] 194message GetNotebookRuntimeTemplateRequest { 195 // Required. The name of the NotebookRuntimeTemplate resource. 196 // Format: 197 // `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` 198 string name = 1 [ 199 (google.api.field_behavior) = REQUIRED, 200 (google.api.resource_reference) = { 201 type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" 202 } 203 ]; 204} 205 206// Request message for 207// [NotebookService.ListNotebookRuntimeTemplates][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimeTemplates]. 208message ListNotebookRuntimeTemplatesRequest { 209 // Required. The resource name of the Location from which to list the 210 // NotebookRuntimeTemplates. 211 // Format: `projects/{project}/locations/{location}` 212 string parent = 1 [ 213 (google.api.field_behavior) = REQUIRED, 214 (google.api.resource_reference) = { 215 type: "locations.googleapis.com/Location" 216 } 217 ]; 218 219 // Optional. An expression for filtering the results of the request. For field 220 // names both snake_case and camelCase are supported. 221 // 222 // * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` 223 // represents the NotebookRuntimeTemplate ID, 224 // i.e. the last segment of the NotebookRuntimeTemplate's [resource name] 225 // [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. 226 // * `display_name` supports = and != 227 // * `labels` supports general map functions that is: 228 // * `labels.key=value` - key:value equality 229 // * `labels.key:* or labels:key - key existence 230 // * A key including a space must be quoted. `labels."a key"`. 231 // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: 232 // [USER_DEFINED, ONE_CLICK]. 233 // 234 // Some examples: 235 // 236 // * `notebookRuntimeTemplate=notebookRuntimeTemplate123` 237 // * `displayName="myDisplayName"` 238 // * `labels.myKey="myValue"` 239 // * `notebookRuntimeType=USER_DEFINED` 240 string filter = 2 [(google.api.field_behavior) = OPTIONAL]; 241 242 // Optional. The standard list page size. 243 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 244 245 // Optional. The standard list page token. 246 // Typically obtained via 247 // [ListNotebookRuntimeTemplatesResponse.next_page_token][google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesResponse.next_page_token] 248 // of the previous 249 // [NotebookService.ListNotebookRuntimeTemplates][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimeTemplates] 250 // call. 251 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 252 253 // Optional. Mask specifying which fields to read. 254 google.protobuf.FieldMask read_mask = 5 255 [(google.api.field_behavior) = OPTIONAL]; 256 257 // Optional. A comma-separated list of fields to order by, sorted in ascending 258 // order. Use "desc" after a field name for descending. Supported fields: 259 // 260 // * `display_name` 261 // * `create_time` 262 // * `update_time` 263 // 264 // Example: `display_name, create_time desc`. 265 string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; 266} 267 268// Response message for 269// [NotebookService.ListNotebookRuntimeTemplates][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimeTemplates]. 270message ListNotebookRuntimeTemplatesResponse { 271 // List of NotebookRuntimeTemplates in the requested page. 272 repeated NotebookRuntimeTemplate notebook_runtime_templates = 1; 273 274 // A token to retrieve next page of results. 275 // Pass to 276 // [ListNotebookRuntimeTemplatesRequest.page_token][google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesRequest.page_token] 277 // to obtain that page. 278 string next_page_token = 2; 279} 280 281// Request message for 282// [NotebookService.DeleteNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.DeleteNotebookRuntimeTemplate]. 283message DeleteNotebookRuntimeTemplateRequest { 284 // Required. The name of the NotebookRuntimeTemplate resource to be deleted. 285 // Format: 286 // `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` 287 string name = 1 [ 288 (google.api.field_behavior) = REQUIRED, 289 (google.api.resource_reference) = { 290 type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" 291 } 292 ]; 293} 294 295// Request message for 296// [NotebookService.AssignNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.AssignNotebookRuntime]. 297message AssignNotebookRuntimeRequest { 298 // Required. The resource name of the Location to get the NotebookRuntime 299 // assignment. Format: `projects/{project}/locations/{location}` 300 string parent = 1 [ 301 (google.api.field_behavior) = REQUIRED, 302 (google.api.resource_reference) = { 303 type: "locations.googleapis.com/Location" 304 } 305 ]; 306 307 // Required. The resource name of the NotebookRuntimeTemplate based on which a 308 // NotebookRuntime will be assigned (reuse or create a new one). 309 string notebook_runtime_template = 2 [ 310 (google.api.field_behavior) = REQUIRED, 311 (google.api.resource_reference) = { 312 type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" 313 } 314 ]; 315 316 // Required. Provide runtime specific information (e.g. runtime owner, 317 // notebook id) used for NotebookRuntime assignment. 318 NotebookRuntime notebook_runtime = 3 [(google.api.field_behavior) = REQUIRED]; 319 320 // Optional. User specified ID for the notebook runtime. 321 string notebook_runtime_id = 4 [(google.api.field_behavior) = OPTIONAL]; 322} 323 324// Metadata information for 325// [NotebookService.AssignNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.AssignNotebookRuntime]. 326message AssignNotebookRuntimeOperationMetadata { 327 // The operation generic information. 328 GenericOperationMetadata generic_metadata = 1; 329 330 // A human-readable message that shows the intermediate progress details of 331 // NotebookRuntime. 332 string progress_message = 2; 333} 334 335// Request message for 336// [NotebookService.GetNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.GetNotebookRuntime] 337message GetNotebookRuntimeRequest { 338 // Required. The name of the NotebookRuntime resource. 339 // Instead of checking whether the name is in valid NotebookRuntime resource 340 // name format, directly throw NotFound exception if there is no such 341 // NotebookRuntime in spanner. 342 string name = 1 [ 343 (google.api.field_behavior) = REQUIRED, 344 (google.api.resource_reference) = { 345 type: "aiplatform.googleapis.com/NotebookRuntime" 346 } 347 ]; 348} 349 350// Request message for 351// [NotebookService.ListNotebookRuntimes][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimes]. 352message ListNotebookRuntimesRequest { 353 // Required. The resource name of the Location from which to list the 354 // NotebookRuntimes. 355 // Format: `projects/{project}/locations/{location}` 356 string parent = 1 [ 357 (google.api.field_behavior) = REQUIRED, 358 (google.api.resource_reference) = { 359 type: "locations.googleapis.com/Location" 360 } 361 ]; 362 363 // Optional. An expression for filtering the results of the request. For field 364 // names both snake_case and camelCase are supported. 365 // 366 // * `notebookRuntime` supports = and !=. `notebookRuntime` represents the 367 // NotebookRuntime ID, 368 // i.e. the last segment of the NotebookRuntime's [resource name] 369 // [google.cloud.aiplatform.v1.NotebookRuntime.name]. 370 // * `displayName` supports = and != and regex. 371 // * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` 372 // represents the NotebookRuntimeTemplate ID, 373 // i.e. the last segment of the NotebookRuntimeTemplate's [resource name] 374 // [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. 375 // * `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, 376 // HEALTH_STATE_UNSPECIFIED]. 377 // * `runtimeState` supports = and !=. runtimeState enum: 378 // [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, 379 // STOPPED, BEING_UPGRADED, ERROR, INVALID]. 380 // * `runtimeUser` supports = and !=. 381 // * API version is UI only: `uiState` supports = and !=. uiState enum: 382 // [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, 383 // UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, 384 // UI_RESOURCE_STATE_CREATION_FAILED]. 385 // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: 386 // [USER_DEFINED, ONE_CLICK]. 387 // 388 // Some examples: 389 // 390 // * `notebookRuntime="notebookRuntime123"` 391 // * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` 392 // * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` 393 // * `healthState=HEALTHY` 394 // * `runtimeState=RUNNING` 395 // * `runtimeUser="[email protected]"` 396 // * `uiState=UI_RESOURCE_STATE_BEING_DELETED` 397 // * `notebookRuntimeType=USER_DEFINED` 398 string filter = 2 [(google.api.field_behavior) = OPTIONAL]; 399 400 // Optional. The standard list page size. 401 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 402 403 // Optional. The standard list page token. 404 // Typically obtained via 405 // [ListNotebookRuntimesResponse.next_page_token][google.cloud.aiplatform.v1.ListNotebookRuntimesResponse.next_page_token] 406 // of the previous 407 // [NotebookService.ListNotebookRuntimes][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimes] 408 // call. 409 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 410 411 // Optional. Mask specifying which fields to read. 412 google.protobuf.FieldMask read_mask = 5 413 [(google.api.field_behavior) = OPTIONAL]; 414 415 // Optional. A comma-separated list of fields to order by, sorted in ascending 416 // order. Use "desc" after a field name for descending. Supported fields: 417 // 418 // * `display_name` 419 // * `create_time` 420 // * `update_time` 421 // 422 // Example: `display_name, create_time desc`. 423 string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; 424} 425 426// Response message for 427// [NotebookService.ListNotebookRuntimes][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimes]. 428message ListNotebookRuntimesResponse { 429 // List of NotebookRuntimes in the requested page. 430 repeated NotebookRuntime notebook_runtimes = 1; 431 432 // A token to retrieve next page of results. 433 // Pass to 434 // [ListNotebookRuntimesRequest.page_token][google.cloud.aiplatform.v1.ListNotebookRuntimesRequest.page_token] 435 // to obtain that page. 436 string next_page_token = 2; 437} 438 439// Request message for 440// [NotebookService.DeleteNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.DeleteNotebookRuntime]. 441message DeleteNotebookRuntimeRequest { 442 // Required. The name of the NotebookRuntime resource to be deleted. 443 // Instead of checking whether the name is in valid NotebookRuntime resource 444 // name format, directly throw NotFound exception if there is no such 445 // NotebookRuntime in spanner. 446 string name = 1 [ 447 (google.api.field_behavior) = REQUIRED, 448 (google.api.resource_reference) = { 449 type: "aiplatform.googleapis.com/NotebookRuntime" 450 } 451 ]; 452} 453 454// Request message for 455// [NotebookService.UpgradeNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.UpgradeNotebookRuntime]. 456message UpgradeNotebookRuntimeRequest { 457 // Required. The name of the NotebookRuntime resource to be upgrade. 458 // Instead of checking whether the name is in valid NotebookRuntime resource 459 // name format, directly throw NotFound exception if there is no such 460 // NotebookRuntime in spanner. 461 string name = 1 [ 462 (google.api.field_behavior) = REQUIRED, 463 (google.api.resource_reference) = { 464 type: "aiplatform.googleapis.com/NotebookRuntime" 465 } 466 ]; 467} 468 469// Metadata information for 470// [NotebookService.UpgradeNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.UpgradeNotebookRuntime]. 471message UpgradeNotebookRuntimeOperationMetadata { 472 // The operation generic information. 473 GenericOperationMetadata generic_metadata = 1; 474 475 // A human-readable message that shows the intermediate progress details of 476 // NotebookRuntime. 477 string progress_message = 2; 478} 479 480// Response message for 481// [NotebookService.UpgradeNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.UpgradeNotebookRuntime]. 482message UpgradeNotebookRuntimeResponse {} 483 484// Request message for 485// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime]. 486message StartNotebookRuntimeRequest { 487 // Required. The name of the NotebookRuntime resource to be started. 488 // Instead of checking whether the name is in valid NotebookRuntime resource 489 // name format, directly throw NotFound exception if there is no such 490 // NotebookRuntime in spanner. 491 string name = 1 [ 492 (google.api.field_behavior) = REQUIRED, 493 (google.api.resource_reference) = { 494 type: "aiplatform.googleapis.com/NotebookRuntime" 495 } 496 ]; 497} 498 499// Metadata information for 500// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime]. 501message StartNotebookRuntimeOperationMetadata { 502 // The operation generic information. 503 GenericOperationMetadata generic_metadata = 1; 504 505 // A human-readable message that shows the intermediate progress details of 506 // NotebookRuntime. 507 string progress_message = 2; 508} 509 510// Response message for 511// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime]. 512message StartNotebookRuntimeResponse {} 513