Class BackupDRClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (BackupDRClient backupDRClient = BackupDRClient.create()) {
ManagementServerName name =
ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
ManagementServer response = backupDRClient.getManagementServer(name);
}
Note: close() needs to be called on the BackupDRClient 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 |
|---|---|---|
ListManagementServers |
Lists ManagementServers in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetManagementServer |
Gets details of a single ManagementServer. |
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.
|
CreateManagementServer |
Creates a new ManagementServer in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteManagementServer |
Deletes a single ManagementServer. |
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.
|
CreateBackupVault |
Creates a new BackupVault in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListBackupVaults |
Lists BackupVaults in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchUsableBackupVaults |
FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission. |
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.
|
GetBackupVault |
Gets details of a BackupVault. |
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.
|
UpdateBackupVault |
Updates the settings of a BackupVault. |
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.
|
DeleteBackupVault |
Deletes a BackupVault. |
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.
|
ListDataSources |
Lists DataSources in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDataSource |
Gets details of a DataSource. |
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.
|
UpdateDataSource |
Updates the settings of a DataSource. |
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.
|
ListBackups |
Lists Backups in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchBackupsForResourceType |
Fetch Backups for a given resource type. |
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.
|
GetBackup |
Gets details of a Backup. |
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.
|
UpdateBackup |
Updates the settings of a Backup. |
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.
|
DeleteBackup |
Deletes a Backup. |
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.
|
RestoreBackup |
Restore from a Backup |
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.
|
CreateBackupPlan |
Create a BackupPlan |
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.
|
UpdateBackupPlan |
Update a BackupPlan. |
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.
|
GetBackupPlan |
Gets details of a single BackupPlan. |
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.
|
ListBackupPlans |
Lists BackupPlans in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteBackupPlan |
Deletes a single BackupPlan. |
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.
|
GetBackupPlanRevision |
Gets details of a single BackupPlanRevision. |
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.
|
ListBackupPlanRevisions |
Lists BackupPlanRevisions in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateBackupPlanAssociation |
Create a BackupPlanAssociation |
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.
|
UpdateBackupPlanAssociation |
Update a BackupPlanAssociation. |
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.
|
GetBackupPlanAssociation |
Gets details of a single BackupPlanAssociation. |
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.
|
ListBackupPlanAssociations |
Lists BackupPlanAssociations in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchBackupPlanAssociationsForResourceType |
List BackupPlanAssociations for a given resource type. |
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.
|
DeleteBackupPlanAssociation |
Deletes a single BackupPlanAssociation. |
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.
|
TriggerBackup |
Triggers a new Backup. |
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.
|
GetDataSourceReference |
Gets details of a single DataSourceReference. |
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.
|
ListDataSourceReferences |
Lists DataSourceReferences for a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchDataSourceReferencesForResourceType |
Fetch DataSourceReferences for a given project, location and resource type. |
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.
|
InitializeService |
Initializes the service related config for a project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of BackupDRSettings 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
BackupDRSettings backupDRSettings =
BackupDRSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
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
BackupDRSettings backupDRSettings =
BackupDRSettings.newBuilder().setEndpoint(myEndpoint).build();
BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
BackupDRSettings backupDRSettings = BackupDRSettings.newHttpJsonBuilder().build();
BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBackupDRClient(BackupDRSettings settings) Constructs an instance of BackupDRClient, using the given settings.protectedBackupDRClient(BackupDRStub stub) -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final BackupDRClientcreate()Constructs an instance of BackupDRClient with default settings.static final BackupDRClientcreate(BackupDRSettings settings) Constructs an instance of BackupDRClient, using the given settings.static final BackupDRClientcreate(BackupDRStub stub) Constructs an instance of BackupDRClient, using the given stub for making calls.Create a BackupPlanAssociationcreateBackupPlanAssociationAsync(LocationName parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId) Create a BackupPlanAssociationcreateBackupPlanAssociationAsync(String parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId) Create a BackupPlanAssociationCreate a BackupPlanAssociationCreate a BackupPlanAssociationCreate a BackupPlancreateBackupPlanAsync(LocationName parent, BackupPlan backupPlan, String backupPlanId) Create a BackupPlancreateBackupPlanAsync(String parent, BackupPlan backupPlan, String backupPlanId) Create a BackupPlanCreate a BackupPlanCreate a BackupPlanCreates a new BackupVault in a given project and location.createBackupVaultAsync(LocationName parent, BackupVault backupVault, String backupVaultId) Creates a new BackupVault in a given project and location.createBackupVaultAsync(String parent, BackupVault backupVault, String backupVaultId) Creates a new BackupVault in a given project and location.Creates a new BackupVault in a given project and location.Creates a new BackupVault in a given project and location.Creates a new ManagementServer in a given project and location.createManagementServerAsync(LocationName parent, ManagementServer managementServer, String managementServerId) Creates a new ManagementServer in a given project and location.createManagementServerAsync(String parent, ManagementServer managementServer, String managementServerId) Creates a new ManagementServer in a given project and location.Creates a new ManagementServer in a given project and location.Creates a new ManagementServer in a given project and location.deleteBackupAsync(BackupName name) Deletes a Backup.deleteBackupAsync(DeleteBackupRequest request) Deletes a Backup.deleteBackupAsync(String name) Deletes a Backup.Deletes a Backup.Deletes a Backup.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackupPlanAssociation.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackupPlanAssociation.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackupPlanAssociation.Deletes a single BackupPlanAssociation.final OperationCallable<DeleteBackupPlanAssociationRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single BackupPlanAssociation.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackupPlan.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackupPlan.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(String name) Deletes a single BackupPlan.Deletes a single BackupPlan.final OperationCallable<DeleteBackupPlanRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single BackupPlan.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a BackupVault.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a BackupVault.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(String name) Deletes a BackupVault.Deletes a BackupVault.final OperationCallable<DeleteBackupVaultRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a BackupVault.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ManagementServer.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ManagementServer.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ManagementServer.Deletes a single ManagementServer.final OperationCallable<DeleteManagementServerRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ManagementServer.fetchBackupPlanAssociationsForResourceType(FetchBackupPlanAssociationsForResourceTypeRequest request) List BackupPlanAssociations for a given resource type.fetchBackupPlanAssociationsForResourceType(LocationName parent, String resourceType) List BackupPlanAssociations for a given resource type.fetchBackupPlanAssociationsForResourceType(String parent, String resourceType) List BackupPlanAssociations for a given resource type.final UnaryCallable<FetchBackupPlanAssociationsForResourceTypeRequest,FetchBackupPlanAssociationsForResourceTypeResponse> List BackupPlanAssociations for a given resource type.final UnaryCallable<FetchBackupPlanAssociationsForResourceTypeRequest,BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse> List BackupPlanAssociations for a given resource type.fetchBackupsForResourceType(DataSourceName parent, String resourceType) Fetch Backups for a given resource type.Fetch Backups for a given resource type.fetchBackupsForResourceType(String parent, String resourceType) Fetch Backups for a given resource type.Fetch Backups for a given resource type.final UnaryCallable<FetchBackupsForResourceTypeRequest,BackupDRClient.FetchBackupsForResourceTypePagedResponse> Fetch Backups for a given resource type.Fetch DataSourceReferences for a given project, location and resource type.fetchDataSourceReferencesForResourceType(LocationName parent, String resourceType) Fetch DataSourceReferences for a given project, location and resource type.fetchDataSourceReferencesForResourceType(String parent, String resourceType) Fetch DataSourceReferences for a given project, location and resource type.final UnaryCallable<FetchDataSourceReferencesForResourceTypeRequest,FetchDataSourceReferencesForResourceTypeResponse> Fetch DataSourceReferences for a given project, location and resource type.final UnaryCallable<FetchDataSourceReferencesForResourceTypeRequest,BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse> Fetch DataSourceReferences for a given project, location and resource type.FetchUsableBackupVaults lists usable BackupVaults in a given project and location.fetchUsableBackupVaults(LocationName parent) FetchUsableBackupVaults lists usable BackupVaults in a given project and location.fetchUsableBackupVaults(String parent) FetchUsableBackupVaults lists usable BackupVaults in a given project and location.FetchUsableBackupVaults lists usable BackupVaults in a given project and location.final UnaryCallable<FetchUsableBackupVaultsRequest,BackupDRClient.FetchUsableBackupVaultsPagedResponse> FetchUsableBackupVaults lists usable BackupVaults in a given project and location.final BackupgetBackup(BackupName name) Gets details of a Backup.final BackupgetBackup(GetBackupRequest request) Gets details of a Backup.final BackupGets details of a Backup.final UnaryCallable<GetBackupRequest,Backup> Gets details of a Backup.final BackupPlangetBackupPlan(BackupPlanName name) Gets details of a single BackupPlan.final BackupPlangetBackupPlan(GetBackupPlanRequest request) Gets details of a single BackupPlan.final BackupPlangetBackupPlan(String name) Gets details of a single BackupPlan.final BackupPlanAssociationGets details of a single BackupPlanAssociation.final BackupPlanAssociationGets details of a single BackupPlanAssociation.final BackupPlanAssociationGets details of a single BackupPlanAssociation.Gets details of a single BackupPlanAssociation.Gets details of a single BackupPlan.final BackupPlanRevisionGets details of a single BackupPlanRevision.final BackupPlanRevisionGets details of a single BackupPlanRevision.final BackupPlanRevisiongetBackupPlanRevision(String name) Gets details of a single BackupPlanRevision.Gets details of a single BackupPlanRevision.final BackupVaultGets details of a BackupVault.final BackupVaultgetBackupVault(GetBackupVaultRequest request) Gets details of a BackupVault.final BackupVaultgetBackupVault(String name) Gets details of a BackupVault.Gets details of a BackupVault.final DataSourcegetDataSource(DataSourceName name) Gets details of a DataSource.final DataSourcegetDataSource(GetDataSourceRequest request) Gets details of a DataSource.final DataSourcegetDataSource(String name) Gets details of a DataSource.Gets details of a DataSource.final DataSourceReferenceGets details of a single DataSourceReference.final DataSourceReferenceGets details of a single DataSourceReference.final DataSourceReferencegetDataSourceReference(String name) Gets details of a single DataSourceReference.Gets details of a single DataSourceReference.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final ManagementServerGets details of a single ManagementServer.final ManagementServerGets details of a single ManagementServer.final ManagementServergetManagementServer(String name) Gets details of a single ManagementServer.Gets details of a single ManagementServer.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final BackupDRSettingsgetStub()Initializes the service related config for a project.Initializes the service related config for a project.Initializes the service related config for a project.booleanbooleanLists BackupPlanAssociations in a given project and location.Lists BackupPlanAssociations in a given project and location.listBackupPlanAssociations(String parent) Lists BackupPlanAssociations in a given project and location.Lists BackupPlanAssociations in a given project and location.final UnaryCallable<ListBackupPlanAssociationsRequest,BackupDRClient.ListBackupPlanAssociationsPagedResponse> Lists BackupPlanAssociations in a given project and location.Lists BackupPlanRevisions in a given project and location.Lists BackupPlanRevisions in a given project and location.listBackupPlanRevisions(String parent) Lists BackupPlanRevisions in a given project and location.Lists BackupPlanRevisions in a given project and location.final UnaryCallable<ListBackupPlanRevisionsRequest,BackupDRClient.ListBackupPlanRevisionsPagedResponse> Lists BackupPlanRevisions in a given project and location.listBackupPlans(ListBackupPlansRequest request) Lists BackupPlans in a given project and location.listBackupPlans(LocationName parent) Lists BackupPlans in a given project and location.listBackupPlans(String parent) Lists BackupPlans in a given project and location.Lists BackupPlans in a given project and location.Lists BackupPlans in a given project and location.listBackups(DataSourceName parent) Lists Backups in a given project and location.listBackups(ListBackupsRequest request) Lists Backups in a given project and location.listBackups(String parent) Lists Backups in a given project and location.Lists Backups in a given project and location.Lists Backups in a given project and location.listBackupVaults(ListBackupVaultsRequest request) Lists BackupVaults in a given project and location.listBackupVaults(LocationName parent) Lists BackupVaults in a given project and location.listBackupVaults(String parent) Lists BackupVaults in a given project and location.Lists BackupVaults in a given project and location.Lists BackupVaults in a given project and location.Lists DataSourceReferences for a given project and location.listDataSourceReferences(LocationName parent) Lists DataSourceReferences for a given project and location.listDataSourceReferences(String parent) Lists DataSourceReferences for a given project and location.Lists DataSourceReferences for a given project and location.final UnaryCallable<ListDataSourceReferencesRequest,BackupDRClient.ListDataSourceReferencesPagedResponse> Lists DataSourceReferences for a given project and location.listDataSources(BackupVaultName parent) Lists DataSources in a given project and location.listDataSources(ListDataSourcesRequest request) Lists DataSources in a given project and location.listDataSources(String parent) Lists DataSources in a given project and location.Lists DataSources in a given project and location.Lists DataSources in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists ManagementServers in a given project and location.listManagementServers(LocationName parent) Lists ManagementServers in a given project and location.listManagementServers(String parent) Lists ManagementServers in a given project and location.Lists ManagementServers in a given project and location.Lists ManagementServers in a given project and location.restoreBackupAsync(BackupName name) Restore from a BackuprestoreBackupAsync(RestoreBackupRequest request) Restore from a BackuprestoreBackupAsync(String name) Restore from a BackupRestore from a BackupRestore from a Backupfinal PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.triggerBackupAsync(BackupPlanAssociationName name, String ruleId) Triggers a new Backup.triggerBackupAsync(TriggerBackupRequest request) Triggers a new Backup.triggerBackupAsync(String name, String ruleId) Triggers a new Backup.Triggers a new Backup.Triggers a new Backup.updateBackupAsync(Backup backup, com.google.protobuf.FieldMask updateMask) Updates the settings of a Backup.updateBackupAsync(UpdateBackupRequest request) Updates the settings of a Backup.Updates the settings of a Backup.Updates the settings of a Backup.updateBackupPlanAssociationAsync(BackupPlanAssociation backupPlanAssociation, com.google.protobuf.FieldMask updateMask) Update a BackupPlanAssociation.Update a BackupPlanAssociation.Update a BackupPlanAssociation.Update a BackupPlanAssociation.updateBackupPlanAsync(BackupPlan backupPlan, com.google.protobuf.FieldMask updateMask) Update a BackupPlan.Update a BackupPlan.Update a BackupPlan.Update a BackupPlan.updateBackupVaultAsync(BackupVault backupVault, com.google.protobuf.FieldMask updateMask) Updates the settings of a BackupVault.Updates the settings of a BackupVault.Updates the settings of a BackupVault.Updates the settings of a BackupVault.updateDataSourceAsync(DataSource dataSource, com.google.protobuf.FieldMask updateMask) Updates the settings of a DataSource.Updates the settings of a DataSource.Updates the settings of a DataSource.Updates the settings of a DataSource.
-
Constructor Details
-
BackupDRClient
Constructs an instance of BackupDRClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
BackupDRClient
-
-
Method Details
-
create
Constructs an instance of BackupDRClient with default settings.- Throws:
IOException
-
create
Constructs an instance of BackupDRClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of BackupDRClient, using the given stub for making calls. This is for advanced usage - prefer using create(BackupDRSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listManagementServers
public final BackupDRClient.ListManagementServersPagedResponse listManagementServers(LocationName parent) Lists ManagementServers in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ManagementServer element : backupDRClient.listManagementServers(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve management servers information, in the format 'projects/{project_id}/locations/{location}'. In Cloud BackupDR, locations map to Google Cloud regions, for example- *us-central1**. To retrieve management servers for all locations, use "-" for the '{location}' value.
- Throws:
ApiException- if the remote call fails
-
listManagementServers
Lists ManagementServers in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ManagementServer element : backupDRClient.listManagementServers(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve management servers information, in the format 'projects/{project_id}/locations/{location}'. In Cloud BackupDR, locations map to Google Cloud regions, for example- *us-central1**. To retrieve management servers for all locations, use "-" for the '{location}' value.
- Throws:
ApiException- if the remote call fails
-
listManagementServers
public final BackupDRClient.ListManagementServersPagedResponse listManagementServers(ListManagementServersRequest request) Lists ManagementServers in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListManagementServersRequest request = ListManagementServersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ManagementServer element : backupDRClient.listManagementServers(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listManagementServersPagedCallable
public final UnaryCallable<ListManagementServersRequest,BackupDRClient.ListManagementServersPagedResponse> listManagementServersPagedCallable()Lists ManagementServers in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListManagementServersRequest request = ListManagementServersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ManagementServer> future = backupDRClient.listManagementServersPagedCallable().futureCall(request); // Do something. for (ManagementServer element : future.get().iterateAll()) { // doThingsWith(element); } } -
listManagementServersCallable
public final UnaryCallable<ListManagementServersRequest,ListManagementServersResponse> listManagementServersCallable()Lists ManagementServers in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListManagementServersRequest request = ListManagementServersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListManagementServersResponse response = backupDRClient.listManagementServersCallable().call(request); for (ManagementServer element : response.getManagementServersList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getManagementServer
Gets details of a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ManagementServerName name = ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"); ManagementServer response = backupDRClient.getManagementServer(name); }- Parameters:
name- Required. Name of the management server resource name, in the format 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'- Throws:
ApiException- if the remote call fails
-
getManagementServer
Gets details of a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]").toString(); ManagementServer response = backupDRClient.getManagementServer(name); }- Parameters:
name- Required. Name of the management server resource name, in the format 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'- Throws:
ApiException- if the remote call fails
-
getManagementServer
Gets details of a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetManagementServerRequest request = GetManagementServerRequest.newBuilder() .setName( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .build(); ManagementServer response = backupDRClient.getManagementServer(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getManagementServerCallable
public final UnaryCallable<GetManagementServerRequest,ManagementServer> getManagementServerCallable()Gets details of a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetManagementServerRequest request = GetManagementServerRequest.newBuilder() .setName( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .build(); ApiFuture<ManagementServer> future = backupDRClient.getManagementServerCallable().futureCall(request); // Do something. ManagementServer response = future.get(); } -
createManagementServerAsync
public final OperationFuture<ManagementServer,OperationMetadata> createManagementServerAsync(LocationName parent, ManagementServer managementServer, String managementServerId) Creates a new ManagementServer in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ManagementServer managementServer = ManagementServer.newBuilder().build(); String managementServerId = "managementServerId-1229628127"; ManagementServer response = backupDRClient .createManagementServerAsync(parent, managementServer, managementServerId) .get(); }- Parameters:
parent- Required. The management server project and location in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR locations map to Google Cloud regions, for example **us-central1**.managementServer- Required. A [management server resource][google.cloud.backupdr.v1.ManagementServer]managementServerId- Required. The name of the management server to create. The name must be unique for the specified project and location.- Throws:
ApiException- if the remote call fails
-
createManagementServerAsync
public final OperationFuture<ManagementServer,OperationMetadata> createManagementServerAsync(String parent, ManagementServer managementServer, String managementServerId) Creates a new ManagementServer in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ManagementServer managementServer = ManagementServer.newBuilder().build(); String managementServerId = "managementServerId-1229628127"; ManagementServer response = backupDRClient .createManagementServerAsync(parent, managementServer, managementServerId) .get(); }- Parameters:
parent- Required. The management server project and location in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR locations map to Google Cloud regions, for example **us-central1**.managementServer- Required. A [management server resource][google.cloud.backupdr.v1.ManagementServer]managementServerId- Required. The name of the management server to create. The name must be unique for the specified project and location.- Throws:
ApiException- if the remote call fails
-
createManagementServerAsync
public final OperationFuture<ManagementServer,OperationMetadata> createManagementServerAsync(CreateManagementServerRequest request) Creates a new ManagementServer in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateManagementServerRequest request = CreateManagementServerRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setManagementServerId("managementServerId-1229628127") .setManagementServer(ManagementServer.newBuilder().build()) .setRequestId("requestId693933066") .build(); ManagementServer response = backupDRClient.createManagementServerAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createManagementServerOperationCallable
public final OperationCallable<CreateManagementServerRequest,ManagementServer, createManagementServerOperationCallable()OperationMetadata> Creates a new ManagementServer in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateManagementServerRequest request = CreateManagementServerRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setManagementServerId("managementServerId-1229628127") .setManagementServer(ManagementServer.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ManagementServer, OperationMetadata> future = backupDRClient.createManagementServerOperationCallable().futureCall(request); // Do something. ManagementServer response = future.get(); } -
createManagementServerCallable
public final UnaryCallable<CreateManagementServerRequest,Operation> createManagementServerCallable()Creates a new ManagementServer in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateManagementServerRequest request = CreateManagementServerRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setManagementServerId("managementServerId-1229628127") .setManagementServer(ManagementServer.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.createManagementServerCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteManagementServerAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteManagementServerAsync(ManagementServerName name) Deletes a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ManagementServerName name = ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"); backupDRClient.deleteManagementServerAsync(name).get(); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
deleteManagementServerAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteManagementServerAsync(String name) Deletes a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]").toString(); backupDRClient.deleteManagementServerAsync(name).get(); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
deleteManagementServerAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteManagementServerAsync(DeleteManagementServerRequest request) Deletes a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteManagementServerRequest request = DeleteManagementServerRequest.newBuilder() .setName( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setRequestId("requestId693933066") .build(); backupDRClient.deleteManagementServerAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteManagementServerOperationCallable
public final OperationCallable<DeleteManagementServerRequest,com.google.protobuf.Empty, deleteManagementServerOperationCallable()OperationMetadata> Deletes a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteManagementServerRequest request = DeleteManagementServerRequest.newBuilder() .setName( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = backupDRClient.deleteManagementServerOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteManagementServerCallable
public final UnaryCallable<DeleteManagementServerRequest,Operation> deleteManagementServerCallable()Deletes a single ManagementServer.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteManagementServerRequest request = DeleteManagementServerRequest.newBuilder() .setName( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.deleteManagementServerCallable().futureCall(request); // Do something. future.get(); } -
createBackupVaultAsync
public final OperationFuture<BackupVault,OperationMetadata> createBackupVaultAsync(LocationName parent, BackupVault backupVault, String backupVaultId) Creates a new BackupVault in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); BackupVault backupVault = BackupVault.newBuilder().build(); String backupVaultId = "backupVaultId-1897432373"; BackupVault response = backupDRClient.createBackupVaultAsync(parent, backupVault, backupVaultId).get(); }- Parameters:
parent- Required. Value for parent.backupVault- Required. The resource being createdbackupVaultId- Required. ID of the requesting object If auto-generating ID server-side, remove this field and backup_vault_id from the method_signature of Create RPC- Throws:
ApiException- if the remote call fails
-
createBackupVaultAsync
public final OperationFuture<BackupVault,OperationMetadata> createBackupVaultAsync(String parent, BackupVault backupVault, String backupVaultId) Creates a new BackupVault in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); BackupVault backupVault = BackupVault.newBuilder().build(); String backupVaultId = "backupVaultId-1897432373"; BackupVault response = backupDRClient.createBackupVaultAsync(parent, backupVault, backupVaultId).get(); }- Parameters:
parent- Required. Value for parent.backupVault- Required. The resource being createdbackupVaultId- Required. ID of the requesting object If auto-generating ID server-side, remove this field and backup_vault_id from the method_signature of Create RPC- Throws:
ApiException- if the remote call fails
-
createBackupVaultAsync
public final OperationFuture<BackupVault,OperationMetadata> createBackupVaultAsync(CreateBackupVaultRequest request) Creates a new BackupVault in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupVaultRequest request = CreateBackupVaultRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupVaultId("backupVaultId-1897432373") .setBackupVault(BackupVault.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .build(); BackupVault response = backupDRClient.createBackupVaultAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createBackupVaultOperationCallable
public final OperationCallable<CreateBackupVaultRequest,BackupVault, createBackupVaultOperationCallable()OperationMetadata> Creates a new BackupVault in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupVaultRequest request = CreateBackupVaultRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupVaultId("backupVaultId-1897432373") .setBackupVault(BackupVault.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .build(); OperationFuture<BackupVault, OperationMetadata> future = backupDRClient.createBackupVaultOperationCallable().futureCall(request); // Do something. BackupVault response = future.get(); } -
createBackupVaultCallable
Creates a new BackupVault in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupVaultRequest request = CreateBackupVaultRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupVaultId("backupVaultId-1897432373") .setBackupVault(BackupVault.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .build(); ApiFuture<Operation> future = backupDRClient.createBackupVaultCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listBackupVaults
Lists BackupVaults in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (BackupVault element : backupDRClient.listBackupVaults(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backupvault stores information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example- *us-central1**. To retrieve backupvault stores for all locations, use "-" for the '{location}' value.
- Throws:
ApiException- if the remote call fails
-
listBackupVaults
Lists BackupVaults in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (BackupVault element : backupDRClient.listBackupVaults(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backupvault stores information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example- *us-central1**. To retrieve backupvault stores for all locations, use "-" for the '{location}' value.
- Throws:
ApiException- if the remote call fails
-
listBackupVaults
public final BackupDRClient.ListBackupVaultsPagedResponse listBackupVaults(ListBackupVaultsRequest request) Lists BackupVaults in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupVaultsRequest request = ListBackupVaultsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupVaultView.forNumber(0)) .build(); for (BackupVault element : backupDRClient.listBackupVaults(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupVaultsPagedCallable
public final UnaryCallable<ListBackupVaultsRequest,BackupDRClient.ListBackupVaultsPagedResponse> listBackupVaultsPagedCallable()Lists BackupVaults in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupVaultsRequest request = ListBackupVaultsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupVaultView.forNumber(0)) .build(); ApiFuture<BackupVault> future = backupDRClient.listBackupVaultsPagedCallable().futureCall(request); // Do something. for (BackupVault element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupVaultsCallable
public final UnaryCallable<ListBackupVaultsRequest,ListBackupVaultsResponse> listBackupVaultsCallable()Lists BackupVaults in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupVaultsRequest request = ListBackupVaultsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupVaultView.forNumber(0)) .build(); while (true) { ListBackupVaultsResponse response = backupDRClient.listBackupVaultsCallable().call(request); for (BackupVault element : response.getBackupVaultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
fetchUsableBackupVaults
public final BackupDRClient.FetchUsableBackupVaultsPagedResponse fetchUsableBackupVaults(LocationName parent) FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (BackupVault element : backupDRClient.fetchUsableBackupVaults(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backupvault stores information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example- *us-central1**. To retrieve backupvault stores for all locations, use "-" for the '{location}' value.
- Throws:
ApiException- if the remote call fails
-
fetchUsableBackupVaults
public final BackupDRClient.FetchUsableBackupVaultsPagedResponse fetchUsableBackupVaults(String parent) FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (BackupVault element : backupDRClient.fetchUsableBackupVaults(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backupvault stores information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example- *us-central1**. To retrieve backupvault stores for all locations, use "-" for the '{location}' value.
- Throws:
ApiException- if the remote call fails
-
fetchUsableBackupVaults
public final BackupDRClient.FetchUsableBackupVaultsPagedResponse fetchUsableBackupVaults(FetchUsableBackupVaultsRequest request) FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchUsableBackupVaultsRequest request = FetchUsableBackupVaultsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (BackupVault element : backupDRClient.fetchUsableBackupVaults(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchUsableBackupVaultsPagedCallable
public final UnaryCallable<FetchUsableBackupVaultsRequest,BackupDRClient.FetchUsableBackupVaultsPagedResponse> fetchUsableBackupVaultsPagedCallable()FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchUsableBackupVaultsRequest request = FetchUsableBackupVaultsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<BackupVault> future = backupDRClient.fetchUsableBackupVaultsPagedCallable().futureCall(request); // Do something. for (BackupVault element : future.get().iterateAll()) { // doThingsWith(element); } } -
fetchUsableBackupVaultsCallable
public final UnaryCallable<FetchUsableBackupVaultsRequest,FetchUsableBackupVaultsResponse> fetchUsableBackupVaultsCallable()FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchUsableBackupVaultsRequest request = FetchUsableBackupVaultsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { FetchUsableBackupVaultsResponse response = backupDRClient.fetchUsableBackupVaultsCallable().call(request); for (BackupVault element : response.getBackupVaultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getBackupVault
Gets details of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupVaultName name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]"); BackupVault response = backupDRClient.getBackupVault(name); }- Parameters:
name- Required. Name of the backupvault store resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'- Throws:
ApiException- if the remote call fails
-
getBackupVault
Gets details of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString(); BackupVault response = backupDRClient.getBackupVault(name); }- Parameters:
name- Required. Name of the backupvault store resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'- Throws:
ApiException- if the remote call fails
-
getBackupVault
Gets details of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupVaultRequest request = GetBackupVaultRequest.newBuilder() .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setView(BackupVaultView.forNumber(0)) .build(); BackupVault response = backupDRClient.getBackupVault(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupVaultCallable
Gets details of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupVaultRequest request = GetBackupVaultRequest.newBuilder() .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setView(BackupVaultView.forNumber(0)) .build(); ApiFuture<BackupVault> future = backupDRClient.getBackupVaultCallable().futureCall(request); // Do something. BackupVault response = future.get(); } -
updateBackupVaultAsync
public final OperationFuture<BackupVault,OperationMetadata> updateBackupVaultAsync(BackupVault backupVault, com.google.protobuf.FieldMask updateMask) Updates the settings of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupVault backupVault = BackupVault.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); BackupVault response = backupDRClient.updateBackupVaultAsync(backupVault, updateMask).get(); }- Parameters:
backupVault- Required. The resource being updatedupdateMask- Required. Field mask is used to specify the fields to be overwritten in the BackupVault resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail.- Throws:
ApiException- if the remote call fails
-
updateBackupVaultAsync
public final OperationFuture<BackupVault,OperationMetadata> updateBackupVaultAsync(UpdateBackupVaultRequest request) Updates the settings of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupVaultRequest request = UpdateBackupVaultRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackupVault(BackupVault.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setForce(true) .setForceUpdateAccessRestriction(true) .build(); BackupVault response = backupDRClient.updateBackupVaultAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateBackupVaultOperationCallable
public final OperationCallable<UpdateBackupVaultRequest,BackupVault, updateBackupVaultOperationCallable()OperationMetadata> Updates the settings of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupVaultRequest request = UpdateBackupVaultRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackupVault(BackupVault.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setForce(true) .setForceUpdateAccessRestriction(true) .build(); OperationFuture<BackupVault, OperationMetadata> future = backupDRClient.updateBackupVaultOperationCallable().futureCall(request); // Do something. BackupVault response = future.get(); } -
updateBackupVaultCallable
Updates the settings of a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupVaultRequest request = UpdateBackupVaultRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackupVault(BackupVault.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setForce(true) .setForceUpdateAccessRestriction(true) .build(); ApiFuture<Operation> future = backupDRClient.updateBackupVaultCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteBackupVaultAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(BackupVaultName name) Deletes a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupVaultName name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]"); backupDRClient.deleteBackupVaultAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteBackupVaultAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(String name) Deletes a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString(); backupDRClient.deleteBackupVaultAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteBackupVaultAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(DeleteBackupVaultRequest request) Deletes a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupVaultRequest request = DeleteBackupVaultRequest.newBuilder() .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setRequestId("requestId693933066") .setForce(true) .setEtag("etag3123477") .setValidateOnly(true) .setAllowMissing(true) .setIgnoreBackupPlanReferences(true) .build(); backupDRClient.deleteBackupVaultAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteBackupVaultOperationCallable
public final OperationCallable<DeleteBackupVaultRequest,com.google.protobuf.Empty, deleteBackupVaultOperationCallable()OperationMetadata> Deletes a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupVaultRequest request = DeleteBackupVaultRequest.newBuilder() .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setRequestId("requestId693933066") .setForce(true) .setEtag("etag3123477") .setValidateOnly(true) .setAllowMissing(true) .setIgnoreBackupPlanReferences(true) .build(); OperationFuture<Empty, OperationMetadata> future = backupDRClient.deleteBackupVaultOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteBackupVaultCallable
Deletes a BackupVault.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupVaultRequest request = DeleteBackupVaultRequest.newBuilder() .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setRequestId("requestId693933066") .setForce(true) .setEtag("etag3123477") .setValidateOnly(true) .setAllowMissing(true) .setIgnoreBackupPlanReferences(true) .build(); ApiFuture<Operation> future = backupDRClient.deleteBackupVaultCallable().futureCall(request); // Do something. future.get(); } -
listDataSources
Lists DataSources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupVaultName parent = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]"); for (DataSource element : backupDRClient.listDataSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve data sources information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example **us-central1**. To retrieve data sources for all locations, use "-" for the '{location}' value.- Throws:
ApiException- if the remote call fails
-
listDataSources
Lists DataSources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString(); for (DataSource element : backupDRClient.listDataSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve data sources information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example **us-central1**. To retrieve data sources for all locations, use "-" for the '{location}' value.- Throws:
ApiException- if the remote call fails
-
listDataSources
public final BackupDRClient.ListDataSourcesPagedResponse listDataSources(ListDataSourcesRequest request) Lists DataSources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder() .setParent(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (DataSource element : backupDRClient.listDataSources(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDataSourcesPagedCallable
public final UnaryCallable<ListDataSourcesRequest,BackupDRClient.ListDataSourcesPagedResponse> listDataSourcesPagedCallable()Lists DataSources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder() .setParent(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DataSource> future = backupDRClient.listDataSourcesPagedCallable().futureCall(request); // Do something. for (DataSource element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDataSourcesCallable
public final UnaryCallable<ListDataSourcesRequest,ListDataSourcesResponse> listDataSourcesCallable()Lists DataSources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder() .setParent(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListDataSourcesResponse response = backupDRClient.listDataSourcesCallable().call(request); for (DataSource element : response.getDataSourcesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDataSource
Gets details of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DataSourceName name = DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]"); DataSource response = backupDRClient.getDataSource(name); }- Parameters:
name- Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'- Throws:
ApiException- if the remote call fails
-
getDataSource
Gets details of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]").toString(); DataSource response = backupDRClient.getDataSource(name); }- Parameters:
name- Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'- Throws:
ApiException- if the remote call fails
-
getDataSource
Gets details of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetDataSourceRequest request = GetDataSourceRequest.newBuilder() .setName( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .build(); DataSource response = backupDRClient.getDataSource(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDataSourceCallable
Gets details of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetDataSourceRequest request = GetDataSourceRequest.newBuilder() .setName( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .build(); ApiFuture<DataSource> future = backupDRClient.getDataSourceCallable().futureCall(request); // Do something. DataSource response = future.get(); } -
updateDataSourceAsync
public final OperationFuture<DataSource,OperationMetadata> updateDataSourceAsync(DataSource dataSource, com.google.protobuf.FieldMask updateMask) Updates the settings of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DataSource dataSource = DataSource.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DataSource response = backupDRClient.updateDataSourceAsync(dataSource, updateMask).get(); }- Parameters:
dataSource- Required. The resource being updatedupdateMask- Required. Field mask is used to specify the fields to be overwritten in the DataSource resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail.- Throws:
ApiException- if the remote call fails
-
updateDataSourceAsync
public final OperationFuture<DataSource,OperationMetadata> updateDataSourceAsync(UpdateDataSourceRequest request) Updates the settings of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateDataSourceRequest request = UpdateDataSourceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataSource(DataSource.newBuilder().build()) .setRequestId("requestId693933066") .setAllowMissing(true) .build(); DataSource response = backupDRClient.updateDataSourceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDataSourceOperationCallable
public final OperationCallable<UpdateDataSourceRequest,DataSource, updateDataSourceOperationCallable()OperationMetadata> Updates the settings of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateDataSourceRequest request = UpdateDataSourceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataSource(DataSource.newBuilder().build()) .setRequestId("requestId693933066") .setAllowMissing(true) .build(); OperationFuture<DataSource, OperationMetadata> future = backupDRClient.updateDataSourceOperationCallable().futureCall(request); // Do something. DataSource response = future.get(); } -
updateDataSourceCallable
Updates the settings of a DataSource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateDataSourceRequest request = UpdateDataSourceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataSource(DataSource.newBuilder().build()) .setRequestId("requestId693933066") .setAllowMissing(true) .build(); ApiFuture<Operation> future = backupDRClient.updateDataSourceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listBackups
Lists Backups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DataSourceName parent = DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]"); for (Backup element : backupDRClient.listBackups(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backup information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example **us-central1**. To retrieve data sources for all locations, use "-" for the '{location}' value.- Throws:
ApiException- if the remote call fails
-
listBackups
Lists Backups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]").toString(); for (Backup element : backupDRClient.listBackups(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backup information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example **us-central1**. To retrieve data sources for all locations, use "-" for the '{location}' value.- Throws:
ApiException- if the remote call fails
-
listBackups
Lists Backups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupsRequest request = ListBackupsRequest.newBuilder() .setParent( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupView.forNumber(0)) .build(); for (Backup element : backupDRClient.listBackups(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupsPagedCallable
public final UnaryCallable<ListBackupsRequest,BackupDRClient.ListBackupsPagedResponse> listBackupsPagedCallable()Lists Backups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupsRequest request = ListBackupsRequest.newBuilder() .setParent( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupView.forNumber(0)) .build(); ApiFuture<Backup> future = backupDRClient.listBackupsPagedCallable().futureCall(request); // Do something. for (Backup element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupsCallable
Lists Backups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupsRequest request = ListBackupsRequest.newBuilder() .setParent( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupView.forNumber(0)) .build(); while (true) { ListBackupsResponse response = backupDRClient.listBackupsCallable().call(request); for (Backup element : response.getBackupsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
fetchBackupsForResourceType
public final BackupDRClient.FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(DataSourceName parent, String resourceType) Fetch Backups for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DataSourceName parent = DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]"); String resourceType = "resourceType-384364440"; for (Backup element : backupDRClient.fetchBackupsForResourceType(parent, resourceType).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Datasources are the parent resource for the backups. Format: projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}resourceType- Required. The type of the GCP resource. Ex: sqladmin.googleapis.com/Instance- Throws:
ApiException- if the remote call fails
-
fetchBackupsForResourceType
public final BackupDRClient.FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(String parent, String resourceType) Fetch Backups for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]").toString(); String resourceType = "resourceType-384364440"; for (Backup element : backupDRClient.fetchBackupsForResourceType(parent, resourceType).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Datasources are the parent resource for the backups. Format: projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}resourceType- Required. The type of the GCP resource. Ex: sqladmin.googleapis.com/Instance- Throws:
ApiException- if the remote call fails
-
fetchBackupsForResourceType
public final BackupDRClient.FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(FetchBackupsForResourceTypeRequest request) Fetch Backups for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchBackupsForResourceTypeRequest request = FetchBackupsForResourceTypeRequest.newBuilder() .setParent( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupView.forNumber(0)) .build(); for (Backup element : backupDRClient.fetchBackupsForResourceType(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchBackupsForResourceTypePagedCallable
public final UnaryCallable<FetchBackupsForResourceTypeRequest,BackupDRClient.FetchBackupsForResourceTypePagedResponse> fetchBackupsForResourceTypePagedCallable()Fetch Backups for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchBackupsForResourceTypeRequest request = FetchBackupsForResourceTypeRequest.newBuilder() .setParent( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupView.forNumber(0)) .build(); ApiFuture<Backup> future = backupDRClient.fetchBackupsForResourceTypePagedCallable().futureCall(request); // Do something. for (Backup element : future.get().iterateAll()) { // doThingsWith(element); } } -
fetchBackupsForResourceTypeCallable
public final UnaryCallable<FetchBackupsForResourceTypeRequest,FetchBackupsForResourceTypeResponse> fetchBackupsForResourceTypeCallable()Fetch Backups for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchBackupsForResourceTypeRequest request = FetchBackupsForResourceTypeRequest.newBuilder() .setParent( DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]") .toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setView(BackupView.forNumber(0)) .build(); while (true) { FetchBackupsForResourceTypeResponse response = backupDRClient.fetchBackupsForResourceTypeCallable().call(request); for (Backup element : response.getBackupsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getBackup
Gets details of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]"); Backup response = backupDRClient.getBackup(name); }- Parameters:
name- Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'- Throws:
ApiException- if the remote call fails
-
getBackup
Gets details of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString(); Backup response = backupDRClient.getBackup(name); }- Parameters:
name- Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'- Throws:
ApiException- if the remote call fails
-
getBackup
Gets details of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupRequest request = GetBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setView(BackupView.forNumber(0)) .build(); Backup response = backupDRClient.getBackup(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupCallable
Gets details of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupRequest request = GetBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setView(BackupView.forNumber(0)) .build(); ApiFuture<Backup> future = backupDRClient.getBackupCallable().futureCall(request); // Do something. Backup response = future.get(); } -
updateBackupAsync
public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(Backup backup, com.google.protobuf.FieldMask updateMask) Updates the settings of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { Backup backup = Backup.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Backup response = backupDRClient.updateBackupAsync(backup, updateMask).get(); }- Parameters:
backup- Required. The resource being updatedupdateMask- Required. Field mask is used to specify the fields to be overwritten in the Backup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail.- Throws:
ApiException- if the remote call fails
-
updateBackupAsync
public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(UpdateBackupRequest request) Updates the settings of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupRequest request = UpdateBackupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackup(Backup.newBuilder().build()) .setRequestId("requestId693933066") .build(); Backup response = backupDRClient.updateBackupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateBackupOperationCallable
public final OperationCallable<UpdateBackupRequest,Backup, updateBackupOperationCallable()OperationMetadata> Updates the settings of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupRequest request = UpdateBackupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackup(Backup.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Backup, OperationMetadata> future = backupDRClient.updateBackupOperationCallable().futureCall(request); // Do something. Backup response = future.get(); } -
updateBackupCallable
Updates the settings of a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupRequest request = UpdateBackupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackup(Backup.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.updateBackupCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteBackupAsync
Deletes a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]"); Backup response = backupDRClient.deleteBackupAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteBackupAsync
Deletes a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString(); Backup response = backupDRClient.deleteBackupAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteBackupAsync
public final OperationFuture<Backup,OperationMetadata> deleteBackupAsync(DeleteBackupRequest request) Deletes a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .build(); Backup response = backupDRClient.deleteBackupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteBackupOperationCallable
public final OperationCallable<DeleteBackupRequest,Backup, deleteBackupOperationCallable()OperationMetadata> Deletes a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Backup, OperationMetadata> future = backupDRClient.deleteBackupOperationCallable().futureCall(request); // Do something. Backup response = future.get(); } -
deleteBackupCallable
Deletes a Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.deleteBackupCallable().futureCall(request); // Do something. Operation response = future.get(); } -
restoreBackupAsync
public final OperationFuture<RestoreBackupResponse,OperationMetadata> restoreBackupAsync(BackupName name) Restore from a BackupSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]"); RestoreBackupResponse response = backupDRClient.restoreBackupAsync(name).get(); }- Parameters:
name- Required. The resource name of the Backup instance, in the format 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.- Throws:
ApiException- if the remote call fails
-
restoreBackupAsync
public final OperationFuture<RestoreBackupResponse,OperationMetadata> restoreBackupAsync(String name) Restore from a BackupSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString(); RestoreBackupResponse response = backupDRClient.restoreBackupAsync(name).get(); }- Parameters:
name- Required. The resource name of the Backup instance, in the format 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.- Throws:
ApiException- if the remote call fails
-
restoreBackupAsync
public final OperationFuture<RestoreBackupResponse,OperationMetadata> restoreBackupAsync(RestoreBackupRequest request) Restore from a BackupSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { RestoreBackupRequest request = RestoreBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .setClearOverridesFieldMask(FieldMask.newBuilder().build()) .build(); RestoreBackupResponse response = backupDRClient.restoreBackupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
restoreBackupOperationCallable
public final OperationCallable<RestoreBackupRequest,RestoreBackupResponse, restoreBackupOperationCallable()OperationMetadata> Restore from a BackupSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { RestoreBackupRequest request = RestoreBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .setClearOverridesFieldMask(FieldMask.newBuilder().build()) .build(); OperationFuture<RestoreBackupResponse, OperationMetadata> future = backupDRClient.restoreBackupOperationCallable().futureCall(request); // Do something. RestoreBackupResponse response = future.get(); } -
restoreBackupCallable
Restore from a BackupSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { RestoreBackupRequest request = RestoreBackupRequest.newBuilder() .setName( BackupName.of( "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]") .toString()) .setRequestId("requestId693933066") .setClearOverridesFieldMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Operation> future = backupDRClient.restoreBackupCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createBackupPlanAsync
public final OperationFuture<BackupPlan,OperationMetadata> createBackupPlanAsync(LocationName parent, BackupPlan backupPlan, String backupPlanId) Create a BackupPlanSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); BackupPlan backupPlan = BackupPlan.newBuilder().build(); String backupPlanId = "backupPlanId-84871546"; BackupPlan response = backupDRClient.createBackupPlanAsync(parent, backupPlan, backupPlanId).get(); }- Parameters:
parent- Required. The `BackupPlan` project and location in the format `projects/{project}/locations/{location}`. In Cloud BackupDR locations map to GCP regions, for example **us-central1**.backupPlan- Required. The `BackupPlan` resource object to create.backupPlanId- Required. The name of the `BackupPlan` to create. The name must be unique for the specified project and location.The name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, /[a-z][a-z0-9-]{,62}/.- Throws:
ApiException- if the remote call fails
-
createBackupPlanAsync
public final OperationFuture<BackupPlan,OperationMetadata> createBackupPlanAsync(String parent, BackupPlan backupPlan, String backupPlanId) Create a BackupPlanSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); BackupPlan backupPlan = BackupPlan.newBuilder().build(); String backupPlanId = "backupPlanId-84871546"; BackupPlan response = backupDRClient.createBackupPlanAsync(parent, backupPlan, backupPlanId).get(); }- Parameters:
parent- Required. The `BackupPlan` project and location in the format `projects/{project}/locations/{location}`. In Cloud BackupDR locations map to GCP regions, for example **us-central1**.backupPlan- Required. The `BackupPlan` resource object to create.backupPlanId- Required. The name of the `BackupPlan` to create. The name must be unique for the specified project and location.The name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, /[a-z][a-z0-9-]{,62}/.- Throws:
ApiException- if the remote call fails
-
createBackupPlanAsync
public final OperationFuture<BackupPlan,OperationMetadata> createBackupPlanAsync(CreateBackupPlanRequest request) Create a BackupPlanSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupPlanRequest request = CreateBackupPlanRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupPlanId("backupPlanId-84871546") .setBackupPlan(BackupPlan.newBuilder().build()) .setRequestId("requestId693933066") .build(); BackupPlan response = backupDRClient.createBackupPlanAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createBackupPlanOperationCallable
public final OperationCallable<CreateBackupPlanRequest,BackupPlan, createBackupPlanOperationCallable()OperationMetadata> Create a BackupPlanSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupPlanRequest request = CreateBackupPlanRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupPlanId("backupPlanId-84871546") .setBackupPlan(BackupPlan.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<BackupPlan, OperationMetadata> future = backupDRClient.createBackupPlanOperationCallable().futureCall(request); // Do something. BackupPlan response = future.get(); } -
createBackupPlanCallable
Create a BackupPlanSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupPlanRequest request = CreateBackupPlanRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupPlanId("backupPlanId-84871546") .setBackupPlan(BackupPlan.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.createBackupPlanCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateBackupPlanAsync
public final OperationFuture<BackupPlan,OperationMetadata> updateBackupPlanAsync(BackupPlan backupPlan, com.google.protobuf.FieldMask updateMask) Update a BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlan backupPlan = BackupPlan.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); BackupPlan response = backupDRClient.updateBackupPlanAsync(backupPlan, updateMask).get(); }- Parameters:
backupPlan- Required. The resource being updatedupdateMask- Required. The list of fields to update. Field mask is used to specify the fields to be overwritten in the BackupPlan resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail. Currently, these fields are supported in update: description, schedules, retention period, adding and removing Backup Rules.- Throws:
ApiException- if the remote call fails
-
updateBackupPlanAsync
public final OperationFuture<BackupPlan,OperationMetadata> updateBackupPlanAsync(UpdateBackupPlanRequest request) Update a BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupPlanRequest request = UpdateBackupPlanRequest.newBuilder() .setBackupPlan(BackupPlan.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); BackupPlan response = backupDRClient.updateBackupPlanAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateBackupPlanOperationCallable
public final OperationCallable<UpdateBackupPlanRequest,BackupPlan, updateBackupPlanOperationCallable()OperationMetadata> Update a BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupPlanRequest request = UpdateBackupPlanRequest.newBuilder() .setBackupPlan(BackupPlan.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<BackupPlan, OperationMetadata> future = backupDRClient.updateBackupPlanOperationCallable().futureCall(request); // Do something. BackupPlan response = future.get(); } -
updateBackupPlanCallable
Update a BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupPlanRequest request = UpdateBackupPlanRequest.newBuilder() .setBackupPlan(BackupPlan.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.updateBackupPlanCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getBackupPlan
Gets details of a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanName name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]"); BackupPlan response = backupDRClient.getBackupPlan(name); }- Parameters:
name- Required. The resource name of the `BackupPlan` to retrieve.Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
- Throws:
ApiException- if the remote call fails
-
getBackupPlan
Gets details of a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString(); BackupPlan response = backupDRClient.getBackupPlan(name); }- Parameters:
name- Required. The resource name of the `BackupPlan` to retrieve.Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
- Throws:
ApiException- if the remote call fails
-
getBackupPlan
Gets details of a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupPlanRequest request = GetBackupPlanRequest.newBuilder() .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .build(); BackupPlan response = backupDRClient.getBackupPlan(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupPlanCallable
Gets details of a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupPlanRequest request = GetBackupPlanRequest.newBuilder() .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .build(); ApiFuture<BackupPlan> future = backupDRClient.getBackupPlanCallable().futureCall(request); // Do something. BackupPlan response = future.get(); } -
listBackupPlans
Lists BackupPlans in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (BackupPlan element : backupDRClient.listBackupPlans(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve `BackupPlans` information. Format: `projects/{project}/locations/{location}`. In Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. To retrieve backup plans for all locations, use "-" for the `{location}` value.- Throws:
ApiException- if the remote call fails
-
listBackupPlans
Lists BackupPlans in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (BackupPlan element : backupDRClient.listBackupPlans(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve `BackupPlans` information. Format: `projects/{project}/locations/{location}`. In Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. To retrieve backup plans for all locations, use "-" for the `{location}` value.- Throws:
ApiException- if the remote call fails
-
listBackupPlans
public final BackupDRClient.ListBackupPlansPagedResponse listBackupPlans(ListBackupPlansRequest request) Lists BackupPlans in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlansRequest request = ListBackupPlansRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (BackupPlan element : backupDRClient.listBackupPlans(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupPlansPagedCallable
public final UnaryCallable<ListBackupPlansRequest,BackupDRClient.ListBackupPlansPagedResponse> listBackupPlansPagedCallable()Lists BackupPlans in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlansRequest request = ListBackupPlansRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<BackupPlan> future = backupDRClient.listBackupPlansPagedCallable().futureCall(request); // Do something. for (BackupPlan element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupPlansCallable
public final UnaryCallable<ListBackupPlansRequest,ListBackupPlansResponse> listBackupPlansCallable()Lists BackupPlans in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlansRequest request = ListBackupPlansRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListBackupPlansResponse response = backupDRClient.listBackupPlansCallable().call(request); for (BackupPlan element : response.getBackupPlansList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteBackupPlanAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(BackupPlanName name) Deletes a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanName name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]"); backupDRClient.deleteBackupPlanAsync(name).get(); }- Parameters:
name- Required. The resource name of the `BackupPlan` to delete.Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
- Throws:
ApiException- if the remote call fails
-
deleteBackupPlanAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(String name) Deletes a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString(); backupDRClient.deleteBackupPlanAsync(name).get(); }- Parameters:
name- Required. The resource name of the `BackupPlan` to delete.Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
- Throws:
ApiException- if the remote call fails
-
deleteBackupPlanAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(DeleteBackupPlanRequest request) Deletes a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupPlanRequest request = DeleteBackupPlanRequest.newBuilder() .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .setRequestId("requestId693933066") .build(); backupDRClient.deleteBackupPlanAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteBackupPlanOperationCallable
public final OperationCallable<DeleteBackupPlanRequest,com.google.protobuf.Empty, deleteBackupPlanOperationCallable()OperationMetadata> Deletes a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupPlanRequest request = DeleteBackupPlanRequest.newBuilder() .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = backupDRClient.deleteBackupPlanOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteBackupPlanCallable
Deletes a single BackupPlan.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupPlanRequest request = DeleteBackupPlanRequest.newBuilder() .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.deleteBackupPlanCallable().futureCall(request); // Do something. future.get(); } -
getBackupPlanRevision
Gets details of a single BackupPlanRevision.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanRevisionName name = BackupPlanRevisionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]"); BackupPlanRevision response = backupDRClient.getBackupPlanRevision(name); }- Parameters:
name- Required. The resource name of the `BackupPlanRevision` to retrieve.Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`
- Throws:
ApiException- if the remote call fails
-
getBackupPlanRevision
Gets details of a single BackupPlanRevision.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupPlanRevisionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]") .toString(); BackupPlanRevision response = backupDRClient.getBackupPlanRevision(name); }- Parameters:
name- Required. The resource name of the `BackupPlanRevision` to retrieve.Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`
- Throws:
ApiException- if the remote call fails
-
getBackupPlanRevision
Gets details of a single BackupPlanRevision.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupPlanRevisionRequest request = GetBackupPlanRevisionRequest.newBuilder() .setName( BackupPlanRevisionName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]") .toString()) .build(); BackupPlanRevision response = backupDRClient.getBackupPlanRevision(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupPlanRevisionCallable
public final UnaryCallable<GetBackupPlanRevisionRequest,BackupPlanRevision> getBackupPlanRevisionCallable()Gets details of a single BackupPlanRevision.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupPlanRevisionRequest request = GetBackupPlanRevisionRequest.newBuilder() .setName( BackupPlanRevisionName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]") .toString()) .build(); ApiFuture<BackupPlanRevision> future = backupDRClient.getBackupPlanRevisionCallable().futureCall(request); // Do something. BackupPlanRevision response = future.get(); } -
listBackupPlanRevisions
public final BackupDRClient.ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(BackupPlanName parent) Lists BackupPlanRevisions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanName parent = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]"); for (BackupPlanRevision element : backupDRClient.listBackupPlanRevisions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve `BackupPlanRevisions` information. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**.- Throws:
ApiException- if the remote call fails
-
listBackupPlanRevisions
public final BackupDRClient.ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(String parent) Lists BackupPlanRevisions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString(); for (BackupPlanRevision element : backupDRClient.listBackupPlanRevisions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve `BackupPlanRevisions` information. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**.- Throws:
ApiException- if the remote call fails
-
listBackupPlanRevisions
public final BackupDRClient.ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(ListBackupPlanRevisionsRequest request) Lists BackupPlanRevisions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlanRevisionsRequest request = ListBackupPlanRevisionsRequest.newBuilder() .setParent(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (BackupPlanRevision element : backupDRClient.listBackupPlanRevisions(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupPlanRevisionsPagedCallable
public final UnaryCallable<ListBackupPlanRevisionsRequest,BackupDRClient.ListBackupPlanRevisionsPagedResponse> listBackupPlanRevisionsPagedCallable()Lists BackupPlanRevisions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlanRevisionsRequest request = ListBackupPlanRevisionsRequest.newBuilder() .setParent(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<BackupPlanRevision> future = backupDRClient.listBackupPlanRevisionsPagedCallable().futureCall(request); // Do something. for (BackupPlanRevision element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupPlanRevisionsCallable
public final UnaryCallable<ListBackupPlanRevisionsRequest,ListBackupPlanRevisionsResponse> listBackupPlanRevisionsCallable()Lists BackupPlanRevisions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlanRevisionsRequest request = ListBackupPlanRevisionsRequest.newBuilder() .setParent(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListBackupPlanRevisionsResponse response = backupDRClient.listBackupPlanRevisionsCallable().call(request); for (BackupPlanRevision element : response.getBackupPlanRevisionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createBackupPlanAssociationAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationAsync(LocationName parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId) Create a BackupPlanAssociationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); BackupPlanAssociation backupPlanAssociation = BackupPlanAssociation.newBuilder().build(); String backupPlanAssociationId = "backupPlanAssociationId567762737"; BackupPlanAssociation response = backupDRClient .createBackupPlanAssociationAsync( parent, backupPlanAssociation, backupPlanAssociationId) .get(); }- Parameters:
parent- Required. The backup plan association project and location in the format `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations map to GCP regions, for example **us-central1**.backupPlanAssociation- Required. The resource being createdbackupPlanAssociationId- Required. The name of the backup plan association to create. The name must be unique for the specified project and location.- Throws:
ApiException- if the remote call fails
-
createBackupPlanAssociationAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationAsync(String parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId) Create a BackupPlanAssociationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); BackupPlanAssociation backupPlanAssociation = BackupPlanAssociation.newBuilder().build(); String backupPlanAssociationId = "backupPlanAssociationId567762737"; BackupPlanAssociation response = backupDRClient .createBackupPlanAssociationAsync( parent, backupPlanAssociation, backupPlanAssociationId) .get(); }- Parameters:
parent- Required. The backup plan association project and location in the format `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations map to GCP regions, for example **us-central1**.backupPlanAssociation- Required. The resource being createdbackupPlanAssociationId- Required. The name of the backup plan association to create. The name must be unique for the specified project and location.- Throws:
ApiException- if the remote call fails
-
createBackupPlanAssociationAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationAsync(CreateBackupPlanAssociationRequest request) Create a BackupPlanAssociationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupPlanAssociationRequest request = CreateBackupPlanAssociationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupPlanAssociationId("backupPlanAssociationId567762737") .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build()) .setRequestId("requestId693933066") .build(); BackupPlanAssociation response = backupDRClient.createBackupPlanAssociationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createBackupPlanAssociationOperationCallable
public final OperationCallable<CreateBackupPlanAssociationRequest,BackupPlanAssociation, createBackupPlanAssociationOperationCallable()OperationMetadata> Create a BackupPlanAssociationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupPlanAssociationRequest request = CreateBackupPlanAssociationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupPlanAssociationId("backupPlanAssociationId567762737") .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<BackupPlanAssociation, OperationMetadata> future = backupDRClient.createBackupPlanAssociationOperationCallable().futureCall(request); // Do something. BackupPlanAssociation response = future.get(); } -
createBackupPlanAssociationCallable
public final UnaryCallable<CreateBackupPlanAssociationRequest,Operation> createBackupPlanAssociationCallable()Create a BackupPlanAssociationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { CreateBackupPlanAssociationRequest request = CreateBackupPlanAssociationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackupPlanAssociationId("backupPlanAssociationId567762737") .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.createBackupPlanAssociationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateBackupPlanAssociationAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> updateBackupPlanAssociationAsync(BackupPlanAssociation backupPlanAssociation, com.google.protobuf.FieldMask updateMask) Update a BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanAssociation backupPlanAssociation = BackupPlanAssociation.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); BackupPlanAssociation response = backupDRClient.updateBackupPlanAssociationAsync(backupPlanAssociation, updateMask).get(); }- Parameters:
backupPlanAssociation- Required. The resource being updatedupdateMask- Required. The list of fields to update. Field mask is used to specify the fields to be overwritten in the BackupPlanAssociation resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail. Currently backup_plan_association.backup_plan is the only supported field.- Throws:
ApiException- if the remote call fails
-
updateBackupPlanAssociationAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> updateBackupPlanAssociationAsync(UpdateBackupPlanAssociationRequest request) Update a BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupPlanAssociationRequest request = UpdateBackupPlanAssociationRequest.newBuilder() .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); BackupPlanAssociation response = backupDRClient.updateBackupPlanAssociationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateBackupPlanAssociationOperationCallable
public final OperationCallable<UpdateBackupPlanAssociationRequest,BackupPlanAssociation, updateBackupPlanAssociationOperationCallable()OperationMetadata> Update a BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupPlanAssociationRequest request = UpdateBackupPlanAssociationRequest.newBuilder() .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<BackupPlanAssociation, OperationMetadata> future = backupDRClient.updateBackupPlanAssociationOperationCallable().futureCall(request); // Do something. BackupPlanAssociation response = future.get(); } -
updateBackupPlanAssociationCallable
public final UnaryCallable<UpdateBackupPlanAssociationRequest,Operation> updateBackupPlanAssociationCallable()Update a BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { UpdateBackupPlanAssociationRequest request = UpdateBackupPlanAssociationRequest.newBuilder() .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.updateBackupPlanAssociationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getBackupPlanAssociation
Gets details of a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanAssociationName name = BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]"); BackupPlanAssociation response = backupDRClient.getBackupPlanAssociation(name); }- Parameters:
name- Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`- Throws:
ApiException- if the remote call fails
-
getBackupPlanAssociation
Gets details of a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString(); BackupPlanAssociation response = backupDRClient.getBackupPlanAssociation(name); }- Parameters:
name- Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`- Throws:
ApiException- if the remote call fails
-
getBackupPlanAssociation
public final BackupPlanAssociation getBackupPlanAssociation(GetBackupPlanAssociationRequest request) Gets details of a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupPlanAssociationRequest request = GetBackupPlanAssociationRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .build(); BackupPlanAssociation response = backupDRClient.getBackupPlanAssociation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackupPlanAssociationCallable
public final UnaryCallable<GetBackupPlanAssociationRequest,BackupPlanAssociation> getBackupPlanAssociationCallable()Gets details of a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetBackupPlanAssociationRequest request = GetBackupPlanAssociationRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .build(); ApiFuture<BackupPlanAssociation> future = backupDRClient.getBackupPlanAssociationCallable().futureCall(request); // Do something. BackupPlanAssociation response = future.get(); } -
listBackupPlanAssociations
public final BackupDRClient.ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(LocationName parent) Lists BackupPlanAssociations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (BackupPlanAssociation element : backupDRClient.listBackupPlanAssociations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backup Plan Associations information, in the format `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations map to GCP regions, for example **us-central1**. To retrieve backup plan associations for all locations, use "-" for the `{location}` value.- Throws:
ApiException- if the remote call fails
-
listBackupPlanAssociations
public final BackupDRClient.ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(String parent) Lists BackupPlanAssociations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (BackupPlanAssociation element : backupDRClient.listBackupPlanAssociations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve backup Plan Associations information, in the format `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations map to GCP regions, for example **us-central1**. To retrieve backup plan associations for all locations, use "-" for the `{location}` value.- Throws:
ApiException- if the remote call fails
-
listBackupPlanAssociations
public final BackupDRClient.ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(ListBackupPlanAssociationsRequest request) Lists BackupPlanAssociations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlanAssociationsRequest request = ListBackupPlanAssociationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (BackupPlanAssociation element : backupDRClient.listBackupPlanAssociations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackupPlanAssociationsPagedCallable
public final UnaryCallable<ListBackupPlanAssociationsRequest,BackupDRClient.ListBackupPlanAssociationsPagedResponse> listBackupPlanAssociationsPagedCallable()Lists BackupPlanAssociations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlanAssociationsRequest request = ListBackupPlanAssociationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<BackupPlanAssociation> future = backupDRClient.listBackupPlanAssociationsPagedCallable().futureCall(request); // Do something. for (BackupPlanAssociation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackupPlanAssociationsCallable
public final UnaryCallable<ListBackupPlanAssociationsRequest,ListBackupPlanAssociationsResponse> listBackupPlanAssociationsCallable()Lists BackupPlanAssociations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListBackupPlanAssociationsRequest request = ListBackupPlanAssociationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListBackupPlanAssociationsResponse response = backupDRClient.listBackupPlanAssociationsCallable().call(request); for (BackupPlanAssociation element : response.getBackupPlanAssociationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
fetchBackupPlanAssociationsForResourceType
public final BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse fetchBackupPlanAssociationsForResourceType(LocationName parent, String resourceType) List BackupPlanAssociations for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); String resourceType = "resourceType-384364440"; for (BackupPlanAssociation element : backupDRClient .fetchBackupPlanAssociationsForResourceType(parent, resourceType) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name. Format: projects/{project}/locations/{location}resourceType- Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance- Throws:
ApiException- if the remote call fails
-
fetchBackupPlanAssociationsForResourceType
public final BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse fetchBackupPlanAssociationsForResourceType(String parent, String resourceType) List BackupPlanAssociations for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); String resourceType = "resourceType-384364440"; for (BackupPlanAssociation element : backupDRClient .fetchBackupPlanAssociationsForResourceType(parent, resourceType) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name. Format: projects/{project}/locations/{location}resourceType- Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance- Throws:
ApiException- if the remote call fails
-
fetchBackupPlanAssociationsForResourceType
public final BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse fetchBackupPlanAssociationsForResourceType(FetchBackupPlanAssociationsForResourceTypeRequest request) List BackupPlanAssociations for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchBackupPlanAssociationsForResourceTypeRequest request = FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (BackupPlanAssociation element : backupDRClient.fetchBackupPlanAssociationsForResourceType(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchBackupPlanAssociationsForResourceTypePagedCallable
public final UnaryCallable<FetchBackupPlanAssociationsForResourceTypeRequest,BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse> fetchBackupPlanAssociationsForResourceTypePagedCallable()List BackupPlanAssociations for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchBackupPlanAssociationsForResourceTypeRequest request = FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<BackupPlanAssociation> future = backupDRClient .fetchBackupPlanAssociationsForResourceTypePagedCallable() .futureCall(request); // Do something. for (BackupPlanAssociation element : future.get().iterateAll()) { // doThingsWith(element); } } -
fetchBackupPlanAssociationsForResourceTypeCallable
public final UnaryCallable<FetchBackupPlanAssociationsForResourceTypeRequest,FetchBackupPlanAssociationsForResourceTypeResponse> fetchBackupPlanAssociationsForResourceTypeCallable()List BackupPlanAssociations for a given resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchBackupPlanAssociationsForResourceTypeRequest request = FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { FetchBackupPlanAssociationsForResourceTypeResponse response = backupDRClient.fetchBackupPlanAssociationsForResourceTypeCallable().call(request); for (BackupPlanAssociation element : response.getBackupPlanAssociationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteBackupPlanAssociationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationAsync(BackupPlanAssociationName name) Deletes a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanAssociationName name = BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]"); backupDRClient.deleteBackupPlanAssociationAsync(name).get(); }- Parameters:
name- Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`- Throws:
ApiException- if the remote call fails
-
deleteBackupPlanAssociationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationAsync(String name) Deletes a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString(); backupDRClient.deleteBackupPlanAssociationAsync(name).get(); }- Parameters:
name- Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`- Throws:
ApiException- if the remote call fails
-
deleteBackupPlanAssociationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationAsync(DeleteBackupPlanAssociationRequest request) Deletes a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupPlanAssociationRequest request = DeleteBackupPlanAssociationRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .setRequestId("requestId693933066") .build(); backupDRClient.deleteBackupPlanAssociationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteBackupPlanAssociationOperationCallable
public final OperationCallable<DeleteBackupPlanAssociationRequest,com.google.protobuf.Empty, deleteBackupPlanAssociationOperationCallable()OperationMetadata> Deletes a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupPlanAssociationRequest request = DeleteBackupPlanAssociationRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = backupDRClient.deleteBackupPlanAssociationOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteBackupPlanAssociationCallable
public final UnaryCallable<DeleteBackupPlanAssociationRequest,Operation> deleteBackupPlanAssociationCallable()Deletes a single BackupPlanAssociation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DeleteBackupPlanAssociationRequest request = DeleteBackupPlanAssociationRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.deleteBackupPlanAssociationCallable().futureCall(request); // Do something. future.get(); } -
triggerBackupAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> triggerBackupAsync(BackupPlanAssociationName name, String ruleId) Triggers a new Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { BackupPlanAssociationName name = BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]"); String ruleId = "ruleId-919875273"; BackupPlanAssociation response = backupDRClient.triggerBackupAsync(name, ruleId).get(); }- Parameters:
name- Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`ruleId- Required. backup rule_id for which a backup needs to be triggered.- Throws:
ApiException- if the remote call fails
-
triggerBackupAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> triggerBackupAsync(String name, String ruleId) Triggers a new Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString(); String ruleId = "ruleId-919875273"; BackupPlanAssociation response = backupDRClient.triggerBackupAsync(name, ruleId).get(); }- Parameters:
name- Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`ruleId- Required. backup rule_id for which a backup needs to be triggered.- Throws:
ApiException- if the remote call fails
-
triggerBackupAsync
public final OperationFuture<BackupPlanAssociation,OperationMetadata> triggerBackupAsync(TriggerBackupRequest request) Triggers a new Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { TriggerBackupRequest request = TriggerBackupRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .setRuleId("ruleId-919875273") .setRequestId("requestId693933066") .build(); BackupPlanAssociation response = backupDRClient.triggerBackupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
triggerBackupOperationCallable
public final OperationCallable<TriggerBackupRequest,BackupPlanAssociation, triggerBackupOperationCallable()OperationMetadata> Triggers a new Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { TriggerBackupRequest request = TriggerBackupRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .setRuleId("ruleId-919875273") .setRequestId("requestId693933066") .build(); OperationFuture<BackupPlanAssociation, OperationMetadata> future = backupDRClient.triggerBackupOperationCallable().futureCall(request); // Do something. BackupPlanAssociation response = future.get(); } -
triggerBackupCallable
Triggers a new Backup.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { TriggerBackupRequest request = TriggerBackupRequest.newBuilder() .setName( BackupPlanAssociationName.of( "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]") .toString()) .setRuleId("ruleId-919875273") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.triggerBackupCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getDataSourceReference
Gets details of a single DataSourceReference.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { DataSourceReferenceName name = DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]"); DataSourceReference response = backupDRClient.getDataSourceReference(name); }- Parameters:
name- Required. The name of the DataSourceReference to retrieve. Format: projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}- Throws:
ApiException- if the remote call fails
-
getDataSourceReference
Gets details of a single DataSourceReference.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String name = DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]") .toString(); DataSourceReference response = backupDRClient.getDataSourceReference(name); }- Parameters:
name- Required. The name of the DataSourceReference to retrieve. Format: projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}- Throws:
ApiException- if the remote call fails
-
getDataSourceReference
Gets details of a single DataSourceReference.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetDataSourceReferenceRequest request = GetDataSourceReferenceRequest.newBuilder() .setName( DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]") .toString()) .build(); DataSourceReference response = backupDRClient.getDataSourceReference(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDataSourceReferenceCallable
public final UnaryCallable<GetDataSourceReferenceRequest,DataSourceReference> getDataSourceReferenceCallable()Gets details of a single DataSourceReference.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetDataSourceReferenceRequest request = GetDataSourceReferenceRequest.newBuilder() .setName( DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]") .toString()) .build(); ApiFuture<DataSourceReference> future = backupDRClient.getDataSourceReferenceCallable().futureCall(request); // Do something. DataSourceReference response = future.get(); } -
listDataSourceReferences
public final BackupDRClient.ListDataSourceReferencesPagedResponse listDataSourceReferences(LocationName parent) Lists DataSourceReferences for a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (DataSourceReference element : backupDRClient.listDataSourceReferences(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name. Format: projects/{project}/locations/{location}- Throws:
ApiException- if the remote call fails
-
listDataSourceReferences
public final BackupDRClient.ListDataSourceReferencesPagedResponse listDataSourceReferences(String parent) Lists DataSourceReferences for a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (DataSourceReference element : backupDRClient.listDataSourceReferences(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name. Format: projects/{project}/locations/{location}- Throws:
ApiException- if the remote call fails
-
listDataSourceReferences
public final BackupDRClient.ListDataSourceReferencesPagedResponse listDataSourceReferences(ListDataSourceReferencesRequest request) Lists DataSourceReferences for a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListDataSourceReferencesRequest request = ListDataSourceReferencesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (DataSourceReference element : backupDRClient.listDataSourceReferences(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDataSourceReferencesPagedCallable
public final UnaryCallable<ListDataSourceReferencesRequest,BackupDRClient.ListDataSourceReferencesPagedResponse> listDataSourceReferencesPagedCallable()Lists DataSourceReferences for a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListDataSourceReferencesRequest request = ListDataSourceReferencesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DataSourceReference> future = backupDRClient.listDataSourceReferencesPagedCallable().futureCall(request); // Do something. for (DataSourceReference element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDataSourceReferencesCallable
public final UnaryCallable<ListDataSourceReferencesRequest,ListDataSourceReferencesResponse> listDataSourceReferencesCallable()Lists DataSourceReferences for a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListDataSourceReferencesRequest request = ListDataSourceReferencesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListDataSourceReferencesResponse response = backupDRClient.listDataSourceReferencesCallable().call(request); for (DataSourceReference element : response.getDataSourceReferencesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
fetchDataSourceReferencesForResourceType
public final BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse fetchDataSourceReferencesForResourceType(LocationName parent, String resourceType) Fetch DataSourceReferences for a given project, location and resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); String resourceType = "resourceType-384364440"; for (DataSourceReference element : backupDRClient .fetchDataSourceReferencesForResourceType(parent, resourceType) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name. Format: projects/{project}/locations/{location}resourceType- Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance- Throws:
ApiException- if the remote call fails
-
fetchDataSourceReferencesForResourceType
public final BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse fetchDataSourceReferencesForResourceType(String parent, String resourceType) Fetch DataSourceReferences for a given project, location and resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); String resourceType = "resourceType-384364440"; for (DataSourceReference element : backupDRClient .fetchDataSourceReferencesForResourceType(parent, resourceType) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name. Format: projects/{project}/locations/{location}resourceType- Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance- Throws:
ApiException- if the remote call fails
-
fetchDataSourceReferencesForResourceType
public final BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse fetchDataSourceReferencesForResourceType(FetchDataSourceReferencesForResourceTypeRequest request) Fetch DataSourceReferences for a given project, location and resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchDataSourceReferencesForResourceTypeRequest request = FetchDataSourceReferencesForResourceTypeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (DataSourceReference element : backupDRClient.fetchDataSourceReferencesForResourceType(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchDataSourceReferencesForResourceTypePagedCallable
public final UnaryCallable<FetchDataSourceReferencesForResourceTypeRequest,BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse> fetchDataSourceReferencesForResourceTypePagedCallable()Fetch DataSourceReferences for a given project, location and resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchDataSourceReferencesForResourceTypeRequest request = FetchDataSourceReferencesForResourceTypeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DataSourceReference> future = backupDRClient .fetchDataSourceReferencesForResourceTypePagedCallable() .futureCall(request); // Do something. for (DataSourceReference element : future.get().iterateAll()) { // doThingsWith(element); } } -
fetchDataSourceReferencesForResourceTypeCallable
public final UnaryCallable<FetchDataSourceReferencesForResourceTypeRequest,FetchDataSourceReferencesForResourceTypeResponse> fetchDataSourceReferencesForResourceTypeCallable()Fetch DataSourceReferences for a given project, location and resource type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { FetchDataSourceReferencesForResourceTypeRequest request = FetchDataSourceReferencesForResourceTypeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setResourceType("resourceType-384364440") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { FetchDataSourceReferencesForResourceTypeResponse response = backupDRClient.fetchDataSourceReferencesForResourceTypeCallable().call(request); for (DataSourceReference element : response.getDataSourceReferencesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
initializeServiceAsync
public final OperationFuture<InitializeServiceResponse,OperationMetadata> initializeServiceAsync(InitializeServiceRequest request) Initializes the service related config for a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { InitializeServiceRequest request = InitializeServiceRequest.newBuilder() .setName("name3373707") .setResourceType("resourceType-384364440") .setRequestId("requestId693933066") .build(); InitializeServiceResponse response = backupDRClient.initializeServiceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
initializeServiceOperationCallable
public final OperationCallable<InitializeServiceRequest,InitializeServiceResponse, initializeServiceOperationCallable()OperationMetadata> Initializes the service related config for a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { InitializeServiceRequest request = InitializeServiceRequest.newBuilder() .setName("name3373707") .setResourceType("resourceType-384364440") .setRequestId("requestId693933066") .build(); OperationFuture<InitializeServiceResponse, OperationMetadata> future = backupDRClient.initializeServiceOperationCallable().futureCall(request); // Do something. InitializeServiceResponse response = future.get(); } -
initializeServiceCallable
Initializes the service related config for a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { InitializeServiceRequest request = InitializeServiceRequest.newBuilder() .setName("name3373707") .setResourceType("resourceType-384364440") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backupDRClient.initializeServiceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listLocations
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : backupDRClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,BackupDRClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = backupDRClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = backupDRClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = backupDRClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = backupDRClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = backupDRClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = backupDRClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = backupDRClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = backupDRClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = backupDRClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackupDRClient backupDRClient = BackupDRClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = backupDRClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-