Backup and DR Service v1 API - Class BackupDrProtectionSummaryClient (2.7.0)

public abstract class BackupDrProtectionSummaryClient

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

BackupDrProtectionSummary client wrapper, for convenient use.

Inheritance

object > BackupDrProtectionSummaryClient

Namespace

Google.Cloud.BackupDR.V1

Assembly

Google.Cloud.BackupDR.V1.dll

Remarks

The Protection Summary service.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the BackupDrProtectionSummary 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 BackupDrProtectionSummary scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default BackupDrProtectionSummary scopes are:

GrpcClient

public virtual BackupDrProtectionSummary.BackupDrProtectionSummaryClient GrpcClient { get; }

The underlying gRPC BackupDrProtectionSummary client

Property Value
Type Description
BackupDrProtectionSummaryBackupDrProtectionSummaryClient

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 BackupDrProtectionSummaryClient Create()

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

Returns
Type Description
BackupDrProtectionSummaryClient

The created BackupDrProtectionSummaryClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskBackupDrProtectionSummaryClient

The task representing the created BackupDrProtectionSummaryClient.

ListResourceBackupConfigs(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> ListResourceBackupConfigs(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ResourceBackupConfigs.

Parameters
Name Description
parent LocationName

Required. The project and location for which to retrieve resource backup configs. Format: 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1.

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
PagedEnumerableListResourceBackupConfigsResponseResourceBackupConfig

A pageable sequence of ResourceBackupConfig resources.

Example
// Create client
BackupDrProtectionSummaryClient backupDrProtectionSummaryClient = BackupDrProtectionSummaryClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> response = backupDrProtectionSummaryClient.ListResourceBackupConfigs(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceBackupConfig 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 (ListResourceBackupConfigsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceBackupConfig 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<ResourceBackupConfig> 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 (ResourceBackupConfig 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;

ListResourceBackupConfigs(ListResourceBackupConfigsRequest, CallSettings)

public virtual PagedEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> ListResourceBackupConfigs(ListResourceBackupConfigsRequest request, CallSettings callSettings = null)

Lists ResourceBackupConfigs.

Parameters
Name Description
request ListResourceBackupConfigsRequest

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
PagedEnumerableListResourceBackupConfigsResponseResourceBackupConfig

A pageable sequence of ResourceBackupConfig resources.

Example
// Create client
BackupDrProtectionSummaryClient backupDrProtectionSummaryClient = BackupDrProtectionSummaryClient.Create();
// Initialize request argument(s)
ListResourceBackupConfigsRequest request = new ListResourceBackupConfigsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> response = backupDrProtectionSummaryClient.ListResourceBackupConfigs(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceBackupConfig 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 (ListResourceBackupConfigsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceBackupConfig 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<ResourceBackupConfig> 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 (ResourceBackupConfig 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;

ListResourceBackupConfigs(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> ListResourceBackupConfigs(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ResourceBackupConfigs.

Parameters
Name Description
parent string

Required. The project and location for which to retrieve resource backup configs. Format: 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1.

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
PagedEnumerableListResourceBackupConfigsResponseResourceBackupConfig

A pageable sequence of ResourceBackupConfig resources.

Example
// Create client
BackupDrProtectionSummaryClient backupDrProtectionSummaryClient = BackupDrProtectionSummaryClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> response = backupDrProtectionSummaryClient.ListResourceBackupConfigs(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceBackupConfig 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 (ListResourceBackupConfigsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceBackupConfig 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<ResourceBackupConfig> 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 (ResourceBackupConfig 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;

ListResourceBackupConfigsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> ListResourceBackupConfigsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ResourceBackupConfigs.

Parameters
Name Description
parent LocationName

Required. The project and location for which to retrieve resource backup configs. Format: 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1.

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
PagedAsyncEnumerableListResourceBackupConfigsResponseResourceBackupConfig

A pageable asynchronous sequence of ResourceBackupConfig resources.

Example
// Create client
BackupDrProtectionSummaryClient backupDrProtectionSummaryClient = await BackupDrProtectionSummaryClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> response = backupDrProtectionSummaryClient.ListResourceBackupConfigsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceBackupConfig 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((ListResourceBackupConfigsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceBackupConfig 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<ResourceBackupConfig> 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 (ResourceBackupConfig 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;

ListResourceBackupConfigsAsync(ListResourceBackupConfigsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> ListResourceBackupConfigsAsync(ListResourceBackupConfigsRequest request, CallSettings callSettings = null)

Lists ResourceBackupConfigs.

Parameters
Name Description
request ListResourceBackupConfigsRequest

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
PagedAsyncEnumerableListResourceBackupConfigsResponseResourceBackupConfig

A pageable asynchronous sequence of ResourceBackupConfig resources.

Example
// Create client
BackupDrProtectionSummaryClient backupDrProtectionSummaryClient = await BackupDrProtectionSummaryClient.CreateAsync();
// Initialize request argument(s)
ListResourceBackupConfigsRequest request = new ListResourceBackupConfigsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> response = backupDrProtectionSummaryClient.ListResourceBackupConfigsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceBackupConfig 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((ListResourceBackupConfigsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceBackupConfig 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<ResourceBackupConfig> 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 (ResourceBackupConfig 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;

ListResourceBackupConfigsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> ListResourceBackupConfigsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ResourceBackupConfigs.

Parameters
Name Description
parent string

Required. The project and location for which to retrieve resource backup configs. Format: 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1.

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
PagedAsyncEnumerableListResourceBackupConfigsResponseResourceBackupConfig

A pageable asynchronous sequence of ResourceBackupConfig resources.

Example
// Create client
BackupDrProtectionSummaryClient backupDrProtectionSummaryClient = await BackupDrProtectionSummaryClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListResourceBackupConfigsResponse, ResourceBackupConfig> response = backupDrProtectionSummaryClient.ListResourceBackupConfigsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceBackupConfig 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((ListResourceBackupConfigsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceBackupConfig 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<ResourceBackupConfig> 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 (ResourceBackupConfig 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;

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.