usage.proto 3.7 KB

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