Class NotebookServiceClient
- java.lang.Object
-
- com.google.cloud.notebooks.v1beta1.NotebookServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class NotebookServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = 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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of NotebookServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library NotebookServiceSettings notebookServiceSettings = NotebookServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); NotebookServiceClient notebookServiceClient = NotebookServiceClient.create(notebookServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library NotebookServiceSettings notebookServiceSettings = NotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); NotebookServiceClient notebookServiceClient = NotebookServiceClient.create(notebookServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NotebookServiceClient.ListEnvironmentsFixedSizeCollection
static class
NotebookServiceClient.ListEnvironmentsPage
static class
NotebookServiceClient.ListEnvironmentsPagedResponse
static class
NotebookServiceClient.ListInstancesFixedSizeCollection
static class
NotebookServiceClient.ListInstancesPage
static class
NotebookServiceClient.ListInstancesPagedResponse
static class
NotebookServiceClient.ListLocationsFixedSizeCollection
static class
NotebookServiceClient.ListLocationsPage
static class
NotebookServiceClient.ListLocationsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
NotebookServiceClient(NotebookServiceSettings settings)
Constructs an instance of NotebookServiceClient, using the given settings.protected
NotebookServiceClient(NotebookServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static NotebookServiceClient
create()
Constructs an instance of NotebookServiceClient with default settings.static NotebookServiceClient
create(NotebookServiceSettings settings)
Constructs an instance of NotebookServiceClient, using the given settings.static NotebookServiceClient
create(NotebookServiceStub stub)
Constructs an instance of NotebookServiceClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Environment,OperationMetadata>
createEnvironmentAsync(CreateEnvironmentRequest request)
Creates a new Environment.com.google.api.gax.rpc.UnaryCallable<CreateEnvironmentRequest,com.google.longrunning.Operation>
createEnvironmentCallable()
Creates a new Environment.com.google.api.gax.rpc.OperationCallable<CreateEnvironmentRequest,Environment,OperationMetadata>
createEnvironmentOperationCallable()
Creates a new Environment.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
createInstanceAsync(CreateInstanceRequest request)
Creates a new Instance in a given project and location.com.google.api.gax.rpc.UnaryCallable<CreateInstanceRequest,com.google.longrunning.Operation>
createInstanceCallable()
Creates a new Instance in a given project and location.com.google.api.gax.rpc.OperationCallable<CreateInstanceRequest,Instance,OperationMetadata>
createInstanceOperationCallable()
Creates a new Instance in a given project and location.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteEnvironmentAsync(DeleteEnvironmentRequest request)
Deletes a single Environment.com.google.api.gax.rpc.UnaryCallable<DeleteEnvironmentRequest,com.google.longrunning.Operation>
deleteEnvironmentCallable()
Deletes a single Environment.com.google.api.gax.rpc.OperationCallable<DeleteEnvironmentRequest,com.google.protobuf.Empty,OperationMetadata>
deleteEnvironmentOperationCallable()
Deletes a single Environment.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteInstanceAsync(DeleteInstanceRequest request)
Deletes a single Instance.com.google.api.gax.rpc.UnaryCallable<DeleteInstanceRequest,com.google.longrunning.Operation>
deleteInstanceCallable()
Deletes a single Instance.com.google.api.gax.rpc.OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty,OperationMetadata>
deleteInstanceOperationCallable()
Deletes a single Instance.Environment
getEnvironment(GetEnvironmentRequest request)
Gets details of a single Environment.com.google.api.gax.rpc.UnaryCallable<GetEnvironmentRequest,Environment>
getEnvironmentCallable()
Gets details of a single Environment.com.google.iam.v1.Policy
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>
getIamPolicyCallable()
Gets the access control policy for a resource.Instance
getInstance(GetInstanceRequest request)
Gets details of a single Instance.com.google.api.gax.rpc.UnaryCallable<GetInstanceRequest,Instance>
getInstanceCallable()
Gets details of a single Instance.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.NotebookServiceSettings
getSettings()
NotebookServiceStub
getStub()
IsInstanceUpgradeableResponse
isInstanceUpgradeable(IsInstanceUpgradeableRequest request)
Deprecated.This method is deprecated and will be removed in the next major version update.com.google.api.gax.rpc.UnaryCallable<IsInstanceUpgradeableRequest,IsInstanceUpgradeableResponse>
isInstanceUpgradeableCallable()
Deprecated.This method is deprecated and will be removed in the next major version update.boolean
isShutdown()
boolean
isTerminated()
NotebookServiceClient.ListEnvironmentsPagedResponse
listEnvironments(ListEnvironmentsRequest request)
Lists environments in a project.com.google.api.gax.rpc.UnaryCallable<ListEnvironmentsRequest,ListEnvironmentsResponse>
listEnvironmentsCallable()
Lists environments in a project.com.google.api.gax.rpc.UnaryCallable<ListEnvironmentsRequest,NotebookServiceClient.ListEnvironmentsPagedResponse>
listEnvironmentsPagedCallable()
Lists environments in a project.NotebookServiceClient.ListInstancesPagedResponse
listInstances(ListInstancesRequest request)
Lists instances in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,ListInstancesResponse>
listInstancesCallable()
Lists instances in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,NotebookServiceClient.ListInstancesPagedResponse>
listInstancesPagedCallable()
Lists instances in a given project and location.NotebookServiceClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,NotebookServiceClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
registerInstanceAsync(RegisterInstanceRequest request)
Registers an existing legacy notebook instance to the Notebooks API server.com.google.api.gax.rpc.UnaryCallable<RegisterInstanceRequest,com.google.longrunning.Operation>
registerInstanceCallable()
Registers an existing legacy notebook instance to the Notebooks API server.com.google.api.gax.rpc.OperationCallable<RegisterInstanceRequest,Instance,OperationMetadata>
registerInstanceOperationCallable()
Registers an existing legacy notebook instance to the Notebooks API server.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
reportInstanceInfoAsync(ReportInstanceInfoRequest request)
Allows notebook instances to report their latest instance information to the Notebooks API server.com.google.api.gax.rpc.UnaryCallable<ReportInstanceInfoRequest,com.google.longrunning.Operation>
reportInstanceInfoCallable()
Allows notebook instances to report their latest instance information to the Notebooks API server.com.google.api.gax.rpc.OperationCallable<ReportInstanceInfoRequest,Instance,OperationMetadata>
reportInstanceInfoOperationCallable()
Allows notebook instances to report their latest instance information to the Notebooks API server.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
resetInstanceAsync(ResetInstanceRequest request)
Resets a notebook instance.com.google.api.gax.rpc.UnaryCallable<ResetInstanceRequest,com.google.longrunning.Operation>
resetInstanceCallable()
Resets a notebook instance.com.google.api.gax.rpc.OperationCallable<ResetInstanceRequest,Instance,OperationMetadata>
resetInstanceOperationCallable()
Resets a notebook instance.com.google.iam.v1.Policy
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>
setIamPolicyCallable()
Sets the access control policy on the specified resource.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
setInstanceAcceleratorAsync(SetInstanceAcceleratorRequest request)
Updates the guest accelerators of a single Instance.com.google.api.gax.rpc.UnaryCallable<SetInstanceAcceleratorRequest,com.google.longrunning.Operation>
setInstanceAcceleratorCallable()
Updates the guest accelerators of a single Instance.com.google.api.gax.rpc.OperationCallable<SetInstanceAcceleratorRequest,Instance,OperationMetadata>
setInstanceAcceleratorOperationCallable()
Updates the guest accelerators of a single Instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
setInstanceLabelsAsync(SetInstanceLabelsRequest request)
Updates the labels of an Instance.com.google.api.gax.rpc.UnaryCallable<SetInstanceLabelsRequest,com.google.longrunning.Operation>
setInstanceLabelsCallable()
Updates the labels of an Instance.com.google.api.gax.rpc.OperationCallable<SetInstanceLabelsRequest,Instance,OperationMetadata>
setInstanceLabelsOperationCallable()
Updates the labels of an Instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
setInstanceMachineTypeAsync(SetInstanceMachineTypeRequest request)
Updates the machine type of a single Instance.com.google.api.gax.rpc.UnaryCallable<SetInstanceMachineTypeRequest,com.google.longrunning.Operation>
setInstanceMachineTypeCallable()
Updates the machine type of a single Instance.com.google.api.gax.rpc.OperationCallable<SetInstanceMachineTypeRequest,Instance,OperationMetadata>
setInstanceMachineTypeOperationCallable()
Updates the machine type of a single Instance.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
startInstanceAsync(StartInstanceRequest request)
Starts a notebook instance.com.google.api.gax.rpc.UnaryCallable<StartInstanceRequest,com.google.longrunning.Operation>
startInstanceCallable()
Starts a notebook instance.com.google.api.gax.rpc.OperationCallable<StartInstanceRequest,Instance,OperationMetadata>
startInstanceOperationCallable()
Starts a notebook instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
stopInstanceAsync(StopInstanceRequest request)
Stops a notebook instance.com.google.api.gax.rpc.UnaryCallable<StopInstanceRequest,com.google.longrunning.Operation>
stopInstanceCallable()
Stops a notebook instance.com.google.api.gax.rpc.OperationCallable<StopInstanceRequest,Instance,OperationMetadata>
stopInstanceOperationCallable()
Stops a notebook instance.com.google.iam.v1.TestIamPermissionsResponse
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
upgradeInstanceAsync(UpgradeInstanceRequest request)
Deprecated.This method is deprecated and will be removed in the next major version update.com.google.api.gax.rpc.UnaryCallable<UpgradeInstanceRequest,com.google.longrunning.Operation>
upgradeInstanceCallable()
Deprecated.This method is deprecated and will be removed in the next major version update.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
upgradeInstanceInternalAsync(UpgradeInstanceInternalRequest request)
Deprecated.This method is deprecated and will be removed in the next major version update.com.google.api.gax.rpc.UnaryCallable<UpgradeInstanceInternalRequest,com.google.longrunning.Operation>
upgradeInstanceInternalCallable()
Deprecated.This method is deprecated and will be removed in the next major version update.com.google.api.gax.rpc.OperationCallable<UpgradeInstanceInternalRequest,Instance,OperationMetadata>
upgradeInstanceInternalOperationCallable()
Deprecated.This method is deprecated and will be removed in the next major version update.com.google.api.gax.rpc.OperationCallable<UpgradeInstanceRequest,Instance,OperationMetadata>
upgradeInstanceOperationCallable()
Deprecated.This method is deprecated and will be removed in the next major version update.
-
-
-
Constructor Detail
-
NotebookServiceClient
protected NotebookServiceClient(NotebookServiceSettings settings) throws IOException
Constructs an instance of NotebookServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
NotebookServiceClient
protected NotebookServiceClient(NotebookServiceStub stub)
-
-
Method Detail
-
create
public static final NotebookServiceClient create() throws IOException
Constructs an instance of NotebookServiceClient with default settings.- Throws:
IOException
-
create
public static final NotebookServiceClient create(NotebookServiceSettings settings) throws IOException
Constructs an instance of NotebookServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final NotebookServiceClient create(NotebookServiceStub stub)
Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(NotebookServiceSettings).
-
getSettings
public final NotebookServiceSettings getSettings()
-
getStub
public NotebookServiceStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
listInstances
public final NotebookServiceClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request)
Lists instances in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Instance element : notebookServiceClient.listInstances(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstancesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,NotebookServiceClient.ListInstancesPagedResponse> listInstancesPagedCallable()
Lists instances in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Instance> future = notebookServiceClient.listInstancesPagedCallable().futureCall(request); // Do something. for (Instance element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listInstancesCallable
public final com.google.api.gax.rpc.UnaryCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListInstancesResponse response = notebookServiceClient.listInstancesCallable().call(request); for (Instance element : response.getInstancesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getInstance
public final Instance getInstance(GetInstanceRequest request)
Gets details of a single Instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.getInstance(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Instance> future = notebookServiceClient.getInstanceCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
createInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request)
Creates a new Instance in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .build(); Instance response = notebookServiceClient.createInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createInstanceOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.createInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
createInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.createInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
registerInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> registerInstanceAsync(RegisterInstanceRequest request)
Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .build(); Instance response = notebookServiceClient.registerInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
registerInstanceOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.registerInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
registerInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<RegisterInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { RegisterInstanceRequest request = RegisterInstanceRequest.newBuilder() .setParent("parent-995424086") .setInstanceId("instanceId902024336") .build(); ApiFuture<Operation> future = notebookServiceClient.registerInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setInstanceAcceleratorAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> setInstanceAcceleratorAsync(SetInstanceAcceleratorRequest request)
Updates the guest accelerators of a single Instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder() .setName("name3373707") .setCoreCount(-1963855761) .build(); Instance response = notebookServiceClient.setInstanceAcceleratorAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setInstanceAcceleratorOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder() .setName("name3373707") .setCoreCount(-1963855761) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceAcceleratorOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
setInstanceAcceleratorCallable
public final com.google.api.gax.rpc.UnaryCallable<SetInstanceAcceleratorRequest,com.google.longrunning.Operation> setInstanceAcceleratorCallable()
Updates the guest accelerators of a single Instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceAcceleratorRequest request = SetInstanceAcceleratorRequest.newBuilder() .setName("name3373707") .setCoreCount(-1963855761) .build(); ApiFuture<Operation> future = notebookServiceClient.setInstanceAcceleratorCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setInstanceMachineTypeAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> setInstanceMachineTypeAsync(SetInstanceMachineTypeRequest request)
Updates the machine type of a single Instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder() .setName("name3373707") .setMachineType("machineType-218117087") .build(); Instance response = notebookServiceClient.setInstanceMachineTypeAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setInstanceMachineTypeOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder() .setName("name3373707") .setMachineType("machineType-218117087") .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceMachineTypeOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
setInstanceMachineTypeCallable
public final com.google.api.gax.rpc.UnaryCallable<SetInstanceMachineTypeRequest,com.google.longrunning.Operation> setInstanceMachineTypeCallable()
Updates the machine type of a single Instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceMachineTypeRequest request = SetInstanceMachineTypeRequest.newBuilder() .setName("name3373707") .setMachineType("machineType-218117087") .build(); ApiFuture<Operation> future = notebookServiceClient.setInstanceMachineTypeCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setInstanceLabelsAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> setInstanceLabelsAsync(SetInstanceLabelsRequest request)
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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder() .setName("name3373707") .putAllLabels(new HashMap<String, String>()) .build(); Instance response = notebookServiceClient.setInstanceLabelsAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setInstanceLabelsOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder() .setName("name3373707") .putAllLabels(new HashMap<String, String>()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.setInstanceLabelsOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
setInstanceLabelsCallable
public final com.google.api.gax.rpc.UnaryCallable<SetInstanceLabelsRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetInstanceLabelsRequest request = SetInstanceLabelsRequest.newBuilder() .setName("name3373707") .putAllLabels(new HashMap<String, String>()) .build(); ApiFuture<Operation> future = notebookServiceClient.setInstanceLabelsCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request)
Deletes a single Instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName("name3373707").build(); notebookServiceClient.deleteInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteInstanceOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteInstanceRequest,com.google.protobuf.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteInstanceOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.deleteInstanceCallable().futureCall(request); // Do something. future.get(); }
-
startInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> startInstanceAsync(StartInstanceRequest request)
Starts a notebook instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { StartInstanceRequest request = StartInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.startInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
startInstanceOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { StartInstanceRequest request = StartInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.startInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
startInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<StartInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { StartInstanceRequest request = StartInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.startInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
stopInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> stopInstanceAsync(StopInstanceRequest request)
Stops a notebook instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.stopInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopInstanceOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.stopInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
stopInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<StopInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.stopInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
resetInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> resetInstanceAsync(ResetInstanceRequest request)
Resets a notebook instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ResetInstanceRequest request = ResetInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.resetInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resetInstanceOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ResetInstanceRequest request = ResetInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.resetInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
resetInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<ResetInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ResetInstanceRequest request = ResetInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.resetInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
reportInstanceInfoAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> reportInstanceInfoAsync(ReportInstanceInfoRequest request)
Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .putAllMetadata(new HashMap<String, String>()) .build(); Instance response = notebookServiceClient.reportInstanceInfoAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
reportInstanceInfoOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .putAllMetadata(new HashMap<String, String>()) .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.reportInstanceInfoOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
reportInstanceInfoCallable
public final com.google.api.gax.rpc.UnaryCallable<ReportInstanceInfoRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ReportInstanceInfoRequest request = ReportInstanceInfoRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .putAllMetadata(new HashMap<String, String>()) .build(); ApiFuture<Operation> future = notebookServiceClient.reportInstanceInfoCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
isInstanceUpgradeable
@Deprecated public final IsInstanceUpgradeableResponse isInstanceUpgradeable(IsInstanceUpgradeableRequest request)
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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { IsInstanceUpgradeableRequest request = IsInstanceUpgradeableRequest.newBuilder() .setNotebookInstance("notebookInstance-544239728") .build(); IsInstanceUpgradeableResponse response = notebookServiceClient.isInstanceUpgradeable(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
isInstanceUpgradeableCallable
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { IsInstanceUpgradeableRequest request = IsInstanceUpgradeableRequest.newBuilder() .setNotebookInstance("notebookInstance-544239728") .build(); ApiFuture<IsInstanceUpgradeableResponse> future = notebookServiceClient.isInstanceUpgradeableCallable().futureCall(request); // Do something. IsInstanceUpgradeableResponse response = future.get(); }
-
upgradeInstanceAsync
@Deprecated public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> upgradeInstanceAsync(UpgradeInstanceRequest request)
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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName("name3373707").build(); Instance response = notebookServiceClient.upgradeInstanceAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
upgradeInstanceOperationCallable
@Deprecated public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName("name3373707").build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.upgradeInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
upgradeInstanceCallable
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<UpgradeInstanceRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.upgradeInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
upgradeInstanceInternalAsync
@Deprecated public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> upgradeInstanceInternalAsync(UpgradeInstanceInternalRequest request)
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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .build(); Instance response = notebookServiceClient.upgradeInstanceInternalAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
upgradeInstanceInternalOperationCallable
@Deprecated public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .build(); OperationFuture<Instance, OperationMetadata> future = notebookServiceClient.upgradeInstanceInternalOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
upgradeInstanceInternalCallable
@Deprecated public final com.google.api.gax.rpc.UnaryCallable<UpgradeInstanceInternalRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { UpgradeInstanceInternalRequest request = UpgradeInstanceInternalRequest.newBuilder() .setName("name3373707") .setVmId("vmId3622450") .build(); ApiFuture<Operation> future = notebookServiceClient.upgradeInstanceInternalCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
listEnvironments
public final NotebookServiceClient.ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequest request)
Lists environments in a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Environment element : notebookServiceClient.listEnvironments(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEnvironmentsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListEnvironmentsRequest,NotebookServiceClient.ListEnvironmentsPagedResponse> listEnvironmentsPagedCallable()
Lists environments in a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Environment> future = notebookServiceClient.listEnvironmentsPagedCallable().futureCall(request); // Do something. for (Environment element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listEnvironmentsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListEnvironmentsRequest,ListEnvironmentsResponse> listEnvironmentsCallable()
Lists environments in a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListEnvironmentsResponse response = notebookServiceClient.listEnvironmentsCallable().call(request); for (Environment element : response.getEnvironmentsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getEnvironment
public final Environment getEnvironment(GetEnvironmentRequest request)
Gets details of a single Environment.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName("name3373707").build(); Environment response = notebookServiceClient.getEnvironment(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEnvironmentCallable
public final com.google.api.gax.rpc.UnaryCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName("name3373707").build(); ApiFuture<Environment> future = notebookServiceClient.getEnvironmentCallable().futureCall(request); // Do something. Environment response = future.get(); }
-
createEnvironmentAsync
public final com.google.api.gax.longrunning.OperationFuture<Environment,OperationMetadata> createEnvironmentAsync(CreateEnvironmentRequest request)
Creates a new Environment.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent("parent-995424086") .setEnvironmentId("environmentId-950205810") .setEnvironment(Environment.newBuilder().build()) .build(); Environment response = notebookServiceClient.createEnvironmentAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEnvironmentOperationCallable
public final com.google.api.gax.rpc.OperationCallable<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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent("parent-995424086") .setEnvironmentId("environmentId-950205810") .setEnvironment(Environment.newBuilder().build()) .build(); OperationFuture<Environment, OperationMetadata> future = notebookServiceClient.createEnvironmentOperationCallable().futureCall(request); // Do something. Environment response = future.get(); }
-
createEnvironmentCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateEnvironmentRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() .setParent("parent-995424086") .setEnvironmentId("environmentId-950205810") .setEnvironment(Environment.newBuilder().build()) .build(); ApiFuture<Operation> future = notebookServiceClient.createEnvironmentCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteEnvironmentAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEnvironmentAsync(DeleteEnvironmentRequest request)
Deletes a single Environment.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName("name3373707").build(); notebookServiceClient.deleteEnvironmentAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEnvironmentOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteEnvironmentRequest,com.google.protobuf.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName("name3373707").build(); OperationFuture<Empty, OperationMetadata> future = notebookServiceClient.deleteEnvironmentOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteEnvironmentCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteEnvironmentRequest,com.google.longrunning.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 (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = notebookServiceClient.deleteEnvironmentCallable().futureCall(request); // Do something. future.get(); }
-
listLocations
public final NotebookServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : notebookServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,NotebookServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = notebookServiceClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = notebookServiceClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = notebookServiceClient.getLocation(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = notebookServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
setIamPolicy
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = notebookServiceClient.setIamPolicy(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = notebookServiceClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
getIamPolicy
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource("GetIamPolicyRequest-1527610370".toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = notebookServiceClient.getIamPolicy(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource("GetIamPolicyRequest-1527610370".toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = notebookServiceClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
testIamPermissions
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource("TestIamPermissionsRequest942398222".toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissionsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource("TestIamPermissionsRequest942398222".toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = notebookServiceClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-