Class NotebookServiceClient (1.49.0)

Service Description: API v1beta1 service for Cloud AI Platform Notebooks.

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetInstanceRequestrequest=GetInstanceRequest.newBuilder().setName("name3373707").build();
Instanceresponse=notebookServiceClient.getInstance(request);
}

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

Methods
Method Description Method Variants

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.

  • listInstances(ListInstancesRequest request)

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

  • listInstancesPagedCallable()

  • listInstancesCallable()

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.

  • getInstance(GetInstanceRequest request)

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

  • getInstanceCallable()

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.

  • createInstanceAsync(CreateInstanceRequest request)

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

  • createInstanceOperationCallable()

  • createInstanceCallable()

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.

  • registerInstanceAsync(RegisterInstanceRequest request)

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

  • registerInstanceOperationCallable()

  • registerInstanceCallable()

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.

  • setInstanceAcceleratorAsync(SetInstanceAcceleratorRequest request)

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

  • setInstanceAcceleratorOperationCallable()

  • setInstanceAcceleratorCallable()

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.

  • setInstanceMachineTypeAsync(SetInstanceMachineTypeRequest request)

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

  • setInstanceMachineTypeOperationCallable()

  • setInstanceMachineTypeCallable()

SetInstanceLabels

Updates the labels of an Instance.

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

  • setInstanceLabelsAsync(SetInstanceLabelsRequest request)

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

  • setInstanceLabelsOperationCallable()

  • setInstanceLabelsCallable()

DeleteInstance

Deletes a single Instance.

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

  • deleteInstanceAsync(DeleteInstanceRequest request)

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

  • deleteInstanceOperationCallable()

  • deleteInstanceCallable()

StartInstance

Starts a notebook instance.

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

  • startInstanceAsync(StartInstanceRequest request)

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

  • startInstanceOperationCallable()

  • startInstanceCallable()

StopInstance

Stops a notebook instance.

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

  • stopInstanceAsync(StopInstanceRequest request)

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

  • stopInstanceOperationCallable()

  • stopInstanceCallable()

ResetInstance

Resets a notebook instance.

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

  • resetInstanceAsync(ResetInstanceRequest request)

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

  • resetInstanceOperationCallable()

  • resetInstanceCallable()

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.

  • reportInstanceInfoAsync(ReportInstanceInfoRequest request)

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

  • reportInstanceInfoOperationCallable()

  • reportInstanceInfoCallable()

IsInstanceUpgradeable

Check if a notebook instance is upgradable. Deprecated. Please consider using v1.

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

  • isInstanceUpgradeable(IsInstanceUpgradeableRequest request)

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

  • isInstanceUpgradeableCallable()

UpgradeInstance

Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1.

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

  • upgradeInstanceAsync(UpgradeInstanceRequest request)

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

  • upgradeInstanceOperationCallable()

  • upgradeInstanceCallable()

UpgradeInstanceInternal

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly. Deprecated. Please consider using v1.

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

  • upgradeInstanceInternalAsync(UpgradeInstanceInternalRequest request)

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

  • upgradeInstanceInternalOperationCallable()

  • upgradeInstanceInternalCallable()

ListEnvironments

Lists environments in a project.

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

  • listEnvironments(ListEnvironmentsRequest request)

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

  • listEnvironmentsPagedCallable()

  • listEnvironmentsCallable()

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.

  • getEnvironment(GetEnvironmentRequest request)

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

  • getEnvironmentCallable()

CreateEnvironment

Creates a new Environment.

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

  • createEnvironmentAsync(CreateEnvironmentRequest request)

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

  • createEnvironmentOperationCallable()

  • createEnvironmentCallable()

DeleteEnvironment

Deletes a single Environment.

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

  • deleteEnvironmentAsync(DeleteEnvironmentRequest request)

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

  • deleteEnvironmentOperationCallable()

  • deleteEnvironmentCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

SetIamPolicy

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

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

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

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

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

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

See the individual methods for example code.

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

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

To customize credentials:


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

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

Inheritance

java.lang.Object > NotebookServiceClient

Static Methods

create()

publicstaticfinalNotebookServiceClientcreate()

Constructs an instance of NotebookServiceClient with default settings.

Returns
Type Description
NotebookServiceClient
Exceptions
Type Description
IOException

create(NotebookServiceSettings settings)

publicstaticfinalNotebookServiceClientcreate(NotebookServiceSettingssettings)

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

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

create(NotebookServiceStub stub)

publicstaticfinalNotebookServiceClientcreate(NotebookServiceStubstub)

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

Parameter
Name Description
stub NotebookServiceStub
Returns
Type Description
NotebookServiceClient

Constructors

NotebookServiceClient(NotebookServiceSettings settings)

protectedNotebookServiceClient(NotebookServiceSettingssettings)

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

Parameter
Name Description
settings NotebookServiceSettings

NotebookServiceClient(NotebookServiceStub stub)

protectedNotebookServiceClient(NotebookServiceStubstub)
Parameter
Name Description
stub NotebookServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

publicbooleanawaitTermination(longduration,TimeUnitunit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

publicfinalvoidclose()

createEnvironmentAsync(CreateEnvironmentRequest request)

publicfinalOperationFuture<Environment,OperationMetadata>createEnvironmentAsync(CreateEnvironmentRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
CreateEnvironmentRequestrequest=
CreateEnvironmentRequest.newBuilder()
.setParent("parent-995424086")
.setEnvironmentId("environmentId-950205810")
.setEnvironment(Environment.newBuilder().build())
.build();
Environmentresponse=notebookServiceClient.createEnvironmentAsync(request).get();
}
Parameter
Name Description
request CreateEnvironmentRequest

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

Returns
Type Description
OperationFuture<Environment,OperationMetadata>

createEnvironmentCallable()

publicfinalUnaryCallable<CreateEnvironmentRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
CreateEnvironmentRequestrequest=
CreateEnvironmentRequest.newBuilder()
.setParent("parent-995424086")
.setEnvironmentId("environmentId-950205810")
.setEnvironment(Environment.newBuilder().build())
.build();
ApiFuture<Operation>future=
notebookServiceClient.createEnvironmentCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<CreateEnvironmentRequest,Operation>

createEnvironmentOperationCallable()

publicfinalOperationCallable<CreateEnvironmentRequest,Environment,OperationMetadata>createEnvironmentOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
CreateEnvironmentRequestrequest=
CreateEnvironmentRequest.newBuilder()
.setParent("parent-995424086")
.setEnvironmentId("environmentId-950205810")
.setEnvironment(Environment.newBuilder().build())
.build();
OperationFuture<Environment,OperationMetadata>future=
notebookServiceClient.createEnvironmentOperationCallable().futureCall(request);
// Do something.
Environmentresponse=future.get();
}
Returns
Type Description
OperationCallable<CreateEnvironmentRequest,Environment,OperationMetadata>

createInstanceAsync(CreateInstanceRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>createInstanceAsync(CreateInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
CreateInstanceRequestrequest=
CreateInstanceRequest.newBuilder()
.setParent("parent-995424086")
.setInstanceId("instanceId902024336")
.setInstance(Instance.newBuilder().build())
.build();
Instanceresponse=notebookServiceClient.createInstanceAsync(request).get();
}
Parameter
Name Description
request CreateInstanceRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createInstanceCallable()

publicfinalUnaryCallable<CreateInstanceRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
CreateInstanceRequestrequest=
CreateInstanceRequest.newBuilder()
.setParent("parent-995424086")
.setInstanceId("instanceId902024336")
.setInstance(Instance.newBuilder().build())
.build();
ApiFuture<Operation>future=
notebookServiceClient.createInstanceCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<CreateInstanceRequest,Operation>

createInstanceOperationCallable()

publicfinalOperationCallable<CreateInstanceRequest,Instance,OperationMetadata>createInstanceOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
CreateInstanceRequestrequest=
CreateInstanceRequest.newBuilder()
.setParent("parent-995424086")
.setInstanceId("instanceId902024336")
.setInstance(Instance.newBuilder().build())
.build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.createInstanceOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<CreateInstanceRequest,Instance,OperationMetadata>

deleteEnvironmentAsync(DeleteEnvironmentRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteEnvironmentAsync(DeleteEnvironmentRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
DeleteEnvironmentRequestrequest=
DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
notebookServiceClient.deleteEnvironmentAsync(request).get();
}
Parameter
Name Description
request DeleteEnvironmentRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEnvironmentCallable()

publicfinalUnaryCallable<DeleteEnvironmentRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
DeleteEnvironmentRequestrequest=
DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation>future=
notebookServiceClient.deleteEnvironmentCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
UnaryCallable<DeleteEnvironmentRequest,Operation>

deleteEnvironmentOperationCallable()

publicfinalOperationCallable<DeleteEnvironmentRequest,Empty,OperationMetadata>deleteEnvironmentOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
DeleteEnvironmentRequestrequest=
DeleteEnvironmentRequest.newBuilder().setName("name3373707").build();
OperationFuture<Empty,OperationMetadata>future=
notebookServiceClient.deleteEnvironmentOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
OperationCallable<DeleteEnvironmentRequest,Empty,OperationMetadata>

deleteInstanceAsync(DeleteInstanceRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteInstanceAsync(DeleteInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
DeleteInstanceRequestrequest=
DeleteInstanceRequest.newBuilder().setName("name3373707").build();
notebookServiceClient.deleteInstanceAsync(request).get();
}
Parameter
Name Description
request DeleteInstanceRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInstanceCallable()

publicfinalUnaryCallable<DeleteInstanceRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
DeleteInstanceRequestrequest=
DeleteInstanceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation>future=
notebookServiceClient.deleteInstanceCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
UnaryCallable<DeleteInstanceRequest,Operation>

deleteInstanceOperationCallable()

publicfinalOperationCallable<DeleteInstanceRequest,Empty,OperationMetadata>deleteInstanceOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
DeleteInstanceRequestrequest=
DeleteInstanceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Empty,OperationMetadata>future=
notebookServiceClient.deleteInstanceOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata>

getEnvironment(GetEnvironmentRequest request)

publicfinalEnvironmentgetEnvironment(GetEnvironmentRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetEnvironmentRequestrequest=
GetEnvironmentRequest.newBuilder().setName("name3373707").build();
Environmentresponse=notebookServiceClient.getEnvironment(request);
}
Parameter
Name Description
request GetEnvironmentRequest

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

Returns
Type Description
Environment

getEnvironmentCallable()

publicfinalUnaryCallable<GetEnvironmentRequest,Environment>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetEnvironmentRequestrequest=
GetEnvironmentRequest.newBuilder().setName("name3373707").build();
ApiFuture<Environment>future=
notebookServiceClient.getEnvironmentCallable().futureCall(request);
// Do something.
Environmentresponse=future.get();
}
Returns
Type Description
UnaryCallable<GetEnvironmentRequest,Environment>

getIamPolicy(GetIamPolicyRequest request)

publicfinalPolicygetIamPolicy(GetIamPolicyRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource("GetIamPolicyRequest-1527610370".toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policyresponse=notebookServiceClient.getIamPolicy(request);
}
Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest

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

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

getIamPolicyCallable()

publicfinalUnaryCallable<GetIamPolicyRequest,Policy>getIamPolicyCallable()

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

Sample code:


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

getInstance(GetInstanceRequest request)

publicfinalInstancegetInstance(GetInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetInstanceRequestrequest=GetInstanceRequest.newBuilder().setName("name3373707").build();
Instanceresponse=notebookServiceClient.getInstance(request);
}
Parameter
Name Description
request GetInstanceRequest

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

Returns
Type Description
Instance

getInstanceCallable()

publicfinalUnaryCallable<GetInstanceRequest,Instance>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetInstanceRequestrequest=GetInstanceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Instance>future=notebookServiceClient.getInstanceCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
UnaryCallable<GetInstanceRequest,Instance>

getLocation(GetLocationRequest request)

publicfinalLocationgetLocation(GetLocationRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
Locationresponse=notebookServiceClient.getLocation(request);
}
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

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

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

getLocationCallable()

publicfinalUnaryCallable<GetLocationRequest,Location>getLocationCallable()

Gets information about a location.

Sample code:


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

getOperationsClient()

publicfinalOperationsClientgetOperationsClient()

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

Returns
Type Description
OperationsClient

getSettings()

publicfinalNotebookServiceSettingsgetSettings()
Returns
Type Description
NotebookServiceSettings

getStub()

publicNotebookServiceStubgetStub()
Returns
Type Description
NotebookServiceStub

isInstanceUpgradeable(IsInstanceUpgradeableRequest request) (deprecated)

publicfinalIsInstanceUpgradeableResponseisInstanceUpgradeable(IsInstanceUpgradeableRequestrequest)

Deprecated. This method is deprecated and will be removed in the next major version update.

Check if a notebook instance is upgradable. Deprecated. Please consider using v1.

Sample code:


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

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

Returns
Type Description
IsInstanceUpgradeableResponse

isInstanceUpgradeableCallable() (deprecated)

publicfinalUnaryCallable<IsInstanceUpgradeableRequest,IsInstanceUpgradeableResponse>isInstanceUpgradeableCallable()

Deprecated. This method is deprecated and will be removed in the next major version update.

Check if a notebook instance is upgradable. Deprecated. Please consider using v1.

Sample code:


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

isShutdown()

publicbooleanisShutdown()
Returns
Type Description
boolean

isTerminated()

publicbooleanisTerminated()
Returns
Type Description
boolean

listEnvironments(ListEnvironmentsRequest request)

publicfinalNotebookServiceClient.ListEnvironmentsPagedResponselistEnvironments(ListEnvironmentsRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListEnvironmentsRequestrequest=
ListEnvironmentsRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Environmentelement:notebookServiceClient.listEnvironments(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request ListEnvironmentsRequest

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

Returns
Type Description
NotebookServiceClient.ListEnvironmentsPagedResponse

listEnvironmentsCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListEnvironmentsRequestrequest=
ListEnvironmentsRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListEnvironmentsResponseresponse=
notebookServiceClient.listEnvironmentsCallable().call(request);
for(Environmentelement:response.getEnvironmentsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<ListEnvironmentsRequest,ListEnvironmentsResponse>

listEnvironmentsPagedCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListEnvironmentsRequestrequest=
ListEnvironmentsRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Environment>future=
notebookServiceClient.listEnvironmentsPagedCallable().futureCall(request);
// Do something.
for(Environmentelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<ListEnvironmentsRequest,ListEnvironmentsPagedResponse>

listInstances(ListInstancesRequest request)

publicfinalNotebookServiceClient.ListInstancesPagedResponselistInstances(ListInstancesRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListInstancesRequestrequest=
ListInstancesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Instanceelement:notebookServiceClient.listInstances(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request ListInstancesRequest

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

Returns
Type Description
NotebookServiceClient.ListInstancesPagedResponse

listInstancesCallable()

publicfinalUnaryCallable<ListInstancesRequest,ListInstancesResponse>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListInstancesRequestrequest=
ListInstancesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListInstancesResponseresponse=
notebookServiceClient.listInstancesCallable().call(request);
for(Instanceelement:response.getInstancesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<ListInstancesRequest,ListInstancesResponse>

listInstancesPagedCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListInstancesRequestrequest=
ListInstancesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Instance>future=
notebookServiceClient.listInstancesPagedCallable().futureCall(request);
// Do something.
for(Instanceelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<ListInstancesRequest,ListInstancesPagedResponse>

listLocations(ListLocationsRequest request)

publicfinalNotebookServiceClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Locationelement:notebookServiceClient.listLocations(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

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

Returns
Type Description
NotebookServiceClient.ListLocationsPagedResponse

listLocationsCallable()

publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


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

listLocationsPagedCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location>future=
notebookServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for(Locationelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

registerInstanceAsync(RegisterInstanceRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>registerInstanceAsync(RegisterInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
RegisterInstanceRequestrequest=
RegisterInstanceRequest.newBuilder()
.setParent("parent-995424086")
.setInstanceId("instanceId902024336")
.build();
Instanceresponse=notebookServiceClient.registerInstanceAsync(request).get();
}
Parameter
Name Description
request RegisterInstanceRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

registerInstanceCallable()

publicfinalUnaryCallable<RegisterInstanceRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
RegisterInstanceRequestrequest=
RegisterInstanceRequest.newBuilder()
.setParent("parent-995424086")
.setInstanceId("instanceId902024336")
.build();
ApiFuture<Operation>future=
notebookServiceClient.registerInstanceCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<RegisterInstanceRequest,Operation>

registerInstanceOperationCallable()

publicfinalOperationCallable<RegisterInstanceRequest,Instance,OperationMetadata>registerInstanceOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
RegisterInstanceRequestrequest=
RegisterInstanceRequest.newBuilder()
.setParent("parent-995424086")
.setInstanceId("instanceId902024336")
.build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.registerInstanceOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<RegisterInstanceRequest,Instance,OperationMetadata>

reportInstanceInfoAsync(ReportInstanceInfoRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>reportInstanceInfoAsync(ReportInstanceInfoRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ReportInstanceInfoRequestrequest=
ReportInstanceInfoRequest.newBuilder()
.setName("name3373707")
.setVmId("vmId3622450")
.putAllMetadata(newHashMap<String,String>())
.build();
Instanceresponse=notebookServiceClient.reportInstanceInfoAsync(request).get();
}
Parameter
Name Description
request ReportInstanceInfoRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

reportInstanceInfoCallable()

publicfinalUnaryCallable<ReportInstanceInfoRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ReportInstanceInfoRequestrequest=
ReportInstanceInfoRequest.newBuilder()
.setName("name3373707")
.setVmId("vmId3622450")
.putAllMetadata(newHashMap<String,String>())
.build();
ApiFuture<Operation>future=
notebookServiceClient.reportInstanceInfoCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<ReportInstanceInfoRequest,Operation>

reportInstanceInfoOperationCallable()

publicfinalOperationCallable<ReportInstanceInfoRequest,Instance,OperationMetadata>reportInstanceInfoOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ReportInstanceInfoRequestrequest=
ReportInstanceInfoRequest.newBuilder()
.setName("name3373707")
.setVmId("vmId3622450")
.putAllMetadata(newHashMap<String,String>())
.build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.reportInstanceInfoOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<ReportInstanceInfoRequest,Instance,OperationMetadata>

resetInstanceAsync(ResetInstanceRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>resetInstanceAsync(ResetInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ResetInstanceRequestrequest=
ResetInstanceRequest.newBuilder().setName("name3373707").build();
Instanceresponse=notebookServiceClient.resetInstanceAsync(request).get();
}
Parameter
Name Description
request ResetInstanceRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

resetInstanceCallable()

publicfinalUnaryCallable<ResetInstanceRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ResetInstanceRequestrequest=
ResetInstanceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation>future=
notebookServiceClient.resetInstanceCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<ResetInstanceRequest,Operation>

resetInstanceOperationCallable()

publicfinalOperationCallable<ResetInstanceRequest,Instance,OperationMetadata>resetInstanceOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
ResetInstanceRequestrequest=
ResetInstanceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.resetInstanceOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<ResetInstanceRequest,Instance,OperationMetadata>

setIamPolicy(SetIamPolicyRequest request)

publicfinalPolicysetIamPolicy(SetIamPolicyRequestrequest)

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


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

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

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

setIamPolicyCallable()

publicfinalUnaryCallable<SetIamPolicyRequest,Policy>setIamPolicyCallable()

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


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

setInstanceAcceleratorAsync(SetInstanceAcceleratorRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>setInstanceAcceleratorAsync(SetInstanceAcceleratorRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceAcceleratorRequestrequest=
SetInstanceAcceleratorRequest.newBuilder()
.setName("name3373707")
.setCoreCount(-1963855761)
.build();
Instanceresponse=notebookServiceClient.setInstanceAcceleratorAsync(request).get();
}
Parameter
Name Description
request SetInstanceAcceleratorRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

setInstanceAcceleratorCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceAcceleratorRequestrequest=
SetInstanceAcceleratorRequest.newBuilder()
.setName("name3373707")
.setCoreCount(-1963855761)
.build();
ApiFuture<Operation>future=
notebookServiceClient.setInstanceAcceleratorCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<SetInstanceAcceleratorRequest,Operation>

setInstanceAcceleratorOperationCallable()

publicfinalOperationCallable<SetInstanceAcceleratorRequest,Instance,OperationMetadata>setInstanceAcceleratorOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceAcceleratorRequestrequest=
SetInstanceAcceleratorRequest.newBuilder()
.setName("name3373707")
.setCoreCount(-1963855761)
.build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.setInstanceAcceleratorOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<SetInstanceAcceleratorRequest,Instance,OperationMetadata>

setInstanceLabelsAsync(SetInstanceLabelsRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>setInstanceLabelsAsync(SetInstanceLabelsRequestrequest)

Updates 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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceLabelsRequestrequest=
SetInstanceLabelsRequest.newBuilder()
.setName("name3373707")
.putAllLabels(newHashMap<String,String>())
.build();
Instanceresponse=notebookServiceClient.setInstanceLabelsAsync(request).get();
}
Parameter
Name Description
request SetInstanceLabelsRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

setInstanceLabelsCallable()

publicfinalUnaryCallable<SetInstanceLabelsRequest,Operation>setInstanceLabelsCallable()

Updates 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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceLabelsRequestrequest=
SetInstanceLabelsRequest.newBuilder()
.setName("name3373707")
.putAllLabels(newHashMap<String,String>())
.build();
ApiFuture<Operation>future=
notebookServiceClient.setInstanceLabelsCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<SetInstanceLabelsRequest,Operation>

setInstanceLabelsOperationCallable()

publicfinalOperationCallable<SetInstanceLabelsRequest,Instance,OperationMetadata>setInstanceLabelsOperationCallable()

Updates 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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceLabelsRequestrequest=
SetInstanceLabelsRequest.newBuilder()
.setName("name3373707")
.putAllLabels(newHashMap<String,String>())
.build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.setInstanceLabelsOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<SetInstanceLabelsRequest,Instance,OperationMetadata>

setInstanceMachineTypeAsync(SetInstanceMachineTypeRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>setInstanceMachineTypeAsync(SetInstanceMachineTypeRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceMachineTypeRequestrequest=
SetInstanceMachineTypeRequest.newBuilder()
.setName("name3373707")
.setMachineType("machineType-218117087")
.build();
Instanceresponse=notebookServiceClient.setInstanceMachineTypeAsync(request).get();
}
Parameter
Name Description
request SetInstanceMachineTypeRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

setInstanceMachineTypeCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceMachineTypeRequestrequest=
SetInstanceMachineTypeRequest.newBuilder()
.setName("name3373707")
.setMachineType("machineType-218117087")
.build();
ApiFuture<Operation>future=
notebookServiceClient.setInstanceMachineTypeCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<SetInstanceMachineTypeRequest,Operation>

setInstanceMachineTypeOperationCallable()

publicfinalOperationCallable<SetInstanceMachineTypeRequest,Instance,OperationMetadata>setInstanceMachineTypeOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
SetInstanceMachineTypeRequestrequest=
SetInstanceMachineTypeRequest.newBuilder()
.setName("name3373707")
.setMachineType("machineType-218117087")
.build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.setInstanceMachineTypeOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<SetInstanceMachineTypeRequest,Instance,OperationMetadata>

shutdown()

publicvoidshutdown()

shutdownNow()

publicvoidshutdownNow()

startInstanceAsync(StartInstanceRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>startInstanceAsync(StartInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
StartInstanceRequestrequest=
StartInstanceRequest.newBuilder().setName("name3373707").build();
Instanceresponse=notebookServiceClient.startInstanceAsync(request).get();
}
Parameter
Name Description
request StartInstanceRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

startInstanceCallable()

publicfinalUnaryCallable<StartInstanceRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
StartInstanceRequestrequest=
StartInstanceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation>future=
notebookServiceClient.startInstanceCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<StartInstanceRequest,Operation>

startInstanceOperationCallable()

publicfinalOperationCallable<StartInstanceRequest,Instance,OperationMetadata>startInstanceOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
StartInstanceRequestrequest=
StartInstanceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.startInstanceOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<StartInstanceRequest,Instance,OperationMetadata>

stopInstanceAsync(StopInstanceRequest request)

publicfinalOperationFuture<Instance,OperationMetadata>stopInstanceAsync(StopInstanceRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
StopInstanceRequestrequest=StopInstanceRequest.newBuilder().setName("name3373707").build();
Instanceresponse=notebookServiceClient.stopInstanceAsync(request).get();
}
Parameter
Name Description
request StopInstanceRequest

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

stopInstanceCallable()

publicfinalUnaryCallable<StopInstanceRequest,Operation>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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
StopInstanceRequestrequest=StopInstanceRequest.newBuilder().setName("name3373707").build();
ApiFuture<Operation>future=
notebookServiceClient.stopInstanceCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<StopInstanceRequest,Operation>

stopInstanceOperationCallable()

publicfinalOperationCallable<StopInstanceRequest,Instance,OperationMetadata>stopInstanceOperationCallable()

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
StopInstanceRequestrequest=StopInstanceRequest.newBuilder().setName("name3373707").build();
OperationFuture<Instance,OperationMetadata>future=
notebookServiceClient.stopInstanceOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
Returns
Type Description
OperationCallable<StopInstanceRequest,Instance,OperationMetadata>

testIamPermissions(TestIamPermissionsRequest request)

publicfinalTestIamPermissionsResponsetestIamPermissions(TestIamPermissionsRequestrequest)

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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource("TestIamPermissionsRequest942398222".toString())
.addAllPermissions(newArrayList<String>())
.build();
TestIamPermissionsResponseresponse=notebookServiceClient.testIamPermissions(request);
}
Parameter
Name Description
request com.google.iam.v1.TestIamPermissionsRequest

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

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

testIamPermissionsCallable()

publicfinalUnaryCallable<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(NotebookServiceClientnotebookServiceClient=NotebookServiceClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource("TestIamPermissionsRequest942398222".toString())
.addAllPermissions(newArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse>future=
notebookServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponseresponse=future.get();
}
Returns
Type Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

upgradeInstanceAsync(UpgradeInstanceRequest request) (deprecated)

publicfinalOperationFuture<Instance,OperationMetadata>upgradeInstanceAsync(UpgradeInstanceRequestrequest)

Deprecated. This method is deprecated and will be removed in the next major version update.

Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1.

Sample code:


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

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

upgradeInstanceCallable() (deprecated)

publicfinalUnaryCallable<UpgradeInstanceRequest,Operation>upgradeInstanceCallable()

Deprecated. This method is deprecated and will be removed in the next major version update.

Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1.

Sample code:


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

upgradeInstanceInternalAsync(UpgradeInstanceInternalRequest request) (deprecated)

publicfinalOperationFuture<Instance,OperationMetadata>upgradeInstanceInternalAsync(UpgradeInstanceInternalRequestrequest)

Deprecated. This method is deprecated and will be removed in the next major version update.

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly. Deprecated. Please consider using v1.

Sample code:


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

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

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

upgradeInstanceInternalCallable() (deprecated)

publicfinalUnaryCallable<UpgradeInstanceInternalRequest,Operation>upgradeInstanceInternalCallable()

Deprecated. This method is deprecated and will be removed in the next major version update.

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly. Deprecated. Please consider using v1.

Sample code:


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

upgradeInstanceInternalOperationCallable() (deprecated)

publicfinalOperationCallable<UpgradeInstanceInternalRequest,Instance,OperationMetadata>upgradeInstanceInternalOperationCallable()

Deprecated. This method is deprecated and will be removed in the next major version update.

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly. Deprecated. Please consider using v1.

Sample code:


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

upgradeInstanceOperationCallable() (deprecated)

publicfinalOperationCallable<UpgradeInstanceRequest,Instance,OperationMetadata>upgradeInstanceOperationCallable()

Deprecated. This method is deprecated and will be removed in the next major version update.

Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1.

Sample code:


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

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.