Class NotebookServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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().
| 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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetNotebookRuntimeTemplate |
Gets a NotebookRuntimeTemplate. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListNotebookRuntimeTemplates |
Lists NotebookRuntimeTemplates in a Location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteNotebookRuntimeTemplate |
Deletes a NotebookRuntimeTemplate. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateNotebookRuntimeTemplate |
Updates a NotebookRuntimeTemplate. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetNotebookRuntime |
Gets a NotebookRuntime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListNotebookRuntimes |
Lists NotebookRuntimes in a Location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteNotebookRuntime |
Deletes a NotebookRuntime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpgradeNotebookRuntime |
Upgrades a NotebookRuntime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartNotebookRuntime |
Starts a NotebookRuntime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StopNotebookRuntime |
Stops a NotebookRuntime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateNotebookExecutionJob |
Creates a NotebookExecutionJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetNotebookExecutionJob |
Gets a NotebookExecutionJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListNotebookExecutionJobs |
Lists NotebookExecutionJobs in a Location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteNotebookExecutionJob |
Deletes a NotebookExecutionJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNotebookServiceClient(NotebookServiceSettings settings) Constructs an instance of NotebookServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionAssigns a NotebookRuntime to a user for a particular Notebook file.assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId) Assigns a NotebookRuntime to a user for a particular Notebook file.assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId) Assigns a NotebookRuntime to a user for a particular Notebook file.assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId) Assigns a NotebookRuntime to a user for a particular Notebook file.assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId) Assigns a NotebookRuntime to a user for a particular Notebook file.Assigns a NotebookRuntime to a user for a particular Notebook file.final OperationCallable<AssignNotebookRuntimeRequest,NotebookRuntime, AssignNotebookRuntimeOperationMetadata> Assigns a NotebookRuntime to a user for a particular Notebook file.booleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final NotebookServiceClientcreate()Constructs an instance of NotebookServiceClient with default settings.static final NotebookServiceClientcreate(NotebookServiceSettings settings) Constructs an instance of NotebookServiceClient, using the given settings.static final NotebookServiceClientcreate(NotebookServiceStub stub) Constructs an instance of NotebookServiceClient, using the given stub for making calls.Creates a NotebookExecutionJob.createNotebookExecutionJobAsync(LocationName parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId) Creates a NotebookExecutionJob.createNotebookExecutionJobAsync(String parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId) Creates a NotebookExecutionJob.Creates a NotebookExecutionJob.final OperationCallable<CreateNotebookExecutionJobRequest,NotebookExecutionJob, CreateNotebookExecutionJobOperationMetadata> Creates a NotebookExecutionJob.Creates a NotebookRuntimeTemplate.createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId) Creates a NotebookRuntimeTemplate.createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId) Creates a NotebookRuntimeTemplate.Creates a NotebookRuntimeTemplate.final OperationCallable<CreateNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate, CreateNotebookRuntimeTemplateOperationMetadata> Creates a NotebookRuntimeTemplate.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookExecutionJob.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookExecutionJob.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookExecutionJob.Deletes a NotebookExecutionJob.final OperationCallable<DeleteNotebookExecutionJobRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a NotebookExecutionJob.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookRuntime.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookRuntime.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookRuntime.Deletes a NotebookRuntime.final OperationCallable<DeleteNotebookRuntimeRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a NotebookRuntime.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookRuntimeTemplate.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookRuntimeTemplate.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a NotebookRuntimeTemplate.Deletes a NotebookRuntimeTemplate.final OperationCallable<DeleteNotebookRuntimeTemplateRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a NotebookRuntimeTemplate.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final NotebookExecutionJobGets a NotebookExecutionJob.final NotebookExecutionJobGets a NotebookExecutionJob.final NotebookExecutionJobGets a NotebookExecutionJob.Gets a NotebookExecutionJob.final NotebookRuntimeGets a NotebookRuntime.final NotebookRuntimeGets a NotebookRuntime.final NotebookRuntimegetNotebookRuntime(String name) Gets a NotebookRuntime.Gets a NotebookRuntime.final NotebookRuntimeTemplateGets a NotebookRuntimeTemplate.final NotebookRuntimeTemplateGets a NotebookRuntimeTemplate.final NotebookRuntimeTemplateGets a NotebookRuntimeTemplate.Gets a NotebookRuntimeTemplate.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final NotebookServiceSettingsgetStub()booleanbooleanlistLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists NotebookExecutionJobs in a Location.Lists NotebookExecutionJobs in a Location.listNotebookExecutionJobs(String parent) Lists NotebookExecutionJobs in a Location.Lists NotebookExecutionJobs in a Location.final UnaryCallable<ListNotebookExecutionJobsRequest,NotebookServiceClient.ListNotebookExecutionJobsPagedResponse> Lists NotebookExecutionJobs in a Location.Lists NotebookRuntimes in a Location.listNotebookRuntimes(LocationName parent) Lists NotebookRuntimes in a Location.listNotebookRuntimes(String parent) Lists NotebookRuntimes in a Location.Lists NotebookRuntimes in a Location.final UnaryCallable<ListNotebookRuntimesRequest,NotebookServiceClient.ListNotebookRuntimesPagedResponse> Lists NotebookRuntimes in a Location.Lists NotebookRuntimeTemplates in a Location.Lists NotebookRuntimeTemplates in a Location.listNotebookRuntimeTemplates(String parent) Lists NotebookRuntimeTemplates in a Location.Lists NotebookRuntimeTemplates in a Location.final UnaryCallable<ListNotebookRuntimeTemplatesRequest,NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse> Lists NotebookRuntimeTemplates in a Location.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidStarts a NotebookRuntime.Starts a NotebookRuntime.Starts a NotebookRuntime.Starts a NotebookRuntime.final OperationCallable<StartNotebookRuntimeRequest,StartNotebookRuntimeResponse, StartNotebookRuntimeOperationMetadata> Starts a NotebookRuntime.Stops a NotebookRuntime.Stops a NotebookRuntime.Stops a NotebookRuntime.Stops a NotebookRuntime.final OperationCallable<StopNotebookRuntimeRequest,StopNotebookRuntimeResponse, StopNotebookRuntimeOperationMetadata> Stops a NotebookRuntime.Returns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.final NotebookRuntimeTemplateupdateNotebookRuntimeTemplate(NotebookRuntimeTemplate notebookRuntimeTemplate, com.google.protobuf.FieldMask updateMask) Updates a NotebookRuntimeTemplate.final NotebookRuntimeTemplateUpdates a NotebookRuntimeTemplate.Updates a NotebookRuntimeTemplate.Upgrades a NotebookRuntime.Upgrades a NotebookRuntime.Upgrades a NotebookRuntime.Upgrades a NotebookRuntime.final OperationCallable<UpgradeNotebookRuntimeRequest,UpgradeNotebookRuntimeResponse, UpgradeNotebookRuntimeOperationMetadata> Upgrades a NotebookRuntime.
-
Constructor Details
-
NotebookServiceClient
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.- Throws:
IOException
-
NotebookServiceClient
-
-
Method Details
-
create
Constructs an instance of NotebookServiceClient with default settings.- Throws:
IOException
-
create
public static final NotebookServiceClient create(NotebookServiceSettings settings) throws IOException 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.- Throws:
IOException
-
create
Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(NotebookServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createNotebookRuntimeTemplateAsync
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:
parent- Required. The resource name of the Location to create the NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`notebookRuntimeTemplate- Required. The NotebookRuntimeTemplate to create.notebookRuntimeTemplateId- Optional. User specified ID for the notebook runtime template.- Throws:
ApiException- if the remote call fails
-
createNotebookRuntimeTemplateAsync
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:
parent- Required. The resource name of the Location to create the NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`notebookRuntimeTemplate- Required. The NotebookRuntimeTemplate to create.notebookRuntimeTemplateId- Optional. User specified ID for the notebook runtime template.- Throws:
ApiException- if the remote call fails
-
createNotebookRuntimeTemplateAsync
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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createNotebookRuntimeTemplateOperationCallable
public final OperationCallable<CreateNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate, createNotebookRuntimeTemplateOperationCallable()CreateNotebookRuntimeTemplateOperationMetadata> 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(); } -
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(); } -
getNotebookRuntimeTemplate
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); }- Parameters:
name- Required. The name of the NotebookRuntimeTemplate resource. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`- Throws:
ApiException- if the remote call fails
-
getNotebookRuntimeTemplate
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); }- Parameters:
name- Required. The name of the NotebookRuntimeTemplate resource. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`- Throws:
ApiException- if the remote call fails
-
getNotebookRuntimeTemplate
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
listNotebookRuntimeTemplates
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); } }- Parameters:
parent- Required. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listNotebookRuntimeTemplates
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); } }- Parameters:
parent- Required. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listNotebookRuntimeTemplates
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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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); } } -
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; } } } -
deleteNotebookRuntimeTemplateAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`- Throws:
ApiException- if the remote call fails
-
deleteNotebookRuntimeTemplateAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format: `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`- Throws:
ApiException- if the remote call fails
-
deleteNotebookRuntimeTemplateAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteNotebookRuntimeTemplateOperationCallable
public final OperationCallable<DeleteNotebookRuntimeTemplateRequest,com.google.protobuf.Empty, deleteNotebookRuntimeTemplateOperationCallable()DeleteOperationMetadata> 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(); } -
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(); } -
updateNotebookRuntimeTemplate
public final NotebookRuntimeTemplate updateNotebookRuntimeTemplate(NotebookRuntimeTemplate notebookRuntimeTemplate, com.google.protobuf.FieldMask updateMask) Updates 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()) { NotebookRuntimeTemplate notebookRuntimeTemplate = NotebookRuntimeTemplate.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); NotebookRuntimeTemplate response = notebookServiceClient.updateNotebookRuntimeTemplate(notebookRuntimeTemplate, updateMask); }- Parameters:
notebookRuntimeTemplate- Required. The NotebookRuntimeTemplate to update.updateMask- Required. The update mask applies to the resource. For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. Input format: `{paths: "${updated_filed}"}` Updatable fields:* `encryption_spec.kms_key_name`
- Throws:
ApiException- if the remote call fails
-
updateNotebookRuntimeTemplate
public final NotebookRuntimeTemplate updateNotebookRuntimeTemplate(UpdateNotebookRuntimeTemplateRequest request) Updates 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()) { UpdateNotebookRuntimeTemplateRequest request = UpdateNotebookRuntimeTemplateRequest.newBuilder() .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); NotebookRuntimeTemplate response = notebookServiceClient.updateNotebookRuntimeTemplate(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateNotebookRuntimeTemplateCallable
public final UnaryCallable<UpdateNotebookRuntimeTemplateRequest,NotebookRuntimeTemplate> updateNotebookRuntimeTemplateCallable()Updates 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()) { UpdateNotebookRuntimeTemplateRequest request = UpdateNotebookRuntimeTemplateRequest.newBuilder() .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<NotebookRuntimeTemplate> future = notebookServiceClient.updateNotebookRuntimeTemplateCallable().futureCall(request); // Do something. NotebookRuntimeTemplate response = future.get(); } -
assignNotebookRuntimeAsync
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:
parent- Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`notebookRuntimeTemplate- Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).notebookRuntime- Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.notebookRuntimeId- Optional. User specified ID for the notebook runtime.- Throws:
ApiException- if the remote call fails
-
assignNotebookRuntimeAsync
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:
parent- Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`notebookRuntimeTemplate- Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).notebookRuntime- Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.notebookRuntimeId- Optional. User specified ID for the notebook runtime.- Throws:
ApiException- if the remote call fails
-
assignNotebookRuntimeAsync
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:
parent- Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`notebookRuntimeTemplate- Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).notebookRuntime- Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.notebookRuntimeId- Optional. User specified ID for the notebook runtime.- Throws:
ApiException- if the remote call fails
-
assignNotebookRuntimeAsync
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:
parent- Required. The resource name of the Location to get the NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`notebookRuntimeTemplate- Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).notebookRuntime- Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.notebookRuntimeId- Optional. User specified ID for the notebook runtime.- Throws:
ApiException- if the remote call fails
-
assignNotebookRuntimeAsync
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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
assignNotebookRuntimeOperationCallable
public final OperationCallable<AssignNotebookRuntimeRequest,NotebookRuntime, assignNotebookRuntimeOperationCallable()AssignNotebookRuntimeOperationMetadata> 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(); } -
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(); } -
getNotebookRuntime
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); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
getNotebookRuntime
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); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
getNotebookRuntime
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
listNotebookRuntimes
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); } }- Parameters:
parent- Required. The resource name of the Location from which to list the NotebookRuntimes. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listNotebookRuntimes
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); } }- Parameters:
parent- Required. The resource name of the Location from which to list the NotebookRuntimes. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listNotebookRuntimes
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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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); } } -
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; } } } -
deleteNotebookRuntimeAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
deleteNotebookRuntimeAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
deleteNotebookRuntimeAsync
public final OperationFuture<com.google.protobuf.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteNotebookRuntimeOperationCallable
public final OperationCallable<DeleteNotebookRuntimeRequest,com.google.protobuf.Empty, deleteNotebookRuntimeOperationCallable()DeleteOperationMetadata> 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(); } -
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(); } -
upgradeNotebookRuntimeAsync
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(); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
upgradeNotebookRuntimeAsync
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(); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
upgradeNotebookRuntimeAsync
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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
upgradeNotebookRuntimeOperationCallable
public final OperationCallable<UpgradeNotebookRuntimeRequest,UpgradeNotebookRuntimeResponse, upgradeNotebookRuntimeOperationCallable()UpgradeNotebookRuntimeOperationMetadata> 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(); } -
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(); } -
startNotebookRuntimeAsync
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(); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
startNotebookRuntimeAsync
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(); }- Parameters:
name- 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.- Throws:
ApiException- if the remote call fails
-
startNotebookRuntimeAsync
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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
startNotebookRuntimeOperationCallable
public final OperationCallable<StartNotebookRuntimeRequest,StartNotebookRuntimeResponse, startNotebookRuntimeOperationCallable()StartNotebookRuntimeOperationMetadata> 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(); } -
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(); } -
stopNotebookRuntimeAsync
public final OperationFuture<StopNotebookRuntimeResponse,StopNotebookRuntimeOperationMetadata> stopNotebookRuntimeAsync(NotebookRuntimeName name) Stops 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]"); StopNotebookRuntimeResponse response = notebookServiceClient.stopNotebookRuntimeAsync(name).get(); }- Parameters:
name- Required. The name of the NotebookRuntime resource to be stopped. 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.- Throws:
ApiException- if the remote call fails
-
stopNotebookRuntimeAsync
public final OperationFuture<StopNotebookRuntimeResponse,StopNotebookRuntimeOperationMetadata> stopNotebookRuntimeAsync(String name) Stops 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(); StopNotebookRuntimeResponse response = notebookServiceClient.stopNotebookRuntimeAsync(name).get(); }- Parameters:
name- Required. The name of the NotebookRuntime resource to be stopped. 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.- Throws:
ApiException- if the remote call fails
-
stopNotebookRuntimeAsync
public final OperationFuture<StopNotebookRuntimeResponse,StopNotebookRuntimeOperationMetadata> stopNotebookRuntimeAsync(StopNotebookRuntimeRequest request) Stops 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()) { StopNotebookRuntimeRequest request = StopNotebookRuntimeRequest.newBuilder() .setName( NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]") .toString()) .build(); StopNotebookRuntimeResponse response = notebookServiceClient.stopNotebookRuntimeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
stopNotebookRuntimeOperationCallable
public final OperationCallable<StopNotebookRuntimeRequest,StopNotebookRuntimeResponse, stopNotebookRuntimeOperationCallable()StopNotebookRuntimeOperationMetadata> Stops 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()) { StopNotebookRuntimeRequest request = StopNotebookRuntimeRequest.newBuilder() .setName( NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]") .toString()) .build(); OperationFuture<StopNotebookRuntimeResponse, StopNotebookRuntimeOperationMetadata> future = notebookServiceClient.stopNotebookRuntimeOperationCallable().futureCall(request); // Do something. StopNotebookRuntimeResponse response = future.get(); } -
stopNotebookRuntimeCallable
Stops 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()) { StopNotebookRuntimeRequest request = StopNotebookRuntimeRequest.newBuilder() .setName( NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]") .toString()) .build(); ApiFuture<Operation> future = notebookServiceClient.stopNotebookRuntimeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createNotebookExecutionJobAsync
public final OperationFuture<NotebookExecutionJob,CreateNotebookExecutionJobOperationMetadata> createNotebookExecutionJobAsync(LocationName parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId) Creates a NotebookExecutionJob.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]"); NotebookExecutionJob notebookExecutionJob = NotebookExecutionJob.newBuilder().build(); String notebookExecutionJobId = "notebookExecutionJobId1598189627"; NotebookExecutionJob response = notebookServiceClient .createNotebookExecutionJobAsync(parent, notebookExecutionJob, notebookExecutionJobId) .get(); }- Parameters:
parent- Required. The resource name of the Location to create the NotebookExecutionJob. Format: `projects/{project}/locations/{location}`notebookExecutionJob- Required. The NotebookExecutionJob to create.notebookExecutionJobId- Optional. User specified ID for the NotebookExecutionJob.- Throws:
ApiException- if the remote call fails
-
createNotebookExecutionJobAsync
public final OperationFuture<NotebookExecutionJob,CreateNotebookExecutionJobOperationMetadata> createNotebookExecutionJobAsync(String parent, NotebookExecutionJob notebookExecutionJob, String notebookExecutionJobId) Creates a NotebookExecutionJob.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(); NotebookExecutionJob notebookExecutionJob = NotebookExecutionJob.newBuilder().build(); String notebookExecutionJobId = "notebookExecutionJobId1598189627"; NotebookExecutionJob response = notebookServiceClient .createNotebookExecutionJobAsync(parent, notebookExecutionJob, notebookExecutionJobId) .get(); }- Parameters:
parent- Required. The resource name of the Location to create the NotebookExecutionJob. Format: `projects/{project}/locations/{location}`notebookExecutionJob- Required. The NotebookExecutionJob to create.notebookExecutionJobId- Optional. User specified ID for the NotebookExecutionJob.- Throws:
ApiException- if the remote call fails
-
createNotebookExecutionJobAsync
public final OperationFuture<NotebookExecutionJob,CreateNotebookExecutionJobOperationMetadata> createNotebookExecutionJobAsync(CreateNotebookExecutionJobRequest request) Creates a NotebookExecutionJob.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()) { CreateNotebookExecutionJobRequest request = CreateNotebookExecutionJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNotebookExecutionJob(NotebookExecutionJob.newBuilder().build()) .setNotebookExecutionJobId("notebookExecutionJobId1598189627") .build(); NotebookExecutionJob response = notebookServiceClient.createNotebookExecutionJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createNotebookExecutionJobOperationCallable
public final OperationCallable<CreateNotebookExecutionJobRequest,NotebookExecutionJob, createNotebookExecutionJobOperationCallable()CreateNotebookExecutionJobOperationMetadata> Creates a NotebookExecutionJob.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()) { CreateNotebookExecutionJobRequest request = CreateNotebookExecutionJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNotebookExecutionJob(NotebookExecutionJob.newBuilder().build()) .setNotebookExecutionJobId("notebookExecutionJobId1598189627") .build(); OperationFuture<NotebookExecutionJob, CreateNotebookExecutionJobOperationMetadata> future = notebookServiceClient.createNotebookExecutionJobOperationCallable().futureCall(request); // Do something. NotebookExecutionJob response = future.get(); } -
createNotebookExecutionJobCallable
public final UnaryCallable<CreateNotebookExecutionJobRequest,Operation> createNotebookExecutionJobCallable()Creates a NotebookExecutionJob.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()) { CreateNotebookExecutionJobRequest request = CreateNotebookExecutionJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNotebookExecutionJob(NotebookExecutionJob.newBuilder().build()) .setNotebookExecutionJobId("notebookExecutionJobId1598189627") .build(); ApiFuture<Operation> future = notebookServiceClient.createNotebookExecutionJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getNotebookExecutionJob
Gets a NotebookExecutionJob.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()) { NotebookExecutionJobName name = NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]"); NotebookExecutionJob response = notebookServiceClient.getNotebookExecutionJob(name); }- Parameters:
name- Required. The name of the NotebookExecutionJob resource.- Throws:
ApiException- if the remote call fails
-
getNotebookExecutionJob
Gets a NotebookExecutionJob.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 = NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString(); NotebookExecutionJob response = notebookServiceClient.getNotebookExecutionJob(name); }- Parameters:
name- Required. The name of the NotebookExecutionJob resource.- Throws:
ApiException- if the remote call fails
-
getNotebookExecutionJob
Gets a NotebookExecutionJob.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()) { GetNotebookExecutionJobRequest request = GetNotebookExecutionJobRequest.newBuilder() .setName( NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString()) .setView(NotebookExecutionJobView.forNumber(0)) .build(); NotebookExecutionJob response = notebookServiceClient.getNotebookExecutionJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getNotebookExecutionJobCallable
public final UnaryCallable<GetNotebookExecutionJobRequest,NotebookExecutionJob> getNotebookExecutionJobCallable()Gets a NotebookExecutionJob.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()) { GetNotebookExecutionJobRequest request = GetNotebookExecutionJobRequest.newBuilder() .setName( NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString()) .setView(NotebookExecutionJobView.forNumber(0)) .build(); ApiFuture<NotebookExecutionJob> future = notebookServiceClient.getNotebookExecutionJobCallable().futureCall(request); // Do something. NotebookExecutionJob response = future.get(); } -
listNotebookExecutionJobs
public final NotebookServiceClient.ListNotebookExecutionJobsPagedResponse listNotebookExecutionJobs(LocationName parent) Lists NotebookExecutionJobs 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 (NotebookExecutionJob element : notebookServiceClient.listNotebookExecutionJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Location from which to list the NotebookExecutionJobs. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listNotebookExecutionJobs
public final NotebookServiceClient.ListNotebookExecutionJobsPagedResponse listNotebookExecutionJobs(String parent) Lists NotebookExecutionJobs 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 (NotebookExecutionJob element : notebookServiceClient.listNotebookExecutionJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the Location from which to list the NotebookExecutionJobs. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listNotebookExecutionJobs
public final NotebookServiceClient.ListNotebookExecutionJobsPagedResponse listNotebookExecutionJobs(ListNotebookExecutionJobsRequest request) Lists NotebookExecutionJobs 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()) { ListNotebookExecutionJobsRequest request = ListNotebookExecutionJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setView(NotebookExecutionJobView.forNumber(0)) .build(); for (NotebookExecutionJob element : notebookServiceClient.listNotebookExecutionJobs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listNotebookExecutionJobsPagedCallable
public final UnaryCallable<ListNotebookExecutionJobsRequest,NotebookServiceClient.ListNotebookExecutionJobsPagedResponse> listNotebookExecutionJobsPagedCallable()Lists NotebookExecutionJobs 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()) { ListNotebookExecutionJobsRequest request = ListNotebookExecutionJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setView(NotebookExecutionJobView.forNumber(0)) .build(); ApiFuture<NotebookExecutionJob> future = notebookServiceClient.listNotebookExecutionJobsPagedCallable().futureCall(request); // Do something. for (NotebookExecutionJob element : future.get().iterateAll()) { // doThingsWith(element); } } -
listNotebookExecutionJobsCallable
public final UnaryCallable<ListNotebookExecutionJobsRequest,ListNotebookExecutionJobsResponse> listNotebookExecutionJobsCallable()Lists NotebookExecutionJobs 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()) { ListNotebookExecutionJobsRequest request = ListNotebookExecutionJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setView(NotebookExecutionJobView.forNumber(0)) .build(); while (true) { ListNotebookExecutionJobsResponse response = notebookServiceClient.listNotebookExecutionJobsCallable().call(request); for (NotebookExecutionJob element : response.getNotebookExecutionJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteNotebookExecutionJobAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobAsync(NotebookExecutionJobName name) Deletes a NotebookExecutionJob.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()) { NotebookExecutionJobName name = NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]"); notebookServiceClient.deleteNotebookExecutionJobAsync(name).get(); }- Parameters:
name- Required. The name of the NotebookExecutionJob resource to be deleted.- Throws:
ApiException- if the remote call fails
-
deleteNotebookExecutionJobAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobAsync(String name) Deletes a NotebookExecutionJob.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 = NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString(); notebookServiceClient.deleteNotebookExecutionJobAsync(name).get(); }- Parameters:
name- Required. The name of the NotebookExecutionJob resource to be deleted.- Throws:
ApiException- if the remote call fails
-
deleteNotebookExecutionJobAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNotebookExecutionJobAsync(DeleteNotebookExecutionJobRequest request) Deletes a NotebookExecutionJob.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()) { DeleteNotebookExecutionJobRequest request = DeleteNotebookExecutionJobRequest.newBuilder() .setName( NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString()) .build(); notebookServiceClient.deleteNotebookExecutionJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteNotebookExecutionJobOperationCallable
public final OperationCallable<DeleteNotebookExecutionJobRequest,com.google.protobuf.Empty, deleteNotebookExecutionJobOperationCallable()DeleteOperationMetadata> Deletes a NotebookExecutionJob.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()) { DeleteNotebookExecutionJobRequest request = DeleteNotebookExecutionJobRequest.newBuilder() .setName( NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString()) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = notebookServiceClient.deleteNotebookExecutionJobOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteNotebookExecutionJobCallable
public final UnaryCallable<DeleteNotebookExecutionJobRequest,Operation> deleteNotebookExecutionJobCallable()Deletes a NotebookExecutionJob.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()) { DeleteNotebookExecutionJobRequest request = DeleteNotebookExecutionJobRequest.newBuilder() .setName( NotebookExecutionJobName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_EXECUTION_JOB]") .toString()) .build(); ApiFuture<Operation> future = notebookServiceClient.deleteNotebookExecutionJobCallable().futureCall(request); // Do something. future.get(); } -
listLocations
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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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); } } -
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; } } } -
getLocation
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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(); } -
getIamPolicy
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
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.
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-