Class BackupDRClient (0.4.0)

GitHub RepositoryProduct Reference

Service Description: The BackupDR Service

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().

Methods
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.

  • listManagementServers(ListManagementServersRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listManagementServers(LocationName parent)

  • listManagementServers(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listManagementServersPagedCallable()

  • listManagementServersCallable()

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.

  • getManagementServer(GetManagementServerRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getManagementServer(ManagementServerName name)

  • getManagementServer(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getManagementServerCallable()

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.

  • createManagementServerAsync(CreateManagementServerRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createManagementServerAsync(LocationName parent, ManagementServer managementServer, String managementServerId)

  • createManagementServerAsync(String parent, ManagementServer managementServer, String managementServerId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createManagementServerOperationCallable()

  • createManagementServerCallable()

DeleteManagementServer

Deletes a single ManagementServer.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteManagementServerAsync(DeleteManagementServerRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteManagementServerAsync(ManagementServerName name)

  • deleteManagementServerAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteManagementServerOperationCallable()

  • deleteManagementServerCallable()

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.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

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.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

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.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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.

Inheritance

java.lang.Object > BackupDRClient

Static Methods

create()

public static final BackupDRClient create()

Constructs an instance of BackupDRClient with default settings.

Returns
Type Description
BackupDRClient
Exceptions
Type Description
IOException

create(BackupDRSettings settings)

public static final BackupDRClient create(BackupDRSettings settings)

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.

Parameter
Name Description
settings BackupDRSettings
Returns
Type Description
BackupDRClient
Exceptions
Type Description
IOException

create(BackupDRStub stub)

public static final BackupDRClient create(BackupDRStub stub)

Constructs an instance of BackupDRClient, using the given stub for making calls. This is for advanced usage - prefer using create(BackupDRSettings).

Parameter
Name Description
stub BackupDRStub
Returns
Type Description
BackupDRClient

Constructors

BackupDRClient(BackupDRSettings settings)

protected BackupDRClient(BackupDRSettings settings)

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.

Parameter
Name Description
settings BackupDRSettings

BackupDRClient(BackupDRStub stub)

protected BackupDRClient(BackupDRStub stub)
Parameter
Name Description
stub BackupDRStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createManagementServerAsync(CreateManagementServerRequest request)

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();
 }
 
Parameter
Name Description
request CreateManagementServerRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<ManagementServer,OperationMetadata>

createManagementServerAsync(LocationName parent, ManagementServer managementServer, String managementServerId)

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
Name Description
parent LocationName

Required. The management server project and location in the format projects/{project_id}/locations/{location}. In Cloud Backup and DR locations map to GCP regions, for example **us-central1**.

managementServer ManagementServer

Required. A management server resource

managementServerId String

Required. The name of the management server to create. The name must be unique for the specified project and location.

Returns
Type Description
OperationFuture<ManagementServer,OperationMetadata>

createManagementServerAsync(String parent, ManagementServer managementServer, String managementServerId)

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
Name Description
parent String

Required. The management server project and location in the format projects/{project_id}/locations/{location}. In Cloud Backup and DR locations map to GCP regions, for example **us-central1**.

managementServer ManagementServer

Required. A management server resource

managementServerId String

Required. The name of the management server to create. The name must be unique for the specified project and location.

Returns
Type Description
OperationFuture<ManagementServer,OperationMetadata>

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();
 }
 
Returns
Type Description
UnaryCallable<CreateManagementServerRequest,Operation>

createManagementServerOperationCallable()

public final OperationCallable<CreateManagementServerRequest,ManagementServer,OperationMetadata> createManagementServerOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<CreateManagementServerRequest,ManagementServer,OperationMetadata>

deleteManagementServerAsync(DeleteManagementServerRequest request)

public final OperationFuture<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();
 }
 
Parameter
Name Description
request DeleteManagementServerRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteManagementServerAsync(ManagementServerName name)

public final OperationFuture<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();
 }
 
Parameter
Name Description
name ManagementServerName

Required. Name of the resource

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteManagementServerAsync(String name)

public final OperationFuture<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();
 }
 
Parameter
Name Description
name String

Required. Name of the resource

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

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();
 }
 
Returns
Type Description
UnaryCallable<DeleteManagementServerRequest,Operation>

deleteManagementServerOperationCallable()

public final OperationCallable<DeleteManagementServerRequest,Empty,OperationMetadata> deleteManagementServerOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<DeleteManagementServerRequest,Empty,OperationMetadata>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (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);
 }
 
Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (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();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BackupDRClient backupDRClient = BackupDRClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = backupDRClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BackupDRClient backupDRClient = BackupDRClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = backupDRClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getManagementServer(GetManagementServerRequest request)

public final ManagementServer getManagementServer(GetManagementServerRequest request)

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);
 }
 
Parameter
Name Description
request GetManagementServerRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ManagementServer

getManagementServer(ManagementServerName name)

public final ManagementServer getManagementServer(ManagementServerName name)

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);
 }
 
Parameter
Name Description
name ManagementServerName

Required. Name of the management server resource name, in the format projects/{project_id}/locations/{location}/managementServers/{resource_name}

Returns
Type Description
ManagementServer

getManagementServer(String name)

public final ManagementServer getManagementServer(String name)

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);
 }
 
Parameter
Name Description
name String

Required. Name of the management server resource name, in the format projects/{project_id}/locations/{location}/managementServers/{resource_name}

Returns
Type Description
ManagementServer

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();
 }
 
Returns
Type Description
UnaryCallable<GetManagementServerRequest,ManagementServer>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getSettings()

public final BackupDRSettings getSettings()
Returns
Type Description
BackupDRSettings

getStub()

public BackupDRStub getStub()
Returns
Type Description
BackupDRStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listLocations(ListLocationsRequest request)

public final BackupDRClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (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);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BackupDRClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

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);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listManagementServers(ListManagementServersRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListManagementServersRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BackupDRClient.ListManagementServersPagedResponse

listManagementServers(LocationName parent)

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);
   }
 }
 
Parameter
Name Description
parent LocationName

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 GCP regions, for example **us-central1**. To retrieve management servers for all locations, use "-" for the {location} value.

Returns
Type Description
BackupDRClient.ListManagementServersPagedResponse

listManagementServers(String parent)

public final BackupDRClient.ListManagementServersPagedResponse listManagementServers(String 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()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (ManagementServer element : backupDRClient.listManagementServers(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

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 GCP regions, for example **us-central1**. To retrieve management servers for all locations, use "-" for the {location} value.

Returns
Type Description
BackupDRClient.ListManagementServersPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListManagementServersRequest,ListManagementServersResponse>

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListManagementServersRequest,ListManagementServersPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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);
 }
 
Parameter
Name Description
request com.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (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);
 }
 
Parameter
Name Description
request com.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.TestIamPermissionsResponse

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();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>