From 98ae60929199d002c17806782584dcc3c3dc19f1 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Fri, 29 Mar 2024 15:20:15 -0700 Subject: [PATCH] feat: add NotebookRuntime resource and APIs to public v1 client library PiperOrigin-RevId: 620353345 --- google/cloud/aiplatform/v1/BUILD.bazel | 6 + google/cloud/aiplatform/v1/aiplatform_v1.yaml | 9 + .../aiplatform/v1/machine_resources.proto | 14 + google/cloud/aiplatform/v1/network_spec.proto | 50 ++ .../aiplatform/v1/notebook_euc_config.proto | 44 ++ .../v1/notebook_idle_shutdown_config.proto | 41 ++ .../aiplatform/v1/notebook_runtime.proto | 274 ++++++++++ .../v1/notebook_runtime_template_ref.proto | 39 ++ .../aiplatform/v1/notebook_service.proto | 512 ++++++++++++++++++ 9 files changed, 989 insertions(+) create mode 100644 google/cloud/aiplatform/v1/network_spec.proto create mode 100644 google/cloud/aiplatform/v1/notebook_euc_config.proto create mode 100644 google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto create mode 100644 google/cloud/aiplatform/v1/notebook_runtime.proto create mode 100644 google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto create mode 100644 google/cloud/aiplatform/v1/notebook_service.proto diff --git a/google/cloud/aiplatform/v1/BUILD.bazel b/google/cloud/aiplatform/v1/BUILD.bazel index 78399af13873c..845ce282ac69f 100644 --- a/google/cloud/aiplatform/v1/BUILD.bazel +++ b/google/cloud/aiplatform/v1/BUILD.bazel @@ -96,6 +96,12 @@ proto_library( "model_service.proto", "model_garden_service.proto", "nas_job.proto", + "network_spec.proto", + "notebook_euc_config.proto", + "notebook_idle_shutdown_config.proto", + "notebook_runtime.proto", + "notebook_runtime_template_ref.proto", + "notebook_service.proto", "openapi.proto", "operation.proto", "pipeline_failure_policy.proto", diff --git a/google/cloud/aiplatform/v1/aiplatform_v1.yaml b/google/cloud/aiplatform/v1/aiplatform_v1.yaml index 457edca26169d..5aee1a2aab8f0 100644 --- a/google/cloud/aiplatform/v1/aiplatform_v1.yaml +++ b/google/cloud/aiplatform/v1/aiplatform_v1.yaml @@ -21,6 +21,7 @@ apis: - name: google.cloud.aiplatform.v1.MigrationService - name: google.cloud.aiplatform.v1.ModelGardenService - name: google.cloud.aiplatform.v1.ModelService +- name: google.cloud.aiplatform.v1.NotebookService - name: google.cloud.aiplatform.v1.PipelineService - name: google.cloud.aiplatform.v1.PredictionService - name: google.cloud.aiplatform.v1.ScheduleService @@ -32,6 +33,7 @@ apis: - name: google.longrunning.Operations types: +- name: google.cloud.aiplatform.v1.AssignNotebookRuntimeOperationMetadata - name: google.cloud.aiplatform.v1.BatchCreateFeaturesOperationMetadata - name: google.cloud.aiplatform.v1.BatchCreateFeaturesResponse - name: google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata @@ -55,6 +57,7 @@ types: - name: google.cloud.aiplatform.v1.CreateIndexEndpointOperationMetadata - name: google.cloud.aiplatform.v1.CreateIndexOperationMetadata - name: google.cloud.aiplatform.v1.CreateMetadataStoreOperationMetadata +- name: google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateOperationMetadata - name: google.cloud.aiplatform.v1.CreateRegistryFeatureOperationMetadata - name: google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata - name: google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata @@ -88,6 +91,7 @@ types: - name: google.cloud.aiplatform.v1.PurgeExecutionsResponse - name: google.cloud.aiplatform.v1.RestoreDatasetVersionOperationMetadata - name: google.cloud.aiplatform.v1.SpecialistPool +- name: google.cloud.aiplatform.v1.StartNotebookRuntimeOperationMetadata - name: google.cloud.aiplatform.v1.SuggestTrialsMetadata - name: google.cloud.aiplatform.v1.SuggestTrialsResponse - name: google.cloud.aiplatform.v1.UndeployIndexOperationMetadata @@ -106,6 +110,7 @@ types: - name: google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobOperationMetadata - name: google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata - name: google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata +- name: google.cloud.aiplatform.v1.UpgradeNotebookRuntimeOperationMetadata - name: google.cloud.aiplatform.v1.UploadModelOperationMetadata - name: google.cloud.aiplatform.v1.UploadModelResponse - name: google.cloud.aiplatform.v1.schema.ImageBoundingBoxAnnotation @@ -718,6 +723,10 @@ authentication: oauth: canonical_scopes: |- https://www.googleapis.com/auth/cloud-platform + - selector: 'google.cloud.aiplatform.v1.NotebookService.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform - selector: 'google.cloud.aiplatform.v1.PipelineService.*' oauth: canonical_scopes: |- diff --git a/google/cloud/aiplatform/v1/machine_resources.proto b/google/cloud/aiplatform/v1/machine_resources.proto index 041ea2e3d0ad5..2870086fcc7a2 100644 --- a/google/cloud/aiplatform/v1/machine_resources.proto +++ b/google/cloud/aiplatform/v1/machine_resources.proto @@ -232,3 +232,17 @@ message AutoscalingMetricSpec { // (representing 60%) if not provided. int32 target = 2; } + +// A set of Shielded Instance options. +// See [Images using supported Shielded VM +// features](https://cloud.google.com/compute/docs/instances/modifying-shielded-vm). +message ShieldedVmConfig { + // Defines whether the instance has [Secure + // Boot](https://cloud.google.com/compute/shielded-vm/docs/shielded-vm#secure-boot) + // enabled. + // + // Secure Boot helps ensure that the system only runs authentic software by + // verifying the digital signature of all boot components, and halting the + // boot process if signature verification fails. + bool enable_secure_boot = 1; +} diff --git a/google/cloud/aiplatform/v1/network_spec.proto b/google/cloud/aiplatform/v1/network_spec.proto new file mode 100644 index 0000000000000..1e8b945706d1e --- /dev/null +++ b/google/cloud/aiplatform/v1/network_spec.proto @@ -0,0 +1,50 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NetworkSpecProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Subnetwork" + pattern: "projects/{project}/regions/{region}/subnetworks/{subnetwork}" +}; + +// Network spec. +message NetworkSpec { + // Whether to enable public internet access. Default false. + bool enable_internet_access = 1; + + // The full name of the Google Compute Engine + // [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) + string network = 2 [ + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // The name of the subnet that this instance is in. + // Format: + // `projects/{project_id_or_number}/regions/{region}/subnetworks/{subnetwork_id}` + string subnetwork = 3 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Subnetwork" + }]; +} diff --git a/google/cloud/aiplatform/v1/notebook_euc_config.proto b/google/cloud/aiplatform/v1/notebook_euc_config.proto new file mode 100644 index 0000000000000..70e5388a90ad8 --- /dev/null +++ b/google/cloud/aiplatform/v1/notebook_euc_config.proto @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookEucConfigProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The euc configuration of NotebookRuntimeTemplate. +message NotebookEucConfig { + // Input only. Whether EUC is disabled in this NotebookRuntimeTemplate. + // In proto3, the default value of a boolean is false. In this way, by default + // EUC will be enabled for NotebookRuntimeTemplate. + bool euc_disabled = 1 [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Whether ActAs check is bypassed for service account attached + // to the VM. If false, we need ActAs check for the default Compute Engine + // Service account. When a Runtime is created, a VM is allocated using Default + // Compute Engine Service Account. Any user requesting to use this Runtime + // requires Service Account User (ActAs) permission over this SA. If true, + // Runtime owner is using EUC and does not require the above permission as VM + // no longer use default Compute Engine SA, but a P4SA. + bool bypass_actas_check = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto b/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto new file mode 100644 index 0000000000000..9dfb02185d7e2 --- /dev/null +++ b/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookIdleShutdownConfigProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The idle shutdown configuration of NotebookRuntimeTemplate, which contains +// the idle_timeout as required field. +message NotebookIdleShutdownConfig { + // Required. Duration is accurate to the second. In Notebook, Idle Timeout is + // accurate to minute so the range of idle_timeout (second) is: 10 * 60 ~ 1440 + // * 60. + google.protobuf.Duration idle_timeout = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Whether Idle Shutdown is disabled in this NotebookRuntimeTemplate. + bool idle_shutdown_disabled = 2; +} diff --git a/google/cloud/aiplatform/v1/notebook_runtime.proto b/google/cloud/aiplatform/v1/notebook_runtime.proto new file mode 100644 index 0000000000000..31bb98fdb924a --- /dev/null +++ b/google/cloud/aiplatform/v1/notebook_runtime.proto @@ -0,0 +1,274 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; +import "google/cloud/aiplatform/v1/network_spec.proto"; +import "google/cloud/aiplatform/v1/notebook_euc_config.proto"; +import "google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto"; +import "google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookRuntimeProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents a notebook runtime type. +enum NotebookRuntimeType { + // Unspecified notebook runtime type, NotebookRuntimeType will default to + // USER_DEFINED. + NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED = 0; + + // runtime or template with coustomized configurations from user. + USER_DEFINED = 1; + + // runtime or template with system defined configurations. + ONE_CLICK = 2; +} + +// A template that specifies runtime configurations such as machine type, +// runtime version, network configurations, etc. +// Multiple runtimes can be created from a runtime template. +message NotebookRuntimeTemplate { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" + pattern: "projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}" + }; + + // Output only. The resource name of the NotebookRuntimeTemplate. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the NotebookRuntimeTemplate. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the NotebookRuntimeTemplate. + string description = 3; + + // Output only. The default template to use if not specified. + bool is_default = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. The specification of a single machine for the + // template. + MachineSpec machine_spec = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The specification of [persistent + // disk][https://cloud.google.com/compute/docs/disks/persistent-disks] + // attached to the runtime as data disk storage. + PersistentDiskSpec data_persistent_disk_spec = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Network spec. + NetworkSpec network_spec = 12 [(google.api.field_behavior) = OPTIONAL]; + + // The service account that the runtime workload runs as. + // You can use any service account within the same project, but you + // must have the service account user permission to use the instance. + // + // If not specified, the [Compute Engine default service + // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. + string service_account = 13; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 14; + + // The labels with user-defined metadata to organize the + // NotebookRuntimeTemplates. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 15; + + // The idle shutdown configuration of NotebookRuntimeTemplate. This config + // will only be set when idle shutdown is enabled. + NotebookIdleShutdownConfig idle_shutdown_config = 17; + + // EUC configuration of the NotebookRuntimeTemplate. + NotebookEucConfig euc_config = 18; + + // Output only. Timestamp when this NotebookRuntimeTemplate was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this NotebookRuntimeTemplate was most recently + // updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. The type of the notebook runtime template. + NotebookRuntimeType notebook_runtime_type = 19 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. Runtime Shielded VM spec. + ShieldedVmConfig shielded_vm_config = 20 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The Compute Engine tags to add to runtime (see [Tagging + // instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + repeated string network_tags = 21 [(google.api.field_behavior) = OPTIONAL]; +} + +// A runtime is a virtual machine allocated to a particular user for a +// particular Notebook file on temporary basis with lifetime limited to 24 +// hours. +message NotebookRuntime { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/NotebookRuntime" + pattern: "projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}" + }; + + // The substate of the NotebookRuntime to display health information. + enum HealthState { + // Unspecified health state. + HEALTH_STATE_UNSPECIFIED = 0; + + // NotebookRuntime is in healthy state. Applies to ACTIVE state. + HEALTHY = 1; + + // NotebookRuntime is in unhealthy state. Applies to ACTIVE state. + UNHEALTHY = 2; + } + + // The substate of the NotebookRuntime to display state of runtime. + // The resource of NotebookRuntime is in ACTIVE state for these sub state. + enum RuntimeState { + // Unspecified runtime state. + RUNTIME_STATE_UNSPECIFIED = 0; + + // NotebookRuntime is in running state. + RUNNING = 1; + + // NotebookRuntime is in starting state. + BEING_STARTED = 2; + + // NotebookRuntime is in stopping state. + BEING_STOPPED = 3; + + // NotebookRuntime is in stopped state. + STOPPED = 4; + + // NotebookRuntime is in upgrading state. It is in the middle of upgrading + // process. + BEING_UPGRADED = 5; + + // NotebookRuntime was unable to start/stop properly. + ERROR = 100; + + // NotebookRuntime is in invalid state. Cannot be recovered. + INVALID = 101; + } + + // Output only. The resource name of the NotebookRuntime. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user email of the NotebookRuntime. + string runtime_user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The pointer to NotebookRuntimeTemplate this NotebookRuntime is + // created from. + NotebookRuntimeTemplateRef notebook_runtime_template_ref = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The proxy endpoint used to access the NotebookRuntime. + string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this NotebookRuntime was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this NotebookRuntime was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The health state of the NotebookRuntime. + HealthState health_state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the NotebookRuntime. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 10 [(google.api.field_behavior) = REQUIRED]; + + // The description of the NotebookRuntime. + string description = 11; + + // Output only. The service account that the NotebookRuntime workload runs as. + string service_account = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime (instance) state of the NotebookRuntime. + RuntimeState runtime_state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether NotebookRuntime is upgradable. + bool is_upgradable = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your + // NotebookRuntime. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one NotebookRuntime + // (System labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for NotebookRuntime: + // + // * "aiplatform.googleapis.com/notebook_runtime_gce_instance_id": output + // only, its value is the Compute Engine instance id. + // * "aiplatform.googleapis.com/colab_enterprise_entry_service": its value is + // either "bigquery" or "vertex"; if absent, it should be "vertex". This is to + // describe the entry service, either BigQuery or Vertex. + map labels = 16; + + // Output only. Timestamp when this NotebookRuntime will be expired: + // 1. System Predefined NotebookRuntime: 24 hours after creation. After + // expiration, system predifined runtime will be deleted. + // 2. User created NotebookRuntime: 6 months after last upgrade. After + // expiration, user created runtime will be stopped and allowed for upgrade. + google.protobuf.Timestamp expiration_time = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The VM os image version of NotebookRuntime. + string version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the notebook runtime. + NotebookRuntimeType notebook_runtime_type = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The Compute Engine tags to add to runtime (see [Tagging + // instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + repeated string network_tags = 25 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto b/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto new file mode 100644 index 0000000000000..d5cd83506a476 --- /dev/null +++ b/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto @@ -0,0 +1,39 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookRuntimeTemplateRefProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Points to a NotebookRuntimeTemplateRef. +message NotebookRuntimeTemplateRef { + // Immutable. A resource name of the NotebookRuntimeTemplate. + string notebook_runtime_template = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" + } + ]; +} diff --git a/google/cloud/aiplatform/v1/notebook_service.proto b/google/cloud/aiplatform/v1/notebook_service.proto new file mode 100644 index 0000000000000..3669f7fe6e29f --- /dev/null +++ b/google/cloud/aiplatform/v1/notebook_service.proto @@ -0,0 +1,512 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/notebook_runtime.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The interface for Vertex Notebook service (a.k.a. Colab on Workbench). +service NotebookService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a NotebookRuntimeTemplate. + rpc CreateNotebookRuntimeTemplate(CreateNotebookRuntimeTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/notebookRuntimeTemplates" + body: "notebook_runtime_template" + }; + option (google.api.method_signature) = + "parent,notebook_runtime_template,notebook_runtime_template_id"; + option (google.longrunning.operation_info) = { + response_type: "NotebookRuntimeTemplate" + metadata_type: "CreateNotebookRuntimeTemplateOperationMetadata" + }; + } + + // Gets a NotebookRuntimeTemplate. + rpc GetNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest) + returns (NotebookRuntimeTemplate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists NotebookRuntimeTemplates in a Location. + rpc ListNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest) + returns (ListNotebookRuntimeTemplatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/notebookRuntimeTemplates" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a NotebookRuntimeTemplate. + rpc DeleteNotebookRuntimeTemplate(DeleteNotebookRuntimeTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Assigns a NotebookRuntime to a user for a particular Notebook file. This + // method will either returns an existing assignment or generates a new one. + rpc AssignNotebookRuntime(AssignNotebookRuntimeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/notebookRuntimes:assign" + body: "*" + }; + option (google.api.method_signature) = + "parent,notebook_runtime_template,notebook_runtime,notebook_runtime_id"; + option (google.longrunning.operation_info) = { + response_type: "NotebookRuntime" + metadata_type: "AssignNotebookRuntimeOperationMetadata" + }; + } + + // Gets a NotebookRuntime. + rpc GetNotebookRuntime(GetNotebookRuntimeRequest) returns (NotebookRuntime) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists NotebookRuntimes in a Location. + rpc ListNotebookRuntimes(ListNotebookRuntimesRequest) + returns (ListNotebookRuntimesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/notebookRuntimes" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a NotebookRuntime. + rpc DeleteNotebookRuntime(DeleteNotebookRuntimeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Upgrades a NotebookRuntime. + rpc UpgradeNotebookRuntime(UpgradeNotebookRuntimeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}:upgrade" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UpgradeNotebookRuntimeResponse" + metadata_type: "UpgradeNotebookRuntimeOperationMetadata" + }; + } + + // Starts a NotebookRuntime. + rpc StartNotebookRuntime(StartNotebookRuntimeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/notebookRuntimes/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "StartNotebookRuntimeResponse" + metadata_type: "StartNotebookRuntimeOperationMetadata" + }; + } +} + +// Request message for +// [NotebookService.CreateNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.CreateNotebookRuntimeTemplate]. +message CreateNotebookRuntimeTemplateRequest { + // Required. The resource name of the Location to create the + // NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The NotebookRuntimeTemplate to create. + NotebookRuntimeTemplate notebook_runtime_template = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. User specified ID for the notebook runtime template. + string notebook_runtime_template_id = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata information for +// [NotebookService.CreateNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.CreateNotebookRuntimeTemplate]. +message CreateNotebookRuntimeTemplateOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [NotebookService.GetNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.GetNotebookRuntimeTemplate] +message GetNotebookRuntimeTemplateRequest { + // Required. The name of the NotebookRuntimeTemplate resource. + // Format: + // `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" + } + ]; +} + +// Request message for +// [NotebookService.ListNotebookRuntimeTemplates][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimeTemplates]. +message ListNotebookRuntimeTemplatesRequest { + // Required. The resource name of the Location from which to list the + // NotebookRuntimeTemplates. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field + // names both snake_case and camelCase are supported. + // + // * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + // represents the NotebookRuntimeTemplate ID, + // i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + // [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + // * `display_name` supports = and != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + // [USER_DEFINED, ONE_CLICK]. + // + // Some examples: + // + // * `notebookRuntimeTemplate=notebookRuntimeTemplate123` + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + // * `notebookRuntimeType=USER_DEFINED` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListNotebookRuntimeTemplatesResponse.next_page_token][google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesResponse.next_page_token] + // of the previous + // [NotebookService.ListNotebookRuntimeTemplates][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimeTemplates] + // call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. Supported fields: + // + // * `display_name` + // * `create_time` + // * `update_time` + // + // Example: `display_name, create_time desc`. + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [NotebookService.ListNotebookRuntimeTemplates][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimeTemplates]. +message ListNotebookRuntimeTemplatesResponse { + // List of NotebookRuntimeTemplates in the requested page. + repeated NotebookRuntimeTemplate notebook_runtime_templates = 1; + + // A token to retrieve next page of results. + // Pass to + // [ListNotebookRuntimeTemplatesRequest.page_token][google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [NotebookService.DeleteNotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookService.DeleteNotebookRuntimeTemplate]. +message DeleteNotebookRuntimeTemplateRequest { + // Required. The name of the NotebookRuntimeTemplate resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" + } + ]; +} + +// Request message for +// [NotebookService.AssignNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.AssignNotebookRuntime]. +message AssignNotebookRuntimeRequest { + // Required. The resource name of the Location to get the NotebookRuntime + // assignment. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The resource name of the NotebookRuntimeTemplate based on which a + // NotebookRuntime will be assigned (reuse or create a new one). + string notebook_runtime_template = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntimeTemplate" + } + ]; + + // Required. Provide runtime specific information (e.g. runtime owner, + // notebook id) used for NotebookRuntime assignment. + NotebookRuntime notebook_runtime = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User specified ID for the notebook runtime. + string notebook_runtime_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata information for +// [NotebookService.AssignNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.AssignNotebookRuntime]. +message AssignNotebookRuntimeOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // A human-readable message that shows the intermediate progress details of + // NotebookRuntime. + string progress_message = 2; +} + +// Request message for +// [NotebookService.GetNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.GetNotebookRuntime] +message GetNotebookRuntimeRequest { + // Required. The name of the NotebookRuntime resource. + // Instead of checking whether the name is in valid NotebookRuntime resource + // name format, directly throw NotFound exception if there is no such + // NotebookRuntime in spanner. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntime" + } + ]; +} + +// Request message for +// [NotebookService.ListNotebookRuntimes][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimes]. +message ListNotebookRuntimesRequest { + // Required. The resource name of the Location from which to list the + // NotebookRuntimes. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field + // names both snake_case and camelCase are supported. + // + // * `notebookRuntime` supports = and !=. `notebookRuntime` represents the + // NotebookRuntime ID, + // i.e. the last segment of the NotebookRuntime's [resource name] + // [google.cloud.aiplatform.v1.NotebookRuntime.name]. + // * `displayName` supports = and != and regex. + // * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + // represents the NotebookRuntimeTemplate ID, + // i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + // [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + // * `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, + // HEALTH_STATE_UNSPECIFIED]. + // * `runtimeState` supports = and !=. runtimeState enum: + // [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, + // STOPPED, BEING_UPGRADED, ERROR, INVALID]. + // * `runtimeUser` supports = and !=. + // * API version is UI only: `uiState` supports = and !=. uiState enum: + // [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, + // UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, + // UI_RESOURCE_STATE_CREATION_FAILED]. + // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + // [USER_DEFINED, ONE_CLICK]. + // + // Some examples: + // + // * `notebookRuntime="notebookRuntime123"` + // * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + // * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` + // * `healthState=HEALTHY` + // * `runtimeState=RUNNING` + // * `runtimeUser="test@google.com"` + // * `uiState=UI_RESOURCE_STATE_BEING_DELETED` + // * `notebookRuntimeType=USER_DEFINED` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListNotebookRuntimesResponse.next_page_token][google.cloud.aiplatform.v1.ListNotebookRuntimesResponse.next_page_token] + // of the previous + // [NotebookService.ListNotebookRuntimes][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimes] + // call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. Supported fields: + // + // * `display_name` + // * `create_time` + // * `update_time` + // + // Example: `display_name, create_time desc`. + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [NotebookService.ListNotebookRuntimes][google.cloud.aiplatform.v1.NotebookService.ListNotebookRuntimes]. +message ListNotebookRuntimesResponse { + // List of NotebookRuntimes in the requested page. + repeated NotebookRuntime notebook_runtimes = 1; + + // A token to retrieve next page of results. + // Pass to + // [ListNotebookRuntimesRequest.page_token][google.cloud.aiplatform.v1.ListNotebookRuntimesRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [NotebookService.DeleteNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.DeleteNotebookRuntime]. +message DeleteNotebookRuntimeRequest { + // Required. The name of the NotebookRuntime resource to be deleted. + // Instead of checking whether the name is in valid NotebookRuntime resource + // name format, directly throw NotFound exception if there is no such + // NotebookRuntime in spanner. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntime" + } + ]; +} + +// Request message for +// [NotebookService.UpgradeNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.UpgradeNotebookRuntime]. +message UpgradeNotebookRuntimeRequest { + // Required. The name of the NotebookRuntime resource to be upgrade. + // Instead of checking whether the name is in valid NotebookRuntime resource + // name format, directly throw NotFound exception if there is no such + // NotebookRuntime in spanner. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntime" + } + ]; +} + +// Metadata information for +// [NotebookService.UpgradeNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.UpgradeNotebookRuntime]. +message UpgradeNotebookRuntimeOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // A human-readable message that shows the intermediate progress details of + // NotebookRuntime. + string progress_message = 2; +} + +// Response message for +// [NotebookService.UpgradeNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.UpgradeNotebookRuntime]. +message UpgradeNotebookRuntimeResponse {} + +// Request message for +// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime]. +message StartNotebookRuntimeRequest { + // Required. The name of the NotebookRuntime resource to be started. + // Instead of checking whether the name is in valid NotebookRuntime resource + // name format, directly throw NotFound exception if there is no such + // NotebookRuntime in spanner. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NotebookRuntime" + } + ]; +} + +// Metadata information for +// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime]. +message StartNotebookRuntimeOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // A human-readable message that shows the intermediate progress details of + // NotebookRuntime. + string progress_message = 2; +} + +// Response message for +// [NotebookService.StartNotebookRuntime][google.cloud.aiplatform.v1.NotebookService.StartNotebookRuntime]. +message StartNotebookRuntimeResponse {}