usage.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "UsageProto";
  20. option java_package = "com.google.api";
  21. option objc_class_prefix = "GAPI";
  22. // Configuration controlling usage of a service.
  23. message Usage {
  24. // Requirements that must be satisfied before a consumer project can use the
  25. // service. Each requirement is of the form <service.name>/<requirement-id>;
  26. // for example 'serviceusage.googleapis.com/billing-enabled'.
  27. repeated string requirements = 1;
  28. // A list of usage rules that apply to individual API methods.
  29. //
  30. // **NOTE:** All service configuration rules follow "last one wins" order.
  31. repeated UsageRule rules = 6;
  32. // The full resource name of a channel used for sending notifications to the
  33. // service producer.
  34. //
  35. // Google Service Management currently only supports
  36. // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
  37. // channel. To use Google Cloud Pub/Sub as the channel, this must be the name
  38. // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
  39. // documented in https://cloud.google.com/pubsub/docs/overview.
  40. string producer_notification_channel = 7;
  41. }
  42. // Usage configuration rules for the service.
  43. //
  44. // NOTE: Under development.
  45. //
  46. //
  47. // Use this rule to configure unregistered calls for the service. Unregistered
  48. // calls are calls that do not contain consumer project identity.
  49. // (Example: calls that do not contain an API key).
  50. // By default, API methods do not allow unregistered calls, and each method call
  51. // must be identified by a consumer project identity. Use this rule to
  52. // allow/disallow unregistered calls.
  53. //
  54. // Example of an API that wants to allow unregistered calls for entire service.
  55. //
  56. // usage:
  57. // rules:
  58. // - selector: "*"
  59. // allow_unregistered_calls: true
  60. //
  61. // Example of a method that wants to allow unregistered calls.
  62. //
  63. // usage:
  64. // rules:
  65. // - selector: "google.example.library.v1.LibraryService.CreateBook"
  66. // allow_unregistered_calls: true
  67. message UsageRule {
  68. // Selects the methods to which this rule applies. Use '*' to indicate all
  69. // methods in all APIs.
  70. //
  71. // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
  72. string selector = 1;
  73. // If true, the selected method allows unregistered calls, e.g. calls
  74. // that don't identify any user or application.
  75. bool allow_unregistered_calls = 2;
  76. // If true, the selected method should skip service control and the control
  77. // plane features, such as quota and billing, will not be available.
  78. // This flag is used by Google Cloud Endpoints to bypass checks for internal
  79. // methods, such as service health check methods.
  80. bool skip_service_control = 3;
  81. }