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()) {
String name = "name3373707";
Instance response = notebookServiceClient.getInstance(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 |
|---|---|---|
ListInstances |
Lists instances in a given project and 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.
|
GetInstance |
Gets details of a single Instance. |
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.
|
CreateInstance |
Creates a new Instance in a given project and location. |
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.
|
RegisterInstance |
Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API. |
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.
|
SetInstanceAccelerator |
Updates the guest accelerators of a single Instance. |
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.
|
SetInstanceMachineType |
Updates the machine type of a single Instance. |
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.
|
UpdateInstanceConfig |
Update Notebook Instance configurations. |
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.
|
UpdateShieldedInstanceConfig |
Updates the Shielded instance configuration of a single Instance. |
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.
|
SetInstanceLabels |
Replaces all the labels of an Instance. |
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.
|
UpdateInstanceMetadataItems |
Add/update metadata items for an instance. |
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.
|
DeleteInstance |
Deletes a single Instance. |
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.
|
StartInstance |
Starts a notebook instance. |
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.
|
StopInstance |
Stops a notebook instance. |
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.
|
ResetInstance |
Resets a notebook instance. |
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.
|
ReportInstanceInfo |
Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly. |
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.
|
IsInstanceUpgradeable |
Check if a notebook instance is upgradable. |
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.
|
GetInstanceHealth |
Check if a notebook instance is healthy. |
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.
|
UpgradeInstance |
Upgrades a notebook instance to the latest version. |
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.
|
RollbackInstance |
Rollbacks a notebook instance to the previous version. |
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.
|
DiagnoseInstance |
Creates a Diagnostic File and runs Diagnostic Tool given an Instance. |
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.
|
UpgradeInstanceInternal |
Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly. |
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.
|
ListEnvironments |
Lists environments in a project. |
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.
|
GetEnvironment |
Gets details of a single Environment. |
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.
|
CreateEnvironment |
Creates a new Environment. |
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.
|
DeleteEnvironment |
Deletes a single Environment. |
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.
|
ListSchedules |
Lists schedules in a given project and 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.
|
GetSchedule |
Gets details of schedule |
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.
|
DeleteSchedule |
Deletes schedule and all underlying jobs |
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.
|
CreateSchedule |
Creates a new Scheduled Notebook in a given project and location. |
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.
|
TriggerSchedule |
Triggers execution of an existing schedule. |
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.
|
ListExecutions |
Lists executions in a given project and 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.
|
GetExecution |
Gets details of executions |
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.
|
DeleteExecution |
Deletes execution |
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.
|
CreateExecution |
Creates a new Execution in a given project and location. |
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 classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNotebookServiceClient(NotebookServiceSettings settings) Constructs an instance of NotebookServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(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 new Environment.createEnvironmentAsync(String parent, Environment environment, String environmentId) Creates a new Environment.Creates a new Environment.Creates a new Environment.Creates a new Execution in a given project and location.createExecutionAsync(ExecutionName parent, Execution execution, String executionId) Creates a new Execution in a given project and location.createExecutionAsync(String parent, Execution execution, String executionId) Creates a new Execution in a given project and location.Creates a new Execution in a given project and location.Creates a new Execution in a given project and location.createInstanceAsync(CreateInstanceRequest request) Creates a new Instance in a given project and location.createInstanceAsync(String parent, Instance instance, String instanceId) Creates a new Instance in a given project and location.Creates a new Instance in a given project and location.Creates a new Instance in a given project and location.createScheduleAsync(CreateScheduleRequest request) Creates a new Scheduled Notebook in a given project and location.createScheduleAsync(ScheduleName parent, Schedule schedule, String scheduleId) Creates a new Scheduled Notebook in a given project and location.createScheduleAsync(String parent, Schedule schedule, String scheduleId) Creates a new Scheduled Notebook in a given project and location.Creates a new Scheduled Notebook in a given project and location.Creates a new Scheduled Notebook in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Environment.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEnvironmentAsync(String name) Deletes a single Environment.Deletes a single Environment.final OperationCallable<DeleteEnvironmentRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Environment.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes executionfinal OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes executionfinal OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(String name) Deletes executionDeletes executionfinal OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty, OperationMetadata> Deletes executionfinal OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request) Deletes a single Instance.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(String name) Deletes a single Instance.Deletes a single Instance.final OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Instance.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteScheduleAsync(DeleteScheduleRequest request) Deletes schedule and all underlying jobsfinal OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes schedule and all underlying jobsfinal OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteScheduleAsync(String name) Deletes schedule and all underlying jobsDeletes schedule and all underlying jobsfinal OperationCallable<DeleteScheduleRequest,com.google.protobuf.Empty, OperationMetadata> Deletes schedule and all underlying jobsCreates a Diagnostic File and runs Diagnostic Tool given an Instance.diagnoseInstanceAsync(InstanceName name, DiagnosticConfig diagnosticConfig) Creates a Diagnostic File and runs Diagnostic Tool given an Instance.diagnoseInstanceAsync(String name, DiagnosticConfig diagnosticConfig) Creates a Diagnostic File and runs Diagnostic Tool given an Instance.Creates a Diagnostic File and runs Diagnostic Tool given an Instance.Creates a Diagnostic File and runs Diagnostic Tool given an Instance.final EnvironmentgetEnvironment(GetEnvironmentRequest request) Gets details of a single Environment.final EnvironmentgetEnvironment(String name) Gets details of a single Environment.Gets details of a single Environment.final ExecutiongetExecution(ExecutionName name) Gets details of executionsfinal ExecutiongetExecution(GetExecutionRequest request) Gets details of executionsfinal ExecutiongetExecution(String name) Gets details of executionsGets details of executionsfinal PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final InstancegetInstance(GetInstanceRequest request) Gets details of a single Instance.final InstancegetInstance(String name) Gets details of a single Instance.Gets details of a single Instance.Check if a notebook instance is healthy.Check if a notebook instance is healthy.getInstanceHealth(String name) Check if a notebook instance is healthy.Check if a notebook instance is healthy.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final SchedulegetSchedule(GetScheduleRequest request) Gets details of schedulefinal SchedulegetSchedule(ScheduleName name) Gets details of schedulefinal SchedulegetSchedule(String name) Gets details of scheduleGets details of schedulefinal NotebookServiceSettingsgetStub()Check if a notebook instance is upgradable.Check if a notebook instance is upgradable.booleanbooleanlistEnvironments(ListEnvironmentsRequest request) Lists environments in a project.listEnvironments(String parent) Lists environments in a project.Lists environments in a project.Lists environments in a project.listExecutions(ExecutionName parent) Lists executions in a given project and locationlistExecutions(ListExecutionsRequest request) Lists executions in a given project and locationlistExecutions(String parent) Lists executions in a given project and locationLists executions in a given project and locationLists executions in a given project and locationlistInstances(ListInstancesRequest request) Lists instances in a given project and location.listInstances(String parent) Lists instances in a given project and location.Lists instances in a given project and location.Lists instances in a given project and location.listLocations(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.listSchedules(ListSchedulesRequest request) Lists schedules in a given project and location.listSchedules(ScheduleName parent) Lists schedules in a given project and location.listSchedules(String parent) Lists schedules in a given project and location.Lists schedules in a given project and location.Lists schedules in a given project and location.Registers an existing legacy notebook instance to the Notebooks API server.Registers an existing legacy notebook instance to the Notebooks API server.Registers an existing legacy notebook instance to the Notebooks API server.Allows notebook instances to report their latest instance information to the Notebooks API server.Allows notebook instances to report their latest instance information to the Notebooks API server.Allows notebook instances to report their latest instance information to the Notebooks API server.resetInstanceAsync(ResetInstanceRequest request) Resets a notebook instance.Resets a notebook instance.Resets a notebook instance.Rollbacks a notebook instance to the previous version.Rollbacks a notebook instance to the previous version.Rollbacks a notebook instance to the previous version.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.Updates the guest accelerators of a single Instance.Updates the guest accelerators of a single Instance.Updates the guest accelerators of a single Instance.Replaces all the labels of an Instance.Replaces all the labels of an Instance.Replaces all the labels of an Instance.Updates the machine type of a single Instance.Updates the machine type of a single Instance.Updates the machine type of a single Instance.voidshutdown()voidstartInstanceAsync(StartInstanceRequest request) Starts a notebook instance.Starts a notebook instance.Starts a notebook instance.stopInstanceAsync(StopInstanceRequest request) Stops a notebook instance.Stops a notebook instance.Stops a notebook instance.Returns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.Triggers execution of an existing schedule.Triggers execution of an existing schedule.Triggers execution of an existing schedule.Update Notebook Instance configurations.Update Notebook Instance configurations.Update Notebook Instance configurations.Add/update metadata items for an instance.Add/update metadata items for an instance.Updates the Shielded instance configuration of a single Instance.Updates the Shielded instance configuration of a single Instance.Updates the Shielded instance configuration of a single Instance.Upgrades a notebook instance to the latest version.Upgrades a notebook instance to the latest version.Allows notebook instances to call this endpoint to upgrade themselves.Allows notebook instances to call this endpoint to upgrade themselves.Allows notebook instances to call this endpoint to upgrade themselves.Upgrades a notebook instance to the latest version.
-
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. -
listInstances
Lists instances in a given project and 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 = "parent-995424086"; for (Instance element : notebookServiceClient.listInstances(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listInstances
public final NotebookServiceClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request) Lists instances in a given project and 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()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Instance element : notebookServiceClient.listInstances(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
-
listInstancesPagedCallable
public final UnaryCallable<ListInstancesRequest,NotebookServiceClient.ListInstancesPagedResponse> listInstancesPagedCallable()Lists instances in a given project and 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()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Instance> future = notebookServiceClient.listInstancesPagedCallable().futureCall(request); // Do something. for (Instance element : future.get().iterateAll()) { // doThingsWith(element); } } -
listInstancesCallable
Lists instances in a given project and 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()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListInstancesResponse response = notebookServiceClient.listInstancesCallable().call(request); for (Instance element : response.getInstancesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getInstance
Gets details of a single Instance.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 = "name3373707"; Instance response = notebookServiceClient.getInstance(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`- Throws:
ApiException- if the remote call fails
-
getInstance
Gets details of a single Instance.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()) { GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.getInstance(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getInstanceCallable
Gets details of a single Instance.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()) { GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Instance> future = notebookServiceClient.getInstanceCallable().futureCall(request); // Do something. Instance response = future.get(); } -
createInstanceAsync
public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(String parent, Instance instance, String instanceId) Creates a new Instance in a given project and 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 = "parent-995424086"; Instance instance = Instance.newBuilder().build(); String instanceId = "instanceId902024336"; Instance response = notebookServiceClient.createInstanceAsync(parent, instance, instanceId).get(); }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`instance- Required. The instance to be created.instanceId- Required. User-defined unique ID of this instance.- Throws:
ApiException- if the remote call fails
-
createInstanceAsync
public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request) Creates a new Instance in a given project and 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()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .build(); Instance response = notebookServiceClient.createInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createInstanceOperationCallable
public final OperationCallable<CreateInstanceRequest,Instance, createInstanceOperationCallable()OperationMetadata> Creates a new Instance in a given project and 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()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.createInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
createInstanceCallable
Creates a new Instance in a given project and 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()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.createInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
registerInstanceAsync
public final OperationFuture<Instance,OperationMetadata> registerInstanceAsync(RegisterInstanceRequest request) Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.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()) { RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .build(); Instance response = notebookServiceClient.registerInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
registerInstanceOperationCallable
public final OperationCallable<RegisterInstanceRequest,Instance, registerInstanceOperationCallable()OperationMetadata> Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.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()) { RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.registerInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
registerInstanceCallable
Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.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()) { RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .build(); ApiFuture<Operation> future = notebookServiceClient.registerInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
setInstanceAcceleratorAsync
public final OperationFuture<Instance,OperationMetadata> setInstanceAcceleratorAsync(SetInstanceAcceleratorRequest request) Updates the guest accelerators of a single Instance.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()) { SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder() .setName("name3373707") .setCoreCount(-1963855761) .build(); Instance response = notebookServiceClient.setInstanceAcceleratorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setInstanceAcceleratorOperationCallable
public final OperationCallable<SetInstanceAcceleratorRequest,Instance, setInstanceAcceleratorOperationCallable()OperationMetadata> Updates the guest accelerators of a single Instance.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()) { SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder() .setName("name3373707") .setCoreCount(-1963855761) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceAcceleratorOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
setInstanceAcceleratorCallable
public final UnaryCallable<SetInstanceAcceleratorRequest,Operation> setInstanceAcceleratorCallable()Updates the guest accelerators of a single Instance.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()) { SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder() .setName("name3373707") .setCoreCount(-1963855761) .build(); ApiFuture<Operation> future = notebookServiceClient.setInstanceAcceleratorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
setInstanceMachineTypeAsync
public final OperationFuture<Instance,OperationMetadata> setInstanceMachineTypeAsync(SetInstanceMachineTypeRequest request) Updates the machine type of a single Instance.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()) { SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder() .setName("name3373707") .setMachineType("machineType-218117087") .build(); Instance response = notebookServiceClient.setInstanceMachineTypeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setInstanceMachineTypeOperationCallable
public final OperationCallable<SetInstanceMachineTypeRequest,Instance, setInstanceMachineTypeOperationCallable()OperationMetadata> Updates the machine type of a single Instance.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()) { SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder() .setName("name3373707") .setMachineType("machineType-218117087") .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceMachineTypeOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
setInstanceMachineTypeCallable
public final UnaryCallable<SetInstanceMachineTypeRequest,Operation> setInstanceMachineTypeCallable()Updates the machine type of a single Instance.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()) { SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder() .setName("name3373707") .setMachineType("machineType-218117087") .build(); ApiFuture<Operation> future = notebookServiceClient.setInstanceMachineTypeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateInstanceConfigAsync
public final OperationFuture<Instance,OperationMetadata> updateInstanceConfigAsync(UpdateInstanceConfigRequest request) Update Notebook Instance configurations.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()) { UpdateInstanceConfigRequest request = UpdateInstanceConfigRequest.newBuilder() .setName("name3373707") .setConfig(InstanceConfig.newBuilder().build()) .build(); Instance response = notebookServiceClient.updateInstanceConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateInstanceConfigOperationCallable
public final OperationCallable<UpdateInstanceConfigRequest,Instance, updateInstanceConfigOperationCallable()OperationMetadata> Update Notebook Instance configurations.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()) { UpdateInstanceConfigRequest request = UpdateInstanceConfigRequest.newBuilder() .setName("name3373707") .setConfig(InstanceConfig.newBuilder().build()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.updateInstanceConfigOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
updateInstanceConfigCallable
Update Notebook Instance configurations.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()) { UpdateInstanceConfigRequest request = UpdateInstanceConfigRequest.newBuilder() .setName("name3373707") .setConfig(InstanceConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.updateInstanceConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateShieldedInstanceConfigAsync
public final OperationFuture<Instance,OperationMetadata> updateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigRequest request) Updates the Shielded instance configuration of a single Instance.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()) { UpdateShieldedInstanceConfigRequest request = UpdateShieldedInstanceConfigRequest.newBuilder() .setName("name3373707") .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build()) .build(); Instance response = notebookServiceClient.updateShieldedInstanceConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateShieldedInstanceConfigOperationCallable
public final OperationCallable<UpdateShieldedInstanceConfigRequest,Instance, updateShieldedInstanceConfigOperationCallable()OperationMetadata> Updates the Shielded instance configuration of a single Instance.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()) { UpdateShieldedInstanceConfigRequest request = UpdateShieldedInstanceConfigRequest.newBuilder() .setName("name3373707") .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.updateShieldedInstanceConfigOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
updateShieldedInstanceConfigCallable
public final UnaryCallable<UpdateShieldedInstanceConfigRequest,Operation> updateShieldedInstanceConfigCallable()Updates the Shielded instance configuration of a single Instance.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()) { UpdateShieldedInstanceConfigRequest request = UpdateShieldedInstanceConfigRequest.newBuilder() .setName("name3373707") .setShieldedInstanceConfig(Instance.ShieldedInstanceConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.updateShieldedInstanceConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
setInstanceLabelsAsync
public final OperationFuture<Instance,OperationMetadata> setInstanceLabelsAsync(SetInstanceLabelsRequest request) Replaces all the labels of an Instance.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()) { SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder() .setName("name3373707") .putAllLabels(new HashMap<String, String>()) .build(); Instance response = notebookServiceClient.setInstanceLabelsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setInstanceLabelsOperationCallable
public final OperationCallable<SetInstanceLabelsRequest,Instance, setInstanceLabelsOperationCallable()OperationMetadata> Replaces all the labels of an Instance.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()) { SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder() .setName("name3373707") .putAllLabels(new HashMap<String, String>()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceLabelsOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
setInstanceLabelsCallable
Replaces all the labels of an Instance.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()) { SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder() .setName("name3373707") .putAllLabels(new HashMap<String, String>()) .build(); ApiFuture<Operation> future = notebookServiceClient.setInstanceLabelsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateInstanceMetadataItems
public final UpdateInstanceMetadataItemsResponse updateInstanceMetadataItems(UpdateInstanceMetadataItemsRequest request) Add/update metadata items for an instance.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()) { UpdateInstanceMetadataItemsRequest request = UpdateInstanceMetadataItemsRequest.newBuilder() .setName("name3373707") .putAllItems(new HashMap<String, String>()) .build(); UpdateInstanceMetadataItemsResponse response = notebookServiceClient.updateInstanceMetadataItems(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateInstanceMetadataItemsCallable
public final UnaryCallable<UpdateInstanceMetadataItemsRequest,UpdateInstanceMetadataItemsResponse> updateInstanceMetadataItemsCallable()Add/update metadata items for an instance.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()) { UpdateInstanceMetadataItemsRequest request = UpdateInstanceMetadataItemsRequest.newBuilder() .setName("name3373707") .putAllItems(new HashMap<String, String>()) .build(); ApiFuture<UpdateInstanceMetadataItemsResponse> future = notebookServiceClient.updateInstanceMetadataItemsCallable().futureCall(request); // Do something. UpdateInstanceMetadataItemsResponse response = future.get(); } -
deleteInstanceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(String name) Deletes a single Instance.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 = "name3373707"; notebookServiceClient.deleteInstanceAsync(name).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`- Throws:
ApiException- if the remote call fails
-
deleteInstanceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request) Deletes a single Instance.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()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName("name3373707").build(); notebookServiceClient.deleteInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteInstanceOperationCallable
public final OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty, deleteInstanceOperationCallable()OperationMetadata> Deletes a single Instance.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()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteInstanceOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteInstanceCallable
Deletes a single Instance.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()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.deleteInstanceCallable().futureCall(request); // Do something. future.get(); } -
startInstanceAsync
public final OperationFuture<Instance,OperationMetadata> startInstanceAsync(StartInstanceRequest request) Starts a notebook instance.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()) { StartInstanceRequest request = StartInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.startInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
startInstanceOperationCallable
public final OperationCallable<StartInstanceRequest,Instance, startInstanceOperationCallable()OperationMetadata> Starts a notebook instance.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()) { StartInstanceRequest request = StartInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.startInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
startInstanceCallable
Starts a notebook instance.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()) { StartInstanceRequest request = StartInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.startInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
stopInstanceAsync
public final OperationFuture<Instance,OperationMetadata> stopInstanceAsync(StopInstanceRequest request) Stops a notebook instance.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()) { StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.stopInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
stopInstanceOperationCallable
public final OperationCallable<StopInstanceRequest,Instance, stopInstanceOperationCallable()OperationMetadata> Stops a notebook instance.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()) { StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.stopInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
stopInstanceCallable
Stops a notebook instance.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()) { StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.stopInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
resetInstanceAsync
public final OperationFuture<Instance,OperationMetadata> resetInstanceAsync(ResetInstanceRequest request) Resets a notebook instance.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()) { ResetInstanceRequest request = ResetInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.resetInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resetInstanceOperationCallable
public final OperationCallable<ResetInstanceRequest,Instance, resetInstanceOperationCallable()OperationMetadata> Resets a notebook instance.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()) { ResetInstanceRequest request = ResetInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.resetInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
resetInstanceCallable
Resets a notebook instance.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()) { ResetInstanceRequest request = ResetInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.resetInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
reportInstanceInfoAsync
public final OperationFuture<Instance,OperationMetadata> reportInstanceInfoAsync(ReportInstanceInfoRequest request) Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.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()) { ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .putAllMetadata(new HashMap<String, String>()) .build(); Instance response = notebookServiceClient.reportInstanceInfoAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
reportInstanceInfoOperationCallable
public final OperationCallable<ReportInstanceInfoRequest,Instance, reportInstanceInfoOperationCallable()OperationMetadata> Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.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()) { ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .putAllMetadata(new HashMap<String, String>()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.reportInstanceInfoOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
reportInstanceInfoCallable
Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.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()) { ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .putAllMetadata(new HashMap<String, String>()) .build(); ApiFuture<Operation> future = notebookServiceClient.reportInstanceInfoCallable().futureCall(request); // Do something. Operation response = future.get(); } -
isInstanceUpgradeable
public final IsInstanceUpgradeableResponse isInstanceUpgradeable(IsInstanceUpgradeableRequest request) Check if a notebook instance is upgradable.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()) { IsInstanceUpgradeableRequest request = IsInstanceUpgradeableRequest.newBuilder() .setNotebookInstance("notebookInstance-544239728") .setType(UpgradeType.forNumber(0)) .build(); IsInstanceUpgradeableResponse response = notebookServiceClient.isInstanceUpgradeable(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
isInstanceUpgradeableCallable
public final UnaryCallable<IsInstanceUpgradeableRequest,IsInstanceUpgradeableResponse> isInstanceUpgradeableCallable()Check if a notebook instance is upgradable.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()) { IsInstanceUpgradeableRequest request = IsInstanceUpgradeableRequest.newBuilder() .setNotebookInstance("notebookInstance-544239728") .setType(UpgradeType.forNumber(0)) .build(); ApiFuture<IsInstanceUpgradeableResponse> future = notebookServiceClient.isInstanceUpgradeableCallable().futureCall(request); // Do something. IsInstanceUpgradeableResponse response = future.get(); } -
getInstanceHealth
Check if a notebook instance is healthy.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()) { InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`- Throws:
ApiException- if the remote call fails
-
getInstanceHealth
Check if a notebook instance is healthy.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 = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`- Throws:
ApiException- if the remote call fails
-
getInstanceHealth
Check if a notebook instance is healthy.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()) { GetInstanceHealthRequest request = GetInstanceHealthRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) .build(); GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getInstanceHealthCallable
public final UnaryCallable<GetInstanceHealthRequest,GetInstanceHealthResponse> getInstanceHealthCallable()Check if a notebook instance is healthy.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()) { GetInstanceHealthRequest request = GetInstanceHealthRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) .build(); ApiFuture<GetInstanceHealthResponse> future = notebookServiceClient.getInstanceHealthCallable().futureCall(request); // Do something. GetInstanceHealthResponse response = future.get(); } -
upgradeInstanceAsync
public final OperationFuture<Instance,OperationMetadata> upgradeInstanceAsync(UpgradeInstanceRequest request) Upgrades a notebook instance to the latest version.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()) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder() .setName("name3373707") .setType(UpgradeType.forNumber(0)) .build(); Instance response = notebookServiceClient.upgradeInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
upgradeInstanceOperationCallable
public final OperationCallable<UpgradeInstanceRequest,Instance, upgradeInstanceOperationCallable()OperationMetadata> Upgrades a notebook instance to the latest version.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()) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder() .setName("name3373707") .setType(UpgradeType.forNumber(0)) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.upgradeInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
upgradeInstanceCallable
Upgrades a notebook instance to the latest version.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()) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder() .setName("name3373707") .setType(UpgradeType.forNumber(0)) .build(); ApiFuture<Operation> future = notebookServiceClient.upgradeInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
rollbackInstanceAsync
public final OperationFuture<Instance,OperationMetadata> rollbackInstanceAsync(RollbackInstanceRequest request) Rollbacks a notebook instance to the previous version.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()) { RollbackInstanceRequest request = RollbackInstanceRequest.newBuilder() .setName("name3373707") .setTargetSnapshot("targetSnapshot-1307211147") .build(); Instance response = notebookServiceClient.rollbackInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
rollbackInstanceOperationCallable
public final OperationCallable<RollbackInstanceRequest,Instance, rollbackInstanceOperationCallable()OperationMetadata> Rollbacks a notebook instance to the previous version.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()) { RollbackInstanceRequest request = RollbackInstanceRequest.newBuilder() .setName("name3373707") .setTargetSnapshot("targetSnapshot-1307211147") .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.rollbackInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
rollbackInstanceCallable
Rollbacks a notebook instance to the previous version.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()) { RollbackInstanceRequest request = RollbackInstanceRequest.newBuilder() .setName("name3373707") .setTargetSnapshot("targetSnapshot-1307211147") .build(); ApiFuture<Operation> future = notebookServiceClient.rollbackInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
diagnoseInstanceAsync
public final OperationFuture<Instance,OperationMetadata> diagnoseInstanceAsync(InstanceName name, DiagnosticConfig diagnosticConfig) Creates a Diagnostic File and runs Diagnostic Tool given an Instance.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()) { InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`diagnosticConfig- Required. Defines flags that are used to run the diagnostic tool- Throws:
ApiException- if the remote call fails
-
diagnoseInstanceAsync
public final OperationFuture<Instance,OperationMetadata> diagnoseInstanceAsync(String name, DiagnosticConfig diagnosticConfig) Creates a Diagnostic File and runs Diagnostic Tool given an Instance.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 = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build(); Instance response = notebookServiceClient.diagnoseInstanceAsync(name, diagnosticConfig).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`diagnosticConfig- Required. Defines flags that are used to run the diagnostic tool- Throws:
ApiException- if the remote call fails
-
diagnoseInstanceAsync
public final OperationFuture<Instance,OperationMetadata> diagnoseInstanceAsync(DiagnoseInstanceRequest request) Creates a Diagnostic File and runs Diagnostic Tool given an Instance.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()) { DiagnoseInstanceRequest request = DiagnoseInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) .build(); Instance response = notebookServiceClient.diagnoseInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
diagnoseInstanceOperationCallable
public final OperationCallable<DiagnoseInstanceRequest,Instance, diagnoseInstanceOperationCallable()OperationMetadata> Creates a Diagnostic File and runs Diagnostic Tool given an Instance.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()) { DiagnoseInstanceRequest request = DiagnoseInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.diagnoseInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
diagnoseInstanceCallable
Creates a Diagnostic File and runs Diagnostic Tool given an Instance.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()) { DiagnoseInstanceRequest request = DiagnoseInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) .setDiagnosticConfig(DiagnosticConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.diagnoseInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
upgradeInstanceInternalAsync
public final OperationFuture<Instance,OperationMetadata> upgradeInstanceInternalAsync(UpgradeInstanceInternalRequest request) Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.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()) { UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .setType(UpgradeType.forNumber(0)) .build(); Instance response = notebookServiceClient.upgradeInstanceInternalAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
upgradeInstanceInternalOperationCallable
public final OperationCallable<UpgradeInstanceInternalRequest,Instance, upgradeInstanceInternalOperationCallable()OperationMetadata> Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.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()) { UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .setType(UpgradeType.forNumber(0)) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.upgradeInstanceInternalOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
upgradeInstanceInternalCallable
public final UnaryCallable<UpgradeInstanceInternalRequest,Operation> upgradeInstanceInternalCallable()Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.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()) { UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .setType(UpgradeType.forNumber(0)) .build(); ApiFuture<Operation> future = notebookServiceClient.upgradeInstanceInternalCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listEnvironments
Lists environments in a project.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 = "parent-995424086"; for (Environment element : notebookServiceClient.listEnvironments(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `projects/{project_id}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listEnvironments
public final NotebookServiceClient.ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequest request) Lists environments in a project.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()) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Environment element : notebookServiceClient.listEnvironments(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
-
listEnvironmentsPagedCallable
public final UnaryCallable<ListEnvironmentsRequest,NotebookServiceClient.ListEnvironmentsPagedResponse> listEnvironmentsPagedCallable()Lists environments in a project.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()) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Environment> future = notebookServiceClient.listEnvironmentsPagedCallable().futureCall(request); // Do something. for (Environment element : future.get().iterateAll()) { // doThingsWith(element); } } -
listEnvironmentsCallable
public final UnaryCallable<ListEnvironmentsRequest,ListEnvironmentsResponse> listEnvironmentsCallable()Lists environments in a project.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()) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListEnvironmentsResponse response = notebookServiceClient.listEnvironmentsCallable().call(request); for (Environment element : response.getEnvironmentsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getEnvironment
Gets details of a single Environment.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 = "name3373707"; Environment response = notebookServiceClient.getEnvironment(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/environments/{environment_id}`- Throws:
ApiException- if the remote call fails
-
getEnvironment
Gets details of a single Environment.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()) { GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName("name3373707").build(); Environment response = notebookServiceClient.getEnvironment(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getEnvironmentCallable
Gets details of a single Environment.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()) { GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName("name3373707").build(); ApiFuture<Environment> future = notebookServiceClient.getEnvironmentCallable().futureCall(request); // Do something. Environment response = future.get(); } -
createEnvironmentAsync
public final OperationFuture<Environment,OperationMetadata> createEnvironmentAsync(String parent, Environment environment, String environmentId) Creates a new Environment.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 = "parent-995424086"; Environment environment = Environment.newBuilder().build(); String environmentId = "environmentId-950205810"; Environment response = notebookServiceClient.createEnvironmentAsync(parent, environment, environmentId).get(); }- Parameters:
parent- Required. Format: `projects/{project_id}/locations/{location}`environment- Required. The environment to be created.environmentId- Required. User-defined unique ID of this environment. The `environment_id` must be 1 to 63 characters long and contain only lowercase letters, numeric characters, and dashes. The first character must be a lowercase letter and the last character cannot be a dash.- Throws:
ApiException- if the remote call fails
-
createEnvironmentAsync
public final OperationFuture<Environment,OperationMetadata> createEnvironmentAsync(CreateEnvironmentRequest request) Creates a new Environment.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()) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent("parent-995424086") .setEnvironmentId("environmentId-950205810") .setEnvironment(Environment.newBuilder().build()) .build(); Environment response = notebookServiceClient.createEnvironmentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createEnvironmentOperationCallable
public final OperationCallable<CreateEnvironmentRequest,Environment, createEnvironmentOperationCallable()OperationMetadata> Creates a new Environment.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()) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent("parent-995424086") .setEnvironmentId("environmentId-950205810") .setEnvironment(Environment.newBuilder().build()) .build(); OperationFuture<Environment, OperationMetadata> future = notebookServiceClient.createEnvironmentOperationCallable().futureCall(request); // Do something. Environment response = future.get(); } -
createEnvironmentCallable
Creates a new Environment.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()) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent("parent-995424086") .setEnvironmentId("environmentId-950205810") .setEnvironment(Environment.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.createEnvironmentCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteEnvironmentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEnvironmentAsync(String name) Deletes a single Environment.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 = "name3373707"; notebookServiceClient.deleteEnvironmentAsync(name).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/environments/{environment_id}`- Throws:
ApiException- if the remote call fails
-
deleteEnvironmentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEnvironmentAsync(DeleteEnvironmentRequest request) Deletes a single Environment.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()) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName("name3373707").build(); notebookServiceClient.deleteEnvironmentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteEnvironmentOperationCallable
public final OperationCallable<DeleteEnvironmentRequest,com.google.protobuf.Empty, deleteEnvironmentOperationCallable()OperationMetadata> Deletes a single Environment.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()) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName("name3373707").build(); OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteEnvironmentOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteEnvironmentCallable
Deletes a single Environment.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()) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.deleteEnvironmentCallable().futureCall(request); // Do something. future.get(); } -
listSchedules
Lists schedules in a given project and 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()) { ScheduleName parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]"); for (Schedule element : notebookServiceClient.listSchedules(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listSchedules
Lists schedules in a given project and 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 = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString(); for (Schedule element : notebookServiceClient.listSchedules(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listSchedules
public final NotebookServiceClient.ListSchedulesPagedResponse listSchedules(ListSchedulesRequest request) Lists schedules in a given project and 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()) { ListSchedulesRequest request = ListSchedulesRequest.newBuilder() .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Schedule element : notebookServiceClient.listSchedules(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
-
listSchedulesPagedCallable
public final UnaryCallable<ListSchedulesRequest,NotebookServiceClient.ListSchedulesPagedResponse> listSchedulesPagedCallable()Lists schedules in a given project and 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()) { ListSchedulesRequest request = ListSchedulesRequest.newBuilder() .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Schedule> future = notebookServiceClient.listSchedulesPagedCallable().futureCall(request); // Do something. for (Schedule element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSchedulesCallable
Lists schedules in a given project and 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()) { ListSchedulesRequest request = ListSchedulesRequest.newBuilder() .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListSchedulesResponse response = notebookServiceClient.listSchedulesCallable().call(request); for (Schedule element : response.getSchedulesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getSchedule
Gets details of scheduleSample 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()) { ScheduleName name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]"); Schedule response = notebookServiceClient.getSchedule(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/schedules/{schedule_id}`- Throws:
ApiException- if the remote call fails
-
getSchedule
Gets details of scheduleSample 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 = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString(); Schedule response = notebookServiceClient.getSchedule(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/schedules/{schedule_id}`- Throws:
ApiException- if the remote call fails
-
getSchedule
Gets details of scheduleSample 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()) { GetScheduleRequest request = GetScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); Schedule response = notebookServiceClient.getSchedule(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getScheduleCallable
Gets details of scheduleSample 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()) { GetScheduleRequest request = GetScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); ApiFuture<Schedule> future = notebookServiceClient.getScheduleCallable().futureCall(request); // Do something. Schedule response = future.get(); } -
deleteScheduleAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteScheduleAsync(ScheduleName name) Deletes schedule and all underlying jobsSample 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()) { ScheduleName name = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]"); notebookServiceClient.deleteScheduleAsync(name).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/schedules/{schedule_id}`- Throws:
ApiException- if the remote call fails
-
deleteScheduleAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteScheduleAsync(String name) Deletes schedule and all underlying jobsSample 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 = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString(); notebookServiceClient.deleteScheduleAsync(name).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/schedules/{schedule_id}`- Throws:
ApiException- if the remote call fails
-
deleteScheduleAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteScheduleAsync(DeleteScheduleRequest request) Deletes schedule and all underlying jobsSample 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()) { DeleteScheduleRequest request = DeleteScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); notebookServiceClient.deleteScheduleAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteScheduleOperationCallable
public final OperationCallable<DeleteScheduleRequest,com.google.protobuf.Empty, deleteScheduleOperationCallable()OperationMetadata> Deletes schedule and all underlying jobsSample 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()) { DeleteScheduleRequest request = DeleteScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteScheduleOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteScheduleCallable
Deletes schedule and all underlying jobsSample 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()) { DeleteScheduleRequest request = DeleteScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); ApiFuture<Operation> future = notebookServiceClient.deleteScheduleCallable().futureCall(request); // Do something. future.get(); } -
createScheduleAsync
public final OperationFuture<Schedule,OperationMetadata> createScheduleAsync(ScheduleName parent, Schedule schedule, String scheduleId) Creates a new Scheduled Notebook in a given project and 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()) { ScheduleName parent = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]"); Schedule schedule = Schedule.newBuilder().build(); String scheduleId = "scheduleId-687058414"; Schedule response = notebookServiceClient.createScheduleAsync(parent, schedule, scheduleId).get(); }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`schedule- Required. The schedule to be created.scheduleId- Required. User-defined unique ID of this schedule.- Throws:
ApiException- if the remote call fails
-
createScheduleAsync
public final OperationFuture<Schedule,OperationMetadata> createScheduleAsync(String parent, Schedule schedule, String scheduleId) Creates a new Scheduled Notebook in a given project and 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 = ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString(); Schedule schedule = Schedule.newBuilder().build(); String scheduleId = "scheduleId-687058414"; Schedule response = notebookServiceClient.createScheduleAsync(parent, schedule, scheduleId).get(); }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`schedule- Required. The schedule to be created.scheduleId- Required. User-defined unique ID of this schedule.- Throws:
ApiException- if the remote call fails
-
createScheduleAsync
public final OperationFuture<Schedule,OperationMetadata> createScheduleAsync(CreateScheduleRequest request) Creates a new Scheduled Notebook in a given project and 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()) { CreateScheduleRequest request = CreateScheduleRequest.newBuilder() .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .setScheduleId("scheduleId-687058414") .setSchedule(Schedule.newBuilder().build()) .build(); Schedule response = notebookServiceClient.createScheduleAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createScheduleOperationCallable
public final OperationCallable<CreateScheduleRequest,Schedule, createScheduleOperationCallable()OperationMetadata> Creates a new Scheduled Notebook in a given project and 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()) { CreateScheduleRequest request = CreateScheduleRequest.newBuilder() .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .setScheduleId("scheduleId-687058414") .setSchedule(Schedule.newBuilder().build()) .build(); OperationFuture<Schedule, OperationMetadata> future = notebookServiceClient.createScheduleOperationCallable().futureCall(request); // Do something. Schedule response = future.get(); } -
createScheduleCallable
Creates a new Scheduled Notebook in a given project and 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()) { CreateScheduleRequest request = CreateScheduleRequest.newBuilder() .setParent(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .setScheduleId("scheduleId-687058414") .setSchedule(Schedule.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.createScheduleCallable().futureCall(request); // Do something. Operation response = future.get(); } -
triggerScheduleAsync
public final OperationFuture<Schedule,OperationMetadata> triggerScheduleAsync(TriggerScheduleRequest request) Triggers execution of an existing schedule.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()) { TriggerScheduleRequest request = TriggerScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); Schedule response = notebookServiceClient.triggerScheduleAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
triggerScheduleOperationCallable
public final OperationCallable<TriggerScheduleRequest,Schedule, triggerScheduleOperationCallable()OperationMetadata> Triggers execution of an existing schedule.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()) { TriggerScheduleRequest request = TriggerScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); OperationFuture<Schedule, OperationMetadata> future = notebookServiceClient.triggerScheduleOperationCallable().futureCall(request); // Do something. Schedule response = future.get(); } -
triggerScheduleCallable
Triggers execution of an existing schedule.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()) { TriggerScheduleRequest request = TriggerScheduleRequest.newBuilder() .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) .build(); ApiFuture<Operation> future = notebookServiceClient.triggerScheduleCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listExecutions
Lists executions in a given project and locationSample 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()) { ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]"); for (Execution element : notebookServiceClient.listExecutions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listExecutions
Lists executions in a given project and locationSample 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 = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString(); for (Execution element : notebookServiceClient.listExecutions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listExecutions
public final NotebookServiceClient.ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) Lists executions in a given project and locationSample 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()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Execution element : notebookServiceClient.listExecutions(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
-
listExecutionsPagedCallable
public final UnaryCallable<ListExecutionsRequest,NotebookServiceClient.ListExecutionsPagedResponse> listExecutionsPagedCallable()Lists executions in a given project and locationSample 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()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Execution> future = notebookServiceClient.listExecutionsPagedCallable().futureCall(request); // Do something. for (Execution element : future.get().iterateAll()) { // doThingsWith(element); } } -
listExecutionsCallable
Lists executions in a given project and locationSample 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()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListExecutionsResponse response = notebookServiceClient.listExecutionsCallable().call(request); for (Execution element : response.getExecutionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getExecution
Gets details of executionsSample 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()) { ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]"); Execution response = notebookServiceClient.getExecution(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/executions/{execution_id}`- Throws:
ApiException- if the remote call fails
-
getExecution
Gets details of executionsSample 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 = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString(); Execution response = notebookServiceClient.getExecution(name); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/executions/{execution_id}`- Throws:
ApiException- if the remote call fails
-
getExecution
Gets details of executionsSample 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()) { GetExecutionRequest request = GetExecutionRequest.newBuilder() .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .build(); Execution response = notebookServiceClient.getExecution(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getExecutionCallable
Gets details of executionsSample 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()) { GetExecutionRequest request = GetExecutionRequest.newBuilder() .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .build(); ApiFuture<Execution> future = notebookServiceClient.getExecutionCallable().futureCall(request); // Do something. Execution response = future.get(); } -
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(ExecutionName name) Deletes executionSample 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()) { ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]"); notebookServiceClient.deleteExecutionAsync(name).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/executions/{execution_id}`- Throws:
ApiException- if the remote call fails
-
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(String name) Deletes executionSample 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 = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString(); notebookServiceClient.deleteExecutionAsync(name).get(); }- Parameters:
name- Required. Format: `projects/{project_id}/locations/{location}/executions/{execution_id}`- Throws:
ApiException- if the remote call fails
-
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(DeleteExecutionRequest request) Deletes executionSample 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()) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder() .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .build(); notebookServiceClient.deleteExecutionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteExecutionOperationCallable
public final OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty, deleteExecutionOperationCallable()OperationMetadata> Deletes executionSample 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()) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder() .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteExecutionOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteExecutionCallable
Deletes executionSample 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()) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder() .setName(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .build(); ApiFuture<Operation> future = notebookServiceClient.deleteExecutionCallable().futureCall(request); // Do something. future.get(); } -
createExecutionAsync
public final OperationFuture<Execution,OperationMetadata> createExecutionAsync(ExecutionName parent, Execution execution, String executionId) Creates a new Execution in a given project and 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()) { ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]"); Execution execution = Execution.newBuilder().build(); String executionId = "executionId-454906285"; Execution response = notebookServiceClient.createExecutionAsync(parent, execution, executionId).get(); }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`execution- Required. The execution to be created.executionId- Required. User-defined unique ID of this execution.- Throws:
ApiException- if the remote call fails
-
createExecutionAsync
public final OperationFuture<Execution,OperationMetadata> createExecutionAsync(String parent, Execution execution, String executionId) Creates a new Execution in a given project and 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 = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString(); Execution execution = Execution.newBuilder().build(); String executionId = "executionId-454906285"; Execution response = notebookServiceClient.createExecutionAsync(parent, execution, executionId).get(); }- Parameters:
parent- Required. Format: `parent=projects/{project_id}/locations/{location}`execution- Required. The execution to be created.executionId- Required. User-defined unique ID of this execution.- Throws:
ApiException- if the remote call fails
-
createExecutionAsync
public final OperationFuture<Execution,OperationMetadata> createExecutionAsync(CreateExecutionRequest request) Creates a new Execution in a given project and 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()) { CreateExecutionRequest request = CreateExecutionRequest.newBuilder() .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .setExecutionId("executionId-454906285") .setExecution(Execution.newBuilder().build()) .build(); Execution response = notebookServiceClient.createExecutionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createExecutionOperationCallable
public final OperationCallable<CreateExecutionRequest,Execution, createExecutionOperationCallable()OperationMetadata> Creates a new Execution in a given project and 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()) { CreateExecutionRequest request = CreateExecutionRequest.newBuilder() .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .setExecutionId("executionId-454906285") .setExecution(Execution.newBuilder().build()) .build(); OperationFuture<Execution, OperationMetadata> future = notebookServiceClient.createExecutionOperationCallable().futureCall(request); // Do something. Execution response = future.get(); } -
createExecutionCallable
Creates a new Execution in a given project and 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()) { CreateExecutionRequest request = CreateExecutionRequest.newBuilder() .setParent(ExecutionName.of("[PROJECT]", "[LOCATION]", "[EXECUTION]").toString()) .setExecutionId("executionId-454906285") .setExecution(Execution.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.createExecutionCallable().futureCall(request); // Do something. Operation response = 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(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").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(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").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(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").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(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").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(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").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(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").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
-