logging_metrics.proto 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. option java_multiple_files = true;
  19. option java_package = "com.google.logging.v2";
  20. option go_package = "google.golang.org/genproto/googleapis/logging/v2";
  21. // Service for configuring logs-based metrics.
  22. service MetricsServiceV2 {
  23. // Lists logs-based metrics.
  24. rpc ListLogMetrics(ListLogMetricsRequest) returns (ListLogMetricsResponse) {
  25. option (google.api.http) = { get: "/v2beta1/{parent=projects/*}/metrics" };
  26. }
  27. // Gets a logs-based metric.
  28. rpc GetLogMetric(GetLogMetricRequest) returns (LogMetric) {
  29. option (google.api.http) = { get: "/v2beta1/{metric_name=projects/*/metrics/*}" };
  30. }
  31. // Creates a logs-based metric.
  32. rpc CreateLogMetric(CreateLogMetricRequest) returns (LogMetric) {
  33. option (google.api.http) = { post: "/v2beta1/{parent=projects/*}/metrics" body: "metric" };
  34. }
  35. // Creates or updates a logs-based metric.
  36. rpc UpdateLogMetric(UpdateLogMetricRequest) returns (LogMetric) {
  37. option (google.api.http) = { put: "/v2beta1/{metric_name=projects/*/metrics/*}" body: "metric" };
  38. }
  39. // Deletes a logs-based metric.
  40. rpc DeleteLogMetric(DeleteLogMetricRequest) returns (google.protobuf.Empty) {
  41. option (google.api.http) = { delete: "/v2beta1/{metric_name=projects/*/metrics/*}" };
  42. }
  43. }
  44. // Describes a logs-based metric. The value of the metric is the
  45. // number of log entries that match a logs filter.
  46. message LogMetric {
  47. // Required. The client-assigned metric identifier. Example:
  48. // `"severe_errors"`. Metric identifiers are limited to 1000
  49. // characters and can include only the following characters: `A-Z`,
  50. // `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`. The
  51. // forward-slash character (`/`) denotes a hierarchy of name pieces,
  52. // and it cannot be the first character of the name.
  53. string name = 1;
  54. // A description of this metric, which is used in documentation.
  55. string description = 2;
  56. // An [advanced logs filter](/logging/docs/view/advanced_filters).
  57. // Example: `"logName:syslog AND severity>=ERROR"`.
  58. string filter = 3;
  59. }
  60. // The parameters to ListLogMetrics.
  61. message ListLogMetricsRequest {
  62. // Required. The resource name containing the metrics.
  63. // Example: `"projects/my-project-id"`.
  64. string parent = 1;
  65. // Optional. If the `pageToken` parameter is supplied, then the next page of
  66. // results is retrieved. The `pageToken` parameter must be set to the value
  67. // of the `nextPageToken` from the previous response.
  68. // The value of `parent` must be the same as in the previous request.
  69. string page_token = 2;
  70. // Optional. The maximum number of results to return from this request.
  71. // You must check for presence of `nextPageToken` to determine if additional
  72. // results are available, which you can retrieve by passing the
  73. // `nextPageToken` value as the `pageToken` parameter in the next request.
  74. int32 page_size = 3;
  75. }
  76. // Result returned from ListLogMetrics.
  77. message ListLogMetricsResponse {
  78. // A list of logs-based metrics.
  79. repeated LogMetric metrics = 1;
  80. // If there are more results than were returned, then `nextPageToken` is
  81. // included in the response. To get the next set of results, call this
  82. // method again using the value of `nextPageToken` as `pageToken`.
  83. string next_page_token = 2;
  84. }
  85. // The parameters to GetLogMetric.
  86. message GetLogMetricRequest {
  87. // The resource name of the desired metric.
  88. // Example: `"projects/my-project-id/metrics/my-metric-id"`.
  89. string metric_name = 1;
  90. }
  91. // The parameters to CreateLogMetric.
  92. message CreateLogMetricRequest {
  93. // The resource name of the project in which to create the metric.
  94. // Example: `"projects/my-project-id"`.
  95. //
  96. // The new metric must be provided in the request.
  97. string parent = 1;
  98. // The new logs-based metric, which must not have an identifier that
  99. // already exists.
  100. LogMetric metric = 2;
  101. }
  102. // The parameters to UpdateLogMetric.
  103. //
  104. message UpdateLogMetricRequest {
  105. // The resource name of the metric to update.
  106. // Example: `"projects/my-project-id/metrics/my-metric-id"`.
  107. //
  108. // The updated metric must be provided in the request and have the
  109. // same identifier that is specified in `metricName`.
  110. // If the metric does not exist, it is created.
  111. string metric_name = 1;
  112. // The updated metric, whose name must be the same as the
  113. // metric identifier in `metricName`. If `metricName` does not
  114. // exist, then a new metric is created.
  115. LogMetric metric = 2;
  116. }
  117. // The parameters to DeleteLogMetric.
  118. message DeleteLogMetricRequest {
  119. // The resource name of the metric to delete.
  120. // Example: `"projects/my-project-id/metrics/my-metric-id"`.
  121. string metric_name = 1;
  122. }