Class InstancesSettings (1.68.0)

public class InstancesSettings extends ClientSettings<InstancesSettings>

Settings class to configure an instance of InstancesClient.

The default instance has everything set to sensible defaults:

  • The default service address (compute.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the RetrySettings of get:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require 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.Builder instancesSettingsBuilder = InstancesSettings.newBuilder();
 instancesSettingsBuilder
     .getSettings()
     .setRetrySettings(
         instancesSettingsBuilder
             .getSettings()
             .getRetrySettings()
             .toBuilder()
             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
             .setMaxAttempts(5)
             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
             .setRetryDelayMultiplier(1.3)
             .setRpcTimeoutMultiplier(1.5)
             .setTotalTimeoutDuration(Duration.ofSeconds(300))
             .build());
 InstancesSettings instancesSettings = instancesSettingsBuilder.build();
 

Please refer to the Client Side Retry Guide for additional support in setting retries.

To configure the RetrySettings of a Long Running Operation method, create an OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to configure the RetrySettings for addAccessConfig:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require 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.Builder instancesSettingsBuilder = InstancesSettings.newBuilder();
 TimedRetryAlgorithm timedRetryAlgorithm =
     OperationalTimedPollAlgorithm.create(
         RetrySettings.newBuilder()
             .setInitialRetryDelayDuration(Duration.ofMillis(500))
             .setRetryDelayMultiplier(1.5)
             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
             .setTotalTimeoutDuration(Duration.ofHours(24))
             .build());
 instancesSettingsBuilder
     .createClusterOperationSettings()
     .setPollingAlgorithm(timedRetryAlgorithm)
     .build();
 

Inheritance

java.lang.Object > ClientSettings > InstancesSettings

Static Methods

create(InstancesStubSettings stub)

public static final InstancesSettings create(InstancesStubSettings stub)
Parameter
Name Description
stub InstancesStubSettings
Returns
Type Description
InstancesSettings
Exceptions
Type Description
IOException

defaultApiClientHeaderProviderBuilder()

public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()
Returns
Type Description
Builder

defaultCredentialsProviderBuilder()

public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()

Returns a builder for the default credentials for this service.

Returns
Type Description
Builder

defaultExecutorProviderBuilder()

public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()

Returns a builder for the default ExecutorProvider for this service.

Returns
Type Description
Builder

defaultHttpJsonTransportProviderBuilder()

public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()

Returns a builder for the default ChannelProvider for this service.

Returns
Type Description
Builder

defaultTransportChannelProvider()

public static TransportChannelProvider defaultTransportChannelProvider()
Returns
Type Description
TransportChannelProvider

getDefaultEndpoint()

public static String getDefaultEndpoint()

Returns the default service endpoint.

Returns
Type Description
String

getDefaultServiceScopes()

public static List<String> getDefaultServiceScopes()

Returns the default service scopes.

Returns
Type Description
List<String>

newBuilder()

public static InstancesSettings.Builder newBuilder()

Returns a new builder for this class.

Returns
Type Description
InstancesSettings.Builder

newBuilder(ClientContext clientContext)

public static InstancesSettings.Builder newBuilder(ClientContext clientContext)

Returns a new builder for this class.

Parameter
Name Description
clientContext ClientContext
Returns
Type Description
InstancesSettings.Builder

Constructors

InstancesSettings(InstancesSettings.Builder settingsBuilder)

protected InstancesSettings(InstancesSettings.Builder settingsBuilder)
Parameter
Name Description
settingsBuilder InstancesSettings.Builder

Methods

addAccessConfigOperationSettings()

public OperationCallSettings<AddAccessConfigInstanceRequest,Operation,Operation> addAccessConfigOperationSettings()

Returns the object with the settings used for calls to addAccessConfig.

addAccessConfigSettings()

public UnaryCallSettings<AddAccessConfigInstanceRequest,Operation> addAccessConfigSettings()

Returns the object with the settings used for calls to addAccessConfig.

addResourcePoliciesOperationSettings()

public OperationCallSettings<AddResourcePoliciesInstanceRequest,Operation,Operation> addResourcePoliciesOperationSettings()

Returns the object with the settings used for calls to addResourcePolicies.

addResourcePoliciesSettings()

public UnaryCallSettings<AddResourcePoliciesInstanceRequest,Operation> addResourcePoliciesSettings()

Returns the object with the settings used for calls to addResourcePolicies.

aggregatedListSettings()

public PagedCallSettings<AggregatedListInstancesRequest,InstanceAggregatedList,InstancesClient.AggregatedListPagedResponse> aggregatedListSettings()

Returns the object with the settings used for calls to aggregatedList.

attachDiskOperationSettings()

public OperationCallSettings<AttachDiskInstanceRequest,Operation,Operation> attachDiskOperationSettings()

Returns the object with the settings used for calls to attachDisk.

attachDiskSettings()

public UnaryCallSettings<AttachDiskInstanceRequest,Operation> attachDiskSettings()

Returns the object with the settings used for calls to attachDisk.

bulkInsertOperationSettings()

public OperationCallSettings<BulkInsertInstanceRequest,Operation,Operation> bulkInsertOperationSettings()

Returns the object with the settings used for calls to bulkInsert.

bulkInsertSettings()

public UnaryCallSettings<BulkInsertInstanceRequest,Operation> bulkInsertSettings()

Returns the object with the settings used for calls to bulkInsert.

deleteAccessConfigOperationSettings()

public OperationCallSettings<DeleteAccessConfigInstanceRequest,Operation,Operation> deleteAccessConfigOperationSettings()

Returns the object with the settings used for calls to deleteAccessConfig.

deleteAccessConfigSettings()

public UnaryCallSettings<DeleteAccessConfigInstanceRequest,Operation> deleteAccessConfigSettings()

Returns the object with the settings used for calls to deleteAccessConfig.

deleteOperationSettings()

public OperationCallSettings<DeleteInstanceRequest,Operation,Operation> deleteOperationSettings()

Returns the object with the settings used for calls to delete.

deleteSettings()

public UnaryCallSettings<DeleteInstanceRequest,Operation> deleteSettings()

Returns the object with the settings used for calls to delete.

detachDiskOperationSettings()

public OperationCallSettings<DetachDiskInstanceRequest,Operation,Operation> detachDiskOperationSettings()

Returns the object with the settings used for calls to detachDisk.

detachDiskSettings()

public UnaryCallSettings<DetachDiskInstanceRequest,Operation> detachDiskSettings()

Returns the object with the settings used for calls to detachDisk.

getEffectiveFirewallsSettings()

public UnaryCallSettings<GetEffectiveFirewallsInstanceRequest,InstancesGetEffectiveFirewallsResponse> getEffectiveFirewallsSettings()

Returns the object with the settings used for calls to getEffectiveFirewalls.

getGuestAttributesSettings()

public UnaryCallSettings<GetGuestAttributesInstanceRequest,GuestAttributes> getGuestAttributesSettings()

Returns the object with the settings used for calls to getGuestAttributes.

getIamPolicySettings()

public UnaryCallSettings<GetIamPolicyInstanceRequest,Policy> getIamPolicySettings()

Returns the object with the settings used for calls to getIamPolicy.

getScreenshotSettings()

public UnaryCallSettings<GetScreenshotInstanceRequest,Screenshot> getScreenshotSettings()

Returns the object with the settings used for calls to getScreenshot.

getSerialPortOutputSettings()

public UnaryCallSettings<GetSerialPortOutputInstanceRequest,SerialPortOutput> getSerialPortOutputSettings()

Returns the object with the settings used for calls to getSerialPortOutput.

getSettings()

public UnaryCallSettings<GetInstanceRequest,Instance> getSettings()

Returns the object with the settings used for calls to get.

Returns
Type Description
UnaryCallSettings<GetInstanceRequest,Instance>

getShieldedInstanceIdentitySettings()

public UnaryCallSettings<GetShieldedInstanceIdentityInstanceRequest,ShieldedInstanceIdentity> getShieldedInstanceIdentitySettings()

Returns the object with the settings used for calls to getShieldedInstanceIdentity.

insertOperationSettings()

public OperationCallSettings<InsertInstanceRequest,Operation,Operation> insertOperationSettings()

Returns the object with the settings used for calls to insert.

insertSettings()

public UnaryCallSettings<InsertInstanceRequest,Operation> insertSettings()

Returns the object with the settings used for calls to insert.

listReferrersSettings()

public PagedCallSettings<ListReferrersInstancesRequest,InstanceListReferrers,InstancesClient.ListReferrersPagedResponse> listReferrersSettings()

Returns the object with the settings used for calls to listReferrers.

listSettings()

public PagedCallSettings<ListInstancesRequest,InstanceList,InstancesClient.ListPagedResponse> listSettings()

Returns the object with the settings used for calls to list.

performMaintenanceOperationSettings()

public OperationCallSettings<PerformMaintenanceInstanceRequest,Operation,Operation> performMaintenanceOperationSettings()

Returns the object with the settings used for calls to performMaintenance.

performMaintenanceSettings()

public UnaryCallSettings<PerformMaintenanceInstanceRequest,Operation> performMaintenanceSettings()

Returns the object with the settings used for calls to performMaintenance.

removeResourcePoliciesOperationSettings()

public OperationCallSettings<RemoveResourcePoliciesInstanceRequest,Operation,Operation> removeResourcePoliciesOperationSettings()

Returns the object with the settings used for calls to removeResourcePolicies.

removeResourcePoliciesSettings()

public UnaryCallSettings<RemoveResourcePoliciesInstanceRequest,Operation> removeResourcePoliciesSettings()

Returns the object with the settings used for calls to removeResourcePolicies.

resetOperationSettings()

public OperationCallSettings<ResetInstanceRequest,Operation,Operation> resetOperationSettings()

Returns the object with the settings used for calls to reset.

resetSettings()

public UnaryCallSettings<ResetInstanceRequest,Operation> resetSettings()

Returns the object with the settings used for calls to reset.

resumeOperationSettings()

public OperationCallSettings<ResumeInstanceRequest,Operation,Operation> resumeOperationSettings()

Returns the object with the settings used for calls to resume.

resumeSettings()

public UnaryCallSettings<ResumeInstanceRequest,Operation> resumeSettings()

Returns the object with the settings used for calls to resume.

sendDiagnosticInterruptSettings()

public UnaryCallSettings<SendDiagnosticInterruptInstanceRequest,SendDiagnosticInterruptInstanceResponse> sendDiagnosticInterruptSettings()

Returns the object with the settings used for calls to sendDiagnosticInterrupt.

setDeletionProtectionOperationSettings()

public OperationCallSettings<SetDeletionProtectionInstanceRequest,Operation,Operation> setDeletionProtectionOperationSettings()

Returns the object with the settings used for calls to setDeletionProtection.

setDeletionProtectionSettings()

public UnaryCallSettings<SetDeletionProtectionInstanceRequest,Operation> setDeletionProtectionSettings()

Returns the object with the settings used for calls to setDeletionProtection.

setDiskAutoDeleteOperationSettings()

public OperationCallSettings<SetDiskAutoDeleteInstanceRequest,Operation,Operation> setDiskAutoDeleteOperationSettings()

Returns the object with the settings used for calls to setDiskAutoDelete.

setDiskAutoDeleteSettings()

public UnaryCallSettings<SetDiskAutoDeleteInstanceRequest,Operation> setDiskAutoDeleteSettings()

Returns the object with the settings used for calls to setDiskAutoDelete.

setIamPolicySettings()

public UnaryCallSettings<SetIamPolicyInstanceRequest,Policy> setIamPolicySettings()

Returns the object with the settings used for calls to setIamPolicy.

setLabelsOperationSettings()

public OperationCallSettings<SetLabelsInstanceRequest,Operation,Operation> setLabelsOperationSettings()

Returns the object with the settings used for calls to setLabels.

setLabelsSettings()

public UnaryCallSettings<SetLabelsInstanceRequest,Operation> setLabelsSettings()

Returns the object with the settings used for calls to setLabels.

setMachineResourcesOperationSettings()

public OperationCallSettings<SetMachineResourcesInstanceRequest,Operation,Operation> setMachineResourcesOperationSettings()

Returns the object with the settings used for calls to setMachineResources.

setMachineResourcesSettings()

public UnaryCallSettings<SetMachineResourcesInstanceRequest,Operation> setMachineResourcesSettings()

Returns the object with the settings used for calls to setMachineResources.

setMachineTypeOperationSettings()

public OperationCallSettings<SetMachineTypeInstanceRequest,Operation,Operation> setMachineTypeOperationSettings()

Returns the object with the settings used for calls to setMachineType.

setMachineTypeSettings()

public UnaryCallSettings<SetMachineTypeInstanceRequest,Operation> setMachineTypeSettings()

Returns the object with the settings used for calls to setMachineType.

setMetadataOperationSettings()

public OperationCallSettings<SetMetadataInstanceRequest,Operation,Operation> setMetadataOperationSettings()

Returns the object with the settings used for calls to setMetadata.

setMetadataSettings()

public UnaryCallSettings<SetMetadataInstanceRequest,Operation> setMetadataSettings()

Returns the object with the settings used for calls to setMetadata.

setMinCpuPlatformOperationSettings()

public OperationCallSettings<SetMinCpuPlatformInstanceRequest,Operation,Operation> setMinCpuPlatformOperationSettings()

Returns the object with the settings used for calls to setMinCpuPlatform.

setMinCpuPlatformSettings()

public UnaryCallSettings<SetMinCpuPlatformInstanceRequest,Operation> setMinCpuPlatformSettings()

Returns the object with the settings used for calls to setMinCpuPlatform.

setNameOperationSettings()

public OperationCallSettings<SetNameInstanceRequest,Operation,Operation> setNameOperationSettings()

Returns the object with the settings used for calls to setName.

setNameSettings()

public UnaryCallSettings<SetNameInstanceRequest,Operation> setNameSettings()

Returns the object with the settings used for calls to setName.

setSchedulingOperationSettings()

public OperationCallSettings<SetSchedulingInstanceRequest,Operation,Operation> setSchedulingOperationSettings()

Returns the object with the settings used for calls to setScheduling.

setSchedulingSettings()

public UnaryCallSettings<SetSchedulingInstanceRequest,Operation> setSchedulingSettings()

Returns the object with the settings used for calls to setScheduling.

setSecurityPolicyOperationSettings()

public OperationCallSettings<SetSecurityPolicyInstanceRequest,Operation,Operation> setSecurityPolicyOperationSettings()

Returns the object with the settings used for calls to setSecurityPolicy.

setSecurityPolicySettings()

public UnaryCallSettings<SetSecurityPolicyInstanceRequest,Operation> setSecurityPolicySettings()

Returns the object with the settings used for calls to setSecurityPolicy.

setServiceAccountOperationSettings()

public OperationCallSettings<SetServiceAccountInstanceRequest,Operation,Operation> setServiceAccountOperationSettings()

Returns the object with the settings used for calls to setServiceAccount.

setServiceAccountSettings()

public UnaryCallSettings<SetServiceAccountInstanceRequest,Operation> setServiceAccountSettings()

Returns the object with the settings used for calls to setServiceAccount.

setShieldedInstanceIntegrityPolicyOperationSettings()

public OperationCallSettings<SetShieldedInstanceIntegrityPolicyInstanceRequest,Operation,Operation> setShieldedInstanceIntegrityPolicyOperationSettings()

Returns the object with the settings used for calls to setShieldedInstanceIntegrityPolicy.

setShieldedInstanceIntegrityPolicySettings()

public UnaryCallSettings<SetShieldedInstanceIntegrityPolicyInstanceRequest,Operation> setShieldedInstanceIntegrityPolicySettings()

Returns the object with the settings used for calls to setShieldedInstanceIntegrityPolicy.

setTagsOperationSettings()

public OperationCallSettings<SetTagsInstanceRequest,Operation,Operation> setTagsOperationSettings()

Returns the object with the settings used for calls to setTags.

setTagsSettings()

public UnaryCallSettings<SetTagsInstanceRequest,Operation> setTagsSettings()

Returns the object with the settings used for calls to setTags.

simulateMaintenanceEventOperationSettings()

public OperationCallSettings<SimulateMaintenanceEventInstanceRequest,Operation,Operation> simulateMaintenanceEventOperationSettings()

Returns the object with the settings used for calls to simulateMaintenanceEvent.

simulateMaintenanceEventSettings()

public UnaryCallSettings<SimulateMaintenanceEventInstanceRequest,Operation> simulateMaintenanceEventSettings()

Returns the object with the settings used for calls to simulateMaintenanceEvent.

startOperationSettings()

public OperationCallSettings<StartInstanceRequest,Operation,Operation> startOperationSettings()

Returns the object with the settings used for calls to start.

startSettings()

public UnaryCallSettings<StartInstanceRequest,Operation> startSettings()

Returns the object with the settings used for calls to start.

startWithEncryptionKeyOperationSettings()

public OperationCallSettings<StartWithEncryptionKeyInstanceRequest,Operation,Operation> startWithEncryptionKeyOperationSettings()

Returns the object with the settings used for calls to startWithEncryptionKey.

startWithEncryptionKeySettings()

public UnaryCallSettings<StartWithEncryptionKeyInstanceRequest,Operation> startWithEncryptionKeySettings()

Returns the object with the settings used for calls to startWithEncryptionKey.

stopOperationSettings()

public OperationCallSettings<StopInstanceRequest,Operation,Operation> stopOperationSettings()

Returns the object with the settings used for calls to stop.

stopSettings()

public UnaryCallSettings<StopInstanceRequest,Operation> stopSettings()

Returns the object with the settings used for calls to stop.

Returns
Type Description
UnaryCallSettings<StopInstanceRequest,Operation>

suspendOperationSettings()

public OperationCallSettings<SuspendInstanceRequest,Operation,Operation> suspendOperationSettings()

Returns the object with the settings used for calls to suspend.

suspendSettings()

public UnaryCallSettings<SuspendInstanceRequest,Operation> suspendSettings()

Returns the object with the settings used for calls to suspend.

testIamPermissionsSettings()

public UnaryCallSettings<TestIamPermissionsInstanceRequest,TestPermissionsResponse> testIamPermissionsSettings()

Returns the object with the settings used for calls to testIamPermissions.

toBuilder()

public InstancesSettings.Builder toBuilder()

Returns a builder containing all the values of this settings class.

Returns
Type Description
InstancesSettings.Builder
Overrides

updateAccessConfigOperationSettings()

public OperationCallSettings<UpdateAccessConfigInstanceRequest,Operation,Operation> updateAccessConfigOperationSettings()

Returns the object with the settings used for calls to updateAccessConfig.

updateAccessConfigSettings()

public UnaryCallSettings<UpdateAccessConfigInstanceRequest,Operation> updateAccessConfigSettings()

Returns the object with the settings used for calls to updateAccessConfig.

updateDisplayDeviceOperationSettings()

public OperationCallSettings<UpdateDisplayDeviceInstanceRequest,Operation,Operation> updateDisplayDeviceOperationSettings()

Returns the object with the settings used for calls to updateDisplayDevice.

updateDisplayDeviceSettings()

public UnaryCallSettings<UpdateDisplayDeviceInstanceRequest,Operation> updateDisplayDeviceSettings()

Returns the object with the settings used for calls to updateDisplayDevice.

updateNetworkInterfaceOperationSettings()

public OperationCallSettings<UpdateNetworkInterfaceInstanceRequest,Operation,Operation> updateNetworkInterfaceOperationSettings()

Returns the object with the settings used for calls to updateNetworkInterface.

updateNetworkInterfaceSettings()

public UnaryCallSettings<UpdateNetworkInterfaceInstanceRequest,Operation> updateNetworkInterfaceSettings()

Returns the object with the settings used for calls to updateNetworkInterface.

updateOperationSettings()

public OperationCallSettings<UpdateInstanceRequest,Operation,Operation> updateOperationSettings()

Returns the object with the settings used for calls to update.

updateSettings()

public UnaryCallSettings<UpdateInstanceRequest,Operation> updateSettings()

Returns the object with the settings used for calls to update.

updateShieldedInstanceConfigOperationSettings()

public OperationCallSettings<UpdateShieldedInstanceConfigInstanceRequest,Operation,Operation> updateShieldedInstanceConfigOperationSettings()

Returns the object with the settings used for calls to updateShieldedInstanceConfig.

updateShieldedInstanceConfigSettings()

public UnaryCallSettings<UpdateShieldedInstanceConfigInstanceRequest,Operation> updateShieldedInstanceConfigSettings()

Returns the object with the settings used for calls to updateShieldedInstanceConfig.