public abstract class ReportErrorsServiceClient
ReportErrorsService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.ErrorReporting.V1Beta1Assembly
Google.Cloud.ErrorReporting.V1Beta1.dll
Remarks
An API for reporting error events.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the ReportErrorsService 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 ReportErrorsService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default ReportErrorsService scopes are:
GrpcClient
public virtual ReportErrorsService.ReportErrorsServiceClient GrpcClient { get; }
The underlying gRPC ReportErrorsService client
Property Value | |
---|---|
Type | Description |
ReportErrorsService.ReportErrorsServiceClient |
Methods
Create()
public static ReportErrorsServiceClient Create()
Synchronously creates a ReportErrorsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ReportErrorsServiceClientBuilder.
Returns | |
---|---|
Type | Description |
ReportErrorsServiceClient | The created ReportErrorsServiceClient. |
CreateAsync(CancellationToken)
public static Task<ReportErrorsServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a ReportErrorsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ReportErrorsServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<ReportErrorsServiceClient> | The task representing the created ReportErrorsServiceClient. |
ReportErrorEvent(ProjectName, ReportedErrorEvent, CallSettings)
public virtual ReportErrorEventResponse ReportErrorEvent(ProjectName projectName, ReportedErrorEvent event, CallSettings callSettings = null)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: // |
event | ReportedErrorEvent Required. The error event to be reported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ReportErrorEventResponse | The RPC response. |
ReportErrorsServiceClient client = ReportErrorsServiceClient.Create();
ProjectName projectName = new ProjectName(projectId);
ReportedErrorEvent error = new ReportedErrorEvent
{
Context = new ErrorContext
{
ReportLocation = new SourceLocation
{
FilePath = "SampleApp.BusinessLogic/ComplexLogic.cs",
FunctionName = "ComputeTrickyAnswer",
LineNumber = 100
},
User = "userid"
},
// If this is a stack trace, the service will parse it.
Message = "Computation failed",
EventTime = Timestamp.FromDateTime(DateTime.UtcNow),
ServiceContext = new ServiceContext
{
Service = "SampleApp",
Version = "1.0.0"
}
};
client.ReportErrorEvent(projectName, error);
ReportErrorEvent(ReportErrorEventRequest, CallSettings)
public virtual ReportErrorEventResponse ReportErrorEvent(ReportErrorEventRequest request, CallSettings callSettings = null)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
request | ReportErrorEventRequest 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 |
ReportErrorEventResponse | The RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = ReportErrorsServiceClient.Create();
// Initialize request argument(s)
ReportErrorEventRequest request = new ReportErrorEventRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
Event = new ReportedErrorEvent(),
};
// Make the request
ReportErrorEventResponse response = reportErrorsServiceClient.ReportErrorEvent(request);
ReportErrorEvent(String, ReportedErrorEvent, CallSettings)
public virtual ReportErrorEventResponse ReportErrorEvent(string projectName, ReportedErrorEvent event, CallSettings callSettings = null)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: // |
event | ReportedErrorEvent Required. The error event to be reported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ReportErrorEventResponse | The RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = ReportErrorsServiceClient.Create();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = reportErrorsServiceClient.ReportErrorEvent(projectName, @event);
ReportErrorEventAsync(ProjectName, ReportedErrorEvent, CallSettings)
public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ProjectName projectName, ReportedErrorEvent event, CallSettings callSettings = null)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: // |
event | ReportedErrorEvent Required. The error event to be reported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ReportErrorEventResponse> | A Task containing the RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);
ReportErrorEventAsync(ProjectName, ReportedErrorEvent, CancellationToken)
public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ProjectName projectName, ReportedErrorEvent event, CancellationToken cancellationToken)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
projectName | ProjectName Required. The resource name of the Google Cloud Platform project. Written
as Example: // |
event | ReportedErrorEvent Required. The error event to be reported. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ReportErrorEventResponse> | A Task containing the RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);
ReportErrorEventAsync(ReportErrorEventRequest, CallSettings)
public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ReportErrorEventRequest request, CallSettings callSettings = null)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
request | ReportErrorEventRequest 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<ReportErrorEventResponse> | A Task containing the RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ReportErrorEventRequest request = new ReportErrorEventRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
Event = new ReportedErrorEvent(),
};
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(request);
ReportErrorEventAsync(ReportErrorEventRequest, CancellationToken)
public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ReportErrorEventRequest request, CancellationToken cancellationToken)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
request | ReportErrorEventRequest 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<ReportErrorEventResponse> | A Task containing the RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ReportErrorEventRequest request = new ReportErrorEventRequest
{
ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
Event = new ReportedErrorEvent(),
};
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(request);
ReportErrorEventAsync(String, ReportedErrorEvent, CallSettings)
public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(string projectName, ReportedErrorEvent event, CallSettings callSettings = null)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: // |
event | ReportedErrorEvent Required. The error event to be reported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ReportErrorEventResponse> | A Task containing the RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);
ReportErrorEventAsync(String, ReportedErrorEvent, CancellationToken)
public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(string projectName, ReportedErrorEvent event, CancellationToken cancellationToken)
Report an individual error event and record the event to a log.
This endpoint accepts either an OAuth token,
or an API key
for authentication. To use an API key, append it to the URL as the value of
a key
parameter. For example:
POST
https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456
Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.
For more information, see Using Error Reporting with regionalized logs.
Parameters | |
---|---|
Name | Description |
projectName | String Required. The resource name of the Google Cloud Platform project. Written
as Example: // |
event | ReportedErrorEvent Required. The error event to be reported. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ReportErrorEventResponse> | A Task containing the RPC response. |
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);
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.