billing.proto 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2019 Google LLC.
  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. //
  15. syntax = "proto3";
  16. package google.api;
  17. import "google/api/metric.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "BillingProto";
  21. option java_package = "com.google.api";
  22. option objc_class_prefix = "GAPI";
  23. // Billing related configuration of the service.
  24. //
  25. // The following example shows how to configure monitored resources and metrics
  26. // for billing:
  27. //
  28. // monitored_resources:
  29. // - type: library.googleapis.com/branch
  30. // labels:
  31. // - key: /city
  32. // description: The city where the library branch is located in.
  33. // - key: /name
  34. // description: The name of the branch.
  35. // metrics:
  36. // - name: library.googleapis.com/book/borrowed_count
  37. // metric_kind: DELTA
  38. // value_type: INT64
  39. // billing:
  40. // consumer_destinations:
  41. // - monitored_resource: library.googleapis.com/branch
  42. // metrics:
  43. // - library.googleapis.com/book/borrowed_count
  44. message Billing {
  45. // Configuration of a specific billing destination (Currently only support
  46. // bill against consumer project).
  47. message BillingDestination {
  48. // The monitored resource type. The type must be defined in
  49. // [Service.monitored_resources][google.api.Service.monitored_resources] section.
  50. string monitored_resource = 1;
  51. // Names of the metrics to report to this billing destination.
  52. // Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
  53. repeated string metrics = 2;
  54. }
  55. // Billing configurations for sending metrics to the consumer project.
  56. // There can be multiple consumer destinations per service, each one must have
  57. // a different monitored resource type. A metric can be used in at most
  58. // one consumer destination.
  59. repeated BillingDestination consumer_destinations = 8;
  60. }