operation.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.api.servicecontrol.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/servicecontrol/v1/log_entry.proto";
  18. import "google/api/servicecontrol/v1/metric_value.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option cc_enable_arenas = true;
  21. option java_multiple_files = true;
  22. option java_outer_classname = "OperationProto";
  23. option java_package = "com.google.api.servicecontrol.v1";
  24. // Represents information regarding an operation.
  25. message Operation {
  26. // Defines the importance of the data contained in the operation.
  27. enum Importance {
  28. // The API implementation may cache and aggregate the data.
  29. // The data may be lost when rare and unexpected system failures occur.
  30. LOW = 0;
  31. // The API implementation doesn't cache and aggregate the data.
  32. // If the method returns successfully, it's guaranteed that the data has
  33. // been persisted in durable storage.
  34. HIGH = 1;
  35. }
  36. // Identity of the operation. This must be unique within the scope of the
  37. // service that generated the operation. If the service calls
  38. // Check() and Report() on the same operation, the two calls should carry
  39. // the same id.
  40. //
  41. // UUID version 4 is recommended, though not required.
  42. // In scenarios where an operation is computed from existing information
  43. // and an idempotent id is desirable for deduplication purpose, UUID version 5
  44. // is recommended. See RFC 4122 for details.
  45. string operation_id = 1;
  46. // Fully qualified name of the operation. Reserved for future use.
  47. string operation_name = 2;
  48. // Identity of the consumer who is using the service.
  49. // This field should be filled in for the operations initiated by a
  50. // consumer, but not for service-initiated operations that are
  51. // not related to a specific consumer.
  52. //
  53. // This can be in one of the following formats:
  54. // project:<project_id>,
  55. // project_number:<project_number>,
  56. // api_key:<api_key>.
  57. string consumer_id = 3;
  58. // Required. Start time of the operation.
  59. google.protobuf.Timestamp start_time = 4;
  60. // End time of the operation.
  61. // Required when the operation is used in [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
  62. // but optional when the operation is used in [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
  63. google.protobuf.Timestamp end_time = 5;
  64. // Labels describing the operation. Only the following labels are allowed:
  65. //
  66. // - Labels describing monitored resources as defined in
  67. // the service configuration.
  68. // - Default labels of metric values. When specified, labels defined in the
  69. // metric value override these default.
  70. // - The following labels defined by Google Cloud Platform:
  71. // - `cloud.googleapis.com/location` describing the location where the
  72. // operation happened,
  73. // - `servicecontrol.googleapis.com/user_agent` describing the user agent
  74. // of the API request,
  75. // - `servicecontrol.googleapis.com/service_agent` describing the service
  76. // used to handle the API request (e.g. ESP),
  77. // - `servicecontrol.googleapis.com/platform` describing the platform
  78. // where the API is served (e.g. GAE, GCE, GKE).
  79. map<string, string> labels = 6;
  80. // Represents information about this operation. Each MetricValueSet
  81. // corresponds to a metric defined in the service configuration.
  82. // The data type used in the MetricValueSet must agree with
  83. // the data type specified in the metric definition.
  84. //
  85. // Within a single operation, it is not allowed to have more than one
  86. // MetricValue instances that have the same metric names and identical
  87. // label value combinations. If a request has such duplicated MetricValue
  88. // instances, the entire request is rejected with
  89. // an invalid argument error.
  90. repeated MetricValueSet metric_value_sets = 7;
  91. // Represents information to be logged.
  92. repeated LogEntry log_entries = 8;
  93. // DO NOT USE. This is an experimental field.
  94. Importance importance = 11;
  95. }