billing.proto 3.0 KB

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