Skip to content

Commit cbf8e95

Browse files
Google APIscopybara-github
authored andcommitted
chore: migrate notebooks to the PHP microgenerator
Committer: @miraleung PiperOrigin-RevId: 365159240
1 parent bf845b2 commit cbf8e95

5 files changed

Lines changed: 83 additions & 66 deletions

File tree

google/cloud/notebooks/v1beta1/BUILD.bazel

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,14 @@ py_gapic_assembly_pkg(
175175

176176
##############################################################################
177177
# PHP
178+
# DO NOT OVERRIDE this PHP microgenerator section with autogenerated rules.
178179
##############################################################################
179180
load(
180181
"@com_google_googleapis_imports//:imports.bzl",
181-
"php_gapic_assembly_pkg",
182-
"php_gapic_library",
183-
"php_grpc_library",
184-
"php_proto_library",
182+
php_gapic_assembly_pkg = "php_gapic_assembly_pkg2",
183+
php_gapic_library = "php_gapic_library2",
184+
php_grpc_library = "php_grpc_library2",
185+
php_proto_library = "php_proto_library2",
185186
)
186187

187188
php_proto_library(
@@ -197,10 +198,8 @@ php_grpc_library(
197198

198199
php_gapic_library(
199200
name = "notebooks_php_gapic",
200-
src = ":notebooks_proto_with_info",
201-
gapic_yaml = "notebooks_gapic.yaml",
201+
srcs = [":notebooks_proto_with_info"],
202202
grpc_service_config = "notebooks_grpc_service_config.json",
203-
package = "google.cloud.notebooks.v1beta1",
204203
service_yaml = "notebooks_v1beta1.yaml",
205204
deps = [
206205
":notebooks_php_grpc",
@@ -251,8 +250,8 @@ nodejs_gapic_assembly_pkg(
251250
##############################################################################
252251
load(
253252
"@com_google_googleapis_imports//:imports.bzl",
254-
"ruby_gapic_assembly_pkg",
255253
"ruby_cloud_gapic_library",
254+
"ruby_gapic_assembly_pkg",
256255
"ruby_grpc_library",
257256
"ruby_proto_library",
258257
)

google/cloud/notebooks/v1beta1/environment.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import "google/api/annotations.proto";
2323

2424
option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks";
2525
option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1";
26-
option php_namespace = "Google\\Cloud\\Notebooks\\V1Beta1";
26+
option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1";
2727
option ruby_package = "Google::Cloud::Notebooks::V1beta1";
2828
option java_multiple_files = true;
2929
option java_outer_classname = "EnvironmentProto";

google/cloud/notebooks/v1beta1/instance.proto

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,18 @@ message Instance {
165165
// Cloud Storage path (`gs://path-to-file/file-name`).
166166
string post_startup_script = 4;
167167

168-
// Output only. The proxy endpoint that is used to access the Jupyter notebook.
168+
// Output only. The proxy endpoint that is used to access the Jupyter
169+
// notebook.
169170
string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
170171

171-
// Input only. The owner of this instance after creation. Format: `[email protected]`
172+
// Input only. The owner of this instance after creation. Format:
173+
172174
//
173175
// Currently supports one owner only. If not specified, all of the service
174176
// account users of your VM instance's service account can use
175177
// the instance.
176-
repeated string instance_owners = 6 [(google.api.field_behavior) = INPUT_ONLY];
178+
repeated string instance_owners = 6
179+
[(google.api.field_behavior) = INPUT_ONLY];
177180

178181
// The service account on this instance, giving access to other Google
179182
// Cloud services.
@@ -185,7 +188,8 @@ message Instance {
185188
// is used.
186189
string service_account = 7;
187190

188-
// Required. The [Compute Engine machine type](https://cloud.google.com/compute/docs/machine-types) of this
191+
// Required. The [Compute Engine machine
192+
// type](https://cloud.google.com/compute/docs/machine-types) of this
189193
// instance.
190194
string machine_type = 8 [(google.api.field_behavior) = REQUIRED];
191195

@@ -208,37 +212,40 @@ message Instance {
208212
// If not specified, we'll automatically choose from official GPU drivers.
209213
string custom_gpu_driver_path = 12;
210214

211-
// Input only. The type of the boot disk attached to this instance, defaults to
212-
// standard persistent disk (`PD_STANDARD`).
215+
// Input only. The type of the boot disk attached to this instance, defaults
216+
// to standard persistent disk (`PD_STANDARD`).
213217
DiskType boot_disk_type = 13 [(google.api.field_behavior) = INPUT_ONLY];
214218

215-
// Input only. The size of the boot disk in GB attached to this instance, up to a maximum
216-
// of 64000 GB (64 TB). The minimum recommended value is
217-
// 100 GB. If not specified, this defaults to 100.
219+
// Input only. The size of the boot disk in GB attached to this instance, up
220+
// to a maximum of 64000 GB (64 TB). The minimum recommended value
221+
// is 100 GB. If not specified, this defaults to 100.
218222
int64 boot_disk_size_gb = 14 [(google.api.field_behavior) = INPUT_ONLY];
219223

220-
// Input only. The type of the data disk attached to this instance, defaults to
221-
// standard persistent disk (`PD_STANDARD`).
224+
// Input only. The type of the data disk attached to this instance, defaults
225+
// to standard persistent disk (`PD_STANDARD`).
222226
DiskType data_disk_type = 25 [(google.api.field_behavior) = INPUT_ONLY];
223227

224-
// Input only. The size of the data disk in GB attached to this instance, up to a maximum
225-
// of 64000 GB (64 TB). You can choose the size of the data disk
226-
// based on how big your notebooks and data are. If not specified, this
227-
// defaults to 100.
228+
// Input only. The size of the data disk in GB attached to this instance, up
229+
// to a maximum of 64000 GB (64 TB). You can choose the size of the
230+
// data disk based on how big your notebooks and data are. If not specified,
231+
// this defaults to 100.
228232
int64 data_disk_size_gb = 26 [(google.api.field_behavior) = INPUT_ONLY];
229233

230-
// Input only. If true, the data disk will not be auto deleted when deleting the instance.
234+
// Input only. If true, the data disk will not be auto deleted when deleting
235+
// the instance.
231236
bool no_remove_data_disk = 27 [(google.api.field_behavior) = INPUT_ONLY];
232237

233-
// Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
234-
DiskEncryption disk_encryption = 15 [(google.api.field_behavior) = INPUT_ONLY];
238+
// Input only. Disk encryption method used on the boot and data disks,
239+
// defaults to GMEK.
240+
DiskEncryption disk_encryption = 15
241+
[(google.api.field_behavior) = INPUT_ONLY];
235242

236-
// Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
237-
// is CMEK.
238-
// Format:
243+
// Input only. The KMS key used to encrypt the disks, only applicable if
244+
// disk_encryption is CMEK. Format:
239245
// `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
240246
//
241-
// Learn more about [using your own encryption keys]( https://cloud.google.com/kms/docs/quickstart).
247+
// Learn more about [using your own encryption keys](
248+
// https://cloud.google.com/kms/docs/quickstart).
242249
string kms_key = 16 [(google.api.field_behavior) = INPUT_ONLY];
243250

244251
// If true, no public IP will be assigned to this instance.
@@ -265,8 +272,10 @@ message Instance {
265272
map<string, string> metadata = 22;
266273

267274
// Output only. Instance creation time.
268-
google.protobuf.Timestamp create_time = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
275+
google.protobuf.Timestamp create_time = 23
276+
[(google.api.field_behavior) = OUTPUT_ONLY];
269277

270278
// Output only. Instance update time.
271-
google.protobuf.Timestamp update_time = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
279+
google.protobuf.Timestamp update_time = 24
280+
[(google.api.field_behavior) = OUTPUT_ONLY];
272281
}

google/cloud/notebooks/v1beta1/notebooks_gapic.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

google/cloud/notebooks/v1beta1/service.proto

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ option java_package = "com.google.cloud.notebooks.v1beta1";
3535
// API v1beta1 service for Cloud AI Platform Notebooks.
3636
service NotebookService {
3737
option (google.api.default_host) = "notebooks.googleapis.com";
38-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
38+
option (google.api.oauth_scopes) =
39+
"https://www.googleapis.com/auth/cloud-platform";
3940

4041
// Lists instances in a given project and location.
4142
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
@@ -52,7 +53,8 @@ service NotebookService {
5253
}
5354

5455
// Creates a new Instance in a given project and location.
55-
rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
56+
rpc CreateInstance(CreateInstanceRequest)
57+
returns (google.longrunning.Operation) {
5658
option (google.api.http) = {
5759
post: "/v1beta1/{parent=projects/*/locations/*}/instances"
5860
body: "instance"
@@ -67,7 +69,8 @@ service NotebookService {
6769
// Legacy instances are instances created with the legacy Compute Engine
6870
// calls. They are not manageable by the Notebooks API out of the box. This
6971
// call makes these instances manageable by the Notebooks API.
70-
rpc RegisterInstance(RegisterInstanceRequest) returns (google.longrunning.Operation) {
72+
rpc RegisterInstance(RegisterInstanceRequest)
73+
returns (google.longrunning.Operation) {
7174
option (google.api.http) = {
7275
post: "/v1beta1/{parent=projects/*/locations/*}/instances:register"
7376
body: "*"
@@ -79,7 +82,8 @@ service NotebookService {
7982
}
8083

8184
// Updates the guest accelerators of a single Instance.
82-
rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest) returns (google.longrunning.Operation) {
85+
rpc SetInstanceAccelerator(SetInstanceAcceleratorRequest)
86+
returns (google.longrunning.Operation) {
8387
option (google.api.http) = {
8488
patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setAccelerator"
8589
body: "*"
@@ -91,7 +95,8 @@ service NotebookService {
9195
}
9296

9397
// Updates the machine type of a single Instance.
94-
rpc SetInstanceMachineType(SetInstanceMachineTypeRequest) returns (google.longrunning.Operation) {
98+
rpc SetInstanceMachineType(SetInstanceMachineTypeRequest)
99+
returns (google.longrunning.Operation) {
95100
option (google.api.http) = {
96101
patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setMachineType"
97102
body: "*"
@@ -103,7 +108,8 @@ service NotebookService {
103108
}
104109

105110
// Updates the labels of an Instance.
106-
rpc SetInstanceLabels(SetInstanceLabelsRequest) returns (google.longrunning.Operation) {
111+
rpc SetInstanceLabels(SetInstanceLabelsRequest)
112+
returns (google.longrunning.Operation) {
107113
option (google.api.http) = {
108114
patch: "/v1beta1/{name=projects/*/locations/*/instances/*}:setLabels"
109115
body: "*"
@@ -115,7 +121,8 @@ service NotebookService {
115121
}
116122

117123
// Deletes a single Instance.
118-
rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
124+
rpc DeleteInstance(DeleteInstanceRequest)
125+
returns (google.longrunning.Operation) {
119126
option (google.api.http) = {
120127
delete: "/v1beta1/{name=projects/*/locations/*/instances/*}"
121128
};
@@ -126,7 +133,8 @@ service NotebookService {
126133
}
127134

128135
// Starts a notebook instance.
129-
rpc StartInstance(StartInstanceRequest) returns (google.longrunning.Operation) {
136+
rpc StartInstance(StartInstanceRequest)
137+
returns (google.longrunning.Operation) {
130138
option (google.api.http) = {
131139
post: "/v1beta1/{name=projects/*/locations/*/instances/*}:start"
132140
body: "*"
@@ -150,7 +158,8 @@ service NotebookService {
150158
}
151159

152160
// Resets a notebook instance.
153-
rpc ResetInstance(ResetInstanceRequest) returns (google.longrunning.Operation) {
161+
rpc ResetInstance(ResetInstanceRequest)
162+
returns (google.longrunning.Operation) {
154163
option (google.api.http) = {
155164
post: "/v1beta1/{name=projects/*/locations/*/instances/*}:reset"
156165
body: "*"
@@ -165,7 +174,8 @@ service NotebookService {
165174
// report their latest instance information to the Notebooks
166175
// API server. The server will merge the reported information to
167176
// the instance metadata store. Do not use this method directly.
168-
rpc ReportInstanceInfo(ReportInstanceInfoRequest) returns (google.longrunning.Operation) {
177+
rpc ReportInstanceInfo(ReportInstanceInfoRequest)
178+
returns (google.longrunning.Operation) {
169179
option (google.api.http) = {
170180
post: "/v1beta1/{name=projects/*/locations/*/instances/*}:report"
171181
body: "*"
@@ -177,14 +187,16 @@ service NotebookService {
177187
}
178188

179189
// Check if a notebook instance is upgradable.
180-
rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest) returns (IsInstanceUpgradeableResponse) {
190+
rpc IsInstanceUpgradeable(IsInstanceUpgradeableRequest)
191+
returns (IsInstanceUpgradeableResponse) {
181192
option (google.api.http) = {
182193
get: "/v1beta1/{notebook_instance=projects/*/locations/*/instances/*}:isUpgradeable"
183194
};
184195
}
185196

186197
// Upgrades a notebook instance to the latest version.
187-
rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) {
198+
rpc UpgradeInstance(UpgradeInstanceRequest)
199+
returns (google.longrunning.Operation) {
188200
option (google.api.http) = {
189201
post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade"
190202
body: "*"
@@ -197,7 +209,8 @@ service NotebookService {
197209

198210
// Allows notebook instances to
199211
// call this endpoint to upgrade themselves. Do not use this method directly.
200-
rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest) returns (google.longrunning.Operation) {
212+
rpc UpgradeInstanceInternal(UpgradeInstanceInternalRequest)
213+
returns (google.longrunning.Operation) {
201214
option (google.api.http) = {
202215
post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgradeInternal"
203216
body: "*"
@@ -209,7 +222,8 @@ service NotebookService {
209222
}
210223

211224
// Lists environments in a project.
212-
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
225+
rpc ListEnvironments(ListEnvironmentsRequest)
226+
returns (ListEnvironmentsResponse) {
213227
option (google.api.http) = {
214228
get: "/v1beta1/{parent=projects/*/locations/*}/environments"
215229
};
@@ -223,7 +237,8 @@ service NotebookService {
223237
}
224238

225239
// Creates a new Environment.
226-
rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) {
240+
rpc CreateEnvironment(CreateEnvironmentRequest)
241+
returns (google.longrunning.Operation) {
227242
option (google.api.http) = {
228243
post: "/v1beta1/{parent=projects/*/locations/*}/environments"
229244
body: "environment"
@@ -235,7 +250,8 @@ service NotebookService {
235250
}
236251

237252
// Deletes a single Environment.
238-
rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) {
253+
rpc DeleteEnvironment(DeleteEnvironmentRequest)
254+
returns (google.longrunning.Operation) {
239255
option (google.api.http) = {
240256
delete: "/v1beta1/{name=projects/*/locations/*/environments/*}"
241257
};
@@ -266,7 +282,8 @@ message OperationMetadata {
266282
// Identifies whether the user has requested cancellation
267283
// of the operation. Operations that have successfully been cancelled
268284
// have [Operation.error][] value with a
269-
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
285+
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
286+
// `Code.CANCELLED`.
270287
bool requested_cancellation = 6;
271288

272289
// API version used to start the operation.
@@ -347,10 +364,10 @@ message SetInstanceAcceleratorRequest {
347364
// Required. Type of this accelerator.
348365
Instance.AcceleratorType type = 2 [(google.api.field_behavior) = REQUIRED];
349366

350-
// Required. Count of cores of this accelerator. Note that not all combinations
351-
// of `type` and `core_count` are valid. Check [GPUs on
352-
// Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
353-
// find a valid combination. TPUs are not supported.
367+
// Required. Count of cores of this accelerator. Note that not all
368+
// combinations of `type` and `core_count` are valid. Check [GPUs on Compute
369+
// Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
370+
// valid combination. TPUs are not supported.
354371
int64 core_count = 3 [(google.api.field_behavior) = REQUIRED];
355372
}
356373

@@ -495,10 +512,10 @@ message CreateEnvironmentRequest {
495512
// Required. Format: `projects/{project_id}/locations/{location}`
496513
string parent = 1 [(google.api.field_behavior) = REQUIRED];
497514

498-
// Required. User-defined unique ID of this environment. The `environment_id` must
499-
// be 1 to 63 characters long and contain only lowercase letters,
500-
// numeric characters, and dashes. The first character must be a lowercase
501-
// letter and the last character cannot be a dash.
515+
// Required. User-defined unique ID of this environment. The `environment_id`
516+
// must be 1 to 63 characters long and contain only lowercase letters, numeric
517+
// characters, and dashes. The first character must be a lowercase letter and
518+
// the last character cannot be a dash.
502519
string environment_id = 2 [(google.api.field_behavior) = REQUIRED];
503520

504521
// Required. The environment to be created.

0 commit comments

Comments
 (0)