logging.proto 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. // Copyright 2016 Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.logging.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/monitored_resource.proto";
  18. import "google/logging/v2/log_entry.proto";
  19. import "google/protobuf/duration.proto";
  20. import "google/protobuf/empty.proto";
  21. import "google/protobuf/timestamp.proto";
  22. import "google/rpc/status.proto";
  23. option cc_enable_arenas = true;
  24. option java_multiple_files = true;
  25. option java_outer_classname = "LoggingProto";
  26. option java_package = "com.google.logging.v2";
  27. option go_package = "google.golang.org/genproto/googleapis/logging/v2";
  28. // Service for ingesting and querying logs.
  29. service LoggingServiceV2 {
  30. // Deletes a log and all its log entries.
  31. // The log will reappear if it receives new entries.
  32. //
  33. rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) {
  34. option (google.api.http) = { delete: "/v2beta1/{log_name=projects/*/logs/*}" };
  35. }
  36. // Writes log entries to Stackdriver Logging. All log entries are
  37. // written by this method.
  38. //
  39. rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse) {
  40. option (google.api.http) = { post: "/v2beta1/entries:write" body: "*" };
  41. }
  42. // Lists log entries. Use this method to retrieve log entries from Cloud
  43. // Logging. For ways to export log entries, see
  44. // [Exporting Logs](/logging/docs/export).
  45. //
  46. rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse) {
  47. option (google.api.http) = { post: "/v2beta1/entries:list" body: "*" };
  48. }
  49. // Lists the monitored resource descriptors used by Stackdriver Logging.
  50. rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) {
  51. option (google.api.http) = { get: "/v2beta1/monitoredResourceDescriptors" };
  52. }
  53. }
  54. // The parameters to DeleteLog.
  55. message DeleteLogRequest {
  56. // Required. The resource name of the log to delete. Example:
  57. // `"projects/my-project/logs/syslog"`.
  58. string log_name = 1;
  59. }
  60. // The parameters to WriteLogEntries.
  61. message WriteLogEntriesRequest {
  62. // Optional. A default log resource name for those log entries in `entries`
  63. // that do not specify their own `logName`. Example:
  64. // `"projects/my-project/logs/syslog"`. See
  65. // [LogEntry][google.logging.v2.LogEntry].
  66. string log_name = 1;
  67. // Optional. A default monitored resource for those log entries in `entries`
  68. // that do not specify their own `resource`.
  69. google.api.MonitoredResource resource = 2;
  70. // Optional. User-defined `key:value` items that are added to
  71. // the `labels` field of each log entry in `entries`, except when a log
  72. // entry specifies its own `key:value` item with the same key.
  73. // Example: `{ "size": "large", "color":"red" }`
  74. map<string, string> labels = 3;
  75. // Required. The log entries to write. The log entries must have values for
  76. // all required fields.
  77. //
  78. // To improve throughput and to avoid exceeding the quota limit for calls
  79. // to `entries.write`, use this field to write multiple log entries at once
  80. // rather than // calling this method for each log entry.
  81. repeated LogEntry entries = 4;
  82. // Optional. Whether valid entries should be written even if some other
  83. // entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
  84. // entry is not written, the response status will be the error associated
  85. // with one of the failed entries and include error details in the form of
  86. // WriteLogEntriesPartialErrors.
  87. bool partial_success = 5;
  88. }
  89. // Result returned from WriteLogEntries.
  90. // empty
  91. message WriteLogEntriesResponse {
  92. }
  93. // The parameters to `ListLogEntries`.
  94. message ListLogEntriesRequest {
  95. // Required. One or more project IDs or project numbers from which to retrieve
  96. // log entries. Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
  97. repeated string project_ids = 1;
  98. // Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
  99. // The filter is compared against all log entries in the projects specified by
  100. // `projectIds`. Only entries that match the filter are retrieved. An empty
  101. // filter matches all log entries.
  102. string filter = 2;
  103. // Optional. How the results should be sorted. Presently, the only permitted
  104. // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
  105. // option returns entries in order of increasing values of
  106. // `LogEntry.timestamp` (oldest first), and the second option returns entries
  107. // in order of decreasing timestamps (newest first). Entries with equal
  108. // timestamps are returned in order of `LogEntry.insertId`.
  109. string order_by = 3;
  110. // Optional. The maximum number of results to return from this request.
  111. // You must check for presence of `nextPageToken` to determine if additional
  112. // results are available, which you can retrieve by passing the
  113. // `nextPageToken` value as the `pageToken` parameter in the next request.
  114. int32 page_size = 4;
  115. // Optional. If the `pageToken` parameter is supplied, then the next page of
  116. // results is retrieved. The `pageToken` parameter must be set to the value
  117. // of the `nextPageToken` from the previous response.
  118. // The values of `projectIds`, `filter`, and `orderBy` must be the same
  119. // as in the previous request.
  120. string page_token = 5;
  121. }
  122. // Result returned from `ListLogEntries`.
  123. message ListLogEntriesResponse {
  124. // A list of log entries.
  125. repeated LogEntry entries = 1;
  126. // If there are more results than were returned, then `nextPageToken` is
  127. // included in the response. To get the next set of results, call this
  128. // method again using the value of `nextPageToken` as `pageToken`.
  129. string next_page_token = 2;
  130. }
  131. // The parameters to ListMonitoredResourceDescriptors
  132. message ListMonitoredResourceDescriptorsRequest {
  133. // Optional. The maximum number of results to return from this request.
  134. // You must check for presence of `nextPageToken` to determine if additional
  135. // results are available, which you can retrieve by passing the
  136. // `nextPageToken` value as the `pageToken` parameter in the next request.
  137. int32 page_size = 1;
  138. // Optional. If the `pageToken` parameter is supplied, then the next page of
  139. // results is retrieved. The `pageToken` parameter must be set to the value
  140. // of the `nextPageToken` from the previous response.
  141. string page_token = 2;
  142. }
  143. // Result returned from ListMonitoredResourceDescriptors.
  144. message ListMonitoredResourceDescriptorsResponse {
  145. // A list of resource descriptors.
  146. repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1;
  147. // If there are more results than were returned, then `nextPageToken` is
  148. // included in the response. To get the next set of results, call this
  149. // method again using the value of `nextPageToken` as `pageToken`.
  150. string next_page_token = 2;
  151. }