public abstract class ErrorStatsServiceClient
ErrorStatsService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.ErrorReporting.V1Beta1Assembly
Google.Cloud.ErrorReporting.V1Beta1.dll
Remarks
An API for retrieving and managing error statistics as well as data for individual events.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the ErrorStatsService service, which is a host of "clouderrorreporting.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default ErrorStatsService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default ErrorStatsService scopes are:
GrpcClient
public virtual ErrorStatsService.ErrorStatsServiceClient GrpcClient { get; }
The underlying gRPC ErrorStatsService client
Property Value | |
---|---|
Type | Description |
ErrorStatsService.ErrorStatsServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
Create()
public static ErrorStatsServiceClient Create()
Synchronously creates a ErrorStatsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ErrorStatsServiceClientBuilder.
Returns | |
---|---|
Type | Description |
ErrorStatsServiceClient | The created ErrorStatsServiceClient. |
CreateAsync(CancellationToken)
public static Task<ErrorStatsServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a ErrorStatsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ErrorStatsServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<ErrorStatsServiceClient> | The task representing the created ErrorStatsServiceClient. |
DeleteEvents(ProjectName, CallSettings)
public virtual DeleteEventsResponse DeleteEvents(ProjectName projectName, CallSettings callSettings = null)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
DeleteEventsResponse | The RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
// Make the request
DeleteEventsResponse response = errorStatsServiceClient.DeleteEvents(projectName);
DeleteEvents(DeleteEventsRequest, CallSettings)
public virtual DeleteEventsResponse DeleteEvents(DeleteEventsRequest request, CallSettings callSettings = null)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
request | DeleteEventsRequest 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 |
DeleteEventsResponse | The RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
DeleteEventsRequest request = new DeleteEventsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
DeleteEventsResponse response = errorStatsServiceClient.DeleteEvents(request);
DeleteEvents(String, CallSettings)
public virtual DeleteEventsResponse DeleteEvents(string projectName, CallSettings callSettings = null)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
DeleteEventsResponse | The RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
// Make the request
DeleteEventsResponse response = errorStatsServiceClient.DeleteEvents(projectName);
DeleteEventsAsync(ProjectName, CallSettings)
public virtual Task<DeleteEventsResponse> DeleteEventsAsync(ProjectName projectName, CallSettings callSettings = null)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<DeleteEventsResponse> | A Task containing the RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
// Make the request
DeleteEventsResponse response = await errorStatsServiceClient.DeleteEventsAsync(projectName);
DeleteEventsAsync(ProjectName, CancellationToken)
public virtual Task<DeleteEventsResponse> DeleteEventsAsync(ProjectName projectName, CancellationToken cancellationToken)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<DeleteEventsResponse> | A Task containing the RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
// Make the request
DeleteEventsResponse response = await errorStatsServiceClient.DeleteEventsAsync(projectName);
DeleteEventsAsync(DeleteEventsRequest, CallSettings)
public virtual Task<DeleteEventsResponse> DeleteEventsAsync(DeleteEventsRequest request, CallSettings callSettings = null)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
request | DeleteEventsRequest 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 |
Task<DeleteEventsResponse> | A Task containing the RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteEventsRequest request = new DeleteEventsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
DeleteEventsResponse response = await errorStatsServiceClient.DeleteEventsAsync(request);
DeleteEventsAsync(DeleteEventsRequest, CancellationToken)
public virtual Task<DeleteEventsResponse> DeleteEventsAsync(DeleteEventsRequest request, CancellationToken cancellationToken)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
request | DeleteEventsRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<DeleteEventsResponse> | A Task containing the RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteEventsRequest request = new DeleteEventsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
DeleteEventsResponse response = await errorStatsServiceClient.DeleteEventsAsync(request);
DeleteEventsAsync(String, CallSettings)
public virtual Task<DeleteEventsResponse> DeleteEventsAsync(string projectName, CallSettings callSettings = null)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<DeleteEventsResponse> | A Task containing the RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
// Make the request
DeleteEventsResponse response = await errorStatsServiceClient.DeleteEventsAsync(projectName);
DeleteEventsAsync(String, CancellationToken)
public virtual Task<DeleteEventsResponse> DeleteEventsAsync(string projectName, CancellationToken cancellationToken)
Deletes all error events of a given project.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<DeleteEventsResponse> | A Task containing the RPC response. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
// Make the request
DeleteEventsResponse response = await errorStatsServiceClient.DeleteEventsAsync(projectName);
ListEvents(ProjectName, String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListEventsResponse, ErrorEvent> ListEvents(ProjectName projectName, string groupId, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified events.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: |
groupId | String Required. The group for which events shall be returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListEventsResponse, ErrorEvent> | A pageable sequence of ErrorEvent resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
string groupId = "";
// Make the request
PagedEnumerable<ListEventsResponse, ErrorEvent> response = errorStatsServiceClient.ListEvents(projectName, groupId);
// Iterate over all response items, lazily performing RPCs as required
foreach (ErrorEvent 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 (ListEventsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorEvent 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<ErrorEvent> 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 (ErrorEvent 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;
ListEvents(ListEventsRequest, CallSettings)
public virtual PagedEnumerable<ListEventsResponse, ErrorEvent> ListEvents(ListEventsRequest request, CallSettings callSettings = null)
Lists the specified events.
Parameters | |
---|---|
Name | Description |
request | ListEventsRequest 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 |
PagedEnumerable<ListEventsResponse, ErrorEvent> | A pageable sequence of ErrorEvent resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
ListEventsRequest request = new ListEventsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
GroupId = "",
ServiceFilter = new ServiceContextFilter(),
TimeRange = new QueryTimeRange(),
};
// Make the request
PagedEnumerable<ListEventsResponse, ErrorEvent> response = errorStatsServiceClient.ListEvents(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (ErrorEvent 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 (ListEventsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorEvent 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<ErrorEvent> 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 (ErrorEvent 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;
ListEvents(String, String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListEventsResponse, ErrorEvent> ListEvents(string projectName, string groupId, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified events.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: |
groupId | String Required. The group for which events shall be returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListEventsResponse, ErrorEvent> | A pageable sequence of ErrorEvent resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
string groupId = "";
// Make the request
PagedEnumerable<ListEventsResponse, ErrorEvent> response = errorStatsServiceClient.ListEvents(projectName, groupId);
// Iterate over all response items, lazily performing RPCs as required
foreach (ErrorEvent 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 (ListEventsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorEvent 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<ErrorEvent> 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 (ErrorEvent 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;
ListEventsAsync(ProjectName, String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> ListEventsAsync(ProjectName projectName, string groupId, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified events.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: |
groupId | String Required. The group for which events shall be returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> | A pageable asynchronous sequence of ErrorEvent resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
string groupId = "";
// Make the request
PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> response = errorStatsServiceClient.ListEventsAsync(projectName, groupId);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ErrorEvent 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((ListEventsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorEvent 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<ErrorEvent> 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 (ErrorEvent 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;
ListEventsAsync(ListEventsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> ListEventsAsync(ListEventsRequest request, CallSettings callSettings = null)
Lists the specified events.
Parameters | |
---|---|
Name | Description |
request | ListEventsRequest 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 |
PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> | A pageable asynchronous sequence of ErrorEvent resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
ListEventsRequest request = new ListEventsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
GroupId = "",
ServiceFilter = new ServiceContextFilter(),
TimeRange = new QueryTimeRange(),
};
// Make the request
PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> response = errorStatsServiceClient.ListEventsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ErrorEvent 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((ListEventsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorEvent 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<ErrorEvent> 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 (ErrorEvent 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;
ListEventsAsync(String, String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> ListEventsAsync(string projectName, string groupId, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified events.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: |
groupId | String Required. The group for which events shall be returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> | A pageable asynchronous sequence of ErrorEvent resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
string groupId = "";
// Make the request
PagedAsyncEnumerable<ListEventsResponse, ErrorEvent> response = errorStatsServiceClient.ListEventsAsync(projectName, groupId);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ErrorEvent 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((ListEventsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorEvent 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<ErrorEvent> 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 (ErrorEvent 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;
ListGroupStats(ProjectName, QueryTimeRange, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> ListGroupStats(ProjectName projectName, QueryTimeRange timeRange, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified groups.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Examples: |
timeRange | QueryTimeRange Optional. List data for the given time range. If not set, a default time range is used. The field <code>time_range_begin</code> in the response will specify the beginning of this time range. Only <code>ErrorGroupStats</code> with a non-zero count in the given time range are returned, unless the request contains an explicit <code>group_id</code> list. If a <code>group_id</code> list is given, also <code>ErrorGroupStats</code> with zero occurrences are returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> | A pageable sequence of ErrorGroupStats resources. |
ErrorStatsServiceClient client = ErrorStatsServiceClient.Create();
ProjectName projectName = new ProjectName(projectId);
PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> groupStats = client.ListGroupStats(
projectName,
new QueryTimeRange { Period = Period._30Days });
foreach (ErrorGroupStats item in groupStats)
{
// Sample output: Group: 8002882452986879952; Count: 6; Services: SampleApp/1.0.0
IEnumerable<string> services = item.AffectedServices.Select(s => $"{s.Service}/{s.Version}");
Console.WriteLine($"Group: {item.Group.GroupId}; Count: {item.Count}; Services: {string.Join(", ", services)}");
}
ListGroupStats(ListGroupStatsRequest, CallSettings)
public virtual PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> ListGroupStats(ListGroupStatsRequest request, CallSettings callSettings = null)
Lists the specified groups.
Parameters | |
---|---|
Name | Description |
request | ListGroupStatsRequest 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 |
PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> | A pageable sequence of ErrorGroupStats resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
ListGroupStatsRequest request = new ListGroupStatsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
GroupId = { "", },
ServiceFilter = new ServiceContextFilter(),
TimeRange = new QueryTimeRange(),
TimedCountDuration = new Duration(),
Alignment = TimedCountAlignment.ErrorCountAlignmentUnspecified,
AlignmentTime = new Timestamp(),
Order = ErrorGroupOrder.GroupOrderUnspecified,
};
// Make the request
PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> response = errorStatsServiceClient.ListGroupStats(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (ErrorGroupStats 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 (ListGroupStatsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorGroupStats 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<ErrorGroupStats> 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 (ErrorGroupStats 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;
ListGroupStats(String, QueryTimeRange, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> ListGroupStats(string projectName, QueryTimeRange timeRange, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified groups.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Examples: |
timeRange | QueryTimeRange Optional. List data for the given time range. If not set, a default time range is used. The field <code>time_range_begin</code> in the response will specify the beginning of this time range. Only <code>ErrorGroupStats</code> with a non-zero count in the given time range are returned, unless the request contains an explicit <code>group_id</code> list. If a <code>group_id</code> list is given, also <code>ErrorGroupStats</code> with zero occurrences are returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> | A pageable sequence of ErrorGroupStats resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.Create();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
QueryTimeRange timeRange = new QueryTimeRange();
// Make the request
PagedEnumerable<ListGroupStatsResponse, ErrorGroupStats> response = errorStatsServiceClient.ListGroupStats(projectName, timeRange);
// Iterate over all response items, lazily performing RPCs as required
foreach (ErrorGroupStats 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 (ListGroupStatsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorGroupStats 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<ErrorGroupStats> 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 (ErrorGroupStats 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;
ListGroupStatsAsync(ProjectName, QueryTimeRange, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> ListGroupStatsAsync(ProjectName projectName, QueryTimeRange timeRange, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified groups.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Examples: |
timeRange | QueryTimeRange Optional. List data for the given time range. If not set, a default time range is used. The field <code>time_range_begin</code> in the response will specify the beginning of this time range. Only <code>ErrorGroupStats</code> with a non-zero count in the given time range are returned, unless the request contains an explicit <code>group_id</code> list. If a <code>group_id</code> list is given, also <code>ErrorGroupStats</code> with zero occurrences are returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> | A pageable asynchronous sequence of ErrorGroupStats resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
QueryTimeRange timeRange = new QueryTimeRange();
// Make the request
PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> response = errorStatsServiceClient.ListGroupStatsAsync(projectName, timeRange);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ErrorGroupStats 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((ListGroupStatsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorGroupStats 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<ErrorGroupStats> 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 (ErrorGroupStats 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;
ListGroupStatsAsync(ListGroupStatsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> ListGroupStatsAsync(ListGroupStatsRequest request, CallSettings callSettings = null)
Lists the specified groups.
Parameters | |
---|---|
Name | Description |
request | ListGroupStatsRequest 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 |
PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> | A pageable asynchronous sequence of ErrorGroupStats resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
ListGroupStatsRequest request = new ListGroupStatsRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
GroupId = { "", },
ServiceFilter = new ServiceContextFilter(),
TimeRange = new QueryTimeRange(),
TimedCountDuration = new Duration(),
Alignment = TimedCountAlignment.ErrorCountAlignmentUnspecified,
AlignmentTime = new Timestamp(),
Order = ErrorGroupOrder.GroupOrderUnspecified,
};
// Make the request
PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> response = errorStatsServiceClient.ListGroupStatsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ErrorGroupStats 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((ListGroupStatsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorGroupStats 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<ErrorGroupStats> 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 (ErrorGroupStats 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;
ListGroupStatsAsync(String, QueryTimeRange, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> ListGroupStatsAsync(string projectName, QueryTimeRange timeRange, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the specified groups.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Examples: |
timeRange | QueryTimeRange Optional. List data for the given time range. If not set, a default time range is used. The field <code>time_range_begin</code> in the response will specify the beginning of this time range. Only <code>ErrorGroupStats</code> with a non-zero count in the given time range are returned, unless the request contains an explicit <code>group_id</code> list. If a <code>group_id</code> list is given, also <code>ErrorGroupStats</code> with zero occurrences are returned. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> | A pageable asynchronous sequence of ErrorGroupStats resources. |
// Create client
ErrorStatsServiceClient errorStatsServiceClient = await ErrorStatsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
QueryTimeRange timeRange = new QueryTimeRange();
// Make the request
PagedAsyncEnumerable<ListGroupStatsResponse, ErrorGroupStats> response = errorStatsServiceClient.ListGroupStatsAsync(projectName, timeRange);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ErrorGroupStats 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((ListGroupStatsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ErrorGroupStats 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<ErrorGroupStats> 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 (ErrorGroupStats 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. |
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.