logging_config.proto 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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/protobuf/empty.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "LoggingConfig";
  21. option java_package = "com.google.logging.v2";
  22. option go_package = "google.golang.org/genproto/googleapis/logging/v2";
  23. // Service for configuring sinks used to export log entries outside Stackdriver
  24. // Logging.
  25. service ConfigServiceV2 {
  26. // Lists sinks.
  27. rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) {
  28. option (google.api.http) = { get: "/v2beta1/{parent=projects/*}/sinks" };
  29. }
  30. // Gets a sink.
  31. rpc GetSink(GetSinkRequest) returns (LogSink) {
  32. option (google.api.http) = { get: "/v2beta1/{sink_name=projects/*/sinks/*}" };
  33. }
  34. // Creates a sink.
  35. rpc CreateSink(CreateSinkRequest) returns (LogSink) {
  36. option (google.api.http) = { post: "/v2beta1/{parent=projects/*}/sinks" body: "sink" };
  37. }
  38. // Creates or updates a sink.
  39. rpc UpdateSink(UpdateSinkRequest) returns (LogSink) {
  40. option (google.api.http) = { put: "/v2beta1/{sink_name=projects/*/sinks/*}" body: "sink" };
  41. }
  42. // Deletes a sink.
  43. rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) {
  44. option (google.api.http) = { delete: "/v2beta1/{sink_name=projects/*/sinks/*}" };
  45. }
  46. }
  47. // Describes a sink used to export log entries outside Stackdriver Logging.
  48. message LogSink {
  49. // Available log entry formats. Log entries can be written to Cloud
  50. // Logging in either format and can be exported in either format.
  51. // Version 2 is the preferred format.
  52. enum VersionFormat {
  53. // An unspecified version format will default to V2.
  54. VERSION_FORMAT_UNSPECIFIED = 0;
  55. // `LogEntry` version 2 format.
  56. V2 = 1;
  57. // `LogEntry` version 1 format.
  58. V1 = 2;
  59. }
  60. // Required. The client-assigned sink identifier. Example:
  61. // `"my-severe-errors-to-pubsub"`.
  62. // Sink identifiers are limited to 1000 characters
  63. // and can include only the following characters: `A-Z`, `a-z`,
  64. // `0-9`, and the special characters `_-.`.
  65. string name = 1;
  66. // The export destination. See
  67. // [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
  68. // Examples: `"storage.googleapis.com/a-bucket"`,
  69. // `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
  70. string destination = 3;
  71. // An [advanced logs filter](/logging/docs/view/advanced_filters). Only
  72. // log entries matching that filter are exported. The filter must be
  73. // consistent with the log entry format specified by the
  74. // `outputVersionFormat` parameter, regardless of the format of the
  75. // log entry that was originally written to Stackdriver Logging.
  76. // Example (V2 format):
  77. // `"logName=projects/my-projectid/logs/syslog AND severity>=ERROR"`.
  78. string filter = 5;
  79. // The log entry version to use for this sink's exported log entries.
  80. // This version does not have to correspond to the version of the log entry
  81. // when it was written to Stackdriver Logging.
  82. VersionFormat output_version_format = 6;
  83. }
  84. // The parameters to `ListSinks`.
  85. message ListSinksRequest {
  86. // Required. The resource name containing the sinks.
  87. // Example: `"projects/my-logging-project"`.
  88. string parent = 1;
  89. // Optional. If the `pageToken` parameter is supplied, then the next page of
  90. // results is retrieved. The `pageToken` parameter must be set to the value
  91. // of the `nextPageToken` from the previous response.
  92. // The value of `parent` must be the same as in the previous request.
  93. string page_token = 2;
  94. // Optional. The maximum number of results to return from this request.
  95. // You must check for presence of `nextPageToken` to determine if additional
  96. // results are available, which you can retrieve by passing the
  97. // `nextPageToken` value as the `pageToken` parameter in the next request.
  98. int32 page_size = 3;
  99. }
  100. // Result returned from `ListSinks`.
  101. message ListSinksResponse {
  102. // A list of sinks.
  103. repeated LogSink sinks = 1;
  104. // If there are more results than were returned, then `nextPageToken` is
  105. // included in the response. To get the next set of results, call this
  106. // method again using the value of `nextPageToken` as `pageToken`.
  107. string next_page_token = 2;
  108. }
  109. // The parameters to `GetSink`.
  110. message GetSinkRequest {
  111. // The resource name of the sink to return.
  112. // Example: `"projects/my-project-id/sinks/my-sink-id"`.
  113. string sink_name = 1;
  114. }
  115. // The parameters to `CreateSink`.
  116. message CreateSinkRequest {
  117. // The resource in which to create the sink.
  118. // Example: `"projects/my-project-id"`.
  119. //
  120. // The new sink must be provided in the request.
  121. string parent = 1;
  122. // The new sink, which must not have an identifier that already
  123. // exists.
  124. LogSink sink = 2;
  125. }
  126. // The parameters to `UpdateSink`.
  127. message UpdateSinkRequest {
  128. // The resource name of the sink to update.
  129. // Example: `"projects/my-project-id/sinks/my-sink-id"`.
  130. //
  131. // The updated sink must be provided in the request and have the
  132. // same name that is specified in `sinkName`. If the sink does not
  133. // exist, it is created.
  134. string sink_name = 1;
  135. // The updated sink, whose name must be the same as the sink
  136. // identifier in `sinkName`. If `sinkName` does not exist, then
  137. // this method creates a new sink.
  138. LogSink sink = 2;
  139. }
  140. // The parameters to `DeleteSink`.
  141. message DeleteSinkRequest {
  142. // The resource name of the sink to delete.
  143. // Example: `"projects/my-project-id/sinks/my-sink-id"`.
  144. string sink_name = 1;
  145. }