@@ -223,6 +223,26 @@ async def list_runtimes(
223
223
) -> pagers .ListRuntimesAsyncPager :
224
224
r"""Lists Runtimes in a given project and location.
225
225
226
+ .. code-block::
227
+
228
+ from google.cloud import notebooks_v1
229
+
230
+ def sample_list_runtimes():
231
+ # Create a client
232
+ client = notebooks_v1.ManagedNotebookServiceClient()
233
+
234
+ # Initialize request argument(s)
235
+ request = notebooks_v1.ListRuntimesRequest(
236
+ parent="parent_value",
237
+ )
238
+
239
+ # Make the request
240
+ page_result = client.list_runtimes(request=request)
241
+
242
+ # Handle the response
243
+ for response in page_result:
244
+ print(response)
245
+
226
246
Args:
227
247
request (Union[google.cloud.notebooks_v1.types.ListRuntimesRequest, dict]):
228
248
The request object. Request for listing Managed Notebook
@@ -304,6 +324,26 @@ async def get_runtime(
304
324
r"""Gets details of a single Runtime. The location must
305
325
be a regional endpoint rather than zonal.
306
326
327
+
328
+ .. code-block::
329
+
330
+ from google.cloud import notebooks_v1
331
+
332
+ def sample_get_runtime():
333
+ # Create a client
334
+ client = notebooks_v1.ManagedNotebookServiceClient()
335
+
336
+ # Initialize request argument(s)
337
+ request = notebooks_v1.GetRuntimeRequest(
338
+ name="name_value",
339
+ )
340
+
341
+ # Make the request
342
+ response = client.get_runtime(request=request)
343
+
344
+ # Handle the response
345
+ print(response)
346
+
307
347
Args:
308
348
request (Union[google.cloud.notebooks_v1.types.GetRuntimeRequest, dict]):
309
349
The request object. Request for getting a Managed
@@ -378,6 +418,31 @@ async def create_runtime(
378
418
r"""Creates a new Runtime in a given project and
379
419
location.
380
420
421
+
422
+ .. code-block::
423
+
424
+ from google.cloud import notebooks_v1
425
+
426
+ def sample_create_runtime():
427
+ # Create a client
428
+ client = notebooks_v1.ManagedNotebookServiceClient()
429
+
430
+ # Initialize request argument(s)
431
+ request = notebooks_v1.CreateRuntimeRequest(
432
+ parent="parent_value",
433
+ runtime_id="runtime_id_value",
434
+ )
435
+
436
+ # Make the request
437
+ operation = client.create_runtime(request=request)
438
+
439
+ print("Waiting for operation to complete...")
440
+
441
+ response = operation.result()
442
+
443
+ # Handle the response
444
+ print(response)
445
+
381
446
Args:
382
447
request (Union[google.cloud.notebooks_v1.types.CreateRuntimeRequest, dict]):
383
448
The request object. Request for creating a Managed
@@ -476,6 +541,29 @@ async def delete_runtime(
476
541
) -> operation_async .AsyncOperation :
477
542
r"""Deletes a single Runtime.
478
543
544
+ .. code-block::
545
+
546
+ from google.cloud import notebooks_v1
547
+
548
+ def sample_delete_runtime():
549
+ # Create a client
550
+ client = notebooks_v1.ManagedNotebookServiceClient()
551
+
552
+ # Initialize request argument(s)
553
+ request = notebooks_v1.DeleteRuntimeRequest(
554
+ name="name_value",
555
+ )
556
+
557
+ # Make the request
558
+ operation = client.delete_runtime(request=request)
559
+
560
+ print("Waiting for operation to complete...")
561
+
562
+ response = operation.result()
563
+
564
+ # Handle the response
565
+ print(response)
566
+
479
567
Args:
480
568
request (Union[google.cloud.notebooks_v1.types.DeleteRuntimeRequest, dict]):
481
569
The request object. Request for deleting a Managed
@@ -572,6 +660,30 @@ async def start_runtime(
572
660
https://cloud.google.com/compute/docs/instances/stop-start-instance
573
661
https://cloud.google.com/compute/docs/instances/suspend-resume-instance
574
662
663
+
664
+ .. code-block::
665
+
666
+ from google.cloud import notebooks_v1
667
+
668
+ def sample_start_runtime():
669
+ # Create a client
670
+ client = notebooks_v1.ManagedNotebookServiceClient()
671
+
672
+ # Initialize request argument(s)
673
+ request = notebooks_v1.StartRuntimeRequest(
674
+ name="name_value",
675
+ )
676
+
677
+ # Make the request
678
+ operation = client.start_runtime(request=request)
679
+
680
+ print("Waiting for operation to complete...")
681
+
682
+ response = operation.result()
683
+
684
+ # Handle the response
685
+ print(response)
686
+
575
687
Args:
576
688
request (Union[google.cloud.notebooks_v1.types.StartRuntimeRequest, dict]):
577
689
The request object. Request for starting a Managed
@@ -658,6 +770,30 @@ async def stop_runtime(
658
770
https://cloud.google.com/compute/docs/instances/stop-start-instance
659
771
https://cloud.google.com/compute/docs/instances/suspend-resume-instance
660
772
773
+
774
+ .. code-block::
775
+
776
+ from google.cloud import notebooks_v1
777
+
778
+ def sample_stop_runtime():
779
+ # Create a client
780
+ client = notebooks_v1.ManagedNotebookServiceClient()
781
+
782
+ # Initialize request argument(s)
783
+ request = notebooks_v1.StopRuntimeRequest(
784
+ name="name_value",
785
+ )
786
+
787
+ # Make the request
788
+ operation = client.stop_runtime(request=request)
789
+
790
+ print("Waiting for operation to complete...")
791
+
792
+ response = operation.result()
793
+
794
+ # Handle the response
795
+ print(response)
796
+
661
797
Args:
662
798
request (Union[google.cloud.notebooks_v1.types.StopRuntimeRequest, dict]):
663
799
The request object. Request for stopping a Managed
@@ -740,6 +876,29 @@ async def switch_runtime(
740
876
) -> operation_async .AsyncOperation :
741
877
r"""Switch a Managed Notebook Runtime.
742
878
879
+ .. code-block::
880
+
881
+ from google.cloud import notebooks_v1
882
+
883
+ def sample_switch_runtime():
884
+ # Create a client
885
+ client = notebooks_v1.ManagedNotebookServiceClient()
886
+
887
+ # Initialize request argument(s)
888
+ request = notebooks_v1.SwitchRuntimeRequest(
889
+ name="name_value",
890
+ )
891
+
892
+ # Make the request
893
+ operation = client.switch_runtime(request=request)
894
+
895
+ print("Waiting for operation to complete...")
896
+
897
+ response = operation.result()
898
+
899
+ # Handle the response
900
+ print(response)
901
+
743
902
Args:
744
903
request (Union[google.cloud.notebooks_v1.types.SwitchRuntimeRequest, dict]):
745
904
The request object. Request for switching a Managed
@@ -822,6 +981,29 @@ async def reset_runtime(
822
981
) -> operation_async .AsyncOperation :
823
982
r"""Resets a Managed Notebook Runtime.
824
983
984
+ .. code-block::
985
+
986
+ from google.cloud import notebooks_v1
987
+
988
+ def sample_reset_runtime():
989
+ # Create a client
990
+ client = notebooks_v1.ManagedNotebookServiceClient()
991
+
992
+ # Initialize request argument(s)
993
+ request = notebooks_v1.ResetRuntimeRequest(
994
+ name="name_value",
995
+ )
996
+
997
+ # Make the request
998
+ operation = client.reset_runtime(request=request)
999
+
1000
+ print("Waiting for operation to complete...")
1001
+
1002
+ response = operation.result()
1003
+
1004
+ # Handle the response
1005
+ print(response)
1006
+
825
1007
Args:
826
1008
request (Union[google.cloud.notebooks_v1.types.ResetRuntimeRequest, dict]):
827
1009
The request object. Request for reseting a Managed
@@ -904,6 +1086,30 @@ async def report_runtime_event(
904
1086
) -> operation_async .AsyncOperation :
905
1087
r"""Report and process a runtime event.
906
1088
1089
+ .. code-block::
1090
+
1091
+ from google.cloud import notebooks_v1
1092
+
1093
+ def sample_report_runtime_event():
1094
+ # Create a client
1095
+ client = notebooks_v1.ManagedNotebookServiceClient()
1096
+
1097
+ # Initialize request argument(s)
1098
+ request = notebooks_v1.ReportRuntimeEventRequest(
1099
+ name="name_value",
1100
+ vm_id="vm_id_value",
1101
+ )
1102
+
1103
+ # Make the request
1104
+ operation = client.report_runtime_event(request=request)
1105
+
1106
+ print("Waiting for operation to complete...")
1107
+
1108
+ response = operation.result()
1109
+
1110
+ # Handle the response
1111
+ print(response)
1112
+
907
1113
Args:
908
1114
request (Union[google.cloud.notebooks_v1.types.ReportRuntimeEventRequest, dict]):
909
1115
The request object. Request for reporting a Managed
0 commit comments