@Generated(value="by gapic-generator-java") public class InstancesClient 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 (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Instance response = instancesClient.get(project, zone, instance);
}
Note: close() needs to be called on the InstancesClient 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 |
|---|---|---|
AddAccessConfig |
Adds an access config to an instance's network interface. |
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.
|
AddResourcePolicies |
Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. |
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.
|
AggregatedList |
Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. |
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.
|
AttachDisk |
Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your 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.
|
BulkInsert |
Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs. |
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.
|
Delete |
Deletes the specified Instance resource. For more information, see Deleting an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAccessConfig |
Deletes an access config from an instance's network interface. |
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.
|
DetachDisk |
Detaches a disk from an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified Instance resource. |
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.
|
GetEffectiveFirewalls |
Returns effective firewalls applied to an interface of the 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.
|
GetGuestAttributes |
Returns the specified guest attributes entry. |
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.
|
GetIamPolicy |
Gets the access control policy for a resource. May be empty if no such policy or resource exists. |
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.
|
GetScreenshot |
Returns the screenshot from the specified 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.
|
GetSerialPortOutput |
Returns the last 1 MB of serial port output from the specified 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.
|
GetShieldedInstanceIdentity |
Returns the Shielded Instance Identity of an 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.
|
Insert |
Creates an instance resource in the specified project using the data included in the request. |
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.
|
List |
Retrieves the list of instances contained within the specified zone. |
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.
|
ListReferrers |
Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. |
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.
|
PerformMaintenance |
Perform a manual maintenance on the 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.
|
RemoveResourcePolicies |
Removes resource policies from an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Reset |
Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Resume |
Resumes an instance that was suspended using the instances().suspend method. |
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.
|
SendDiagnosticInterrupt |
Sends diagnostic interrupt to the 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.
|
SetDeletionProtection |
Sets deletion protection on the 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.
|
SetDiskAutoDelete |
Sets the auto-delete flag for a disk attached to an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replaces any existing policy. |
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.
|
SetLabels |
Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. |
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.
|
SetMachineResources |
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. |
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.
|
SetMachineType |
Changes the machine type for a stopped instance to the machine type specified in the request. |
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.
|
SetMetadata |
Sets metadata for the specified instance to the data included in the request. |
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.
|
SetMinCpuPlatform |
Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. |
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.
|
SetName |
Sets name of an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetScheduling |
Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. |
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.
|
SetSecurityPolicy |
Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview |
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.
|
SetServiceAccount |
Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetShieldedInstanceIntegrityPolicy |
Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
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.
|
SetTags |
Sets network tags for the specified instance to the data included in the request. |
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.
|
SimulateMaintenanceEvent |
Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance 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.
|
Start |
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartWithEncryptionKey |
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Stop |
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Suspend |
This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. |
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.
|
Update |
Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. |
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.
|
UpdateAccessConfig |
Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
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.
|
UpdateDisplayDevice |
Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
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.
|
UpdateNetworkInterface |
Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. |
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.
|
UpdateShieldedInstanceConfig |
Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
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.
|
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 InstancesSettings 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
InstancesSettings instancesSettings =
InstancesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InstancesClient instancesClient = InstancesClient.create(instancesSettings);
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
InstancesSettings instancesSettings =
InstancesSettings.newBuilder().setEndpoint(myEndpoint).build();
InstancesClient instancesClient = InstancesClient.create(instancesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
InstancesClient.AggregatedListFixedSizeCollection |
static class |
InstancesClient.AggregatedListPage |
static class |
InstancesClient.AggregatedListPagedResponse |
static class |
InstancesClient.ListFixedSizeCollection |
static class |
InstancesClient.ListPage |
static class |
InstancesClient.ListPagedResponse |
static class |
InstancesClient.ListReferrersFixedSizeCollection |
static class |
InstancesClient.ListReferrersPage |
static class |
InstancesClient.ListReferrersPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
InstancesClient(InstancesSettings settings)
Constructs an instance of InstancesClient, using the given settings.
|
protected |
InstancesClient(InstancesStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAccessConfigAsync(AddAccessConfigInstanceRequest request)
Adds an access config to an instance's network interface.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAccessConfigAsync(String project,
String zone,
String instance,
String networkInterface,
AccessConfig accessConfigResource)
Adds an access config to an instance's network interface.
|
com.google.api.gax.rpc.UnaryCallable<AddAccessConfigInstanceRequest,Operation> |
addAccessConfigCallable()
Adds an access config to an instance's network interface.
|
com.google.api.gax.rpc.OperationCallable<AddAccessConfigInstanceRequest,Operation,Operation> |
addAccessConfigOperationCallable()
Adds an access config to an instance's network interface.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request)
Adds existing resource policies to an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addResourcePoliciesAsync(String project,
String zone,
String instance,
InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource)
Adds existing resource policies to an instance.
|
com.google.api.gax.rpc.UnaryCallable<AddResourcePoliciesInstanceRequest,Operation> |
addResourcePoliciesCallable()
Adds existing resource policies to an instance.
|
com.google.api.gax.rpc.OperationCallable<AddResourcePoliciesInstanceRequest,Operation,Operation> |
addResourcePoliciesOperationCallable()
Adds existing resource policies to an instance.
|
InstancesClient.AggregatedListPagedResponse |
aggregatedList(AggregatedListInstancesRequest request)
Retrieves an aggregated list of all of the instances in your project across all regions and
zones.
|
InstancesClient.AggregatedListPagedResponse |
aggregatedList(String project)
Retrieves an aggregated list of all of the instances in your project across all regions and
zones.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListInstancesRequest,InstanceAggregatedList> |
aggregatedListCallable()
Retrieves an aggregated list of all of the instances in your project across all regions and
zones.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListInstancesRequest,InstancesClient.AggregatedListPagedResponse> |
aggregatedListPagedCallable()
Retrieves an aggregated list of all of the instances in your project across all regions and
zones.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
attachDiskAsync(AttachDiskInstanceRequest request)
Attaches an existing Disk resource to an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
attachDiskAsync(String project,
String zone,
String instance,
AttachedDisk attachedDiskResource)
Attaches an existing Disk resource to an instance.
|
com.google.api.gax.rpc.UnaryCallable<AttachDiskInstanceRequest,Operation> |
attachDiskCallable()
Attaches an existing Disk resource to an instance.
|
com.google.api.gax.rpc.OperationCallable<AttachDiskInstanceRequest,Operation,Operation> |
attachDiskOperationCallable()
Attaches an existing Disk resource to an instance.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
bulkInsertAsync(BulkInsertInstanceRequest request)
Creates multiple instances.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
bulkInsertAsync(String project,
String zone,
BulkInsertInstanceResource bulkInsertInstanceResourceResource)
Creates multiple instances.
|
com.google.api.gax.rpc.UnaryCallable<BulkInsertInstanceRequest,Operation> |
bulkInsertCallable()
Creates multiple instances.
|
com.google.api.gax.rpc.OperationCallable<BulkInsertInstanceRequest,Operation,Operation> |
bulkInsertOperationCallable()
Creates multiple instances.
|
void |
close() |
static InstancesClient |
create()
Constructs an instance of InstancesClient with default settings.
|
static InstancesClient |
create(InstancesSettings settings)
Constructs an instance of InstancesClient, using the given settings.
|
static InstancesClient |
create(InstancesStub stub)
Constructs an instance of InstancesClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request)
Deletes an access config from an instance's network interface.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAccessConfigAsync(String project,
String zone,
String instance,
String accessConfig,
String networkInterface)
Deletes an access config from an instance's network interface.
|
com.google.api.gax.rpc.UnaryCallable<DeleteAccessConfigInstanceRequest,Operation> |
deleteAccessConfigCallable()
Deletes an access config from an instance's network interface.
|
com.google.api.gax.rpc.OperationCallable<DeleteAccessConfigInstanceRequest,Operation,Operation> |
deleteAccessConfigOperationCallable()
Deletes an access config from an instance's network interface.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteInstanceRequest request)
Deletes the specified Instance resource.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String zone,
String instance)
Deletes the specified Instance resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInstanceRequest,Operation> |
deleteCallable()
Deletes the specified Instance resource.
|
com.google.api.gax.rpc.OperationCallable<DeleteInstanceRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified Instance resource.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
detachDiskAsync(DetachDiskInstanceRequest request)
Detaches a disk from an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
detachDiskAsync(String project,
String zone,
String instance,
String deviceName)
Detaches a disk from an instance.
|
com.google.api.gax.rpc.UnaryCallable<DetachDiskInstanceRequest,Operation> |
detachDiskCallable()
Detaches a disk from an instance.
|
com.google.api.gax.rpc.OperationCallable<DetachDiskInstanceRequest,Operation,Operation> |
detachDiskOperationCallable()
Detaches a disk from an instance.
|
Instance |
get(GetInstanceRequest request)
Returns the specified Instance resource.
|
Instance |
get(String project,
String zone,
String instance)
Returns the specified Instance resource.
|
com.google.api.gax.rpc.UnaryCallable<GetInstanceRequest,Instance> |
getCallable()
Returns the specified Instance resource.
|
InstancesGetEffectiveFirewallsResponse |
getEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest request)
Returns effective firewalls applied to an interface of the instance.
|
InstancesGetEffectiveFirewallsResponse |
getEffectiveFirewalls(String project,
String zone,
String instance,
String networkInterface)
Returns effective firewalls applied to an interface of the instance.
|
com.google.api.gax.rpc.UnaryCallable<GetEffectiveFirewallsInstanceRequest,InstancesGetEffectiveFirewallsResponse> |
getEffectiveFirewallsCallable()
Returns effective firewalls applied to an interface of the instance.
|
GuestAttributes |
getGuestAttributes(GetGuestAttributesInstanceRequest request)
Returns the specified guest attributes entry.
|
GuestAttributes |
getGuestAttributes(String project,
String zone,
String instance)
Returns the specified guest attributes entry.
|
com.google.api.gax.rpc.UnaryCallable<GetGuestAttributesInstanceRequest,GuestAttributes> |
getGuestAttributesCallable()
Returns the specified guest attributes entry.
|
Policy |
getIamPolicy(GetIamPolicyInstanceRequest request)
Gets the access control policy for a resource.
|
Policy |
getIamPolicy(String project,
String zone,
String resource)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<GetIamPolicyInstanceRequest,Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
Screenshot |
getScreenshot(GetScreenshotInstanceRequest request)
Returns the screenshot from the specified instance.
|
Screenshot |
getScreenshot(String project,
String zone,
String instance)
Returns the screenshot from the specified instance.
|
com.google.api.gax.rpc.UnaryCallable<GetScreenshotInstanceRequest,Screenshot> |
getScreenshotCallable()
Returns the screenshot from the specified instance.
|
SerialPortOutput |
getSerialPortOutput(GetSerialPortOutputInstanceRequest request)
Returns the last 1 MB of serial port output from the specified instance.
|
SerialPortOutput |
getSerialPortOutput(String project,
String zone,
String instance)
Returns the last 1 MB of serial port output from the specified instance.
|
com.google.api.gax.rpc.UnaryCallable<GetSerialPortOutputInstanceRequest,SerialPortOutput> |
getSerialPortOutputCallable()
Returns the last 1 MB of serial port output from the specified instance.
|
InstancesSettings |
getSettings() |
ShieldedInstanceIdentity |
getShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceRequest request)
Returns the Shielded Instance Identity of an instance
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetShieldedInstanceIdentityInstanceRequest request =
GetShieldedInstanceIdentityInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ShieldedInstanceIdentity response = instancesClient.getShieldedInstanceIdentity(request);
}
|
ShieldedInstanceIdentity |
getShieldedInstanceIdentity(String project,
String zone,
String instance)
Returns the Shielded Instance Identity of an instance
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
ShieldedInstanceIdentity response =
instancesClient.getShieldedInstanceIdentity(project, zone, instance);
}
|
com.google.api.gax.rpc.UnaryCallable<GetShieldedInstanceIdentityInstanceRequest,ShieldedInstanceIdentity> |
getShieldedInstanceIdentityCallable()
Returns the Shielded Instance Identity of an instance
Sample code:
{@code
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetShieldedInstanceIdentityInstanceRequest request =
GetShieldedInstanceIdentityInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture
|
InstancesStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertInstanceRequest request)
Creates an instance resource in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
String zone,
Instance instanceResource)
Creates an instance resource in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertInstanceRequest,Operation> |
insertCallable()
Creates an instance resource in the specified project using the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertInstanceRequest,Operation,Operation> |
insertOperationCallable()
Creates an instance resource in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
InstancesClient.ListPagedResponse |
list(ListInstancesRequest request)
Retrieves the list of instances contained within the specified zone.
|
InstancesClient.ListPagedResponse |
list(String project,
String zone)
Retrieves the list of instances contained within the specified zone.
|
com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,InstanceList> |
listCallable()
Retrieves the list of instances contained within the specified zone.
|
com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,InstancesClient.ListPagedResponse> |
listPagedCallable()
Retrieves the list of instances contained within the specified zone.
|
InstancesClient.ListReferrersPagedResponse |
listReferrers(ListReferrersInstancesRequest request)
Retrieves a list of resources that refer to the VM instance specified in the request.
|
InstancesClient.ListReferrersPagedResponse |
listReferrers(String project,
String zone,
String instance)
Retrieves a list of resources that refer to the VM instance specified in the request.
|
com.google.api.gax.rpc.UnaryCallable<ListReferrersInstancesRequest,InstanceListReferrers> |
listReferrersCallable()
Retrieves a list of resources that refer to the VM instance specified in the request.
|
com.google.api.gax.rpc.UnaryCallable<ListReferrersInstancesRequest,InstancesClient.ListReferrersPagedResponse> |
listReferrersPagedCallable()
Retrieves a list of resources that refer to the VM instance specified in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
performMaintenanceAsync(PerformMaintenanceInstanceRequest request)
Perform a manual maintenance on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
performMaintenanceAsync(String project,
String zone,
String instance)
Perform a manual maintenance on the instance.
|
com.google.api.gax.rpc.UnaryCallable<PerformMaintenanceInstanceRequest,Operation> |
performMaintenanceCallable()
Perform a manual maintenance on the instance.
|
com.google.api.gax.rpc.OperationCallable<PerformMaintenanceInstanceRequest,Operation,Operation> |
performMaintenanceOperationCallable()
Perform a manual maintenance on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request)
Removes resource policies from an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeResourcePoliciesAsync(String project,
String zone,
String instance,
InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource)
Removes resource policies from an instance.
|
com.google.api.gax.rpc.UnaryCallable<RemoveResourcePoliciesInstanceRequest,Operation> |
removeResourcePoliciesCallable()
Removes resource policies from an instance.
|
com.google.api.gax.rpc.OperationCallable<RemoveResourcePoliciesInstanceRequest,Operation,Operation> |
removeResourcePoliciesOperationCallable()
Removes resource policies from an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
resetAsync(ResetInstanceRequest request)
Performs a reset on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
resetAsync(String project,
String zone,
String instance)
Performs a reset on the instance.
|
com.google.api.gax.rpc.UnaryCallable<ResetInstanceRequest,Operation> |
resetCallable()
Performs a reset on the instance.
|
com.google.api.gax.rpc.OperationCallable<ResetInstanceRequest,Operation,Operation> |
resetOperationCallable()
Performs a reset on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
resumeAsync(ResumeInstanceRequest request)
Resumes an instance that was suspended using the instances().suspend method.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
resumeAsync(String project,
String zone,
String instance)
Resumes an instance that was suspended using the instances().suspend method.
|
com.google.api.gax.rpc.UnaryCallable<ResumeInstanceRequest,Operation> |
resumeCallable()
Resumes an instance that was suspended using the instances().suspend method.
|
com.google.api.gax.rpc.OperationCallable<ResumeInstanceRequest,Operation,Operation> |
resumeOperationCallable()
Resumes an instance that was suspended using the instances().suspend method.
|
SendDiagnosticInterruptInstanceResponse |
sendDiagnosticInterrupt(SendDiagnosticInterruptInstanceRequest request)
Sends diagnostic interrupt to the instance.
|
SendDiagnosticInterruptInstanceResponse |
sendDiagnosticInterrupt(String project,
String zone,
String instance)
Sends diagnostic interrupt to the instance.
|
com.google.api.gax.rpc.UnaryCallable<SendDiagnosticInterruptInstanceRequest,SendDiagnosticInterruptInstanceResponse> |
sendDiagnosticInterruptCallable()
Sends diagnostic interrupt to the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request)
Sets deletion protection on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setDeletionProtectionAsync(String project,
String zone,
String resource)
Sets deletion protection on the instance.
|
com.google.api.gax.rpc.UnaryCallable<SetDeletionProtectionInstanceRequest,Operation> |
setDeletionProtectionCallable()
Sets deletion protection on the instance.
|
com.google.api.gax.rpc.OperationCallable<SetDeletionProtectionInstanceRequest,Operation,Operation> |
setDeletionProtectionOperationCallable()
Sets deletion protection on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request)
Sets the auto-delete flag for a disk attached to an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setDiskAutoDeleteAsync(String project,
String zone,
String instance,
boolean autoDelete,
String deviceName)
Sets the auto-delete flag for a disk attached to an instance.
|
com.google.api.gax.rpc.UnaryCallable<SetDiskAutoDeleteInstanceRequest,Operation> |
setDiskAutoDeleteCallable()
Sets the auto-delete flag for a disk attached to an instance.
|
com.google.api.gax.rpc.OperationCallable<SetDiskAutoDeleteInstanceRequest,Operation,Operation> |
setDiskAutoDeleteOperationCallable()
Sets the auto-delete flag for a disk attached to an instance.
|
Policy |
setIamPolicy(SetIamPolicyInstanceRequest request)
Sets the access control policy on the specified resource.
|
Policy |
setIamPolicy(String project,
String zone,
String resource,
ZoneSetPolicyRequest zoneSetPolicyRequestResource)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<SetIamPolicyInstanceRequest,Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setLabelsAsync(SetLabelsInstanceRequest request)
Sets labels on an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setLabelsAsync(String project,
String zone,
String instance,
InstancesSetLabelsRequest instancesSetLabelsRequestResource)
Sets labels on an instance.
|
com.google.api.gax.rpc.UnaryCallable<SetLabelsInstanceRequest,Operation> |
setLabelsCallable()
Sets labels on an instance.
|
com.google.api.gax.rpc.OperationCallable<SetLabelsInstanceRequest,Operation,Operation> |
setLabelsOperationCallable()
Sets labels on an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMachineResourcesAsync(SetMachineResourcesInstanceRequest request)
Changes the number and/or type of accelerator for a stopped instance to the values specified in
the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMachineResourcesAsync(String project,
String zone,
String instance,
InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource)
Changes the number and/or type of accelerator for a stopped instance to the values specified in
the request.
|
com.google.api.gax.rpc.UnaryCallable<SetMachineResourcesInstanceRequest,Operation> |
setMachineResourcesCallable()
Changes the number and/or type of accelerator for a stopped instance to the values specified in
the request.
|
com.google.api.gax.rpc.OperationCallable<SetMachineResourcesInstanceRequest,Operation,Operation> |
setMachineResourcesOperationCallable()
Changes the number and/or type of accelerator for a stopped instance to the values specified in
the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMachineTypeAsync(SetMachineTypeInstanceRequest request)
Changes the machine type for a stopped instance to the machine type specified in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMachineTypeAsync(String project,
String zone,
String instance,
InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource)
Changes the machine type for a stopped instance to the machine type specified in the request.
|
com.google.api.gax.rpc.UnaryCallable<SetMachineTypeInstanceRequest,Operation> |
setMachineTypeCallable()
Changes the machine type for a stopped instance to the machine type specified in the request.
|
com.google.api.gax.rpc.OperationCallable<SetMachineTypeInstanceRequest,Operation,Operation> |
setMachineTypeOperationCallable()
Changes the machine type for a stopped instance to the machine type specified in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMetadataAsync(SetMetadataInstanceRequest request)
Sets metadata for the specified instance to the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMetadataAsync(String project,
String zone,
String instance,
Metadata metadataResource)
Sets metadata for the specified instance to the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<SetMetadataInstanceRequest,Operation> |
setMetadataCallable()
Sets metadata for the specified instance to the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<SetMetadataInstanceRequest,Operation,Operation> |
setMetadataOperationCallable()
Sets metadata for the specified instance to the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request)
Changes the minimum CPU platform that this instance should use.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setMinCpuPlatformAsync(String project,
String zone,
String instance,
InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource)
Changes the minimum CPU platform that this instance should use.
|
com.google.api.gax.rpc.UnaryCallable<SetMinCpuPlatformInstanceRequest,Operation> |
setMinCpuPlatformCallable()
Changes the minimum CPU platform that this instance should use.
|
com.google.api.gax.rpc.OperationCallable<SetMinCpuPlatformInstanceRequest,Operation,Operation> |
setMinCpuPlatformOperationCallable()
Changes the minimum CPU platform that this instance should use.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setNameAsync(SetNameInstanceRequest request)
Sets name of an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setNameAsync(String project,
String zone,
String instance,
InstancesSetNameRequest instancesSetNameRequestResource)
Sets name of an instance.
|
com.google.api.gax.rpc.UnaryCallable<SetNameInstanceRequest,Operation> |
setNameCallable()
Sets name of an instance.
|
com.google.api.gax.rpc.OperationCallable<SetNameInstanceRequest,Operation,Operation> |
setNameOperationCallable()
Sets name of an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setSchedulingAsync(SetSchedulingInstanceRequest request)
Sets an instance's scheduling options.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setSchedulingAsync(String project,
String zone,
String instance,
Scheduling schedulingResource)
Sets an instance's scheduling options.
|
com.google.api.gax.rpc.UnaryCallable<SetSchedulingInstanceRequest,Operation> |
setSchedulingCallable()
Sets an instance's scheduling options.
|
com.google.api.gax.rpc.OperationCallable<SetSchedulingInstanceRequest,Operation,Operation> |
setSchedulingOperationCallable()
Sets an instance's scheduling options.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setSecurityPolicyAsync(SetSecurityPolicyInstanceRequest request)
Sets the Google Cloud Armor security policy for the specified instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setSecurityPolicyAsync(String project,
String zone,
String instance,
InstancesSetSecurityPolicyRequest instancesSetSecurityPolicyRequestResource)
Sets the Google Cloud Armor security policy for the specified instance.
|
com.google.api.gax.rpc.UnaryCallable<SetSecurityPolicyInstanceRequest,Operation> |
setSecurityPolicyCallable()
Sets the Google Cloud Armor security policy for the specified instance.
|
com.google.api.gax.rpc.OperationCallable<SetSecurityPolicyInstanceRequest,Operation,Operation> |
setSecurityPolicyOperationCallable()
Sets the Google Cloud Armor security policy for the specified instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setServiceAccountAsync(SetServiceAccountInstanceRequest request)
Sets the service account on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setServiceAccountAsync(String project,
String zone,
String instance,
InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource)
Sets the service account on the instance.
|
com.google.api.gax.rpc.UnaryCallable<SetServiceAccountInstanceRequest,Operation> |
setServiceAccountCallable()
Sets the service account on the instance.
|
com.google.api.gax.rpc.OperationCallable<SetServiceAccountInstanceRequest,Operation,Operation> |
setServiceAccountOperationCallable()
Sets the service account on the instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request)
Sets the Shielded Instance integrity policy for an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setShieldedInstanceIntegrityPolicyAsync(String project,
String zone,
String instance,
ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource)
Sets the Shielded Instance integrity policy for an instance.
|
com.google.api.gax.rpc.UnaryCallable<SetShieldedInstanceIntegrityPolicyInstanceRequest,Operation> |
setShieldedInstanceIntegrityPolicyCallable()
Sets the Shielded Instance integrity policy for an instance.
|
com.google.api.gax.rpc.OperationCallable<SetShieldedInstanceIntegrityPolicyInstanceRequest,Operation,Operation> |
setShieldedInstanceIntegrityPolicyOperationCallable()
Sets the Shielded Instance integrity policy for an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setTagsAsync(SetTagsInstanceRequest request)
Sets network tags for the specified instance to the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setTagsAsync(String project,
String zone,
String instance,
Tags tagsResource)
Sets network tags for the specified instance to the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<SetTagsInstanceRequest,Operation> |
setTagsCallable()
Sets network tags for the specified instance to the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<SetTagsInstanceRequest,Operation,Operation> |
setTagsOperationCallable()
Sets network tags for the specified instance to the data included in the request.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
simulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request)
Simulates a host maintenance event on a VM.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
simulateMaintenanceEventAsync(String project,
String zone,
String instance)
Simulates a host maintenance event on a VM.
|
com.google.api.gax.rpc.UnaryCallable<SimulateMaintenanceEventInstanceRequest,Operation> |
simulateMaintenanceEventCallable()
Simulates a host maintenance event on a VM.
|
com.google.api.gax.rpc.OperationCallable<SimulateMaintenanceEventInstanceRequest,Operation,Operation> |
simulateMaintenanceEventOperationCallable()
Simulates a host maintenance event on a VM.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
startAsync(StartInstanceRequest request)
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
startAsync(String project,
String zone,
String instance)
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.rpc.UnaryCallable<StartInstanceRequest,Operation> |
startCallable()
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.rpc.OperationCallable<StartInstanceRequest,Operation,Operation> |
startOperationCallable()
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
startWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request)
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
startWithEncryptionKeyAsync(String project,
String zone,
String instance,
InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource)
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.rpc.UnaryCallable<StartWithEncryptionKeyInstanceRequest,Operation> |
startWithEncryptionKeyCallable()
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.rpc.OperationCallable<StartWithEncryptionKeyInstanceRequest,Operation,Operation> |
startWithEncryptionKeyOperationCallable()
Starts an instance that was stopped using the instances().stop method.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
stopAsync(StopInstanceRequest request)
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a
later time.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
stopAsync(String project,
String zone,
String instance)
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a
later time.
|
com.google.api.gax.rpc.UnaryCallable<StopInstanceRequest,Operation> |
stopCallable()
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a
later time.
|
com.google.api.gax.rpc.OperationCallable<StopInstanceRequest,Operation,Operation> |
stopOperationCallable()
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a
later time.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
suspendAsync(String project,
String zone,
String instance)
This method suspends a running instance, saving its state to persistent storage, and allows you
to resume the instance at a later time.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
suspendAsync(SuspendInstanceRequest request)
This method suspends a running instance, saving its state to persistent storage, and allows you
to resume the instance at a later time.
|
com.google.api.gax.rpc.UnaryCallable<SuspendInstanceRequest,Operation> |
suspendCallable()
This method suspends a running instance, saving its state to persistent storage, and allows you
to resume the instance at a later time.
|
com.google.api.gax.rpc.OperationCallable<SuspendInstanceRequest,Operation,Operation> |
suspendOperationCallable()
This method suspends a running instance, saving its state to persistent storage, and allows you
to resume the instance at a later time.
|
TestPermissionsResponse |
testIamPermissions(String project,
String zone,
String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissions(TestIamPermissionsInstanceRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsInstanceRequest,TestPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateAccessConfigAsync(String project,
String zone,
String instance,
String networkInterface,
AccessConfig accessConfigResource)
Updates the specified access config from an instance's network interface with the data included
in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateAccessConfigAsync(UpdateAccessConfigInstanceRequest request)
Updates the specified access config from an instance's network interface with the data included
in the request.
|
com.google.api.gax.rpc.UnaryCallable<UpdateAccessConfigInstanceRequest,Operation> |
updateAccessConfigCallable()
Updates the specified access config from an instance's network interface with the data included
in the request.
|
com.google.api.gax.rpc.OperationCallable<UpdateAccessConfigInstanceRequest,Operation,Operation> |
updateAccessConfigOperationCallable()
Updates the specified access config from an instance's network interface with the data included
in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateAsync(String project,
String zone,
String instance,
Instance instanceResource)
Updates an instance only if the necessary resources are available.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateAsync(UpdateInstanceRequest request)
Updates an instance only if the necessary resources are available.
|
com.google.api.gax.rpc.UnaryCallable<UpdateInstanceRequest,Operation> |
updateCallable()
Updates an instance only if the necessary resources are available.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateDisplayDeviceAsync(String project,
String zone,
String instance,
DisplayDevice displayDeviceResource)
Updates the Display config for a VM instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request)
Updates the Display config for a VM instance.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDisplayDeviceInstanceRequest,Operation> |
updateDisplayDeviceCallable()
Updates the Display config for a VM instance.
|
com.google.api.gax.rpc.OperationCallable<UpdateDisplayDeviceInstanceRequest,Operation,Operation> |
updateDisplayDeviceOperationCallable()
Updates the Display config for a VM instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateNetworkInterfaceAsync(String project,
String zone,
String instance,
String networkInterface,
NetworkInterface networkInterfaceResource)
Updates an instance's network interface.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request)
Updates an instance's network interface.
|
com.google.api.gax.rpc.UnaryCallable<UpdateNetworkInterfaceInstanceRequest,Operation> |
updateNetworkInterfaceCallable()
Updates an instance's network interface.
|
com.google.api.gax.rpc.OperationCallable<UpdateNetworkInterfaceInstanceRequest,Operation,Operation> |
updateNetworkInterfaceOperationCallable()
Updates an instance's network interface.
|
com.google.api.gax.rpc.OperationCallable<UpdateInstanceRequest,Operation,Operation> |
updateOperationCallable()
Updates an instance only if the necessary resources are available.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateShieldedInstanceConfigAsync(String project,
String zone,
String instance,
ShieldedInstanceConfig shieldedInstanceConfigResource)
Updates the Shielded Instance config for an instance.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request)
Updates the Shielded Instance config for an instance.
|
com.google.api.gax.rpc.UnaryCallable<UpdateShieldedInstanceConfigInstanceRequest,Operation> |
updateShieldedInstanceConfigCallable()
Updates the Shielded Instance config for an instance.
|
com.google.api.gax.rpc.OperationCallable<UpdateShieldedInstanceConfigInstanceRequest,Operation,Operation> |
updateShieldedInstanceConfigOperationCallable()
Updates the Shielded Instance config for an instance.
|
protected InstancesClient(InstancesSettings settings) throws IOException
IOExceptionprotected InstancesClient(InstancesStub stub)
public static final InstancesClient create() throws IOException
IOExceptionpublic static final InstancesClient create(InstancesSettings settings) throws IOException
IOExceptionpublic static final InstancesClient create(InstancesStub stub)
public final InstancesSettings getSettings()
public InstancesStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAccessConfigAsync(String project, String zone, String instance, String networkInterface, AccessConfig accessConfigResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
String networkInterface = "networkInterface-341981525";
AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
Operation response =
instancesClient
.addAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.networkInterface - The name of the network interface to add to this instance.accessConfigResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAccessConfigAsync(AddAccessConfigInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
AddAccessConfigInstanceRequest request =
AddAccessConfigInstanceRequest.newBuilder()
.setAccessConfigResource(AccessConfig.newBuilder().build())
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.addAccessConfigAsync(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<AddAccessConfigInstanceRequest,Operation,Operation> addAccessConfigOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AddAccessConfigInstanceRequest request =
AddAccessConfigInstanceRequest.newBuilder()
.setAccessConfigResource(AccessConfig.newBuilder().build())
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.addAccessConfigOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddAccessConfigInstanceRequest,Operation> addAccessConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AddAccessConfigInstanceRequest request =
AddAccessConfigInstanceRequest.newBuilder()
.setAccessConfigResource(AccessConfig.newBuilder().build())
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.addAccessConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addResourcePoliciesAsync(String project, String zone, String instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource =
InstancesAddResourcePoliciesRequest.newBuilder().build();
Operation response =
instancesClient
.addResourcePoliciesAsync(
project, zone, instance, instancesAddResourcePoliciesRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.instancesAddResourcePoliciesRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addResourcePoliciesAsync(AddResourcePoliciesInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
AddResourcePoliciesInstanceRequest request =
AddResourcePoliciesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesAddResourcePoliciesRequestResource(
InstancesAddResourcePoliciesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.addResourcePoliciesAsync(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<AddResourcePoliciesInstanceRequest,Operation,Operation> addResourcePoliciesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AddResourcePoliciesInstanceRequest request =
AddResourcePoliciesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesAddResourcePoliciesRequestResource(
InstancesAddResourcePoliciesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.addResourcePoliciesOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddResourcePoliciesInstanceRequest,Operation> addResourcePoliciesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AddResourcePoliciesInstanceRequest request =
AddResourcePoliciesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesAddResourcePoliciesRequestResource(
InstancesAddResourcePoliciesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.addResourcePoliciesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final InstancesClient.AggregatedListPagedResponse aggregatedList(String project)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
for (Map.Entry<String, InstancesScopedList> element :
instancesClient.aggregatedList(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InstancesClient.AggregatedListPagedResponse aggregatedList(AggregatedListInstancesRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
AggregatedListInstancesRequest request =
AggregatedListInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
for (Map.Entry<String, InstancesScopedList> element :
instancesClient.aggregatedList(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<AggregatedListInstancesRequest,InstancesClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AggregatedListInstancesRequest request =
AggregatedListInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
ApiFuture<Map.Entry<String, InstancesScopedList>> future =
instancesClient.aggregatedListPagedCallable().futureCall(request);
// Do something.
for (Map.Entry<String, InstancesScopedList> element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListInstancesRequest,InstanceAggregatedList> aggregatedListCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AggregatedListInstancesRequest request =
AggregatedListInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
while (true) {
InstanceAggregatedList response = instancesClient.aggregatedListCallable().call(request);
for (Map.Entry<String, InstancesScopedList> element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> attachDiskAsync(String project, String zone, String instance, AttachedDisk attachedDiskResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
AttachedDisk attachedDiskResource = AttachedDisk.newBuilder().build();
Operation response =
instancesClient.attachDiskAsync(project, zone, instance, attachedDiskResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.attachedDiskResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> attachDiskAsync(AttachDiskInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
AttachDiskInstanceRequest request =
AttachDiskInstanceRequest.newBuilder()
.setAttachedDiskResource(AttachedDisk.newBuilder().build())
.setForceAttach(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.attachDiskAsync(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<AttachDiskInstanceRequest,Operation,Operation> attachDiskOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AttachDiskInstanceRequest request =
AttachDiskInstanceRequest.newBuilder()
.setAttachedDiskResource(AttachedDisk.newBuilder().build())
.setForceAttach(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.attachDiskOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AttachDiskInstanceRequest,Operation> attachDiskCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
AttachDiskInstanceRequest request =
AttachDiskInstanceRequest.newBuilder()
.setAttachedDiskResource(AttachedDisk.newBuilder().build())
.setForceAttach(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.attachDiskCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> bulkInsertAsync(String project, String zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
BulkInsertInstanceResource bulkInsertInstanceResourceResource =
BulkInsertInstanceResource.newBuilder().build();
Operation response =
instancesClient.bulkInsertAsync(project, zone, bulkInsertInstanceResourceResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.bulkInsertInstanceResourceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> bulkInsertAsync(BulkInsertInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
BulkInsertInstanceRequest request =
BulkInsertInstanceRequest.newBuilder()
.setBulkInsertInstanceResourceResource(
BulkInsertInstanceResource.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.bulkInsertAsync(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<BulkInsertInstanceRequest,Operation,Operation> bulkInsertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
BulkInsertInstanceRequest request =
BulkInsertInstanceRequest.newBuilder()
.setBulkInsertInstanceResourceResource(
BulkInsertInstanceResource.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.bulkInsertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<BulkInsertInstanceRequest,Operation> bulkInsertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
BulkInsertInstanceRequest request =
BulkInsertInstanceRequest.newBuilder()
.setBulkInsertInstanceResourceResource(
BulkInsertInstanceResource.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.bulkInsertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.deleteAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
DeleteInstanceRequest request =
DeleteInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.deleteAsync(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<DeleteInstanceRequest,Operation,Operation> deleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
DeleteInstanceRequest request =
DeleteInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteInstanceRequest,Operation> deleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
DeleteInstanceRequest request =
DeleteInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAccessConfigAsync(String project, String zone, String instance, String accessConfig, String networkInterface)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
String accessConfig = "accessConfig1549765062";
String networkInterface = "networkInterface-341981525";
Operation response =
instancesClient
.deleteAccessConfigAsync(project, zone, instance, accessConfig, networkInterface)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.accessConfig - The name of the access config to delete.networkInterface - The name of the network interface.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAccessConfigAsync(DeleteAccessConfigInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
DeleteAccessConfigInstanceRequest request =
DeleteAccessConfigInstanceRequest.newBuilder()
.setAccessConfig("accessConfig1549765062")
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.deleteAccessConfigAsync(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<DeleteAccessConfigInstanceRequest,Operation,Operation> deleteAccessConfigOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
DeleteAccessConfigInstanceRequest request =
DeleteAccessConfigInstanceRequest.newBuilder()
.setAccessConfig("accessConfig1549765062")
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.deleteAccessConfigOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteAccessConfigInstanceRequest,Operation> deleteAccessConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
DeleteAccessConfigInstanceRequest request =
DeleteAccessConfigInstanceRequest.newBuilder()
.setAccessConfig("accessConfig1549765062")
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.deleteAccessConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> detachDiskAsync(String project, String zone, String instance, String deviceName)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
String deviceName = "deviceName780988929";
Operation response =
instancesClient.detachDiskAsync(project, zone, instance, deviceName).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Instance name for this request.deviceName - The device name of the disk to detach. Make a get() request on the instance
to view currently attached disks and device names.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> detachDiskAsync(DetachDiskInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
DetachDiskInstanceRequest request =
DetachDiskInstanceRequest.newBuilder()
.setDeviceName("deviceName780988929")
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.detachDiskAsync(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<DetachDiskInstanceRequest,Operation,Operation> detachDiskOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
DetachDiskInstanceRequest request =
DetachDiskInstanceRequest.newBuilder()
.setDeviceName("deviceName780988929")
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.detachDiskOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DetachDiskInstanceRequest,Operation> detachDiskCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
DetachDiskInstanceRequest request =
DetachDiskInstanceRequest.newBuilder()
.setDeviceName("deviceName780988929")
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.detachDiskCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Instance get(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Instance response = instancesClient.get(project, zone, instance);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to return.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Instance get(GetInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetInstanceRequest request =
GetInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
Instance response = instancesClient.get(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<GetInstanceRequest,Instance> getCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetInstanceRequest request =
GetInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<Instance> future = instancesClient.getCallable().futureCall(request);
// Do something.
Instance response = future.get();
}
public final InstancesGetEffectiveFirewallsResponse getEffectiveFirewalls(String project, String zone, String instance, String networkInterface)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
String networkInterface = "networkInterface-341981525";
InstancesGetEffectiveFirewallsResponse response =
instancesClient.getEffectiveFirewalls(project, zone, instance, networkInterface);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.networkInterface - The name of the network interface to get the effective firewalls.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InstancesGetEffectiveFirewallsResponse getEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetEffectiveFirewallsInstanceRequest request =
GetEffectiveFirewallsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
InstancesGetEffectiveFirewallsResponse response =
instancesClient.getEffectiveFirewalls(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<GetEffectiveFirewallsInstanceRequest,InstancesGetEffectiveFirewallsResponse> getEffectiveFirewallsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetEffectiveFirewallsInstanceRequest request =
GetEffectiveFirewallsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<InstancesGetEffectiveFirewallsResponse> future =
instancesClient.getEffectiveFirewallsCallable().futureCall(request);
// Do something.
InstancesGetEffectiveFirewallsResponse response = future.get();
}
public final GuestAttributes getGuestAttributes(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
GuestAttributes response = instancesClient.getGuestAttributes(project, zone, instance);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GuestAttributes getGuestAttributes(GetGuestAttributesInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetGuestAttributesInstanceRequest request =
GetGuestAttributesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setQueryPath("queryPath-1807004403")
.setVariableKey("variableKey-1951698365")
.setZone("zone3744684")
.build();
GuestAttributes response = instancesClient.getGuestAttributes(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<GetGuestAttributesInstanceRequest,GuestAttributes> getGuestAttributesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetGuestAttributesInstanceRequest request =
GetGuestAttributesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setQueryPath("queryPath-1807004403")
.setVariableKey("variableKey-1951698365")
.setZone("zone3744684")
.build();
ApiFuture<GuestAttributes> future =
instancesClient.getGuestAttributesCallable().futureCall(request);
// Do something.
GuestAttributes response = future.get();
}
public final Policy getIamPolicy(String project, String zone, String resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
Policy response = instancesClient.getIamPolicy(project, zone, resource);
}
project - Project ID for this request.zone - The name of the zone for this request.resource - Name or id of the resource for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy getIamPolicy(GetIamPolicyInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetIamPolicyInstanceRequest request =
GetIamPolicyInstanceRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
Policy response = instancesClient.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<GetIamPolicyInstanceRequest,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 (InstancesClient instancesClient = InstancesClient.create()) {
GetIamPolicyInstanceRequest request =
GetIamPolicyInstanceRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
ApiFuture<Policy> future = instancesClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final Screenshot getScreenshot(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Screenshot response = instancesClient.getScreenshot(project, zone, instance);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Screenshot getScreenshot(GetScreenshotInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetScreenshotInstanceRequest request =
GetScreenshotInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
Screenshot response = instancesClient.getScreenshot(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<GetScreenshotInstanceRequest,Screenshot> getScreenshotCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetScreenshotInstanceRequest request =
GetScreenshotInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<Screenshot> future = instancesClient.getScreenshotCallable().futureCall(request);
// Do something.
Screenshot response = future.get();
}
public final SerialPortOutput getSerialPortOutput(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
SerialPortOutput response = instancesClient.getSerialPortOutput(project, zone, instance);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SerialPortOutput getSerialPortOutput(GetSerialPortOutputInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetSerialPortOutputInstanceRequest request =
GetSerialPortOutputInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setPort(3446913)
.setProject("project-309310695")
.setStart(109757538)
.setZone("zone3744684")
.build();
SerialPortOutput response = instancesClient.getSerialPortOutput(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<GetSerialPortOutputInstanceRequest,SerialPortOutput> getSerialPortOutputCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetSerialPortOutputInstanceRequest request =
GetSerialPortOutputInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setPort(3446913)
.setProject("project-309310695")
.setStart(109757538)
.setZone("zone3744684")
.build();
ApiFuture<SerialPortOutput> future =
instancesClient.getSerialPortOutputCallable().futureCall(request);
// Do something.
SerialPortOutput response = future.get();
}
public final ShieldedInstanceIdentity getShieldedInstanceIdentity(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
ShieldedInstanceIdentity response =
instancesClient.getShieldedInstanceIdentity(project, zone, instance);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name or id of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ShieldedInstanceIdentity getShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
GetShieldedInstanceIdentityInstanceRequest request =
GetShieldedInstanceIdentityInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ShieldedInstanceIdentity response = instancesClient.getShieldedInstanceIdentity(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<GetShieldedInstanceIdentityInstanceRequest,ShieldedInstanceIdentity> getShieldedInstanceIdentityCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
GetShieldedInstanceIdentityInstanceRequest request =
GetShieldedInstanceIdentityInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<ShieldedInstanceIdentity> future =
instancesClient.getShieldedInstanceIdentityCallable().futureCall(request);
// Do something.
ShieldedInstanceIdentity response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, String zone, Instance instanceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
Instance instanceResource = Instance.newBuilder().build();
Operation response = instancesClient.insertAsync(project, zone, instanceResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instanceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
InsertInstanceRequest request =
InsertInstanceRequest.newBuilder()
.setInstanceResource(Instance.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceInstanceTemplate("sourceInstanceTemplate949712490")
.setSourceMachineImage("sourceMachineImage1261073679")
.setZone("zone3744684")
.build();
Operation response = instancesClient.insertAsync(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<InsertInstanceRequest,Operation,Operation> insertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
InsertInstanceRequest request =
InsertInstanceRequest.newBuilder()
.setInstanceResource(Instance.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceInstanceTemplate("sourceInstanceTemplate949712490")
.setSourceMachineImage("sourceMachineImage1261073679")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertInstanceRequest,Operation> insertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
InsertInstanceRequest request =
InsertInstanceRequest.newBuilder()
.setInstanceResource(Instance.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceInstanceTemplate("sourceInstanceTemplate949712490")
.setSourceMachineImage("sourceMachineImage1261073679")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final InstancesClient.ListPagedResponse list(String project, String zone)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
for (Instance element : instancesClient.list(project, zone).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.zone - The name of the zone for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InstancesClient.ListPagedResponse list(ListInstancesRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
ListInstancesRequest request =
ListInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
for (Instance element : instancesClient.list(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<ListInstancesRequest,InstancesClient.ListPagedResponse> listPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ListInstancesRequest request =
ListInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<Instance> future = instancesClient.listPagedCallable().futureCall(request);
// Do something.
for (Instance element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,InstanceList> listCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ListInstancesRequest request =
ListInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
while (true) {
InstanceList response = instancesClient.listCallable().call(request);
for (Instance element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final InstancesClient.ListReferrersPagedResponse listReferrers(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
for (Reference element :
instancesClient.listReferrers(project, zone, instance).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the target instance scoping this request, or '-' if the request should
span over all instances in the container.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InstancesClient.ListReferrersPagedResponse listReferrers(ListReferrersInstancesRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
ListReferrersInstancesRequest request =
ListReferrersInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstance("instance555127957")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
for (Reference element : instancesClient.listReferrers(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<ListReferrersInstancesRequest,InstancesClient.ListReferrersPagedResponse> listReferrersPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ListReferrersInstancesRequest request =
ListReferrersInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstance("instance555127957")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<Reference> future =
instancesClient.listReferrersPagedCallable().futureCall(request);
// Do something.
for (Reference element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListReferrersInstancesRequest,InstanceListReferrers> listReferrersCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ListReferrersInstancesRequest request =
ListReferrersInstancesRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstance("instance555127957")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
while (true) {
InstanceListReferrers response = instancesClient.listReferrersCallable().call(request);
for (Reference element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> performMaintenanceAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.performMaintenanceAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> performMaintenanceAsync(PerformMaintenanceInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
PerformMaintenanceInstanceRequest request =
PerformMaintenanceInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.performMaintenanceAsync(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<PerformMaintenanceInstanceRequest,Operation,Operation> performMaintenanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
PerformMaintenanceInstanceRequest request =
PerformMaintenanceInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.performMaintenanceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PerformMaintenanceInstanceRequest,Operation> performMaintenanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
PerformMaintenanceInstanceRequest request =
PerformMaintenanceInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.performMaintenanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeResourcePoliciesAsync(String project, String zone, String instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource =
InstancesRemoveResourcePoliciesRequest.newBuilder().build();
Operation response =
instancesClient
.removeResourcePoliciesAsync(
project, zone, instance, instancesRemoveResourcePoliciesRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.instancesRemoveResourcePoliciesRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
RemoveResourcePoliciesInstanceRequest request =
RemoveResourcePoliciesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesRemoveResourcePoliciesRequestResource(
InstancesRemoveResourcePoliciesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.removeResourcePoliciesAsync(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<RemoveResourcePoliciesInstanceRequest,Operation,Operation> removeResourcePoliciesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
RemoveResourcePoliciesInstanceRequest request =
RemoveResourcePoliciesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesRemoveResourcePoliciesRequestResource(
InstancesRemoveResourcePoliciesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.removeResourcePoliciesOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveResourcePoliciesInstanceRequest,Operation> removeResourcePoliciesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
RemoveResourcePoliciesInstanceRequest request =
RemoveResourcePoliciesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesRemoveResourcePoliciesRequestResource(
InstancesRemoveResourcePoliciesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.removeResourcePoliciesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> resetAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.resetAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> resetAsync(ResetInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
ResetInstanceRequest request =
ResetInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.resetAsync(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<ResetInstanceRequest,Operation,Operation> resetOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ResetInstanceRequest request =
ResetInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.resetOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ResetInstanceRequest,Operation> resetCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ResetInstanceRequest request =
ResetInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.resetCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> resumeAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.resumeAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to resume.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> resumeAsync(ResumeInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
ResumeInstanceRequest request =
ResumeInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.resumeAsync(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<ResumeInstanceRequest,Operation,Operation> resumeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ResumeInstanceRequest request =
ResumeInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.resumeOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ResumeInstanceRequest,Operation> resumeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
ResumeInstanceRequest request =
ResumeInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.resumeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final SendDiagnosticInterruptInstanceResponse sendDiagnosticInterrupt(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
SendDiagnosticInterruptInstanceResponse response =
instancesClient.sendDiagnosticInterrupt(project, zone, instance);
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SendDiagnosticInterruptInstanceResponse sendDiagnosticInterrupt(SendDiagnosticInterruptInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SendDiagnosticInterruptInstanceRequest request =
SendDiagnosticInterruptInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
SendDiagnosticInterruptInstanceResponse response =
instancesClient.sendDiagnosticInterrupt(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<SendDiagnosticInterruptInstanceRequest,SendDiagnosticInterruptInstanceResponse> sendDiagnosticInterruptCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SendDiagnosticInterruptInstanceRequest request =
SendDiagnosticInterruptInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<SendDiagnosticInterruptInstanceResponse> future =
instancesClient.sendDiagnosticInterruptCallable().futureCall(request);
// Do something.
SendDiagnosticInterruptInstanceResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setDeletionProtectionAsync(String project, String zone, String resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
Operation response =
instancesClient.setDeletionProtectionAsync(project, zone, resource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.resource - Name or id of the resource for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setDeletionProtectionAsync(SetDeletionProtectionInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetDeletionProtectionInstanceRequest request =
SetDeletionProtectionInstanceRequest.newBuilder()
.setDeletionProtection(true)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setDeletionProtectionAsync(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<SetDeletionProtectionInstanceRequest,Operation,Operation> setDeletionProtectionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetDeletionProtectionInstanceRequest request =
SetDeletionProtectionInstanceRequest.newBuilder()
.setDeletionProtection(true)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setDeletionProtectionOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetDeletionProtectionInstanceRequest,Operation> setDeletionProtectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetDeletionProtectionInstanceRequest request =
SetDeletionProtectionInstanceRequest.newBuilder()
.setDeletionProtection(true)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.setDeletionProtectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setDiskAutoDeleteAsync(String project, String zone, String instance, boolean autoDelete, String deviceName)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
boolean autoDelete = true;
String deviceName = "deviceName780988929";
Operation response =
instancesClient
.setDiskAutoDeleteAsync(project, zone, instance, autoDelete, deviceName)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.autoDelete - Whether to auto-delete the disk when the instance is deleted.deviceName - The device name of the disk to modify. Make a get() request on the instance
to view currently attached disks and device names.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetDiskAutoDeleteInstanceRequest request =
SetDiskAutoDeleteInstanceRequest.newBuilder()
.setAutoDelete(true)
.setDeviceName("deviceName780988929")
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setDiskAutoDeleteAsync(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<SetDiskAutoDeleteInstanceRequest,Operation,Operation> setDiskAutoDeleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetDiskAutoDeleteInstanceRequest request =
SetDiskAutoDeleteInstanceRequest.newBuilder()
.setAutoDelete(true)
.setDeviceName("deviceName780988929")
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setDiskAutoDeleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetDiskAutoDeleteInstanceRequest,Operation> setDiskAutoDeleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetDiskAutoDeleteInstanceRequest request =
SetDiskAutoDeleteInstanceRequest.newBuilder()
.setAutoDelete(true)
.setDeviceName("deviceName780988929")
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setDiskAutoDeleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Policy setIamPolicy(String project, String zone, String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
Policy response =
instancesClient.setIamPolicy(project, zone, resource, zoneSetPolicyRequestResource);
}
project - Project ID for this request.zone - The name of the zone for this request.resource - Name or id of the resource for this request.zoneSetPolicyRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy setIamPolicy(SetIamPolicyInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetIamPolicyInstanceRequest request =
SetIamPolicyInstanceRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.setZoneSetPolicyRequestResource(ZoneSetPolicyRequest.newBuilder().build())
.build();
Policy response = instancesClient.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<SetIamPolicyInstanceRequest,Policy> setIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetIamPolicyInstanceRequest request =
SetIamPolicyInstanceRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.setZoneSetPolicyRequestResource(ZoneSetPolicyRequest.newBuilder().build())
.build();
ApiFuture<Policy> future = instancesClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setLabelsAsync(String project, String zone, String instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetLabelsRequest instancesSetLabelsRequestResource =
InstancesSetLabelsRequest.newBuilder().build();
Operation response =
instancesClient
.setLabelsAsync(project, zone, instance, instancesSetLabelsRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.instancesSetLabelsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setLabelsAsync(SetLabelsInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetLabelsInstanceRequest request =
SetLabelsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetLabelsRequestResource(InstancesSetLabelsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setLabelsAsync(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<SetLabelsInstanceRequest,Operation,Operation> setLabelsOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetLabelsInstanceRequest request =
SetLabelsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetLabelsRequestResource(InstancesSetLabelsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setLabelsOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetLabelsInstanceRequest,Operation> setLabelsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetLabelsInstanceRequest request =
SetLabelsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetLabelsRequestResource(InstancesSetLabelsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setLabelsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMachineResourcesAsync(String project, String zone, String instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource =
InstancesSetMachineResourcesRequest.newBuilder().build();
Operation response =
instancesClient
.setMachineResourcesAsync(
project, zone, instance, instancesSetMachineResourcesRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.instancesSetMachineResourcesRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMachineResourcesAsync(SetMachineResourcesInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetMachineResourcesInstanceRequest request =
SetMachineResourcesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMachineResourcesRequestResource(
InstancesSetMachineResourcesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setMachineResourcesAsync(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<SetMachineResourcesInstanceRequest,Operation,Operation> setMachineResourcesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMachineResourcesInstanceRequest request =
SetMachineResourcesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMachineResourcesRequestResource(
InstancesSetMachineResourcesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setMachineResourcesOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetMachineResourcesInstanceRequest,Operation> setMachineResourcesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMachineResourcesInstanceRequest request =
SetMachineResourcesInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMachineResourcesRequestResource(
InstancesSetMachineResourcesRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.setMachineResourcesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMachineTypeAsync(String project, String zone, String instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource =
InstancesSetMachineTypeRequest.newBuilder().build();
Operation response =
instancesClient
.setMachineTypeAsync(project, zone, instance, instancesSetMachineTypeRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.instancesSetMachineTypeRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMachineTypeAsync(SetMachineTypeInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetMachineTypeInstanceRequest request =
SetMachineTypeInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMachineTypeRequestResource(
InstancesSetMachineTypeRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setMachineTypeAsync(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<SetMachineTypeInstanceRequest,Operation,Operation> setMachineTypeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMachineTypeInstanceRequest request =
SetMachineTypeInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMachineTypeRequestResource(
InstancesSetMachineTypeRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setMachineTypeOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetMachineTypeInstanceRequest,Operation> setMachineTypeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMachineTypeInstanceRequest request =
SetMachineTypeInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMachineTypeRequestResource(
InstancesSetMachineTypeRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setMachineTypeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMetadataAsync(String project, String zone, String instance, Metadata metadataResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Metadata metadataResource = Metadata.newBuilder().build();
Operation response =
instancesClient.setMetadataAsync(project, zone, instance, metadataResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.metadataResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMetadataAsync(SetMetadataInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetMetadataInstanceRequest request =
SetMetadataInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setMetadataResource(Metadata.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setMetadataAsync(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<SetMetadataInstanceRequest,Operation,Operation> setMetadataOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMetadataInstanceRequest request =
SetMetadataInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setMetadataResource(Metadata.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setMetadataOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetMetadataInstanceRequest,Operation> setMetadataCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMetadataInstanceRequest request =
SetMetadataInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setMetadataResource(Metadata.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setMetadataCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMinCpuPlatformAsync(String project, String zone, String instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource =
InstancesSetMinCpuPlatformRequest.newBuilder().build();
Operation response =
instancesClient
.setMinCpuPlatformAsync(
project, zone, instance, instancesSetMinCpuPlatformRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.instancesSetMinCpuPlatformRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetMinCpuPlatformInstanceRequest request =
SetMinCpuPlatformInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMinCpuPlatformRequestResource(
InstancesSetMinCpuPlatformRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setMinCpuPlatformAsync(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<SetMinCpuPlatformInstanceRequest,Operation,Operation> setMinCpuPlatformOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMinCpuPlatformInstanceRequest request =
SetMinCpuPlatformInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMinCpuPlatformRequestResource(
InstancesSetMinCpuPlatformRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setMinCpuPlatformOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetMinCpuPlatformInstanceRequest,Operation> setMinCpuPlatformCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetMinCpuPlatformInstanceRequest request =
SetMinCpuPlatformInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetMinCpuPlatformRequestResource(
InstancesSetMinCpuPlatformRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setMinCpuPlatformCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setNameAsync(String project, String zone, String instance, InstancesSetNameRequest instancesSetNameRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetNameRequest instancesSetNameRequestResource =
InstancesSetNameRequest.newBuilder().build();
Operation response =
instancesClient
.setNameAsync(project, zone, instance, instancesSetNameRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.instancesSetNameRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setNameAsync(SetNameInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetNameInstanceRequest request =
SetNameInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetNameRequestResource(InstancesSetNameRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setNameAsync(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<SetNameInstanceRequest,Operation,Operation> setNameOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetNameInstanceRequest request =
SetNameInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetNameRequestResource(InstancesSetNameRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setNameOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetNameInstanceRequest,Operation> setNameCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetNameInstanceRequest request =
SetNameInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetNameRequestResource(InstancesSetNameRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setNameCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSchedulingAsync(String project, String zone, String instance, Scheduling schedulingResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Scheduling schedulingResource = Scheduling.newBuilder().build();
Operation response =
instancesClient.setSchedulingAsync(project, zone, instance, schedulingResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Instance name for this request.schedulingResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSchedulingAsync(SetSchedulingInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetSchedulingInstanceRequest request =
SetSchedulingInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSchedulingResource(Scheduling.newBuilder().build())
.setZone("zone3744684")
.build();
Operation response = instancesClient.setSchedulingAsync(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<SetSchedulingInstanceRequest,Operation,Operation> setSchedulingOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetSchedulingInstanceRequest request =
SetSchedulingInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSchedulingResource(Scheduling.newBuilder().build())
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setSchedulingOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetSchedulingInstanceRequest,Operation> setSchedulingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetSchedulingInstanceRequest request =
SetSchedulingInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSchedulingResource(Scheduling.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setSchedulingCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSecurityPolicyAsync(String project, String zone, String instance, InstancesSetSecurityPolicyRequest instancesSetSecurityPolicyRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetSecurityPolicyRequest instancesSetSecurityPolicyRequestResource =
InstancesSetSecurityPolicyRequest.newBuilder().build();
Operation response =
instancesClient
.setSecurityPolicyAsync(
project, zone, instance, instancesSetSecurityPolicyRequestResource)
.get();
}
project - Project ID for this request.zone - Name of the zone scoping this request.instance - Name of the Instance resource to which the security policy should be set. The
name should conform to RFC1035.instancesSetSecurityPolicyRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSecurityPolicyAsync(SetSecurityPolicyInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetSecurityPolicyInstanceRequest request =
SetSecurityPolicyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetSecurityPolicyRequestResource(
InstancesSetSecurityPolicyRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setSecurityPolicyAsync(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<SetSecurityPolicyInstanceRequest,Operation,Operation> setSecurityPolicyOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetSecurityPolicyInstanceRequest request =
SetSecurityPolicyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetSecurityPolicyRequestResource(
InstancesSetSecurityPolicyRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setSecurityPolicyOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetSecurityPolicyInstanceRequest,Operation> setSecurityPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetSecurityPolicyInstanceRequest request =
SetSecurityPolicyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetSecurityPolicyRequestResource(
InstancesSetSecurityPolicyRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setSecurityPolicyCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setServiceAccountAsync(String project, String zone, String instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource =
InstancesSetServiceAccountRequest.newBuilder().build();
Operation response =
instancesClient
.setServiceAccountAsync(
project, zone, instance, instancesSetServiceAccountRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to start.instancesSetServiceAccountRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setServiceAccountAsync(SetServiceAccountInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetServiceAccountInstanceRequest request =
SetServiceAccountInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetServiceAccountRequestResource(
InstancesSetServiceAccountRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.setServiceAccountAsync(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<SetServiceAccountInstanceRequest,Operation,Operation> setServiceAccountOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetServiceAccountInstanceRequest request =
SetServiceAccountInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetServiceAccountRequestResource(
InstancesSetServiceAccountRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setServiceAccountOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetServiceAccountInstanceRequest,Operation> setServiceAccountCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetServiceAccountInstanceRequest request =
SetServiceAccountInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesSetServiceAccountRequestResource(
InstancesSetServiceAccountRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setServiceAccountCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setShieldedInstanceIntegrityPolicyAsync(String project, String zone, String instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource =
ShieldedInstanceIntegrityPolicy.newBuilder().build();
Operation response =
instancesClient
.setShieldedInstanceIntegrityPolicyAsync(
project, zone, instance, shieldedInstanceIntegrityPolicyResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name or id of the instance scoping this request.shieldedInstanceIntegrityPolicyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetShieldedInstanceIntegrityPolicyInstanceRequest request =
SetShieldedInstanceIntegrityPolicyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setShieldedInstanceIntegrityPolicyResource(
ShieldedInstanceIntegrityPolicy.newBuilder().build())
.setZone("zone3744684")
.build();
Operation response = instancesClient.setShieldedInstanceIntegrityPolicyAsync(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<SetShieldedInstanceIntegrityPolicyInstanceRequest,Operation,Operation> setShieldedInstanceIntegrityPolicyOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetShieldedInstanceIntegrityPolicyInstanceRequest request =
SetShieldedInstanceIntegrityPolicyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setShieldedInstanceIntegrityPolicyResource(
ShieldedInstanceIntegrityPolicy.newBuilder().build())
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setShieldedInstanceIntegrityPolicyOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetShieldedInstanceIntegrityPolicyInstanceRequest,Operation> setShieldedInstanceIntegrityPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetShieldedInstanceIntegrityPolicyInstanceRequest request =
SetShieldedInstanceIntegrityPolicyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setShieldedInstanceIntegrityPolicyResource(
ShieldedInstanceIntegrityPolicy.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.setShieldedInstanceIntegrityPolicyCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setTagsAsync(String project, String zone, String instance, Tags tagsResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Tags tagsResource = Tags.newBuilder().build();
Operation response =
instancesClient.setTagsAsync(project, zone, instance, tagsResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.tagsResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setTagsAsync(SetTagsInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SetTagsInstanceRequest request =
SetTagsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setTagsResource(Tags.newBuilder().build())
.setZone("zone3744684")
.build();
Operation response = instancesClient.setTagsAsync(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<SetTagsInstanceRequest,Operation,Operation> setTagsOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetTagsInstanceRequest request =
SetTagsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setTagsResource(Tags.newBuilder().build())
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.setTagsOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetTagsInstanceRequest,Operation> setTagsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SetTagsInstanceRequest request =
SetTagsInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setTagsResource(Tags.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.setTagsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> simulateMaintenanceEventAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response =
instancesClient.simulateMaintenanceEventAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> simulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SimulateMaintenanceEventInstanceRequest request =
SimulateMaintenanceEventInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setWithExtendedNotifications(true)
.setZone("zone3744684")
.build();
Operation response = instancesClient.simulateMaintenanceEventAsync(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<SimulateMaintenanceEventInstanceRequest,Operation,Operation> simulateMaintenanceEventOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SimulateMaintenanceEventInstanceRequest request =
SimulateMaintenanceEventInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setWithExtendedNotifications(true)
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.simulateMaintenanceEventOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SimulateMaintenanceEventInstanceRequest,Operation> simulateMaintenanceEventCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SimulateMaintenanceEventInstanceRequest request =
SimulateMaintenanceEventInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setWithExtendedNotifications(true)
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.simulateMaintenanceEventCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> startAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.startAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to start.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> startAsync(StartInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
StartInstanceRequest request =
StartInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.startAsync(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<StartInstanceRequest,Operation,Operation> startOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
StartInstanceRequest request =
StartInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.startOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StartInstanceRequest,Operation> startCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
StartInstanceRequest request =
StartInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.startCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> startWithEncryptionKeyAsync(String project, String zone, String instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource =
InstancesStartWithEncryptionKeyRequest.newBuilder().build();
Operation response =
instancesClient
.startWithEncryptionKeyAsync(
project, zone, instance, instancesStartWithEncryptionKeyRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to start.instancesStartWithEncryptionKeyRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> startWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
StartWithEncryptionKeyInstanceRequest request =
StartWithEncryptionKeyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesStartWithEncryptionKeyRequestResource(
InstancesStartWithEncryptionKeyRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.startWithEncryptionKeyAsync(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<StartWithEncryptionKeyInstanceRequest,Operation,Operation> startWithEncryptionKeyOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
StartWithEncryptionKeyInstanceRequest request =
StartWithEncryptionKeyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesStartWithEncryptionKeyRequestResource(
InstancesStartWithEncryptionKeyRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.startWithEncryptionKeyOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StartWithEncryptionKeyInstanceRequest,Operation> startWithEncryptionKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
StartWithEncryptionKeyInstanceRequest request =
StartWithEncryptionKeyInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstancesStartWithEncryptionKeyRequestResource(
InstancesStartWithEncryptionKeyRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.startWithEncryptionKeyCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> stopAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.stopAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to stop.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> stopAsync(StopInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
StopInstanceRequest request =
StopInstanceRequest.newBuilder()
.setDiscardLocalSsd(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.stopAsync(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<StopInstanceRequest,Operation,Operation> stopOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
StopInstanceRequest request =
StopInstanceRequest.newBuilder()
.setDiscardLocalSsd(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.stopOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StopInstanceRequest,Operation> stopCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
StopInstanceRequest request =
StopInstanceRequest.newBuilder()
.setDiscardLocalSsd(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.stopCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> suspendAsync(String project, String zone, String instance)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Operation response = instancesClient.suspendAsync(project, zone, instance).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to suspend.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> suspendAsync(SuspendInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
SuspendInstanceRequest request =
SuspendInstanceRequest.newBuilder()
.setDiscardLocalSsd(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.suspendAsync(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<SuspendInstanceRequest,Operation,Operation> suspendOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SuspendInstanceRequest request =
SuspendInstanceRequest.newBuilder()
.setDiscardLocalSsd(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.suspendOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SuspendInstanceRequest,Operation> suspendCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
SuspendInstanceRequest request =
SuspendInstanceRequest.newBuilder()
.setDiscardLocalSsd(true)
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.suspendCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final TestPermissionsResponse testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
instancesClient.testIamPermissions(
project, zone, resource, testPermissionsRequestResource);
}
project - Project ID for this request.zone - The name of the zone for this request.resource - Name or id of the resource for this request.testPermissionsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final TestPermissionsResponse testIamPermissions(TestIamPermissionsInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
TestIamPermissionsInstanceRequest request =
TestIamPermissionsInstanceRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.setZone("zone3744684")
.build();
TestPermissionsResponse response = instancesClient.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<TestIamPermissionsInstanceRequest,TestPermissionsResponse> testIamPermissionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
TestIamPermissionsInstanceRequest request =
TestIamPermissionsInstanceRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<TestPermissionsResponse> future =
instancesClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestPermissionsResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAsync(String project, String zone, String instance, Instance instanceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
Instance instanceResource = Instance.newBuilder().build();
Operation response =
instancesClient.updateAsync(project, zone, instance, instanceResource).get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance resource to update.instanceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAsync(UpdateInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
UpdateInstanceRequest request =
UpdateInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstanceResource(Instance.newBuilder().build())
.setMinimalAction("minimalAction624261943")
.setMostDisruptiveAllowedAction("mostDisruptiveAllowedAction-1597376488")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.updateAsync(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<UpdateInstanceRequest,Operation,Operation> updateOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateInstanceRequest request =
UpdateInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstanceResource(Instance.newBuilder().build())
.setMinimalAction("minimalAction624261943")
.setMostDisruptiveAllowedAction("mostDisruptiveAllowedAction-1597376488")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.updateOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateInstanceRequest,Operation> updateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateInstanceRequest request =
UpdateInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setInstanceResource(Instance.newBuilder().build())
.setMinimalAction("minimalAction624261943")
.setMostDisruptiveAllowedAction("mostDisruptiveAllowedAction-1597376488")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future = instancesClient.updateCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAccessConfigAsync(String project, String zone, String instance, String networkInterface, AccessConfig accessConfigResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
String networkInterface = "networkInterface-341981525";
AccessConfig accessConfigResource = AccessConfig.newBuilder().build();
Operation response =
instancesClient
.updateAccessConfigAsync(
project, zone, instance, networkInterface, accessConfigResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.networkInterface - The name of the network interface where the access config is attached.accessConfigResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAccessConfigAsync(UpdateAccessConfigInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
UpdateAccessConfigInstanceRequest request =
UpdateAccessConfigInstanceRequest.newBuilder()
.setAccessConfigResource(AccessConfig.newBuilder().build())
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.updateAccessConfigAsync(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<UpdateAccessConfigInstanceRequest,Operation,Operation> updateAccessConfigOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateAccessConfigInstanceRequest request =
UpdateAccessConfigInstanceRequest.newBuilder()
.setAccessConfigResource(AccessConfig.newBuilder().build())
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.updateAccessConfigOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateAccessConfigInstanceRequest,Operation> updateAccessConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateAccessConfigInstanceRequest request =
UpdateAccessConfigInstanceRequest.newBuilder()
.setAccessConfigResource(AccessConfig.newBuilder().build())
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.updateAccessConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateDisplayDeviceAsync(String project, String zone, String instance, DisplayDevice displayDeviceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
DisplayDevice displayDeviceResource = DisplayDevice.newBuilder().build();
Operation response =
instancesClient
.updateDisplayDeviceAsync(project, zone, instance, displayDeviceResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name of the instance scoping this request.displayDeviceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
UpdateDisplayDeviceInstanceRequest request =
UpdateDisplayDeviceInstanceRequest.newBuilder()
.setDisplayDeviceResource(DisplayDevice.newBuilder().build())
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.updateDisplayDeviceAsync(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<UpdateDisplayDeviceInstanceRequest,Operation,Operation> updateDisplayDeviceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateDisplayDeviceInstanceRequest request =
UpdateDisplayDeviceInstanceRequest.newBuilder()
.setDisplayDeviceResource(DisplayDevice.newBuilder().build())
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.updateDisplayDeviceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateDisplayDeviceInstanceRequest,Operation> updateDisplayDeviceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateDisplayDeviceInstanceRequest request =
UpdateDisplayDeviceInstanceRequest.newBuilder()
.setDisplayDeviceResource(DisplayDevice.newBuilder().build())
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.updateDisplayDeviceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateNetworkInterfaceAsync(String project, String zone, String instance, String networkInterface, NetworkInterface networkInterfaceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
String networkInterface = "networkInterface-341981525";
NetworkInterface networkInterfaceResource = NetworkInterface.newBuilder().build();
Operation response =
instancesClient
.updateNetworkInterfaceAsync(
project, zone, instance, networkInterface, networkInterfaceResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - The instance name for this request.networkInterface - The name of the network interface to update.networkInterfaceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
UpdateNetworkInterfaceInstanceRequest request =
UpdateNetworkInterfaceInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setNetworkInterfaceResource(NetworkInterface.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instancesClient.updateNetworkInterfaceAsync(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<UpdateNetworkInterfaceInstanceRequest,Operation,Operation> updateNetworkInterfaceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateNetworkInterfaceInstanceRequest request =
UpdateNetworkInterfaceInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setNetworkInterfaceResource(NetworkInterface.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.updateNetworkInterfaceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateNetworkInterfaceInstanceRequest,Operation> updateNetworkInterfaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateNetworkInterfaceInstanceRequest request =
UpdateNetworkInterfaceInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setNetworkInterface("networkInterface-341981525")
.setNetworkInterfaceResource(NetworkInterface.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.updateNetworkInterfaceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateShieldedInstanceConfigAsync(String project, String zone, String instance, ShieldedInstanceConfig shieldedInstanceConfigResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instance = "instance555127957";
ShieldedInstanceConfig shieldedInstanceConfigResource =
ShieldedInstanceConfig.newBuilder().build();
Operation response =
instancesClient
.updateShieldedInstanceConfigAsync(
project, zone, instance, shieldedInstanceConfigResource)
.get();
}
project - Project ID for this request.zone - The name of the zone for this request.instance - Name or id of the instance scoping this request.shieldedInstanceConfigResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest 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 (InstancesClient instancesClient = InstancesClient.create()) {
UpdateShieldedInstanceConfigInstanceRequest request =
UpdateShieldedInstanceConfigInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setShieldedInstanceConfigResource(ShieldedInstanceConfig.newBuilder().build())
.setZone("zone3744684")
.build();
Operation response = instancesClient.updateShieldedInstanceConfigAsync(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<UpdateShieldedInstanceConfigInstanceRequest,Operation,Operation> updateShieldedInstanceConfigOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateShieldedInstanceConfigInstanceRequest request =
UpdateShieldedInstanceConfigInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setShieldedInstanceConfigResource(ShieldedInstanceConfig.newBuilder().build())
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instancesClient.updateShieldedInstanceConfigOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateShieldedInstanceConfigInstanceRequest,Operation> updateShieldedInstanceConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstancesClient instancesClient = InstancesClient.create()) {
UpdateShieldedInstanceConfigInstanceRequest request =
UpdateShieldedInstanceConfigInstanceRequest.newBuilder()
.setInstance("instance555127957")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setShieldedInstanceConfigResource(ShieldedInstanceConfig.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instancesClient.updateShieldedInstanceConfigCallable().futureCall(request);
// Do something.
Operation 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.