diff --git a/google/cloud/errorreporting_v1beta1/proto/common.proto b/google/cloud/errorreporting_v1beta1/proto/common.proto deleted file mode 100644 index e9bb321e..00000000 --- a/google/cloud/errorreporting_v1beta1/proto/common.proto +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.devtools.clouderrorreporting.v1beta1; - -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.devtools.clouderrorreporting.v1beta1"; -option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1"; -option ruby_package = "Google::Cloud::ErrorReporting::V1beta1"; - -// Description of a group of similar error events. -message ErrorGroup { - option (google.api.resource) = { - type: "clouderrorreporting.googleapis.com/ErrorGroup" - pattern: "projects/{project}/groups/{group}" - }; - - // The group resource name. - // Example: projects/my-project-123/groups/CNSgkpnppqKCUw - string name = 1; - - // Group IDs are unique for a given project. If the same kind of error - // occurs in different service contexts, it will receive the same group ID. - string group_id = 2; - - // Associated tracking issues. - repeated TrackingIssue tracking_issues = 3; - - // Error group's resolution status. - // An unspecified resolution status will be interpreted as OPEN - ResolutionStatus resolution_status = 5; -} - -// Information related to tracking the progress on resolving the error. -message TrackingIssue { - // A URL pointing to a related entry in an issue tracking system. - // Example: `https://github.com/user/project/issues/4` - string url = 1; -} - -// An error event which is returned by the Error Reporting system. -message ErrorEvent { - // Time when the event occurred as provided in the error report. - // If the report did not contain a timestamp, the time the error was received - // by the Error Reporting system is used. - google.protobuf.Timestamp event_time = 1; - - // The `ServiceContext` for which this error was reported. - ServiceContext service_context = 2; - - // The stack trace that was reported or logged by the service. - string message = 3; - - // Data about the context in which the error occurred. - ErrorContext context = 5; -} - -// Describes a running service that sends errors. -// Its version changes over time and multiple versions can run in parallel. -message ServiceContext { - // An identifier of the service, such as the name of the - // executable, job, or Google App Engine service name. This field is expected - // to have a low number of values that are relatively stable over time, as - // opposed to `version`, which can be changed whenever new code is deployed. - // - // Contains the service name for error reports extracted from Google - // App Engine logs or `default` if the App Engine default service is used. - string service = 2; - - // Represents the source code version that the developer provided, - // which could represent a version label or a Git SHA-1 hash, for example. - // For App Engine standard environment, the version is set to the version of - // the app. - string version = 3; - - // Type of the MonitoredResource. List of possible values: - // https://cloud.google.com/monitoring/api/resources - // - // Value is set automatically for incoming errors and must not be set when - // reporting errors. - string resource_type = 4; -} - -// A description of the context in which an error occurred. -// This data should be provided by the application when reporting an error, -// unless the -// error report has been generated automatically from Google App Engine logs. -message ErrorContext { - // The HTTP request which was processed when the error was - // triggered. - HttpRequestContext http_request = 1; - - // The user who caused or was affected by the crash. - // This can be a user ID, an email address, or an arbitrary token that - // uniquely identifies the user. - // When sending an error report, leave this field empty if the user was not - // logged in. In this case the - // Error Reporting system will use other data, such as remote IP address, to - // distinguish affected users. See `affected_users_count` in - // `ErrorGroupStats`. - string user = 2; - - // The location in the source code where the decision was made to - // report the error, usually the place where it was logged. - // For a logged exception this would be the source line where the - // exception is logged, usually close to the place where it was - // caught. - SourceLocation report_location = 3; -} - -// HTTP request data that is related to a reported error. -// This data should be provided by the application when reporting an error, -// unless the -// error report has been generated automatically from Google App Engine logs. -message HttpRequestContext { - // The type of HTTP request, such as `GET`, `POST`, etc. - string method = 1; - - // The URL of the request. - string url = 2; - - // The user agent information that is provided with the request. - string user_agent = 3; - - // The referrer information that is provided with the request. - string referrer = 4; - - // The HTTP response status code for the request. - int32 response_status_code = 5; - - // The IP address from which the request originated. - // This can be IPv4, IPv6, or a token which is derived from the - // IP address, depending on the data that has been provided - // in the error report. - string remote_ip = 6; -} - -// Indicates a location in the source code of the service for which errors are -// reported. `functionName` must be provided by the application when reporting -// an error, unless the error report contains a `message` with a supported -// exception stack trace. All fields are optional for the later case. -message SourceLocation { - // The source code filename, which can include a truncated relative - // path, or a full path from a production machine. - string file_path = 1; - - // 1-based. 0 indicates that the line number is unknown. - int32 line_number = 2; - - // Human-readable name of a function or method. - // The value can include optional context like the class or package name. - // For example, `my.package.MyClass.method` in case of Java. - string function_name = 4; -} - -// Resolution status of an error group. -enum ResolutionStatus { - // Status is unknown. When left unspecified in requests, it is treated like - // OPEN. - RESOLUTION_STATUS_UNSPECIFIED = 0; - - // The error group is not being addressed. This is the default for - // new groups. It is also used for errors re-occurring after marked RESOLVED. - OPEN = 1; - - // Error Group manually acknowledged, it can have an issue link attached. - ACKNOWLEDGED = 2; - - // Error Group manually resolved, more events for this group are not expected - // to occur. - RESOLVED = 3; - - // The error group is muted and excluded by default on group stats requests. - MUTED = 4; -} diff --git a/google/cloud/errorreporting_v1beta1/proto/error_group_service.proto b/google/cloud/errorreporting_v1beta1/proto/error_group_service.proto deleted file mode 100644 index 0104b62d..00000000 --- a/google/cloud/errorreporting_v1beta1/proto/error_group_service.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.devtools.clouderrorreporting.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/devtools/clouderrorreporting/v1beta1/common.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting"; -option java_multiple_files = true; -option java_outer_classname = "ErrorGroupServiceProto"; -option java_package = "com.google.devtools.clouderrorreporting.v1beta1"; -option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1"; -option ruby_package = "Google::Cloud::ErrorReporting::V1beta1"; - -// Service for retrieving and updating individual error groups. -service ErrorGroupService { - option (google.api.default_host) = "clouderrorreporting.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Get the specified group. - rpc GetGroup(GetGroupRequest) returns (ErrorGroup) { - option (google.api.http) = { - get: "/v1beta1/{group_name=projects/*/groups/*}" - }; - option (google.api.method_signature) = "group_name"; - } - - // Replace the data for the specified group. - // Fails if the group does not exist. - rpc UpdateGroup(UpdateGroupRequest) returns (ErrorGroup) { - option (google.api.http) = { - put: "/v1beta1/{group.name=projects/*/groups/*}" - body: "group" - }; - option (google.api.method_signature) = "group"; - } -} - -// A request to return an individual group. -message GetGroupRequest { - // Required. The group resource name. Written as - // `projects/{projectID}/groups/{group_name}`. Call - // [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list) - // to return a list of groups belonging to this project. - // - // Example: `projects/my-project-123/groups/my-group` - string group_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "clouderrorreporting.googleapis.com/ErrorGroup" - } - ]; -} - -// A request to replace the existing data for the given group. -message UpdateGroupRequest { - // Required. The group which replaces the resource on the server. - ErrorGroup group = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/google/cloud/errorreporting_v1beta1/proto/error_stats_service.proto b/google/cloud/errorreporting_v1beta1/proto/error_stats_service.proto deleted file mode 100644 index 6c62edd9..00000000 --- a/google/cloud/errorreporting_v1beta1/proto/error_stats_service.proto +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.devtools.clouderrorreporting.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/devtools/clouderrorreporting/v1beta1/common.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting"; -option java_multiple_files = true; -option java_outer_classname = "ErrorStatsServiceProto"; -option java_package = "com.google.devtools.clouderrorreporting.v1beta1"; -option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1"; -option ruby_package = "Google::Cloud::ErrorReporting::V1beta1"; - -// An API for retrieving and managing error statistics as well as data for -// individual events. -service ErrorStatsService { - option (google.api.default_host) = "clouderrorreporting.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists the specified groups. - rpc ListGroupStats(ListGroupStatsRequest) returns (ListGroupStatsResponse) { - option (google.api.http) = { - get: "/v1beta1/{project_name=projects/*}/groupStats" - }; - option (google.api.method_signature) = "project_name,time_range"; - } - - // Lists the specified events. - rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { - option (google.api.http) = { - get: "/v1beta1/{project_name=projects/*}/events" - }; - option (google.api.method_signature) = "project_name,group_id"; - } - - // Deletes all error events of a given project. - rpc DeleteEvents(DeleteEventsRequest) returns (DeleteEventsResponse) { - option (google.api.http) = { - delete: "/v1beta1/{project_name=projects/*}/events" - }; - option (google.api.method_signature) = "project_name"; - } -} - -// Specifies a set of `ErrorGroupStats` to return. -message ListGroupStatsRequest { - // Required. The resource name of the Google Cloud Platform project. Written - // as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}` - // and `{projectNumber}` can be found in the - // [Google Cloud Console](https://support.google.com/cloud/answer/6158840). - // - // Examples: `projects/my-project-123`, `projects/5551234`. - string project_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. List all ErrorGroupStats with these IDs. - repeated string group_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List only ErrorGroupStats which belong to a service - // context that matches the filter. - // Data for all service contexts is returned if this field is not specified. - ServiceContextFilter service_filter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List data for the given time range. - // If not set, a default time range is used. The field - // time_range_begin in the response will specify the beginning - // of this time range. - // Only ErrorGroupStats with a non-zero count in the given time - // range are returned, unless the request contains an explicit - // group_id list. If a group_id list is given, also - // ErrorGroupStats with zero occurrences are returned. - QueryTimeRange time_range = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The preferred duration for a single returned `TimedCount`. - // If not set, no timed counts are returned. - google.protobuf.Duration timed_count_duration = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The alignment of the timed counts to be returned. - // Default is `ALIGNMENT_EQUAL_AT_END`. - TimedCountAlignment alignment = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Time where the timed counts shall be aligned if rounded - // alignment is chosen. Default is 00:00 UTC. - google.protobuf.Timestamp alignment_time = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The sort order in which the results are returned. - // Default is `COUNT_DESC`. - ErrorGroupOrder order = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of results to return per response. - // Default is 20. - int32 page_size = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A `next_page_token` provided by a previous response. To view - // additional results, pass this token along with the identical query - // parameters as the first request. - string page_token = 12 [(google.api.field_behavior) = OPTIONAL]; -} - -// Contains a set of requested error group stats. -message ListGroupStatsResponse { - // The error group stats which match the given request. - repeated ErrorGroupStats error_group_stats = 1; - - // If non-empty, more results are available. - // Pass this token, along with the same query parameters as the first - // request, to view the next page of results. - string next_page_token = 2; - - // The timestamp specifies the start time to which the request was restricted. - // The start time is set based on the requested time range. It may be adjusted - // to a later time if a project has exceeded the storage quota and older data - // has been deleted. - google.protobuf.Timestamp time_range_begin = 4; -} - -// Data extracted for a specific group based on certain filter criteria, -// such as a given time period and/or service filter. -message ErrorGroupStats { - // Group data that is independent of the filter criteria. - ErrorGroup group = 1; - - // Approximate total number of events in the given group that match - // the filter criteria. - int64 count = 2; - - // Approximate number of affected users in the given group that - // match the filter criteria. - // Users are distinguished by data in the `ErrorContext` of the - // individual error events, such as their login name or their remote - // IP address in case of HTTP requests. - // The number of affected users can be zero even if the number of - // errors is non-zero if no data was provided from which the - // affected user could be deduced. - // Users are counted based on data in the request - // context that was provided in the error report. If more users are - // implicitly affected, such as due to a crash of the whole service, - // this is not reflected here. - int64 affected_users_count = 3; - - // Approximate number of occurrences over time. - // Timed counts returned by ListGroups are guaranteed to be: - // - // - Inside the requested time interval - // - Non-overlapping, and - // - Ordered by ascending time. - repeated TimedCount timed_counts = 4; - - // Approximate first occurrence that was ever seen for this group - // and which matches the given filter criteria, ignoring the - // time_range that was specified in the request. - google.protobuf.Timestamp first_seen_time = 5; - - // Approximate last occurrence that was ever seen for this group and - // which matches the given filter criteria, ignoring the time_range - // that was specified in the request. - google.protobuf.Timestamp last_seen_time = 6; - - // Service contexts with a non-zero error count for the given filter - // criteria. This list can be truncated if multiple services are affected. - // Refer to `num_affected_services` for the total count. - repeated ServiceContext affected_services = 7; - - // The total number of services with a non-zero error count for the given - // filter criteria. - int32 num_affected_services = 8; - - // An arbitrary event that is chosen as representative for the whole group. - // The representative event is intended to be used as a quick preview for - // the whole group. Events in the group are usually sufficiently similar - // to each other such that showing an arbitrary representative provides - // insight into the characteristics of the group as a whole. - ErrorEvent representative = 9; -} - -// The number of errors in a given time period. -// All numbers are approximate since the error events are sampled -// before counting them. -message TimedCount { - // Approximate number of occurrences in the given time period. - int64 count = 1; - - // Start of the time period to which `count` refers (included). - google.protobuf.Timestamp start_time = 2; - - // End of the time period to which `count` refers (excluded). - google.protobuf.Timestamp end_time = 3; -} - -// Specifies how the time periods of error group counts are aligned. -enum TimedCountAlignment { - // No alignment specified. - ERROR_COUNT_ALIGNMENT_UNSPECIFIED = 0; - - // The time periods shall be consecutive, have width equal to the - // requested duration, and be aligned at the `alignment_time` provided in - // the request. - // The `alignment_time` does not have to be inside the query period but - // even if it is outside, only time periods are returned which overlap - // with the query period. - // A rounded alignment will typically result in a - // different size of the first or the last time period. - ALIGNMENT_EQUAL_ROUNDED = 1; - - // The time periods shall be consecutive, have width equal to the - // requested duration, and be aligned at the end of the requested time - // period. This can result in a different size of the - // first time period. - ALIGNMENT_EQUAL_AT_END = 2; -} - -// A sorting order of error groups. -enum ErrorGroupOrder { - // No group order specified. - GROUP_ORDER_UNSPECIFIED = 0; - - // Total count of errors in the given time window in descending order. - COUNT_DESC = 1; - - // Timestamp when the group was last seen in the given time window - // in descending order. - LAST_SEEN_DESC = 2; - - // Timestamp when the group was created in descending order. - CREATED_DESC = 3; - - // Number of affected users in the given time window in descending order. - AFFECTED_USERS_DESC = 4; -} - -// Specifies a set of error events to return. -message ListEventsRequest { - // Required. The resource name of the Google Cloud Platform project. Written - // as `projects/{projectID}`, where `{projectID}` is the - // [Google Cloud Platform project - // ID](https://support.google.com/cloud/answer/6158840). - // - // Example: `projects/my-project-123`. - string project_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The group for which events shall be returned. - string group_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. List only ErrorGroups which belong to a service context that - // matches the filter. - // Data for all service contexts is returned if this field is not specified. - ServiceContextFilter service_filter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List only data for the given time range. - // If not set a default time range is used. The field time_range_begin - // in the response will specify the beginning of this time range. - QueryTimeRange time_range = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of results to return per response. - int32 page_size = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A `next_page_token` provided by a previous response. - string page_token = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Contains a set of requested error events. -message ListEventsResponse { - // The error events which match the given request. - repeated ErrorEvent error_events = 1; - - // If non-empty, more results are available. - // Pass this token, along with the same query parameters as the first - // request, to view the next page of results. - string next_page_token = 2; - - // The timestamp specifies the start time to which the request was restricted. - google.protobuf.Timestamp time_range_begin = 4; -} - -// Requests might be rejected or the resulting timed count durations might be -// adjusted for lower durations. -message QueryTimeRange { - // The supported time ranges. - enum Period { - // Do not use. - PERIOD_UNSPECIFIED = 0; - - // Retrieve data for the last hour. - // Recommended minimum timed count duration: 1 min. - PERIOD_1_HOUR = 1; - - // Retrieve data for the last 6 hours. - // Recommended minimum timed count duration: 10 min. - PERIOD_6_HOURS = 2; - - // Retrieve data for the last day. - // Recommended minimum timed count duration: 1 hour. - PERIOD_1_DAY = 3; - - // Retrieve data for the last week. - // Recommended minimum timed count duration: 6 hours. - PERIOD_1_WEEK = 4; - - // Retrieve data for the last 30 days. - // Recommended minimum timed count duration: 1 day. - PERIOD_30_DAYS = 5; - } - - // Restricts the query to the specified time range. - Period period = 1; -} - -// Specifies criteria for filtering a subset of service contexts. -// The fields in the filter correspond to the fields in `ServiceContext`. -// Only exact, case-sensitive matches are supported. -// If a field is unset or empty, it matches arbitrary values. -message ServiceContextFilter { - // Optional. The exact value to match against - // [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). - string service = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The exact value to match against - // [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). - string version = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The exact value to match against - // [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). - string resource_type = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Deletes all events in the project. -message DeleteEventsRequest { - // Required. The resource name of the Google Cloud Platform project. Written - // as `projects/{projectID}`, where `{projectID}` is the - // [Google Cloud Platform project - // ID](https://support.google.com/cloud/answer/6158840). - // - // Example: `projects/my-project-123`. - string project_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; -} - -// Response message for deleting error events. -message DeleteEventsResponse { - -} diff --git a/google/cloud/errorreporting_v1beta1/proto/report_errors_service.proto b/google/cloud/errorreporting_v1beta1/proto/report_errors_service.proto deleted file mode 100644 index cd1e5100..00000000 --- a/google/cloud/errorreporting_v1beta1/proto/report_errors_service.proto +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.devtools.clouderrorreporting.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/devtools/clouderrorreporting/v1beta1/common.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1;clouderrorreporting"; -option java_multiple_files = true; -option java_outer_classname = "ReportErrorsServiceProto"; -option java_package = "com.google.devtools.clouderrorreporting.v1beta1"; -option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1"; -option ruby_package = "Google::Cloud::ErrorReporting::V1beta1"; - -// An API for reporting error events. -service ReportErrorsService { - option (google.api.default_host) = "clouderrorreporting.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Report an individual error event and record the event to a log. - // - // This endpoint accepts **either** an OAuth token, - // **or** an [API key](https://support.google.com/cloud/answer/6158862) - // 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](/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](/error-reporting/docs/regionalization). - rpc ReportErrorEvent(ReportErrorEventRequest) returns (ReportErrorEventResponse) { - option (google.api.http) = { - post: "/v1beta1/{project_name=projects/*}/events:report" - body: "event" - }; - option (google.api.method_signature) = "project_name,event"; - } -} - -// A request for reporting an individual error event. -message ReportErrorEventRequest { - // Required. The resource name of the Google Cloud Platform project. Written - // as `projects/{projectId}`, where `{projectId}` is the - // [Google Cloud Platform project - // ID](https://support.google.com/cloud/answer/6158840). - // - // Example: // `projects/my-project-123`. - string project_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The error event to be reported. - ReportedErrorEvent event = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for reporting an individual error event. -// Data may be added to this message in the future. -message ReportErrorEventResponse { - -} - -// An error event which is reported to the Error Reporting system. -message ReportedErrorEvent { - // Optional. Time when the event occurred. - // If not provided, the time when the event was received by the - // Error Reporting system will be used. - google.protobuf.Timestamp event_time = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The service context in which this error has occurred. - ServiceContext service_context = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The error message. - // If no `context.reportLocation` is provided, the message must contain a - // header (typically consisting of the exception type name and an error - // message) and an exception stack trace in one of the supported programming - // languages and formats. - // Supported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go. - // Supported stack trace formats are: - // - // * **Java**: Must be the return value of - // [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29). - // * **Python**: Must be the return value of - // [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc). - // * **JavaScript**: Must be the value of - // [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) as returned - // by V8. - // * **Ruby**: Must contain frames returned by - // [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace). - // * **C#**: Must be the return value of - // [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx). - // * **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)` - // and contain the result of - // [`(string)$exception`](http://php.net/manual/en/exception.tostring.php). - // * **Go**: Must be the return value of - // [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack). - string message = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A description of the context in which the error occurred. - ErrorContext context = 4 [(google.api.field_behavior) = OPTIONAL]; -}