From cbf8e95fbd0cba135d997762044f6ed5725045c0 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 25 Mar 2021 17:29:31 -0700 Subject: [PATCH] chore: migrate notebooks to the PHP microgenerator Committer: @miraleung PiperOrigin-RevId: 365159240 --- google/cloud/notebooks/v1beta1/BUILD.bazel | 15 ++--- .../cloud/notebooks/v1beta1/environment.proto | 2 +- google/cloud/notebooks/v1beta1/instance.proto | 57 +++++++++------- .../notebooks/v1beta1/notebooks_gapic.yaml | 8 --- google/cloud/notebooks/v1beta1/service.proto | 67 ++++++++++++------- 5 files changed, 83 insertions(+), 66 deletions(-) delete mode 100644 google/cloud/notebooks/v1beta1/notebooks_gapic.yaml diff --git a/google/cloud/notebooks/v1beta1/BUILD.bazel b/google/cloud/notebooks/v1beta1/BUILD.bazel index 672ad7967502b..283903f1fb7c3 100644 --- a/google/cloud/notebooks/v1beta1/BUILD.bazel +++ b/google/cloud/notebooks/v1beta1/BUILD.bazel @@ -175,13 +175,14 @@ py_gapic_assembly_pkg( ############################################################################## # PHP +# DO NOT OVERRIDE this PHP microgenerator section with autogenerated rules. ############################################################################## load( "@com_google_googleapis_imports//:imports.bzl", - "php_gapic_assembly_pkg", - "php_gapic_library", - "php_grpc_library", - "php_proto_library", + php_gapic_assembly_pkg = "php_gapic_assembly_pkg2", + php_gapic_library = "php_gapic_library2", + php_grpc_library = "php_grpc_library2", + php_proto_library = "php_proto_library2", ) php_proto_library( @@ -197,10 +198,8 @@ php_grpc_library( php_gapic_library( name = "notebooks_php_gapic", - src = ":notebooks_proto_with_info", - gapic_yaml = "notebooks_gapic.yaml", + srcs = [":notebooks_proto_with_info"], grpc_service_config = "notebooks_grpc_service_config.json", - package = "google.cloud.notebooks.v1beta1", service_yaml = "notebooks_v1beta1.yaml", deps = [ ":notebooks_php_grpc", @@ -251,8 +250,8 @@ nodejs_gapic_assembly_pkg( ############################################################################## load( "@com_google_googleapis_imports//:imports.bzl", - "ruby_gapic_assembly_pkg", "ruby_cloud_gapic_library", + "ruby_gapic_assembly_pkg", "ruby_grpc_library", "ruby_proto_library", ) diff --git a/google/cloud/notebooks/v1beta1/environment.proto b/google/cloud/notebooks/v1beta1/environment.proto index 1f5ee9963e32c..ceee46cd52819 100644 --- a/google/cloud/notebooks/v1beta1/environment.proto +++ b/google/cloud/notebooks/v1beta1/environment.proto @@ -23,7 +23,7 @@ import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks"; option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1"; -option php_namespace = "Google\\Cloud\\Notebooks\\V1Beta1"; +option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1"; option ruby_package = "Google::Cloud::Notebooks::V1beta1"; option java_multiple_files = true; option java_outer_classname = "EnvironmentProto"; diff --git a/google/cloud/notebooks/v1beta1/instance.proto b/google/cloud/notebooks/v1beta1/instance.proto index e1cf91f9817bc..c35d8e513f104 100644 --- a/google/cloud/notebooks/v1beta1/instance.proto +++ b/google/cloud/notebooks/v1beta1/instance.proto @@ -165,15 +165,18 @@ message Instance { // Cloud Storage path (`gs://path-to-file/file-name`). string post_startup_script = 4; - // Output only. The proxy endpoint that is used to access the Jupyter notebook. + // Output only. The proxy endpoint that is used to access the Jupyter + // notebook. string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Input only. The owner of this instance after creation. Format: `alias@example.com` + // Input only. The owner of this instance after creation. Format: + // `alias@example.com` // // Currently supports one owner only. If not specified, all of the service // account users of your VM instance's service account can use // the instance. - repeated string instance_owners = 6 [(google.api.field_behavior) = INPUT_ONLY]; + repeated string instance_owners = 6 + [(google.api.field_behavior) = INPUT_ONLY]; // The service account on this instance, giving access to other Google // Cloud services. @@ -185,7 +188,8 @@ message Instance { // is used. string service_account = 7; - // Required. The [Compute Engine machine type](https://cloud.google.com/compute/docs/machine-types) of this + // Required. The [Compute Engine machine + // type](https://cloud.google.com/compute/docs/machine-types) of this // instance. string machine_type = 8 [(google.api.field_behavior) = REQUIRED]; @@ -208,37 +212,40 @@ message Instance { // If not specified, we'll automatically choose from official GPU drivers. string custom_gpu_driver_path = 12; - // Input only. The type of the boot disk attached to this instance, defaults to - // standard persistent disk (`PD_STANDARD`). + // Input only. The type of the boot disk attached to this instance, defaults + // to standard persistent disk (`PD_STANDARD`). DiskType boot_disk_type = 13 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The size of the boot disk in GB attached to this instance, up to a maximum - // of 64000 GB (64 TB). The minimum recommended value is - // 100 GB. If not specified, this defaults to 100. + // Input only. The size of the boot disk in GB attached to this instance, up + // to a maximum of 64000 GB (64 TB). The minimum recommended value + // is 100 GB. If not specified, this defaults to 100. int64 boot_disk_size_gb = 14 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The type of the data disk attached to this instance, defaults to - // standard persistent disk (`PD_STANDARD`). + // Input only. The type of the data disk attached to this instance, defaults + // to standard persistent disk (`PD_STANDARD`). DiskType data_disk_type = 25 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The size of the data disk in GB attached to this instance, up to a maximum - // of 64000 GB (64 TB). You can choose the size of the data disk - // based on how big your notebooks and data are. If not specified, this - // defaults to 100. + // Input only. The size of the data disk in GB attached to this instance, up + // to a maximum of 64000 GB (64 TB). You can choose the size of the + // data disk based on how big your notebooks and data are. If not specified, + // this defaults to 100. int64 data_disk_size_gb = 26 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. If true, the data disk will not be auto deleted when deleting the instance. + // Input only. If true, the data disk will not be auto deleted when deleting + // the instance. bool no_remove_data_disk = 27 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. - DiskEncryption disk_encryption = 15 [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Disk encryption method used on the boot and data disks, + // defaults to GMEK. + DiskEncryption disk_encryption = 15 + [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption - // is CMEK. - // Format: + // Input only. The KMS key used to encrypt the disks, only applicable if + // disk_encryption is CMEK. Format: // `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` // - // Learn more about [using your own encryption keys]( https://cloud.google.com/kms/docs/quickstart). + // Learn more about [using your own encryption keys]( + // https://cloud.google.com/kms/docs/quickstart). string kms_key = 16 [(google.api.field_behavior) = INPUT_ONLY]; // If true, no public IP will be assigned to this instance. @@ -265,8 +272,10 @@ message Instance { map metadata = 22; // Output only. Instance creation time. - google.protobuf.Timestamp create_time = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Instance update time. - google.protobuf.Timestamp update_time = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/google/cloud/notebooks/v1beta1/notebooks_gapic.yaml b/google/cloud/notebooks/v1beta1/notebooks_gapic.yaml deleted file mode 100644 index b98aa012b8bce..0000000000000 --- a/google/cloud/notebooks/v1beta1/notebooks_gapic.yaml +++ /dev/null @@ -1,8 +0,0 @@ -type: com.google.api.codegen.ConfigProto -config_schema_version: 2.0.0 -language_settings: - python: - package_name: google.cloud.notebooks_v1beta1.gapic - nodejs: - package_name: notebooks.v1beta1 - domain_layer_location: google-cloud diff --git a/google/cloud/notebooks/v1beta1/service.proto b/google/cloud/notebooks/v1beta1/service.proto index 8c1b58c8d16be..06064336cc0d5 100644 --- a/google/cloud/notebooks/v1beta1/service.proto +++ b/google/cloud/notebooks/v1beta1/service.proto @@ -35,7 +35,8 @@ option java_package = "com.google.cloud.notebooks.v1beta1"; // API v1beta1 service for Cloud AI Platform Notebooks. service NotebookService { option (google.api.default_host) = "notebooks.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Lists instances in a given project and location. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { @@ -52,7 +53,8 @@ service NotebookService { } // Creates a new Instance in a given project and location. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/instances" body: "instance" @@ -67,7 +69,8 @@ service NotebookService { // Legacy instances are instances created with the legacy Compute Engine // calls. They are not manageable by the Notebooks API out of the box. This // call makes these instances manageable by the Notebooks API. - rpc RegisterInstance(RegisterInstanceRequest) returns (google.longrunning.Operation) { + rpc RegisterInstance(RegisterInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/instances:register" body: "*" @@ -79,7 +82,8 @@ service NotebookService { } // Updates the guest accelerators of a single Instance. - rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest) returns (google.longrunning.Operation) { + rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setAccelerator" body: "*" @@ -91,7 +95,8 @@ service NotebookService { } // Updates the machine type of a single Instance. - rpc SetInstanceMachineType(SetInstanceMachineTypeRequest) returns (google.longrunning.Operation) { + rpc SetInstanceMachineType(SetInstanceMachineTypeRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setMachineType" body: "*" @@ -103,7 +108,8 @@ service NotebookService { } // Updates the labels of an Instance. - rpc SetInstanceLabels(SetInstanceLabelsRequest) returns (google.longrunning.Operation) { + rpc SetInstanceLabels(SetInstanceLabelsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setLabels" body: "*" @@ -115,7 +121,8 @@ service NotebookService { } // Deletes a single Instance. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" }; @@ -126,7 +133,8 @@ service NotebookService { } // Starts a notebook instance. - rpc StartInstance(StartInstanceRequest) returns (google.longrunning.Operation) { + rpc StartInstance(StartInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:start" body: "*" @@ -150,7 +158,8 @@ service NotebookService { } // Resets a notebook instance. - rpc ResetInstance(ResetInstanceRequest) returns (google.longrunning.Operation) { + rpc ResetInstance(ResetInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:reset" body: "*" @@ -165,7 +174,8 @@ service NotebookService { // report their latest instance information to the Notebooks // API server. The server will merge the reported information to // the instance metadata store. Do not use this method directly. - rpc ReportInstanceInfo(ReportInstanceInfoRequest) returns (google.longrunning.Operation) { + rpc ReportInstanceInfo(ReportInstanceInfoRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:report" body: "*" @@ -177,14 +187,16 @@ service NotebookService { } // Check if a notebook instance is upgradable. - rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest) returns (IsInstanceUpgradeableResponse) { + rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest) + returns (IsInstanceUpgradeableResponse) { option (google.api.http) = { get: "/v1beta1/{notebook_instance=projects/*/locations/*/instances/*}:isUpgradeable" }; } // Upgrades a notebook instance to the latest version. - rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) { + rpc UpgradeInstance(UpgradeInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" body: "*" @@ -197,7 +209,8 @@ service NotebookService { // Allows notebook instances to // call this endpoint to upgrade themselves. Do not use this method directly. - rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) returns (google.longrunning.Operation) { + rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgradeInternal" body: "*" @@ -209,7 +222,8 @@ service NotebookService { } // Lists environments in a project. - rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { + rpc ListEnvironments(ListEnvironmentsRequest) + returns (ListEnvironmentsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*}/environments" }; @@ -223,7 +237,8 @@ service NotebookService { } // Creates a new Environment. - rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { + rpc CreateEnvironment(CreateEnvironmentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/environments" body: "environment" @@ -235,7 +250,8 @@ service NotebookService { } // Deletes a single Environment. - rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { + rpc DeleteEnvironment(DeleteEnvironmentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/environments/*}" }; @@ -266,7 +282,8 @@ message OperationMetadata { // Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6; // API version used to start the operation. @@ -347,10 +364,10 @@ message SetInstanceAcceleratorRequest { // Required. Type of this accelerator. Instance.AcceleratorType type = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Count of cores of this accelerator. Note that not all combinations - // of `type` and `core_count` are valid. Check [GPUs on - // Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to - // find a valid combination. TPUs are not supported. + // Required. Count of cores of this accelerator. Note that not all + // combinations of `type` and `core_count` are valid. Check [GPUs on Compute + // Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a + // valid combination. TPUs are not supported. int64 core_count = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -495,10 +512,10 @@ message CreateEnvironmentRequest { // Required. Format: `projects/{project_id}/locations/{location}` string parent = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. User-defined unique ID of this environment. The `environment_id` must - // be 1 to 63 characters long and contain only lowercase letters, - // numeric characters, and dashes. The first character must be a lowercase - // letter and the last character cannot be a dash. + // Required. User-defined unique ID of this environment. The `environment_id` + // must be 1 to 63 characters long and contain only lowercase letters, numeric + // characters, and dashes. The first character must be a lowercase letter and + // the last character cannot be a dash. string environment_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The environment to be created.