1- // Copyright 2016 Google Inc.
1+ // Copyright 2017 Google Inc.
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -23,76 +23,45 @@ option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;ser
2323option java_multiple_files = true ;
2424option java_outer_classname = "BillingProto" ;
2525option java_package = "com.google.api" ;
26+ option objc_class_prefix = "GAPI" ;
2627
2728
2829// Billing related configuration of the service.
2930//
30- // The following example shows how to configure metrics for billing:
31- //
31+ // The following example shows how to configure monitored resources and metrics
32+ // for billing:
33+ // monitored_resources:
34+ // - type: library.googleapis.com/branch
35+ // labels:
36+ // - key: /city
37+ // description: The city where the library branch is located in.
38+ // - key: /name
39+ // description: The name of the branch.
3240// metrics:
33- // - name: library.googleapis.com/read_calls
34- // metric_kind: DELTA
35- // value_type: INT64
36- // - name: library.googleapis.com/write_calls
41+ // - name: library.googleapis.com/book/borrowed_count
3742// metric_kind: DELTA
3843// value_type: INT64
3944// billing:
40- // metrics:
41- // - library.googleapis.com/read_calls
42- // - library.googleapis.com/write_calls
43- //
44- // The next example shows how to enable billing status check and customize the
45- // check behavior. It makes sure billing status check is included in the `Check`
46- // method of [Service Control API](https://cloud.google.com/service-control/).
47- // In the example, "google.storage.Get" method can be served when the billing
48- // status is either `current` or `delinquent`, while "google.storage.Write"
49- // method can only be served when the billing status is `current`:
50- //
51- // billing:
52- // rules:
53- // - selector: google.storage.Get
54- // allowed_statuses:
55- // - current
56- // - delinquent
57- // - selector: google.storage.Write
58- // allowed_statuses: current
59- //
60- // Mostly services should only allow `current` status when serving requests.
61- // In addition, services can choose to allow both `current` and `delinquent`
62- // statuses when serving read-only requests to resources. If there's no
63- // matching selector for operation, no billing status check will be performed.
64- //
45+ // consumer_destinations:
46+ // - monitored_resource: library.googleapis.com/branch
47+ // metrics:
48+ // - library.googleapis.com/book/borrowed_count
6549message Billing {
66- // Names of the metrics to report to billing. Each name must
67- // be defined in [Service.metrics][google.api.Service.metrics] section.
68- repeated string metrics = 1 ;
69-
70- // A list of billing status rules for configuring billing status check.
71- repeated BillingStatusRule rules = 5 ;
72- }
50+ // Configuration of a specific billing destination (Currently only support
51+ // bill against consumer project).
52+ message BillingDestination {
53+ // The monitored resource type. The type must be defined in
54+ // [Service.monitored_resources][google.api.Service.monitored_resources] section.
55+ string monitored_resource = 1 ;
7356
74- // Defines the billing status requirements for operations.
75- //
76- // When used with
77- // [Service Control API](https://cloud.google.com/service-control/), the
78- // following statuses are supported:
79- //
80- // - **current**: the associated billing account is up to date and capable of
81- // paying for resource usages.
82- // - **delinquent**: the associated billing account has a correctable problem,
83- // such as late payment.
84- //
85- // Mostly services should only allow `current` status when serving requests.
86- // In addition, services can choose to allow both `current` and `delinquent`
87- // statuses when serving read-only requests to resources. If the list of
88- // allowed_statuses is empty, it means no billing requirement.
89- //
90- message BillingStatusRule {
91- // Selects the operation names to which this rule applies.
92- // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
93- string selector = 1 ;
57+ // Names of the metrics to report to this billing destination.
58+ // Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
59+ repeated string metrics = 2 ;
60+ }
9461
95- // Allowed billing statuses. The billing status check passes if the actual
96- // billing status matches any of the provided values here.
97- repeated string allowed_statuses = 2 ;
62+ // Billing configurations for sending metrics to the consumer project.
63+ // There can be multiple consumer destinations per service, each one must have
64+ // a different monitored resource type. A metric can be used in at most
65+ // one consumer destination.
66+ repeated BillingDestination consumer_destinations = 8 ;
9867}
0 commit comments