@Generated(value="by gapic-generator-java") public class ManagedNotebookServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
Runtime response = managedNotebookServiceClient.getRuntime(name);
}
Note: close() needs to be called on the ManagedNotebookServiceClient 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 |
|---|---|---|
ListRuntimes |
Lists Runtimes in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRuntime |
Gets details of a single Runtime. The location must be a regional endpoint rather than zonal. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateRuntime |
Creates a new Runtime in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateRuntime |
Update Notebook Runtime configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteRuntime |
Deletes a single Runtime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartRuntime |
Starts a Managed Notebook Runtime. Perform "Start" on GPU instances; "Resume" on CPU instances See: https://cloud.google.com/compute/docs/instances/stop-start-instance https://cloud.google.com/compute/docs/instances/suspend-resume-instance |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StopRuntime |
Stops a Managed Notebook Runtime. Perform "Stop" on GPU instances; "Suspend" on CPU instances See: https://cloud.google.com/compute/docs/instances/stop-start-instance https://cloud.google.com/compute/docs/instances/suspend-resume-instance |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SwitchRuntime |
Switch a Managed Notebook Runtime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ResetRuntime |
Resets a Managed Notebook Runtime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpgradeRuntime |
Upgrades a Managed Notebook Runtime to the latest version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ReportRuntimeEvent |
Report and process a runtime event. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RefreshRuntimeTokenInternal |
Gets an access token for the consumer service account that the customer attached to the runtime. Only accessible from the tenant instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DiagnoseRuntime |
Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ManagedNotebookServiceSettings 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
ManagedNotebookServiceSettings managedNotebookServiceSettings =
ManagedNotebookServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create(managedNotebookServiceSettings);
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
ManagedNotebookServiceSettings managedNotebookServiceSettings =
ManagedNotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create(managedNotebookServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
ManagedNotebookServiceClient.ListLocationsFixedSizeCollection |
static class |
ManagedNotebookServiceClient.ListLocationsPage |
static class |
ManagedNotebookServiceClient.ListLocationsPagedResponse |
static class |
ManagedNotebookServiceClient.ListRuntimesFixedSizeCollection |
static class |
ManagedNotebookServiceClient.ListRuntimesPage |
static class |
ManagedNotebookServiceClient.ListRuntimesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
ManagedNotebookServiceClient(ManagedNotebookServiceSettings settings)
Constructs an instance of ManagedNotebookServiceClient, using the given settings.
|
protected |
ManagedNotebookServiceClient(ManagedNotebookServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static ManagedNotebookServiceClient |
create()
Constructs an instance of ManagedNotebookServiceClient with default settings.
|
static ManagedNotebookServiceClient |
create(ManagedNotebookServiceSettings settings)
Constructs an instance of ManagedNotebookServiceClient, using the given settings.
|
static ManagedNotebookServiceClient |
create(ManagedNotebookServiceStub stub)
Constructs an instance of ManagedNotebookServiceClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
createRuntimeAsync(CreateRuntimeRequest request)
Creates a new Runtime in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
createRuntimeAsync(RuntimeName parent,
String runtimeId,
Runtime runtime)
Creates a new Runtime in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
createRuntimeAsync(String parent,
String runtimeId,
Runtime runtime)
Creates a new Runtime in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateRuntimeRequest,com.google.longrunning.Operation> |
createRuntimeCallable()
Creates a new Runtime in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateRuntimeRequest,Runtime,OperationMetadata> |
createRuntimeOperationCallable()
Creates a new Runtime in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRuntimeAsync(DeleteRuntimeRequest request)
Deletes a single Runtime.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRuntimeAsync(RuntimeName name)
Deletes a single Runtime.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRuntimeAsync(String name)
Deletes a single Runtime.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRuntimeRequest,com.google.longrunning.Operation> |
deleteRuntimeCallable()
Deletes a single Runtime.
|
com.google.api.gax.rpc.OperationCallable<DeleteRuntimeRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteRuntimeOperationCallable()
Deletes a single Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
diagnoseRuntimeAsync(DiagnoseRuntimeRequest request)
Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
diagnoseRuntimeAsync(RuntimeName name,
DiagnosticConfig diagnosticConfig)
Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
diagnoseRuntimeAsync(String name,
DiagnosticConfig diagnosticConfig)
Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
com.google.api.gax.rpc.UnaryCallable<DiagnoseRuntimeRequest,com.google.longrunning.Operation> |
diagnoseRuntimeCallable()
Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
com.google.api.gax.rpc.OperationCallable<DiagnoseRuntimeRequest,Runtime,OperationMetadata> |
diagnoseRuntimeOperationCallable()
Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
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.
|
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.
|
Runtime |
getRuntime(GetRuntimeRequest request)
Gets details of a single Runtime.
|
Runtime |
getRuntime(RuntimeName name)
Gets details of a single Runtime.
|
Runtime |
getRuntime(String name)
Gets details of a single Runtime.
|
com.google.api.gax.rpc.UnaryCallable<GetRuntimeRequest,Runtime> |
getRuntimeCallable()
Gets details of a single Runtime.
|
ManagedNotebookServiceSettings |
getSettings() |
ManagedNotebookServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
ManagedNotebookServiceClient.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,ManagedNotebookServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
ManagedNotebookServiceClient.ListRuntimesPagedResponse |
listRuntimes(ListRuntimesRequest request)
Lists Runtimes in a given project and location.
|
ManagedNotebookServiceClient.ListRuntimesPagedResponse |
listRuntimes(LocationName parent)
Lists Runtimes in a given project and location.
|
ManagedNotebookServiceClient.ListRuntimesPagedResponse |
listRuntimes(String parent)
Lists Runtimes in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListRuntimesRequest,ListRuntimesResponse> |
listRuntimesCallable()
Lists Runtimes in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListRuntimesRequest,ManagedNotebookServiceClient.ListRuntimesPagedResponse> |
listRuntimesPagedCallable()
Lists Runtimes in a given project and location.
|
RefreshRuntimeTokenInternalResponse |
refreshRuntimeTokenInternal(RefreshRuntimeTokenInternalRequest request)
Gets an access token for the consumer service account that the customer attached to the
runtime.
|
RefreshRuntimeTokenInternalResponse |
refreshRuntimeTokenInternal(RuntimeName name,
String vmId)
Gets an access token for the consumer service account that the customer attached to the
runtime.
|
RefreshRuntimeTokenInternalResponse |
refreshRuntimeTokenInternal(String name,
String vmId)
Gets an access token for the consumer service account that the customer attached to the
runtime.
|
com.google.api.gax.rpc.UnaryCallable<RefreshRuntimeTokenInternalRequest,RefreshRuntimeTokenInternalResponse> |
refreshRuntimeTokenInternalCallable()
Gets an access token for the consumer service account that the customer attached to the
runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
reportRuntimeEventAsync(ReportRuntimeEventRequest request)
Report and process a runtime event.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
reportRuntimeEventAsync(RuntimeName name)
Report and process a runtime event.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
reportRuntimeEventAsync(String name)
Report and process a runtime event.
|
com.google.api.gax.rpc.UnaryCallable<ReportRuntimeEventRequest,com.google.longrunning.Operation> |
reportRuntimeEventCallable()
Report and process a runtime event.
|
com.google.api.gax.rpc.OperationCallable<ReportRuntimeEventRequest,Runtime,OperationMetadata> |
reportRuntimeEventOperationCallable()
Report and process a runtime event.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
resetRuntimeAsync(ResetRuntimeRequest request)
Resets a Managed Notebook Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
resetRuntimeAsync(String name)
Resets a Managed Notebook Runtime.
|
com.google.api.gax.rpc.UnaryCallable<ResetRuntimeRequest,com.google.longrunning.Operation> |
resetRuntimeCallable()
Resets a Managed Notebook Runtime.
|
com.google.api.gax.rpc.OperationCallable<ResetRuntimeRequest,Runtime,OperationMetadata> |
resetRuntimeOperationCallable()
Resets a Managed Notebook Runtime.
|
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.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
startRuntimeAsync(StartRuntimeRequest request)
Starts a Managed Notebook Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
startRuntimeAsync(String name)
Starts a Managed Notebook Runtime.
|
com.google.api.gax.rpc.UnaryCallable<StartRuntimeRequest,com.google.longrunning.Operation> |
startRuntimeCallable()
Starts a Managed Notebook Runtime.
|
com.google.api.gax.rpc.OperationCallable<StartRuntimeRequest,Runtime,OperationMetadata> |
startRuntimeOperationCallable()
Starts a Managed Notebook Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
stopRuntimeAsync(StopRuntimeRequest request)
Stops a Managed Notebook Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
stopRuntimeAsync(String name)
Stops a Managed Notebook Runtime.
|
com.google.api.gax.rpc.UnaryCallable<StopRuntimeRequest,com.google.longrunning.Operation> |
stopRuntimeCallable()
Stops a Managed Notebook Runtime.
|
com.google.api.gax.rpc.OperationCallable<StopRuntimeRequest,Runtime,OperationMetadata> |
stopRuntimeOperationCallable()
Stops a Managed Notebook Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
switchRuntimeAsync(String name)
Switch a Managed Notebook Runtime.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
switchRuntimeAsync(SwitchRuntimeRequest request)
Switch a Managed Notebook Runtime.
|
com.google.api.gax.rpc.UnaryCallable<SwitchRuntimeRequest,com.google.longrunning.Operation> |
switchRuntimeCallable()
Switch a Managed Notebook Runtime.
|
com.google.api.gax.rpc.OperationCallable<SwitchRuntimeRequest,Runtime,OperationMetadata> |
switchRuntimeOperationCallable()
Switch a Managed Notebook Runtime.
|
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<Runtime,OperationMetadata> |
updateRuntimeAsync(Runtime runtime,
com.google.protobuf.FieldMask updateMask)
Update Notebook Runtime configuration.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
updateRuntimeAsync(UpdateRuntimeRequest request)
Update Notebook Runtime configuration.
|
com.google.api.gax.rpc.UnaryCallable<UpdateRuntimeRequest,com.google.longrunning.Operation> |
updateRuntimeCallable()
Update Notebook Runtime configuration.
|
com.google.api.gax.rpc.OperationCallable<UpdateRuntimeRequest,Runtime,OperationMetadata> |
updateRuntimeOperationCallable()
Update Notebook Runtime configuration.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
upgradeRuntimeAsync(String name)
Upgrades a Managed Notebook Runtime to the latest version.
|
com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> |
upgradeRuntimeAsync(UpgradeRuntimeRequest request)
Upgrades a Managed Notebook Runtime to the latest version.
|
com.google.api.gax.rpc.UnaryCallable<UpgradeRuntimeRequest,com.google.longrunning.Operation> |
upgradeRuntimeCallable()
Upgrades a Managed Notebook Runtime to the latest version.
|
com.google.api.gax.rpc.OperationCallable<UpgradeRuntimeRequest,Runtime,OperationMetadata> |
upgradeRuntimeOperationCallable()
Upgrades a Managed Notebook Runtime to the latest version.
|
protected ManagedNotebookServiceClient(ManagedNotebookServiceSettings settings) throws IOException
IOExceptionprotected ManagedNotebookServiceClient(ManagedNotebookServiceStub stub)
public static final ManagedNotebookServiceClient create() throws IOException
IOExceptionpublic static final ManagedNotebookServiceClient create(ManagedNotebookServiceSettings settings) throws IOException
IOExceptionpublic static final ManagedNotebookServiceClient create(ManagedNotebookServiceStub stub)
public final ManagedNotebookServiceSettings getSettings()
public ManagedNotebookServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final ManagedNotebookServiceClient.ListRuntimesPagedResponse listRuntimes(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Runtime element : managedNotebookServiceClient.listRuntimes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Format: `parent=projects/{project_id}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ManagedNotebookServiceClient.ListRuntimesPagedResponse listRuntimes(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Runtime element : managedNotebookServiceClient.listRuntimes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Format: `parent=projects/{project_id}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ManagedNotebookServiceClient.ListRuntimesPagedResponse listRuntimes(ListRuntimesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ListRuntimesRequest request =
ListRuntimesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Runtime element : managedNotebookServiceClient.listRuntimes(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRuntimesRequest,ManagedNotebookServiceClient.ListRuntimesPagedResponse> listRuntimesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ListRuntimesRequest request =
ListRuntimesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Runtime> future =
managedNotebookServiceClient.listRuntimesPagedCallable().futureCall(request);
// Do something.
for (Runtime element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRuntimesRequest,ListRuntimesResponse> listRuntimesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ListRuntimesRequest request =
ListRuntimesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListRuntimesResponse response =
managedNotebookServiceClient.listRuntimesCallable().call(request);
for (Runtime element : response.getRuntimesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Runtime getRuntime(RuntimeName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
Runtime response = managedNotebookServiceClient.getRuntime(name);
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final Runtime getRuntime(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
Runtime response = managedNotebookServiceClient.getRuntime(name);
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final Runtime getRuntime(GetRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
GetRuntimeRequest request =
GetRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.build();
Runtime response = managedNotebookServiceClient.getRuntime(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRuntimeRequest,Runtime> getRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
GetRuntimeRequest request =
GetRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.build();
ApiFuture<Runtime> future =
managedNotebookServiceClient.getRuntimeCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> createRuntimeAsync(RuntimeName parent, String runtimeId, Runtime runtime)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName parent = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
String runtimeId = "runtimeId121455379";
Runtime runtime = Runtime.newBuilder().build();
Runtime response =
managedNotebookServiceClient.createRuntimeAsync(parent, runtimeId, runtime).get();
}
parent - Required. Format: `parent=projects/{project_id}/locations/{location}`runtimeId - Required. User-defined unique ID of this Runtime.runtime - Required. The Runtime to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> createRuntimeAsync(String parent, String runtimeId, Runtime runtime)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String parent = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
String runtimeId = "runtimeId121455379";
Runtime runtime = Runtime.newBuilder().build();
Runtime response =
managedNotebookServiceClient.createRuntimeAsync(parent, runtimeId, runtime).get();
}
parent - Required. Format: `parent=projects/{project_id}/locations/{location}`runtimeId - Required. User-defined unique ID of this Runtime.runtime - Required. The Runtime to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> createRuntimeAsync(CreateRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
CreateRuntimeRequest request =
CreateRuntimeRequest.newBuilder()
.setParent(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setRuntimeId("runtimeId121455379")
.setRuntime(Runtime.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.createRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateRuntimeRequest,Runtime,OperationMetadata> createRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
CreateRuntimeRequest request =
CreateRuntimeRequest.newBuilder()
.setParent(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setRuntimeId("runtimeId121455379")
.setRuntime(Runtime.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.createRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateRuntimeRequest,com.google.longrunning.Operation> createRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
CreateRuntimeRequest request =
CreateRuntimeRequest.newBuilder()
.setParent(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setRuntimeId("runtimeId121455379")
.setRuntime(Runtime.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.createRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> updateRuntimeAsync(Runtime runtime, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
Runtime runtime = Runtime.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Runtime response = managedNotebookServiceClient.updateRuntimeAsync(runtime, updateMask).get();
}
runtime - Required. The Runtime to be updated.updateMask - Required. Specifies the path, relative to `Runtime`, of the field to update.
For example, to change the software configuration kernels, the `update_mask` parameter
would be specified as `software_config.kernels`, and the `PATCH` request body would specify
the new value, as follows:
{ "software_config":{ "kernels": [{ 'repository': 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': 'latest' }], } }
Currently, only the following fields can be updated: - `software_config.kernels` - `software_config.post_startup_script` - `software_config.custom_gpu_driver_path` - `software_config.idle_shutdown` - `software_config.idle_shutdown_timeout` - `software_config.disable_terminal`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> updateRuntimeAsync(UpdateRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
UpdateRuntimeRequest request =
UpdateRuntimeRequest.newBuilder()
.setRuntime(Runtime.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.updateRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateRuntimeRequest,Runtime,OperationMetadata> updateRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
UpdateRuntimeRequest request =
UpdateRuntimeRequest.newBuilder()
.setRuntime(Runtime.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.updateRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateRuntimeRequest,com.google.longrunning.Operation> updateRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
UpdateRuntimeRequest request =
UpdateRuntimeRequest.newBuilder()
.setRuntime(Runtime.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.updateRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRuntimeAsync(RuntimeName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
managedNotebookServiceClient.deleteRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRuntimeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
managedNotebookServiceClient.deleteRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRuntimeAsync(DeleteRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
DeleteRuntimeRequest request =
DeleteRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setRequestId("requestId693933066")
.build();
managedNotebookServiceClient.deleteRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRuntimeRequest,com.google.protobuf.Empty,OperationMetadata> deleteRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
DeleteRuntimeRequest request =
DeleteRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
managedNotebookServiceClient.deleteRuntimeOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRuntimeRequest,com.google.longrunning.Operation> deleteRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
DeleteRuntimeRequest request =
DeleteRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.deleteRuntimeCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> startRuntimeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = "name3373707";
Runtime response = managedNotebookServiceClient.startRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> startRuntimeAsync(StartRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
StartRuntimeRequest request =
StartRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.startRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<StartRuntimeRequest,Runtime,OperationMetadata> startRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
StartRuntimeRequest request =
StartRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.startRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StartRuntimeRequest,com.google.longrunning.Operation> startRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
StartRuntimeRequest request =
StartRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.startRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> stopRuntimeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = "name3373707";
Runtime response = managedNotebookServiceClient.stopRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> stopRuntimeAsync(StopRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
StopRuntimeRequest request =
StopRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.stopRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<StopRuntimeRequest,Runtime,OperationMetadata> stopRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
StopRuntimeRequest request =
StopRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.stopRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StopRuntimeRequest,com.google.longrunning.Operation> stopRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
StopRuntimeRequest request =
StopRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.stopRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> switchRuntimeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = "name3373707";
Runtime response = managedNotebookServiceClient.switchRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> switchRuntimeAsync(SwitchRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
SwitchRuntimeRequest request =
SwitchRuntimeRequest.newBuilder()
.setName("name3373707")
.setMachineType("machineType-218117087")
.setAcceleratorConfig(RuntimeAcceleratorConfig.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.switchRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SwitchRuntimeRequest,Runtime,OperationMetadata> switchRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
SwitchRuntimeRequest request =
SwitchRuntimeRequest.newBuilder()
.setName("name3373707")
.setMachineType("machineType-218117087")
.setAcceleratorConfig(RuntimeAcceleratorConfig.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.switchRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SwitchRuntimeRequest,com.google.longrunning.Operation> switchRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
SwitchRuntimeRequest request =
SwitchRuntimeRequest.newBuilder()
.setName("name3373707")
.setMachineType("machineType-218117087")
.setAcceleratorConfig(RuntimeAcceleratorConfig.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.switchRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> resetRuntimeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = "name3373707";
Runtime response = managedNotebookServiceClient.resetRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> resetRuntimeAsync(ResetRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ResetRuntimeRequest request =
ResetRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.resetRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ResetRuntimeRequest,Runtime,OperationMetadata> resetRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ResetRuntimeRequest request =
ResetRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.resetRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ResetRuntimeRequest,com.google.longrunning.Operation> resetRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ResetRuntimeRequest request =
ResetRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.resetRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> upgradeRuntimeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = "name3373707";
Runtime response = managedNotebookServiceClient.upgradeRuntimeAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> upgradeRuntimeAsync(UpgradeRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
UpgradeRuntimeRequest request =
UpgradeRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
Runtime response = managedNotebookServiceClient.upgradeRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpgradeRuntimeRequest,Runtime,OperationMetadata> upgradeRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
UpgradeRuntimeRequest request =
UpgradeRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.upgradeRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpgradeRuntimeRequest,com.google.longrunning.Operation> upgradeRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
UpgradeRuntimeRequest request =
UpgradeRuntimeRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.upgradeRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> reportRuntimeEventAsync(RuntimeName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
Runtime response = managedNotebookServiceClient.reportRuntimeEventAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> reportRuntimeEventAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
Runtime response = managedNotebookServiceClient.reportRuntimeEventAsync(name).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> reportRuntimeEventAsync(ReportRuntimeEventRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ReportRuntimeEventRequest request =
ReportRuntimeEventRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setVmId("vmId3622450")
.setEvent(Event.newBuilder().build())
.build();
Runtime response = managedNotebookServiceClient.reportRuntimeEventAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ReportRuntimeEventRequest,Runtime,OperationMetadata> reportRuntimeEventOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ReportRuntimeEventRequest request =
ReportRuntimeEventRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setVmId("vmId3622450")
.setEvent(Event.newBuilder().build())
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.reportRuntimeEventOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ReportRuntimeEventRequest,com.google.longrunning.Operation> reportRuntimeEventCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ReportRuntimeEventRequest request =
ReportRuntimeEventRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setVmId("vmId3622450")
.setEvent(Event.newBuilder().build())
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.reportRuntimeEventCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final RefreshRuntimeTokenInternalResponse refreshRuntimeTokenInternal(RuntimeName name, String vmId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
String vmId = "vmId3622450";
RefreshRuntimeTokenInternalResponse response =
managedNotebookServiceClient.refreshRuntimeTokenInternal(name, vmId);
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`vmId - Required. The VM hardware token for authenticating the VM.
https://cloud.google.com/compute/docs/instances/verifying-instance-identitycom.google.api.gax.rpc.ApiException - if the remote call failspublic final RefreshRuntimeTokenInternalResponse refreshRuntimeTokenInternal(String name, String vmId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
String vmId = "vmId3622450";
RefreshRuntimeTokenInternalResponse response =
managedNotebookServiceClient.refreshRuntimeTokenInternal(name, vmId);
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtime_id}`vmId - Required. The VM hardware token for authenticating the VM.
https://cloud.google.com/compute/docs/instances/verifying-instance-identitycom.google.api.gax.rpc.ApiException - if the remote call failspublic final RefreshRuntimeTokenInternalResponse refreshRuntimeTokenInternal(RefreshRuntimeTokenInternalRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RefreshRuntimeTokenInternalRequest request =
RefreshRuntimeTokenInternalRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setVmId("vmId3622450")
.build();
RefreshRuntimeTokenInternalResponse response =
managedNotebookServiceClient.refreshRuntimeTokenInternal(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RefreshRuntimeTokenInternalRequest,RefreshRuntimeTokenInternalResponse> refreshRuntimeTokenInternalCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RefreshRuntimeTokenInternalRequest request =
RefreshRuntimeTokenInternalRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setVmId("vmId3622450")
.build();
ApiFuture<RefreshRuntimeTokenInternalResponse> future =
managedNotebookServiceClient.refreshRuntimeTokenInternalCallable().futureCall(request);
// Do something.
RefreshRuntimeTokenInternalResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> diagnoseRuntimeAsync(RuntimeName name, DiagnosticConfig diagnosticConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
RuntimeName name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]");
DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
Runtime response =
managedNotebookServiceClient.diagnoseRuntimeAsync(name, diagnosticConfig).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`diagnosticConfig - Required. Defines flags that are used to run the diagnostic toolcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> diagnoseRuntimeAsync(String name, DiagnosticConfig diagnosticConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
String name = RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString();
DiagnosticConfig diagnosticConfig = DiagnosticConfig.newBuilder().build();
Runtime response =
managedNotebookServiceClient.diagnoseRuntimeAsync(name, diagnosticConfig).get();
}
name - Required. Format:
`projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`diagnosticConfig - Required. Defines flags that are used to run the diagnostic toolcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Runtime,OperationMetadata> diagnoseRuntimeAsync(DiagnoseRuntimeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
DiagnoseRuntimeRequest request =
DiagnoseRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
.build();
Runtime response = managedNotebookServiceClient.diagnoseRuntimeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DiagnoseRuntimeRequest,Runtime,OperationMetadata> diagnoseRuntimeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
DiagnoseRuntimeRequest request =
DiagnoseRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
.build();
OperationFuture<Runtime, OperationMetadata> future =
managedNotebookServiceClient.diagnoseRuntimeOperationCallable().futureCall(request);
// Do something.
Runtime response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DiagnoseRuntimeRequest,com.google.longrunning.Operation> diagnoseRuntimeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
DiagnoseRuntimeRequest request =
DiagnoseRuntimeRequest.newBuilder()
.setName(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setDiagnosticConfig(DiagnosticConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
managedNotebookServiceClient.diagnoseRuntimeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final ManagedNotebookServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : managedNotebookServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ManagedNotebookServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
managedNotebookServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
managedNotebookServiceClient.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;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = managedNotebookServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
managedNotebookServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
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 (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = managedNotebookServiceClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
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 (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future =
managedNotebookServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = managedNotebookServiceClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future =
managedNotebookServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
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 (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response =
managedNotebookServiceClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
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 (ManagedNotebookServiceClient managedNotebookServiceClient =
ManagedNotebookServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(RuntimeName.of("[PROJECT]", "[LOCATION]", "[RUNTIME]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
managedNotebookServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.