resources.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. // Copyright 2021 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.serviceusage.v1beta1;
  16. import "google/api/auth.proto";
  17. import "google/api/documentation.proto";
  18. import "google/api/endpoint.proto";
  19. import "google/api/monitored_resource.proto";
  20. import "google/api/monitoring.proto";
  21. import "google/api/quota.proto";
  22. import "google/api/usage.proto";
  23. import "google/protobuf/api.proto";
  24. import "google/api/annotations.proto";
  25. option csharp_namespace = "Google.Api.ServiceUsage.V1Beta1";
  26. option go_package = "google.golang.org/genproto/googleapis/api/serviceusage/v1beta1;serviceusage";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "ResourcesProto";
  29. option java_package = "com.google.api.serviceusage.v1beta1";
  30. option php_namespace = "Google\\Api\\ServiceUsage\\V1beta1";
  31. option ruby_package = "Google::Api::ServiceUsage::V1beta1";
  32. // A service that is available for use by the consumer.
  33. message Service {
  34. // The resource name of the consumer and service.
  35. //
  36. // A valid name would be:
  37. // - `projects/123/services/serviceusage.googleapis.com`
  38. string name = 1;
  39. // The resource name of the consumer.
  40. //
  41. // A valid name would be:
  42. // - `projects/123`
  43. string parent = 5;
  44. // The service configuration of the available service.
  45. // Some fields may be filtered out of the configuration in responses to
  46. // the `ListServices` method. These fields are present only in responses to
  47. // the `GetService` method.
  48. ServiceConfig config = 2;
  49. // Whether or not the service has been enabled for use by the consumer.
  50. State state = 4;
  51. }
  52. // Whether or not a service has been enabled for use by a consumer.
  53. enum State {
  54. // The default value, which indicates that the enabled state of the service
  55. // is unspecified or not meaningful. Currently, all consumers other than
  56. // projects (such as folders and organizations) are always in this state.
  57. STATE_UNSPECIFIED = 0;
  58. // The service cannot be used by this consumer. It has either been explicitly
  59. // disabled, or has never been enabled.
  60. DISABLED = 1;
  61. // The service has been explicitly enabled for use by this consumer.
  62. ENABLED = 2;
  63. }
  64. // The configuration of the service.
  65. message ServiceConfig {
  66. // The DNS address at which this service is available.
  67. //
  68. // An example DNS address would be:
  69. // `calendar.googleapis.com`.
  70. string name = 1;
  71. // The product title for this service.
  72. string title = 2;
  73. // A list of API interfaces exported by this service. Contains only the names,
  74. // versions, and method names of the interfaces.
  75. repeated google.protobuf.Api apis = 3;
  76. // Additional API documentation. Contains only the summary and the
  77. // documentation URL.
  78. google.api.Documentation documentation = 6;
  79. // Quota configuration.
  80. google.api.Quota quota = 10;
  81. // Auth configuration. Contains only the OAuth rules.
  82. google.api.Authentication authentication = 11;
  83. // Configuration controlling usage of this service.
  84. google.api.Usage usage = 15;
  85. // Configuration for network endpoints. Contains only the names and aliases
  86. // of the endpoints.
  87. repeated google.api.Endpoint endpoints = 18;
  88. // Defines the monitored resources used by this service. This is required
  89. // by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
  90. repeated google.api.MonitoredResourceDescriptor monitored_resources = 25;
  91. // Monitoring configuration.
  92. // This should not include the 'producer_destinations' field.
  93. google.api.Monitoring monitoring = 28;
  94. }
  95. // The operation metadata returned for the batchend services operation.
  96. message OperationMetadata {
  97. // The full name of the resources that this operation is directly
  98. // associated with.
  99. repeated string resource_names = 2;
  100. }
  101. // Consumer quota settings for a quota metric.
  102. message ConsumerQuotaMetric {
  103. // The resource name of the quota settings on this metric for this consumer.
  104. //
  105. // An example name would be:
  106. // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus`
  107. //
  108. // The resource name is intended to be opaque and should not be parsed for
  109. // its component strings, since its representation could change in the future.
  110. string name = 1;
  111. // The name of the metric.
  112. //
  113. // An example name would be:
  114. // `compute.googleapis.com/cpus`
  115. string metric = 4;
  116. // The display name of the metric.
  117. //
  118. // An example name would be:
  119. // `CPUs`
  120. string display_name = 2;
  121. // The consumer quota for each quota limit defined on the metric.
  122. repeated ConsumerQuotaLimit consumer_quota_limits = 3;
  123. // The quota limits targeting the descendant containers of the
  124. // consumer in request.
  125. //
  126. // If the consumer in request is of type `organizations`
  127. // or `folders`, the field will list per-project limits in the metric; if the
  128. // consumer in request is of type `project`, the field will be empty.
  129. //
  130. // The `quota_buckets` field of each descendant consumer quota limit will not
  131. // be populated.
  132. repeated ConsumerQuotaLimit descendant_consumer_quota_limits = 6;
  133. // The units in which the metric value is reported.
  134. string unit = 5;
  135. }
  136. // Consumer quota settings for a quota limit.
  137. message ConsumerQuotaLimit {
  138. // The resource name of the quota limit.
  139. //
  140. // An example name would be:
  141. // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
  142. //
  143. // The resource name is intended to be opaque and should not be parsed for
  144. // its component strings, since its representation could change in the future.
  145. string name = 1;
  146. // The name of the parent metric of this limit.
  147. //
  148. // An example name would be:
  149. // `compute.googleapis.com/cpus`
  150. string metric = 8;
  151. // The limit unit.
  152. //
  153. // An example unit would be
  154. // `1/{project}/{region}`
  155. // Note that `{project}` and `{region}` are not placeholders in this example;
  156. // the literal characters `{` and `}` occur in the string.
  157. string unit = 2;
  158. // Whether this limit is precise or imprecise.
  159. bool is_precise = 3;
  160. // Whether admin overrides are allowed on this limit
  161. bool allows_admin_overrides = 7;
  162. // Summary of the enforced quota buckets, organized by quota dimension,
  163. // ordered from least specific to most specific (for example, the global
  164. // default bucket, with no quota dimensions, will always appear first).
  165. repeated QuotaBucket quota_buckets = 9;
  166. }
  167. // Selected view of quota. Can be used to request more detailed quota
  168. // information when retrieving quota metrics and limits.
  169. enum QuotaView {
  170. // No quota view specified. Requests that do not specify a quota view will
  171. // typically default to the BASIC view.
  172. QUOTA_VIEW_UNSPECIFIED = 0;
  173. // Only buckets with overrides are shown in the response.
  174. BASIC = 1;
  175. // Include per-location buckets even if they do not have overrides.
  176. // When the view is FULL, and a limit has regional or zonal quota, the limit
  177. // will include buckets for all regions or zones that could support
  178. // overrides, even if none are currently present. In some cases this will
  179. // cause the response to become very large; callers that do not need this
  180. // extra information should use the BASIC view instead.
  181. FULL = 2;
  182. }
  183. // A quota bucket is a quota provisioning unit for a specific set of dimensions.
  184. message QuotaBucket {
  185. // The effective limit of this quota bucket. Equal to default_limit if there
  186. // are no overrides.
  187. int64 effective_limit = 1;
  188. // The default limit of this quota bucket, as specified by the service
  189. // configuration.
  190. int64 default_limit = 2;
  191. // Producer override on this quota bucket.
  192. QuotaOverride producer_override = 3;
  193. // Consumer override on this quota bucket.
  194. QuotaOverride consumer_override = 4;
  195. // Admin override on this quota bucket.
  196. QuotaOverride admin_override = 5;
  197. // The dimensions of this quota bucket.
  198. //
  199. // If this map is empty, this is the global bucket, which is the default quota
  200. // value applied to all requests that do not have a more specific override.
  201. //
  202. // If this map is nonempty, the default limit, effective limit, and quota
  203. // overrides apply only to requests that have the dimensions given in the map.
  204. //
  205. // For example, if the map has key `region` and value `us-east-1`, then the
  206. // specified effective limit is only effective in that region, and the
  207. // specified overrides apply only in that region.
  208. map<string, string> dimensions = 6;
  209. }
  210. // A quota override
  211. message QuotaOverride {
  212. // The resource name of the override.
  213. // This name is generated by the server when the override is created.
  214. //
  215. // Example names would be:
  216. // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
  217. // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
  218. //
  219. // The resource name is intended to be opaque and should not be parsed for
  220. // its component strings, since its representation could change in the future.
  221. string name = 1;
  222. // The overriding quota limit value.
  223. // Can be any nonnegative integer, or -1 (unlimited quota).
  224. int64 override_value = 2;
  225. // If this map is nonempty, then this override applies only to specific values
  226. // for dimensions defined in the limit unit.
  227. //
  228. // For example, an override on a limit with the unit `1/{project}/{region}`
  229. // could contain an entry with the key `region` and the value `us-east-1`;
  230. // the override is only applied to quota consumed in that region.
  231. //
  232. // This map has the following restrictions:
  233. //
  234. // * Keys that are not defined in the limit's unit are not valid keys.
  235. // Any string appearing in `{brackets}` in the unit (besides `{project}`
  236. // or
  237. // `{user}`) is a defined key.
  238. // * `project` is not a valid key; the project is already specified in
  239. // the parent resource name.
  240. // * `user` is not a valid key; the API does not support quota overrides
  241. // that apply only to a specific user.
  242. // * If `region` appears as a key, its value must be a valid Cloud region.
  243. // * If `zone` appears as a key, its value must be a valid Cloud zone.
  244. // * If any valid key other than `region` or `zone` appears in the map, then
  245. // all valid keys other than `region` or `zone` must also appear in the
  246. // map.
  247. map<string, string> dimensions = 3;
  248. // The name of the metric to which this override applies.
  249. //
  250. // An example name would be:
  251. // `compute.googleapis.com/cpus`
  252. string metric = 4;
  253. // The limit unit of the limit to which this override applies.
  254. //
  255. // An example unit would be:
  256. // `1/{project}/{region}`
  257. // Note that `{project}` and `{region}` are not placeholders in this example;
  258. // the literal characters `{` and `}` occur in the string.
  259. string unit = 5;
  260. // The resource name of the ancestor that requested the override. For example:
  261. // `organizations/12345` or `folders/67890`.
  262. // Used by admin overrides only.
  263. string admin_override_ancestor = 6;
  264. }
  265. // Import data embedded in the request message
  266. message OverrideInlineSource {
  267. // The overrides to create.
  268. // Each override must have a value for 'metric' and 'unit', to specify
  269. // which metric and which limit the override should be applied to.
  270. // The 'name' field of the override does not need to be set; it is ignored.
  271. repeated QuotaOverride overrides = 1;
  272. }
  273. // Enumerations of quota safety checks.
  274. enum QuotaSafetyCheck {
  275. // Unspecified quota safety check.
  276. QUOTA_SAFETY_CHECK_UNSPECIFIED = 0;
  277. // Validates that a quota mutation would not cause the consumer's effective
  278. // limit to be lower than the consumer's quota usage.
  279. LIMIT_DECREASE_BELOW_USAGE = 1;
  280. // Validates that a quota mutation would not cause the consumer's effective
  281. // limit to decrease by more than 10 percent.
  282. LIMIT_DECREASE_PERCENTAGE_TOO_HIGH = 2;
  283. }
  284. // Quota policy created by quota administrator.
  285. message AdminQuotaPolicy {
  286. // The resource name of the policy.
  287. // This name is generated by the server when the policy is created.
  288. //
  289. // Example names would be:
  290. // `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminQuotaPolicies/4a3f2c1d`
  291. string name = 1;
  292. // The quota policy value.
  293. // Can be any nonnegative integer, or -1 (unlimited quota).
  294. int64 policy_value = 2;
  295. //
  296. // If this map is nonempty, then this policy applies only to specific values
  297. // for dimensions defined in the limit unit.
  298. //
  299. // For example, an policy on a limit with the unit `1/{project}/{region}`
  300. // could contain an entry with the key `region` and the value `us-east-1`;
  301. // the policy is only applied to quota consumed in that region.
  302. //
  303. // This map has the following restrictions:
  304. //
  305. // * If `region` appears as a key, its value must be a valid Cloud region.
  306. // * If `zone` appears as a key, its value must be a valid Cloud zone.
  307. // * Keys other than `region` or `zone` are not valid.
  308. map<string, string> dimensions = 3;
  309. // The name of the metric to which this policy applies.
  310. //
  311. // An example name would be:
  312. // `compute.googleapis.com/cpus`
  313. string metric = 4;
  314. // The limit unit of the limit to which this policy applies.
  315. //
  316. // An example unit would be:
  317. // `1/{project}/{region}`
  318. // Note that `{project}` and `{region}` are not placeholders in this example;
  319. // the literal characters `{` and `}` occur in the string.
  320. string unit = 5;
  321. // The cloud resource container at which the quota policy is created. The
  322. // format is `{container_type}/{container_number}`
  323. string container = 6;
  324. }
  325. // Service identity for a service. This is the identity that service producer
  326. // should use to access consumer resources.
  327. message ServiceIdentity {
  328. // The email address of the service account that a service producer would use
  329. // to access consumer resources.
  330. string email = 1;
  331. // The unique and stable id of the service account.
  332. // https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts#ServiceAccount
  333. string unique_id = 2;
  334. }