service.proto 34 KB

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