Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
docs: add generated snippets (#130)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 11, 2022
1 parent a0cab1c commit dd62813
Show file tree
Hide file tree
Showing 128 changed files with 14,008 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,26 @@ async def list_runtimes(
) -> pagers.ListRuntimesAsyncPager:
r"""Lists Runtimes in a given project and location.
.. code-block::
from google.cloud import notebooks_v1
def sample_list_runtimes():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.ListRuntimesRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_runtimes(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.ListRuntimesRequest, dict]):
The request object. Request for listing Managed Notebook
Expand Down Expand Up @@ -304,6 +324,26 @@ async def get_runtime(
r"""Gets details of a single Runtime. The location must
be a regional endpoint rather than zonal.
.. code-block::
from google.cloud import notebooks_v1
def sample_get_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.GetRuntimeRequest(
name="name_value",
)
# Make the request
response = client.get_runtime(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.GetRuntimeRequest, dict]):
The request object. Request for getting a Managed
Expand Down Expand Up @@ -378,6 +418,31 @@ async def create_runtime(
r"""Creates a new Runtime in a given project and
location.
.. code-block::
from google.cloud import notebooks_v1
def sample_create_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.CreateRuntimeRequest(
parent="parent_value",
runtime_id="runtime_id_value",
)
# Make the request
operation = client.create_runtime(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.CreateRuntimeRequest, dict]):
The request object. Request for creating a Managed
Expand Down Expand Up @@ -476,6 +541,29 @@ async def delete_runtime(
) -> operation_async.AsyncOperation:
r"""Deletes a single Runtime.
.. code-block::
from google.cloud import notebooks_v1
def sample_delete_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.DeleteRuntimeRequest(
name="name_value",
)
# Make the request
operation = client.delete_runtime(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.DeleteRuntimeRequest, dict]):
The request object. Request for deleting a Managed
Expand Down Expand Up @@ -572,6 +660,30 @@ async def start_runtime(
https://cloud.google.com/compute/docs/instances/stop-start-instance
https://cloud.google.com/compute/docs/instances/suspend-resume-instance
.. code-block::
from google.cloud import notebooks_v1
def sample_start_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.StartRuntimeRequest(
name="name_value",
)
# Make the request
operation = client.start_runtime(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.StartRuntimeRequest, dict]):
The request object. Request for starting a Managed
Expand Down Expand Up @@ -658,6 +770,30 @@ async def stop_runtime(
https://cloud.google.com/compute/docs/instances/stop-start-instance
https://cloud.google.com/compute/docs/instances/suspend-resume-instance
.. code-block::
from google.cloud import notebooks_v1
def sample_stop_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.StopRuntimeRequest(
name="name_value",
)
# Make the request
operation = client.stop_runtime(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.StopRuntimeRequest, dict]):
The request object. Request for stopping a Managed
Expand Down Expand Up @@ -740,6 +876,29 @@ async def switch_runtime(
) -> operation_async.AsyncOperation:
r"""Switch a Managed Notebook Runtime.
.. code-block::
from google.cloud import notebooks_v1
def sample_switch_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.SwitchRuntimeRequest(
name="name_value",
)
# Make the request
operation = client.switch_runtime(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.SwitchRuntimeRequest, dict]):
The request object. Request for switching a Managed
Expand Down Expand Up @@ -822,6 +981,29 @@ async def reset_runtime(
) -> operation_async.AsyncOperation:
r"""Resets a Managed Notebook Runtime.
.. code-block::
from google.cloud import notebooks_v1
def sample_reset_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.ResetRuntimeRequest(
name="name_value",
)
# Make the request
operation = client.reset_runtime(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.ResetRuntimeRequest, dict]):
The request object. Request for reseting a Managed
Expand Down Expand Up @@ -904,6 +1086,30 @@ async def report_runtime_event(
) -> operation_async.AsyncOperation:
r"""Report and process a runtime event.
.. code-block::
from google.cloud import notebooks_v1
def sample_report_runtime_event():
# Create a client
client = notebooks_v1.ManagedNotebookServiceClient()
# Initialize request argument(s)
request = notebooks_v1.ReportRuntimeEventRequest(
name="name_value",
vm_id="vm_id_value",
)
# Make the request
operation = client.report_runtime_event(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.notebooks_v1.types.ReportRuntimeEventRequest, dict]):
The request object. Request for reporting a Managed
Expand Down
Loading

0 comments on commit dd62813

Please sign in to comment.