resources.proto 14 KB

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