Class NotebookServiceClient (3.43.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: The interface for Vertex Notebook service (a.k.a. Colab on Workbench).

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeTemplateName name =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
   NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
 }
 

Note: close() needs to be called on the NotebookServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

CreateNotebookRuntimeTemplate

Creates a NotebookRuntimeTemplate.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createNotebookRuntimeTemplateAsync(CreateNotebookRuntimeTemplateRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

  • createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createNotebookRuntimeTemplateOperationCallable()

  • createNotebookRuntimeTemplateCallable()

GetNotebookRuntimeTemplate

Gets a NotebookRuntimeTemplate.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getNotebookRuntimeTemplate(NotebookRuntimeTemplateName name)

  • getNotebookRuntimeTemplate(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getNotebookRuntimeTemplateCallable()

ListNotebookRuntimeTemplates

Lists NotebookRuntimeTemplates in a Location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listNotebookRuntimeTemplates(LocationName parent)

  • listNotebookRuntimeTemplates(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNotebookRuntimeTemplatesPagedCallable()

  • listNotebookRuntimeTemplatesCallable()

DeleteNotebookRuntimeTemplate

Deletes a NotebookRuntimeTemplate.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteNotebookRuntimeTemplateAsync(DeleteNotebookRuntimeTemplateRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteNotebookRuntimeTemplateAsync(NotebookRuntimeTemplateName name)

  • deleteNotebookRuntimeTemplateAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteNotebookRuntimeTemplateOperationCallable()

  • deleteNotebookRuntimeTemplateCallable()

AssignNotebookRuntime

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • assignNotebookRuntimeAsync(AssignNotebookRuntimeRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

  • assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

  • assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

  • assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • assignNotebookRuntimeOperationCallable()

  • assignNotebookRuntimeCallable()

GetNotebookRuntime

Gets a NotebookRuntime.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getNotebookRuntime(GetNotebookRuntimeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getNotebookRuntime(NotebookRuntimeName name)

  • getNotebookRuntime(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getNotebookRuntimeCallable()

ListNotebookRuntimes

Lists NotebookRuntimes in a Location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listNotebookRuntimes(ListNotebookRuntimesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listNotebookRuntimes(LocationName parent)

  • listNotebookRuntimes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNotebookRuntimesPagedCallable()

  • listNotebookRuntimesCallable()

DeleteNotebookRuntime

Deletes a NotebookRuntime.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteNotebookRuntimeAsync(DeleteNotebookRuntimeRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteNotebookRuntimeAsync(NotebookRuntimeName name)

  • deleteNotebookRuntimeAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteNotebookRuntimeOperationCallable()

  • deleteNotebookRuntimeCallable()

UpgradeNotebookRuntime

Upgrades a NotebookRuntime.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • upgradeNotebookRuntimeAsync(NotebookRuntimeName name)

  • upgradeNotebookRuntimeAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • upgradeNotebookRuntimeOperationCallable()

  • upgradeNotebookRuntimeCallable()

StartNotebookRuntime

Starts a NotebookRuntime.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • startNotebookRuntimeAsync(StartNotebookRuntimeRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • startNotebookRuntimeAsync(NotebookRuntimeName name)

  • startNotebookRuntimeAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • startNotebookRuntimeOperationCallable()

  • startNotebookRuntimeCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of NotebookServiceSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 NotebookServiceSettings notebookServiceSettings =
     NotebookServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 NotebookServiceClient notebookServiceClient =
     NotebookServiceClient.create(notebookServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 NotebookServiceSettings notebookServiceSettings =
     NotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 NotebookServiceClient notebookServiceClient =
     NotebookServiceClient.create(notebookServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > NotebookServiceClient

Static Methods

create()

public static final NotebookServiceClient create()

Constructs an instance of NotebookServiceClient with default settings.

Returns
Type Description
NotebookServiceClient
Exceptions
Type Description
IOException

create(NotebookServiceSettings settings)

public static final NotebookServiceClient create(NotebookServiceSettings settings)

Constructs an instance of NotebookServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings NotebookServiceSettings
Returns
Type Description
NotebookServiceClient
Exceptions
Type Description
IOException

create(NotebookServiceStub stub)

public static final NotebookServiceClient create(NotebookServiceStub stub)

Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(NotebookServiceSettings).

Parameter
Name Description
stub NotebookServiceStub
Returns
Type Description
NotebookServiceClient

Constructors

NotebookServiceClient(NotebookServiceSettings settings)

protected NotebookServiceClient(NotebookServiceSettings settings)

Constructs an instance of NotebookServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings NotebookServiceSettings

NotebookServiceClient(NotebookServiceStub stub)

protected NotebookServiceClient(NotebookServiceStub stub)
Parameter
Name Description
stub NotebookServiceStub

Methods

assignNotebookRuntimeAsync(AssignNotebookRuntimeRequest request)

public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(AssignNotebookRuntimeRequest request)

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   AssignNotebookRuntimeRequest request =
       AssignNotebookRuntimeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNotebookRuntimeTemplate(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .setNotebookRuntime(NotebookRuntime.newBuilder().build())
           .setNotebookRuntimeId("notebookRuntimeId400795512")
           .build();
   NotebookRuntime response = notebookServiceClient.assignNotebookRuntimeAsync(request).get();
 }
 
Parameter
Name Description
request AssignNotebookRuntimeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata>

assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   NotebookRuntimeTemplateName notebookRuntimeTemplate =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
   NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
   String notebookRuntimeId = "notebookRuntimeId400795512";
   NotebookRuntime response =
       notebookServiceClient
           .assignNotebookRuntimeAsync(
               parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
           .get();
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to get the NotebookRuntime assignment. Format: projects/{project}/locations/{location}

notebookRuntimeTemplate NotebookRuntimeTemplateName

Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).

notebookRuntime NotebookRuntime

Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.

notebookRuntimeId String

Optional. User specified ID for the notebook runtime.

Returns
Type Description
OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata>

assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String notebookRuntimeTemplate =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
           .toString();
   NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
   String notebookRuntimeId = "notebookRuntimeId400795512";
   NotebookRuntime response =
       notebookServiceClient
           .assignNotebookRuntimeAsync(
               parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
           .get();
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to get the NotebookRuntime assignment. Format: projects/{project}/locations/{location}

notebookRuntimeTemplate String

Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).

notebookRuntime NotebookRuntime

Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.

notebookRuntimeId String

Optional. User specified ID for the notebook runtime.

Returns
Type Description
OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata>

assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   NotebookRuntimeTemplateName notebookRuntimeTemplate =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
   NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
   String notebookRuntimeId = "notebookRuntimeId400795512";
   NotebookRuntime response =
       notebookServiceClient
           .assignNotebookRuntimeAsync(
               parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
           .get();
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to get the NotebookRuntime assignment. Format: projects/{project}/locations/{location}

notebookRuntimeTemplate NotebookRuntimeTemplateName

Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).

notebookRuntime NotebookRuntime

Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.

notebookRuntimeId String

Optional. User specified ID for the notebook runtime.

Returns
Type Description
OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata>

assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

public final OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   String notebookRuntimeTemplate =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
           .toString();
   NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
   String notebookRuntimeId = "notebookRuntimeId400795512";
   NotebookRuntime response =
       notebookServiceClient
           .assignNotebookRuntimeAsync(
               parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
           .get();
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to get the NotebookRuntime assignment. Format: projects/{project}/locations/{location}

notebookRuntimeTemplate String

Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).

notebookRuntime NotebookRuntime

Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.

notebookRuntimeId String

Optional. User specified ID for the notebook runtime.

Returns
Type Description
OperationFuture<NotebookRuntime,AssignNotebookRuntimeOperationMetadata>

assignNotebookRuntimeCallable()

public final UnaryCallable<AssignNotebookRuntimeRequest,Operation> assignNotebookRuntimeCallable()

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   AssignNotebookRuntimeRequest request =
       AssignNotebookRuntimeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNotebookRuntimeTemplate(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .setNotebookRuntime(NotebookRuntime.newBuilder().build())
           .setNotebookRuntimeId("notebookRuntimeId400795512")
           .build();
   ApiFuture<Operation> future =
       notebookServiceClient.assignNotebookRuntimeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AssignNotebookRuntimeRequest,Operation>

assignNotebookRuntimeOperationCallable()

public final OperationCallable<AssignNotebookRuntimeRequest,NotebookRuntime,AssignNotebookRuntimeOperationMetadata> assignNotebookRuntimeOperationCallable()

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   AssignNotebookRuntimeRequest request =
       AssignNotebookRuntimeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNotebookRuntimeTemplate(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .setNotebookRuntime(NotebookRuntime.newBuilder().build())
           .setNotebookRuntimeId("notebookRuntimeId400795512")
           .build();
   OperationFuture<NotebookRuntime, AssignNotebookRuntimeOperationMetadata> future =
       notebookServiceClient.assignNotebookRuntimeOperationCallable().futureCall(request);
   // Do something.
   NotebookRuntime response = future.get();
 }
 
Returns
Type Description
OperationCallable<AssignNotebookRuntimeRequest,NotebookRuntime,AssignNotebookRuntimeOperationMetadata>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createNotebookRuntimeTemplateAsync(CreateNotebookRuntimeTemplateRequest request)

public final OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata> createNotebookRuntimeTemplateAsync(CreateNotebookRuntimeTemplateRequest request)

Creates a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   CreateNotebookRuntimeTemplateRequest request =
       CreateNotebookRuntimeTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
           .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
           .build();
   NotebookRuntimeTemplate response =
       notebookServiceClient.createNotebookRuntimeTemplateAsync(request).get();
 }
 
Parameter
Name Description
request CreateNotebookRuntimeTemplateRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata>

createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

public final OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata> createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

Creates a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   NotebookRuntimeTemplate notebookRuntimeTemplate =
       NotebookRuntimeTemplate.newBuilder().build();
   String notebookRuntimeTemplateId = "notebookRuntimeTemplateId-633369454";
   NotebookRuntimeTemplate response =
       notebookServiceClient
           .createNotebookRuntimeTemplateAsync(
               parent, notebookRuntimeTemplate, notebookRuntimeTemplateId)
           .get();
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to create the NotebookRuntimeTemplate. Format: projects/{project}/locations/{location}

notebookRuntimeTemplate NotebookRuntimeTemplate

Required. The NotebookRuntimeTemplate to create.

notebookRuntimeTemplateId String

Optional. User specified ID for the notebook runtime template.

Returns
Type Description
OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata>

createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

public final OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata> createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)

Creates a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   NotebookRuntimeTemplate notebookRuntimeTemplate =
       NotebookRuntimeTemplate.newBuilder().build();
   String notebookRuntimeTemplateId = "notebookRuntimeTemplateId-633369454";
   NotebookRuntimeTemplate response =
       notebookServiceClient
           .createNotebookRuntimeTemplateAsync(
               parent, notebookRuntimeTemplate, notebookRuntimeTemplateId)
           .get();
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to create the NotebookRuntimeTemplate. Format: projects/{project}/locations/{location}

notebookRuntimeTemplate NotebookRuntimeTemplate

Required. The NotebookRuntimeTemplate to create.

notebookRuntimeTemplateId String

Optional. User specified ID for the notebook runtime template.

Returns
Type Description
OperationFuture<NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata>

createNotebookRuntimeTemplateCallable()

public final UnaryCallable<CreateNotebookRuntimeTemplateRequest,Operation> createNotebookRuntimeTemplateCallable()

Creates a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   CreateNotebookRuntimeTemplateRequest request =
       CreateNotebookRuntimeTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
           .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
           .build();
   ApiFuture<Operation> future =
       notebookServiceClient.createNotebookRuntimeTemplateCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateNotebookRuntimeTemplateRequest,Operation>

createNotebookRuntimeTemplateOperationCallable()

public final OperationCallable<CreateNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata> createNotebookRuntimeTemplateOperationCallable()

Creates a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   CreateNotebookRuntimeTemplateRequest request =
       CreateNotebookRuntimeTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
           .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
           .build();
   OperationFuture<NotebookRuntimeTemplate, CreateNotebookRuntimeTemplateOperationMetadata>
       future =
           notebookServiceClient
               .createNotebookRuntimeTemplateOperationCallable()
               .futureCall(request);
   // Do something.
   NotebookRuntimeTemplate response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate,CreateNotebookRuntimeTemplateOperationMetadata>

deleteNotebookRuntimeAsync(DeleteNotebookRuntimeRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNotebookRuntimeAsync(DeleteNotebookRuntimeRequest request)

Deletes a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   DeleteNotebookRuntimeRequest request =
       DeleteNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   notebookServiceClient.deleteNotebookRuntimeAsync(request).get();
 }
 
Parameter
Name Description
request DeleteNotebookRuntimeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNotebookRuntimeAsync(NotebookRuntimeName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNotebookRuntimeAsync(NotebookRuntimeName name)

Deletes a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeName name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
   notebookServiceClient.deleteNotebookRuntimeAsync(name).get();
 }
 
Parameter
Name Description
name NotebookRuntimeName

Required. The name of the NotebookRuntime resource to be deleted. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNotebookRuntimeAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNotebookRuntimeAsync(String name)

Deletes a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
   notebookServiceClient.deleteNotebookRuntimeAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the NotebookRuntime resource to be deleted. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNotebookRuntimeCallable()

public final UnaryCallable<DeleteNotebookRuntimeRequest,Operation> deleteNotebookRuntimeCallable()

Deletes a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   DeleteNotebookRuntimeRequest request =
       DeleteNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       notebookServiceClient.deleteNotebookRuntimeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteNotebookRuntimeRequest,Operation>

deleteNotebookRuntimeOperationCallable()

public final OperationCallable<DeleteNotebookRuntimeRequest,Empty,DeleteOperationMetadata> deleteNotebookRuntimeOperationCallable()

Deletes a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   DeleteNotebookRuntimeRequest request =
       DeleteNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       notebookServiceClient.deleteNotebookRuntimeOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteNotebookRuntimeRequest,Empty,DeleteOperationMetadata>

deleteNotebookRuntimeTemplateAsync(DeleteNotebookRuntimeTemplateRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateAsync(DeleteNotebookRuntimeTemplateRequest request)

Deletes a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   DeleteNotebookRuntimeTemplateRequest request =
       DeleteNotebookRuntimeTemplateRequest.newBuilder()
           .setName(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .build();
   notebookServiceClient.deleteNotebookRuntimeTemplateAsync(request).get();
 }
 
Parameter
Name Description
request DeleteNotebookRuntimeTemplateRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNotebookRuntimeTemplateAsync(NotebookRuntimeTemplateName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateAsync(NotebookRuntimeTemplateName name)

Deletes a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeTemplateName name =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
   notebookServiceClient.deleteNotebookRuntimeTemplateAsync(name).get();
 }
 
Parameter
Name Description
name NotebookRuntimeTemplateName

Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNotebookRuntimeTemplateAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateAsync(String name)

Deletes a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String name =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
           .toString();
   notebookServiceClient.deleteNotebookRuntimeTemplateAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNotebookRuntimeTemplateCallable()

public final UnaryCallable<DeleteNotebookRuntimeTemplateRequest,Operation> deleteNotebookRuntimeTemplateCallable()

Deletes a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   DeleteNotebookRuntimeTemplateRequest request =
       DeleteNotebookRuntimeTemplateRequest.newBuilder()
           .setName(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       notebookServiceClient.deleteNotebookRuntimeTemplateCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteNotebookRuntimeTemplateRequest,Operation>

deleteNotebookRuntimeTemplateOperationCallable()

public final OperationCallable<DeleteNotebookRuntimeTemplateRequest,Empty,DeleteOperationMetadata> deleteNotebookRuntimeTemplateOperationCallable()

Deletes a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   DeleteNotebookRuntimeTemplateRequest request =
       DeleteNotebookRuntimeTemplateRequest.newBuilder()
           .setName(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       notebookServiceClient
           .deleteNotebookRuntimeTemplateOperationCallable()
           .futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteNotebookRuntimeTemplateRequest,Empty,DeleteOperationMetadata>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = notebookServiceClient.getIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = notebookServiceClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = notebookServiceClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = notebookServiceClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getNotebookRuntime(GetNotebookRuntimeRequest request)

public final NotebookRuntime getNotebookRuntime(GetNotebookRuntimeRequest request)

Gets a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetNotebookRuntimeRequest request =
       GetNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   NotebookRuntime response = notebookServiceClient.getNotebookRuntime(request);
 }
 
Parameter
Name Description
request GetNotebookRuntimeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NotebookRuntime

getNotebookRuntime(NotebookRuntimeName name)

public final NotebookRuntime getNotebookRuntime(NotebookRuntimeName name)

Gets a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeName name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
   NotebookRuntime response = notebookServiceClient.getNotebookRuntime(name);
 }
 
Parameter
Name Description
name NotebookRuntimeName

Required. The name of the NotebookRuntime resource. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
NotebookRuntime

getNotebookRuntime(String name)

public final NotebookRuntime getNotebookRuntime(String name)

Gets a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
   NotebookRuntime response = notebookServiceClient.getNotebookRuntime(name);
 }
 
Parameter
Name Description
name String

Required. The name of the NotebookRuntime resource. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
NotebookRuntime

getNotebookRuntimeCallable()

public final UnaryCallable<GetNotebookRuntimeRequest,NotebookRuntime> getNotebookRuntimeCallable()

Gets a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetNotebookRuntimeRequest request =
       GetNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   ApiFuture<NotebookRuntime> future =
       notebookServiceClient.getNotebookRuntimeCallable().futureCall(request);
   // Do something.
   NotebookRuntime response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetNotebookRuntimeRequest,NotebookRuntime>

getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest request)

public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest request)

Gets a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetNotebookRuntimeTemplateRequest request =
       GetNotebookRuntimeTemplateRequest.newBuilder()
           .setName(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .build();
   NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(request);
 }
 
Parameter
Name Description
request GetNotebookRuntimeTemplateRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NotebookRuntimeTemplate

getNotebookRuntimeTemplate(NotebookRuntimeTemplateName name)

public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(NotebookRuntimeTemplateName name)

Gets a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeTemplateName name =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
   NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
 }
 
Parameter
Name Description
name NotebookRuntimeTemplateName

Required. The name of the NotebookRuntimeTemplate resource. Format: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}

Returns
Type Description
NotebookRuntimeTemplate

getNotebookRuntimeTemplate(String name)

public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(String name)

Gets a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String name =
       NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
           .toString();
   NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
 }
 
Parameter
Name Description
name String

Required. The name of the NotebookRuntimeTemplate resource. Format: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}

Returns
Type Description
NotebookRuntimeTemplate

getNotebookRuntimeTemplateCallable()

public final UnaryCallable<GetNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate> getNotebookRuntimeTemplateCallable()

Gets a NotebookRuntimeTemplate.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   GetNotebookRuntimeTemplateRequest request =
       GetNotebookRuntimeTemplateRequest.newBuilder()
           .setName(
               NotebookRuntimeTemplateName.of(
                       "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
                   .toString())
           .build();
   ApiFuture<NotebookRuntimeTemplate> future =
       notebookServiceClient.getNotebookRuntimeTemplateCallable().futureCall(request);
   // Do something.
   NotebookRuntimeTemplate response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getSettings()

public final NotebookServiceSettings getSettings()
Returns
Type Description
NotebookServiceSettings

getStub()

public NotebookServiceStub getStub()
Returns
Type Description
NotebookServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listLocations(ListLocationsRequest request)

public final NotebookServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : notebookServiceClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NotebookServiceClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         notebookServiceClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,NotebookServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       notebookServiceClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest request)

public final NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest request)

Lists NotebookRuntimeTemplates in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListNotebookRuntimeTemplatesRequest request =
       ListNotebookRuntimeTemplatesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   for (NotebookRuntimeTemplate element :
       notebookServiceClient.listNotebookRuntimeTemplates(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListNotebookRuntimeTemplatesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse

listNotebookRuntimeTemplates(LocationName parent)

public final NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(LocationName parent)

Lists NotebookRuntimeTemplates in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (NotebookRuntimeTemplate element :
       notebookServiceClient.listNotebookRuntimeTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: projects/{project}/locations/{location}

Returns
Type Description
NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse

listNotebookRuntimeTemplates(String parent)

public final NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(String parent)

Lists NotebookRuntimeTemplates in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (NotebookRuntimeTemplate element :
       notebookServiceClient.listNotebookRuntimeTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: projects/{project}/locations/{location}

Returns
Type Description
NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse

listNotebookRuntimeTemplatesCallable()

public final UnaryCallable<ListNotebookRuntimeTemplatesRequest,ListNotebookRuntimeTemplatesResponse> listNotebookRuntimeTemplatesCallable()

Lists NotebookRuntimeTemplates in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListNotebookRuntimeTemplatesRequest request =
       ListNotebookRuntimeTemplatesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListNotebookRuntimeTemplatesResponse response =
         notebookServiceClient.listNotebookRuntimeTemplatesCallable().call(request);
     for (NotebookRuntimeTemplate element : response.getNotebookRuntimeTemplatesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNotebookRuntimeTemplatesRequest,ListNotebookRuntimeTemplatesResponse>

listNotebookRuntimeTemplatesPagedCallable()

public final UnaryCallable<ListNotebookRuntimeTemplatesRequest,NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse> listNotebookRuntimeTemplatesPagedCallable()

Lists NotebookRuntimeTemplates in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListNotebookRuntimeTemplatesRequest request =
       ListNotebookRuntimeTemplatesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<NotebookRuntimeTemplate> future =
       notebookServiceClient.listNotebookRuntimeTemplatesPagedCallable().futureCall(request);
   // Do something.
   for (NotebookRuntimeTemplate element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNotebookRuntimeTemplatesRequest,ListNotebookRuntimeTemplatesPagedResponse>

listNotebookRuntimes(ListNotebookRuntimesRequest request)

public final NotebookServiceClient.ListNotebookRuntimesPagedResponse listNotebookRuntimes(ListNotebookRuntimesRequest request)

Lists NotebookRuntimes in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListNotebookRuntimesRequest request =
       ListNotebookRuntimesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   for (NotebookRuntime element :
       notebookServiceClient.listNotebookRuntimes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListNotebookRuntimesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NotebookServiceClient.ListNotebookRuntimesPagedResponse

listNotebookRuntimes(LocationName parent)

public final NotebookServiceClient.ListNotebookRuntimesPagedResponse listNotebookRuntimes(LocationName parent)

Lists NotebookRuntimes in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (NotebookRuntime element :
       notebookServiceClient.listNotebookRuntimes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The resource name of the Location from which to list the NotebookRuntimes. Format: projects/{project}/locations/{location}

Returns
Type Description
NotebookServiceClient.ListNotebookRuntimesPagedResponse

listNotebookRuntimes(String parent)

public final NotebookServiceClient.ListNotebookRuntimesPagedResponse listNotebookRuntimes(String parent)

Lists NotebookRuntimes in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (NotebookRuntime element :
       notebookServiceClient.listNotebookRuntimes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The resource name of the Location from which to list the NotebookRuntimes. Format: projects/{project}/locations/{location}

Returns
Type Description
NotebookServiceClient.ListNotebookRuntimesPagedResponse

listNotebookRuntimesCallable()

public final UnaryCallable<ListNotebookRuntimesRequest,ListNotebookRuntimesResponse> listNotebookRuntimesCallable()

Lists NotebookRuntimes in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListNotebookRuntimesRequest request =
       ListNotebookRuntimesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListNotebookRuntimesResponse response =
         notebookServiceClient.listNotebookRuntimesCallable().call(request);
     for (NotebookRuntime element : response.getNotebookRuntimesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNotebookRuntimesRequest,ListNotebookRuntimesResponse>

listNotebookRuntimesPagedCallable()

public final UnaryCallable<ListNotebookRuntimesRequest,NotebookServiceClient.ListNotebookRuntimesPagedResponse> listNotebookRuntimesPagedCallable()

Lists NotebookRuntimes in a Location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   ListNotebookRuntimesRequest request =
       ListNotebookRuntimesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<NotebookRuntime> future =
       notebookServiceClient.listNotebookRuntimesPagedCallable().futureCall(request);
   // Do something.
   for (NotebookRuntime element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNotebookRuntimesRequest,ListNotebookRuntimesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = notebookServiceClient.setIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future = notebookServiceClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

startNotebookRuntimeAsync(NotebookRuntimeName name)

public final OperationFuture<StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata> startNotebookRuntimeAsync(NotebookRuntimeName name)

Starts a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeName name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
   StartNotebookRuntimeResponse response =
       notebookServiceClient.startNotebookRuntimeAsync(name).get();
 }
 
Parameter
Name Description
name NotebookRuntimeName

Required. The name of the NotebookRuntime resource to be started. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
OperationFuture<StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata>

startNotebookRuntimeAsync(StartNotebookRuntimeRequest request)

public final OperationFuture<StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata> startNotebookRuntimeAsync(StartNotebookRuntimeRequest request)

Starts a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   StartNotebookRuntimeRequest request =
       StartNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   StartNotebookRuntimeResponse response =
       notebookServiceClient.startNotebookRuntimeAsync(request).get();
 }
 
Parameter
Name Description
request StartNotebookRuntimeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata>

startNotebookRuntimeAsync(String name)

public final OperationFuture<StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata> startNotebookRuntimeAsync(String name)

Starts a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
   StartNotebookRuntimeResponse response =
       notebookServiceClient.startNotebookRuntimeAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the NotebookRuntime resource to be started. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
OperationFuture<StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata>

startNotebookRuntimeCallable()

public final UnaryCallable<StartNotebookRuntimeRequest,Operation> startNotebookRuntimeCallable()

Starts a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   StartNotebookRuntimeRequest request =
       StartNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       notebookServiceClient.startNotebookRuntimeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<StartNotebookRuntimeRequest,Operation>

startNotebookRuntimeOperationCallable()

public final OperationCallable<StartNotebookRuntimeRequest,StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata> startNotebookRuntimeOperationCallable()

Starts a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   StartNotebookRuntimeRequest request =
       StartNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   OperationFuture<StartNotebookRuntimeResponse, StartNotebookRuntimeOperationMetadata> future =
       notebookServiceClient.startNotebookRuntimeOperationCallable().futureCall(request);
   // Do something.
   StartNotebookRuntimeResponse response = future.get();
 }
 
Returns
Type Description
OperationCallable<StartNotebookRuntimeRequest,StartNotebookRuntimeResponse,StartNotebookRuntimeOperationMetadata>

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       notebookServiceClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

upgradeNotebookRuntimeAsync(NotebookRuntimeName name)

public final OperationFuture<UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata> upgradeNotebookRuntimeAsync(NotebookRuntimeName name)

Upgrades a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   NotebookRuntimeName name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
   UpgradeNotebookRuntimeResponse response =
       notebookServiceClient.upgradeNotebookRuntimeAsync(name).get();
 }
 
Parameter
Name Description
name NotebookRuntimeName

Required. The name of the NotebookRuntime resource to be upgrade. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
OperationFuture<UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata>

upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest request)

public final OperationFuture<UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata> upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest request)

Upgrades a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   UpgradeNotebookRuntimeRequest request =
       UpgradeNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   UpgradeNotebookRuntimeResponse response =
       notebookServiceClient.upgradeNotebookRuntimeAsync(request).get();
 }
 
Parameter
Name Description
request UpgradeNotebookRuntimeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata>

upgradeNotebookRuntimeAsync(String name)

public final OperationFuture<UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata> upgradeNotebookRuntimeAsync(String name)

Upgrades a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   String name =
       NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
   UpgradeNotebookRuntimeResponse response =
       notebookServiceClient.upgradeNotebookRuntimeAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the NotebookRuntime resource to be upgrade. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Returns
Type Description
OperationFuture<UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata>

upgradeNotebookRuntimeCallable()

public final UnaryCallable<UpgradeNotebookRuntimeRequest,Operation> upgradeNotebookRuntimeCallable()

Upgrades a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   UpgradeNotebookRuntimeRequest request =
       UpgradeNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       notebookServiceClient.upgradeNotebookRuntimeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpgradeNotebookRuntimeRequest,Operation>

upgradeNotebookRuntimeOperationCallable()

public final OperationCallable<UpgradeNotebookRuntimeRequest,UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata> upgradeNotebookRuntimeOperationCallable()

Upgrades a NotebookRuntime.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
   UpgradeNotebookRuntimeRequest request =
       UpgradeNotebookRuntimeRequest.newBuilder()
           .setName(
               NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
                   .toString())
           .build();
   OperationFuture<UpgradeNotebookRuntimeResponse, UpgradeNotebookRuntimeOperationMetadata>
       future =
           notebookServiceClient.upgradeNotebookRuntimeOperationCallable().futureCall(request);
   // Do something.
   UpgradeNotebookRuntimeResponse response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpgradeNotebookRuntimeRequest,UpgradeNotebookRuntimeResponse,UpgradeNotebookRuntimeOperationMetadata>