Backup and DR Service v1 API - Class BackupDRClient (1.1.0)

public abstract class BackupDRClient

Reference documentation and code samples for the Backup and DR Service v1 API class BackupDRClient.

BackupDR client wrapper, for convenient use.

Inheritance

object > BackupDRClient

Derived Types

Namespace

Google.Cloud.BackupDR.V1

Assembly

Google.Cloud.BackupDR.V1.dll

Remarks

The BackupDR Service

Properties

CreateManagementServerOperationsClient

public virtual OperationsClient CreateManagementServerOperationsClient { get; }

The long-running operations client for CreateManagementServer.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the BackupDR service, which is a host of "backupdr.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default BackupDR scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default BackupDR scopes are:

DeleteManagementServerOperationsClient

public virtual OperationsClient DeleteManagementServerOperationsClient { get; }

The long-running operations client for DeleteManagementServer.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual BackupDR.BackupDRClient GrpcClient { get; }

The underlying gRPC BackupDR client

Property Value
Type Description
BackupDRBackupDRClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static BackupDRClient Create()

Synchronously creates a BackupDRClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BackupDRClientBuilder.

Returns
Type Description
BackupDRClient

The created BackupDRClient.

CreateAsync(CancellationToken)

public static Task<BackupDRClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a BackupDRClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BackupDRClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskBackupDRClient

The task representing the created BackupDRClient.

CreateManagementServer(LocationName, ManagementServer, string, CallSettings)

public virtual Operation<ManagementServer, OperationMetadata> CreateManagementServer(LocationName parent, ManagementServer managementServer, string managementServerId, CallSettings callSettings = null)

Creates a new ManagementServer in a given project and location.

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][google.cloud.backupdr.v1.ManagementServer]

managementServerId string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationManagementServerOperationMetadata

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ManagementServer managementServer = new ManagementServer();
string managementServerId = "";
// Make the request
Operation<ManagementServer, OperationMetadata> response = backupDRClient.CreateManagementServer(parent, managementServer, managementServerId);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = backupDRClient.PollOnceCreateManagementServer(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServer(CreateManagementServerRequest, CallSettings)

public virtual Operation<ManagementServer, OperationMetadata> CreateManagementServer(CreateManagementServerRequest request, CallSettings callSettings = null)

Creates a new ManagementServer in a given project and location.

Parameters
Name Description
request CreateManagementServerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationManagementServerOperationMetadata

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
CreateManagementServerRequest request = new CreateManagementServerRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ManagementServerId = "",
    ManagementServer = new ManagementServer(),
    RequestId = "",
};
// Make the request
Operation<ManagementServer, OperationMetadata> response = backupDRClient.CreateManagementServer(request);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = backupDRClient.PollOnceCreateManagementServer(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServer(string, ManagementServer, string, CallSettings)

public virtual Operation<ManagementServer, OperationMetadata> CreateManagementServer(string parent, ManagementServer managementServer, string managementServerId, CallSettings callSettings = null)

Creates a new ManagementServer in a given project and location.

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][google.cloud.backupdr.v1.ManagementServer]

managementServerId string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationManagementServerOperationMetadata

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ManagementServer managementServer = new ManagementServer();
string managementServerId = "";
// Make the request
Operation<ManagementServer, OperationMetadata> response = backupDRClient.CreateManagementServer(parent, managementServer, managementServerId);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = backupDRClient.PollOnceCreateManagementServer(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServerAsync(LocationName, ManagementServer, string, CallSettings)

public virtual Task<Operation<ManagementServer, OperationMetadata>> CreateManagementServerAsync(LocationName parent, ManagementServer managementServer, string managementServerId, CallSettings callSettings = null)

Creates a new ManagementServer in a given project and location.

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][google.cloud.backupdr.v1.ManagementServer]

managementServerId string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ManagementServer managementServer = new ManagementServer();
string managementServerId = "";
// Make the request
Operation<ManagementServer, OperationMetadata> response = await backupDRClient.CreateManagementServerAsync(parent, managementServer, managementServerId);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceCreateManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServerAsync(LocationName, ManagementServer, string, CancellationToken)

public virtual Task<Operation<ManagementServer, OperationMetadata>> CreateManagementServerAsync(LocationName parent, ManagementServer managementServer, string managementServerId, CancellationToken cancellationToken)

Creates a new ManagementServer in a given project and location.

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][google.cloud.backupdr.v1.ManagementServer]

managementServerId string

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ManagementServer managementServer = new ManagementServer();
string managementServerId = "";
// Make the request
Operation<ManagementServer, OperationMetadata> response = await backupDRClient.CreateManagementServerAsync(parent, managementServer, managementServerId);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceCreateManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServerAsync(CreateManagementServerRequest, CallSettings)

public virtual Task<Operation<ManagementServer, OperationMetadata>> CreateManagementServerAsync(CreateManagementServerRequest request, CallSettings callSettings = null)

Creates a new ManagementServer in a given project and location.

Parameters
Name Description
request CreateManagementServerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
CreateManagementServerRequest request = new CreateManagementServerRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ManagementServerId = "",
    ManagementServer = new ManagementServer(),
    RequestId = "",
};
// Make the request
Operation<ManagementServer, OperationMetadata> response = await backupDRClient.CreateManagementServerAsync(request);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceCreateManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServerAsync(CreateManagementServerRequest, CancellationToken)

public virtual Task<Operation<ManagementServer, OperationMetadata>> CreateManagementServerAsync(CreateManagementServerRequest request, CancellationToken cancellationToken)

Creates a new ManagementServer in a given project and location.

Parameters
Name Description
request CreateManagementServerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
CreateManagementServerRequest request = new CreateManagementServerRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ManagementServerId = "",
    ManagementServer = new ManagementServer(),
    RequestId = "",
};
// Make the request
Operation<ManagementServer, OperationMetadata> response = await backupDRClient.CreateManagementServerAsync(request);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceCreateManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServerAsync(string, ManagementServer, string, CallSettings)

public virtual Task<Operation<ManagementServer, OperationMetadata>> CreateManagementServerAsync(string parent, ManagementServer managementServer, string managementServerId, CallSettings callSettings = null)

Creates a new ManagementServer in a given project and location.

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][google.cloud.backupdr.v1.ManagementServer]

managementServerId string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ManagementServer managementServer = new ManagementServer();
string managementServerId = "";
// Make the request
Operation<ManagementServer, OperationMetadata> response = await backupDRClient.CreateManagementServerAsync(parent, managementServer, managementServerId);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceCreateManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

CreateManagementServerAsync(string, ManagementServer, string, CancellationToken)

public virtual Task<Operation<ManagementServer, OperationMetadata>> CreateManagementServerAsync(string parent, ManagementServer managementServer, string managementServerId, CancellationToken cancellationToken)

Creates a new ManagementServer in a given project and location.

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][google.cloud.backupdr.v1.ManagementServer]

managementServerId string

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ManagementServer managementServer = new ManagementServer();
string managementServerId = "";
// Make the request
Operation<ManagementServer, OperationMetadata> response = await backupDRClient.CreateManagementServerAsync(parent, managementServer, managementServerId);

// Poll until the returned long-running operation is complete
Operation<ManagementServer, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ManagementServer result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ManagementServer, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceCreateManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ManagementServer retrievedResult = retrievedResponse.Result;
}

DeleteManagementServer(DeleteManagementServerRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteManagementServer(DeleteManagementServerRequest request, CallSettings callSettings = null)

Deletes a single ManagementServer.

Parameters
Name Description
request DeleteManagementServerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
DeleteManagementServerRequest request = new DeleteManagementServerRequest
{
    ManagementServerName = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"),
    RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = backupDRClient.DeleteManagementServer(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = backupDRClient.PollOnceDeleteManagementServer(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServer(ManagementServerName, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteManagementServer(ManagementServerName name, CallSettings callSettings = null)

Deletes a single ManagementServer.

Parameters
Name Description
name ManagementServerName

Required. Name of the resource

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
ManagementServerName name = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
// Make the request
Operation<Empty, OperationMetadata> response = backupDRClient.DeleteManagementServer(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = backupDRClient.PollOnceDeleteManagementServer(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServer(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteManagementServer(string name, CallSettings callSettings = null)

Deletes a single ManagementServer.

Parameters
Name Description
name string

Required. Name of the resource

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/managementServers/[MANAGEMENTSERVER]";
// Make the request
Operation<Empty, OperationMetadata> response = backupDRClient.DeleteManagementServer(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = backupDRClient.PollOnceDeleteManagementServer(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServerAsync(DeleteManagementServerRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteManagementServerAsync(DeleteManagementServerRequest request, CallSettings callSettings = null)

Deletes a single ManagementServer.

Parameters
Name Description
request DeleteManagementServerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
DeleteManagementServerRequest request = new DeleteManagementServerRequest
{
    ManagementServerName = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"),
    RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteManagementServerAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceDeleteManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServerAsync(DeleteManagementServerRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteManagementServerAsync(DeleteManagementServerRequest request, CancellationToken cancellationToken)

Deletes a single ManagementServer.

Parameters
Name Description
request DeleteManagementServerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
DeleteManagementServerRequest request = new DeleteManagementServerRequest
{
    ManagementServerName = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"),
    RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteManagementServerAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceDeleteManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServerAsync(ManagementServerName, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteManagementServerAsync(ManagementServerName name, CallSettings callSettings = null)

Deletes a single ManagementServer.

Parameters
Name Description
name ManagementServerName

Required. Name of the resource

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
ManagementServerName name = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteManagementServerAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceDeleteManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServerAsync(ManagementServerName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteManagementServerAsync(ManagementServerName name, CancellationToken cancellationToken)

Deletes a single ManagementServer.

Parameters
Name Description
name ManagementServerName

Required. Name of the resource

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
ManagementServerName name = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteManagementServerAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceDeleteManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServerAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteManagementServerAsync(string name, CallSettings callSettings = null)

Deletes a single ManagementServer.

Parameters
Name Description
name string

Required. Name of the resource

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/managementServers/[MANAGEMENTSERVER]";
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteManagementServerAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceDeleteManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteManagementServerAsync(string, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteManagementServerAsync(string name, CancellationToken cancellationToken)

Deletes a single ManagementServer.

Parameters
Name Description
name string

Required. Name of the resource

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/managementServers/[MANAGEMENTSERVER]";
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteManagementServerAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceDeleteManagementServerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetManagementServer(GetManagementServerRequest, CallSettings)

public virtual ManagementServer GetManagementServer(GetManagementServerRequest request, CallSettings callSettings = null)

Gets details of a single ManagementServer.

Parameters
Name Description
request GetManagementServerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ManagementServer

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
GetManagementServerRequest request = new GetManagementServerRequest
{
    ManagementServerName = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"),
};
// Make the request
ManagementServer response = backupDRClient.GetManagementServer(request);

GetManagementServer(ManagementServerName, CallSettings)

public virtual ManagementServer GetManagementServer(ManagementServerName name, CallSettings callSettings = null)

Gets details of a single ManagementServer.

Parameters
Name Description
name ManagementServerName

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ManagementServer

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
ManagementServerName name = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
// Make the request
ManagementServer response = backupDRClient.GetManagementServer(name);

GetManagementServer(string, CallSettings)

public virtual ManagementServer GetManagementServer(string name, CallSettings callSettings = null)

Gets details of a single ManagementServer.

Parameters
Name Description
name string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ManagementServer

The RPC response.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/managementServers/[MANAGEMENTSERVER]";
// Make the request
ManagementServer response = backupDRClient.GetManagementServer(name);

GetManagementServerAsync(GetManagementServerRequest, CallSettings)

public virtual Task<ManagementServer> GetManagementServerAsync(GetManagementServerRequest request, CallSettings callSettings = null)

Gets details of a single ManagementServer.

Parameters
Name Description
request GetManagementServerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskManagementServer

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
GetManagementServerRequest request = new GetManagementServerRequest
{
    ManagementServerName = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"),
};
// Make the request
ManagementServer response = await backupDRClient.GetManagementServerAsync(request);

GetManagementServerAsync(GetManagementServerRequest, CancellationToken)

public virtual Task<ManagementServer> GetManagementServerAsync(GetManagementServerRequest request, CancellationToken cancellationToken)

Gets details of a single ManagementServer.

Parameters
Name Description
request GetManagementServerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskManagementServer

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
GetManagementServerRequest request = new GetManagementServerRequest
{
    ManagementServerName = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]"),
};
// Make the request
ManagementServer response = await backupDRClient.GetManagementServerAsync(request);

GetManagementServerAsync(ManagementServerName, CallSettings)

public virtual Task<ManagementServer> GetManagementServerAsync(ManagementServerName name, CallSettings callSettings = null)

Gets details of a single ManagementServer.

Parameters
Name Description
name ManagementServerName

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskManagementServer

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
ManagementServerName name = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
// Make the request
ManagementServer response = await backupDRClient.GetManagementServerAsync(name);

GetManagementServerAsync(ManagementServerName, CancellationToken)

public virtual Task<ManagementServer> GetManagementServerAsync(ManagementServerName name, CancellationToken cancellationToken)

Gets details of a single ManagementServer.

Parameters
Name Description
name ManagementServerName

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskManagementServer

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
ManagementServerName name = ManagementServerName.FromProjectLocationManagementserver("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
// Make the request
ManagementServer response = await backupDRClient.GetManagementServerAsync(name);

GetManagementServerAsync(string, CallSettings)

public virtual Task<ManagementServer> GetManagementServerAsync(string name, CallSettings callSettings = null)

Gets details of a single ManagementServer.

Parameters
Name Description
name string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskManagementServer

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/managementServers/[MANAGEMENTSERVER]";
// Make the request
ManagementServer response = await backupDRClient.GetManagementServerAsync(name);

GetManagementServerAsync(string, CancellationToken)

public virtual Task<ManagementServer> GetManagementServerAsync(string name, CancellationToken cancellationToken)

Gets details of a single ManagementServer.

Parameters
Name Description
name string

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskManagementServer

A Task containing the RPC response.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/managementServers/[MANAGEMENTSERVER]";
// Make the request
ManagementServer response = await backupDRClient.GetManagementServerAsync(name);

ListManagementServers(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListManagementServersResponse, ManagementServer> ListManagementServers(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ManagementServers in a given project and location.

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

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListManagementServersResponseManagementServer

A pageable sequence of ManagementServer resources.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListManagementServersResponse, ManagementServer> response = backupDRClient.ListManagementServers(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ManagementServer item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListManagementServersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ManagementServer item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ManagementServer> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ManagementServer item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListManagementServers(ListManagementServersRequest, CallSettings)

public virtual PagedEnumerable<ListManagementServersResponse, ManagementServer> ListManagementServers(ListManagementServersRequest request, CallSettings callSettings = null)

Lists ManagementServers in a given project and location.

Parameters
Name Description
request ListManagementServersRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListManagementServersResponseManagementServer

A pageable sequence of ManagementServer resources.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
ListManagementServersRequest request = new ListManagementServersRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListManagementServersResponse, ManagementServer> response = backupDRClient.ListManagementServers(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ManagementServer item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListManagementServersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ManagementServer item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ManagementServer> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ManagementServer item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListManagementServers(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListManagementServersResponse, ManagementServer> ListManagementServers(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ManagementServers in a given project and location.

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

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListManagementServersResponseManagementServer

A pageable sequence of ManagementServer resources.

Example
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListManagementServersResponse, ManagementServer> response = backupDRClient.ListManagementServers(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ManagementServer item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListManagementServersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ManagementServer item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ManagementServer> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ManagementServer item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListManagementServersAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListManagementServersResponse, ManagementServer> ListManagementServersAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ManagementServers in a given project and location.

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

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListManagementServersResponseManagementServer

A pageable asynchronous sequence of ManagementServer resources.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListManagementServersResponse, ManagementServer> response = backupDRClient.ListManagementServersAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ManagementServer item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListManagementServersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ManagementServer item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ManagementServer> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ManagementServer item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListManagementServersAsync(ListManagementServersRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListManagementServersResponse, ManagementServer> ListManagementServersAsync(ListManagementServersRequest request, CallSettings callSettings = null)

Lists ManagementServers in a given project and location.

Parameters
Name Description
request ListManagementServersRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListManagementServersResponseManagementServer

A pageable asynchronous sequence of ManagementServer resources.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
ListManagementServersRequest request = new ListManagementServersRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListManagementServersResponse, ManagementServer> response = backupDRClient.ListManagementServersAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ManagementServer item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListManagementServersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ManagementServer item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ManagementServer> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ManagementServer item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListManagementServersAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListManagementServersResponse, ManagementServer> ListManagementServersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ManagementServers in a given project and location.

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

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListManagementServersResponseManagementServer

A pageable asynchronous sequence of ManagementServer resources.

Example
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListManagementServersResponse, ManagementServer> response = backupDRClient.ListManagementServersAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ManagementServer item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListManagementServersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ManagementServer item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ManagementServer> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ManagementServer item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceCreateManagementServer(string, CallSettings)

public virtual Operation<ManagementServer, OperationMetadata> PollOnceCreateManagementServer(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateManagementServer.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationManagementServerOperationMetadata

The result of polling the operation.

PollOnceCreateManagementServerAsync(string, CallSettings)

public virtual Task<Operation<ManagementServer, OperationMetadata>> PollOnceCreateManagementServerAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateManagementServer.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationManagementServerOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteManagementServer(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeleteManagementServer(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteManagementServer.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The result of polling the operation.

PollOnceDeleteManagementServerAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeleteManagementServerAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteManagementServer.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.