Class NotebookServiceClient (1.49.0)
Stay organized with collections
Save and categorize content based on your preferences.
- 1.76.0 (latest)
- 1.74.0
- 1.73.0
- 1.72.0
- 1.71.0
- 1.70.0
- 1.68.0
- 1.66.0
- 1.65.0
- 1.62.0
- 1.61.0
- 1.60.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.3
- 1.0.6
- 0.6.2
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().
| 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.
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.
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.
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.
|
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.
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.
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. Deprecated. Please consider using v1. |
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.
|
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.
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. Deprecated. Please consider using v1. |
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.
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.
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.
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.
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 |
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 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
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.
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.GetIamPolicyRequestThe 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.GetLocationRequestThe 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.ListLocationsRequestThe 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.SetIamPolicyRequestThe 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.TestIamPermissionsRequestThe 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> |
|