registry_models.proto 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. // Copyright 2022 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.cloud.apigeeregistry.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/apigeeregistry/v1;apigeeregistry";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "RegistryModelsProto";
  23. option java_package = "com.google.cloud.apigeeregistry.v1";
  24. option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1";
  25. option ruby_package = "Google::Cloud::ApigeeRegistry::V1";
  26. // A top-level description of an API.
  27. // Produced by producers and are commitments to provide services.
  28. message Api {
  29. option (google.api.resource) = {
  30. type: "apigeeregistry.googleapis.com/Api"
  31. pattern: "projects/{project}/locations/{location}/apis/{api}"
  32. };
  33. // Resource name.
  34. string name = 1;
  35. // Human-meaningful name.
  36. string display_name = 2;
  37. // A detailed description.
  38. string description = 3;
  39. // Output only. Creation timestamp.
  40. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  41. // Output only. Last update timestamp.
  42. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  43. // A user-definable description of the availability of this service.
  44. // Format: free-form, but we expect single words that describe availability,
  45. // e.g., "NONE", "TESTING", "PREVIEW", "GENERAL", "DEPRECATED", "SHUTDOWN".
  46. string availability = 6;
  47. // The recommended version of the API.
  48. // Format: `apis/{api}/versions/{version}`
  49. string recommended_version = 7 [(google.api.resource_reference) = {
  50. type: "apigeeregistry.googleapis.com/ApiVersion"
  51. }];
  52. // The recommended deployment of the API.
  53. // Format: `apis/{api}/deployments/{deployment}`
  54. string recommended_deployment = 8 [(google.api.resource_reference) = {
  55. type: "apigeeregistry.googleapis.com/ApiDeployment"
  56. }];
  57. // Labels attach identifying metadata to resources. Identifying metadata can
  58. // be used to filter list operations.
  59. //
  60. // Label keys and values can be no longer than 64 characters
  61. // (Unicode codepoints), can only contain lowercase letters, numeric
  62. // characters, underscores, and dashes. International characters are allowed.
  63. // No more than 64 user labels can be associated with one resource (System
  64. // labels are excluded).
  65. //
  66. // See https://goo.gl/xmQnxf for more information and examples of labels.
  67. // System reserved label keys are prefixed with
  68. // `apigeeregistry.googleapis.com/` and cannot be changed.
  69. map<string, string> labels = 9;
  70. // Annotations attach non-identifying metadata to resources.
  71. //
  72. // Annotation keys and values are less restricted than those of labels, but
  73. // should be generally used for small values of broad interest. Larger, topic-
  74. // specific metadata should be stored in Artifacts.
  75. map<string, string> annotations = 10;
  76. }
  77. // Describes a particular version of an API.
  78. // ApiVersions are what consumers actually use.
  79. message ApiVersion {
  80. option (google.api.resource) = {
  81. type: "apigeeregistry.googleapis.com/ApiVersion"
  82. pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}"
  83. };
  84. // Resource name.
  85. string name = 1;
  86. // Human-meaningful name.
  87. string display_name = 2;
  88. // A detailed description.
  89. string description = 3;
  90. // Output only. Creation timestamp.
  91. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  92. // Output only. Last update timestamp.
  93. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  94. // A user-definable description of the lifecycle phase of this API version.
  95. // Format: free-form, but we expect single words that describe API maturity,
  96. // e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION",
  97. // "DEPRECATED", "RETIRED".
  98. string state = 6;
  99. // Labels attach identifying metadata to resources. Identifying metadata can
  100. // be used to filter list operations.
  101. //
  102. // Label keys and values can be no longer than 64 characters
  103. // (Unicode codepoints), can only contain lowercase letters, numeric
  104. // characters, underscores and dashes. International characters are allowed.
  105. // No more than 64 user labels can be associated with one resource (System
  106. // labels are excluded).
  107. //
  108. // See https://goo.gl/xmQnxf for more information and examples of labels.
  109. // System reserved label keys are prefixed with
  110. // `apigeeregistry.googleapis.com/` and cannot be changed.
  111. map<string, string> labels = 7;
  112. // Annotations attach non-identifying metadata to resources.
  113. //
  114. // Annotation keys and values are less restricted than those of labels, but
  115. // should be generally used for small values of broad interest. Larger, topic-
  116. // specific metadata should be stored in Artifacts.
  117. map<string, string> annotations = 8;
  118. }
  119. // Describes a version of an API in a structured way.
  120. // ApiSpecs provide formal descriptions that consumers can use to use a version.
  121. // ApiSpec resources are intended to be fully-resolved descriptions of an
  122. // ApiVersion. When specs consist of multiple files, these should be bundled
  123. // together (e.g., in a zip archive) and stored as a unit. Multiple specs can
  124. // exist to provide representations in different API description formats.
  125. // Synchronization of these representations would be provided by tooling and
  126. // background services.
  127. message ApiSpec {
  128. option (google.api.resource) = {
  129. type: "apigeeregistry.googleapis.com/ApiSpec"
  130. pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}"
  131. };
  132. // Resource name.
  133. string name = 1;
  134. // A possibly-hierarchical name used to refer to the spec from other specs.
  135. string filename = 2;
  136. // A detailed description.
  137. string description = 3;
  138. // Output only. Immutable. The revision ID of the spec.
  139. // A new revision is committed whenever the spec contents are changed.
  140. // The format is an 8-character hexadecimal string.
  141. string revision_id = 4 [
  142. (google.api.field_behavior) = IMMUTABLE,
  143. (google.api.field_behavior) = OUTPUT_ONLY
  144. ];
  145. // Output only. Creation timestamp; when the spec resource was created.
  146. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  147. // Output only. Revision creation timestamp; when the represented revision was created.
  148. google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  149. // Output only. Last update timestamp: when the represented revision was last modified.
  150. google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  151. // A style (format) descriptor for this spec that is specified as a Media Type
  152. // (https://en.wikipedia.org/wiki/Media_type). Possible values include
  153. // `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and
  154. // `application/vnd.apigee.graphql`, with possible suffixes representing
  155. // compression types. These hypothetical names are defined in the vendor tree
  156. // defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final.
  157. // Content types can specify compression. Currently only GZip compression is
  158. // supported (indicated with "+gzip").
  159. string mime_type = 8;
  160. // Output only. The size of the spec file in bytes. If the spec is gzipped, this is the
  161. // size of the uncompressed spec.
  162. int32 size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  163. // Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
  164. // the hash of the uncompressed spec.
  165. string hash = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  166. // The original source URI of the spec (if one exists).
  167. // This is an external location that can be used for reference purposes
  168. // but which may not be authoritative since this external resource may
  169. // change after the spec is retrieved.
  170. string source_uri = 11;
  171. // Input only. The contents of the spec.
  172. // Provided by API callers when specs are created or updated.
  173. // To access the contents of a spec, use GetApiSpecContents.
  174. bytes contents = 12 [(google.api.field_behavior) = INPUT_ONLY];
  175. // Labels attach identifying metadata to resources. Identifying metadata can
  176. // be used to filter list operations.
  177. //
  178. // Label keys and values can be no longer than 64 characters
  179. // (Unicode codepoints), can only contain lowercase letters, numeric
  180. // characters, underscores and dashes. International characters are allowed.
  181. // No more than 64 user labels can be associated with one resource (System
  182. // labels are excluded).
  183. //
  184. // See https://goo.gl/xmQnxf for more information and examples of labels.
  185. // System reserved label keys are prefixed with
  186. // `apigeeregistry.googleapis.com/` and cannot be changed.
  187. map<string, string> labels = 14;
  188. // Annotations attach non-identifying metadata to resources.
  189. //
  190. // Annotation keys and values are less restricted than those of labels, but
  191. // should be generally used for small values of broad interest. Larger, topic-
  192. // specific metadata should be stored in Artifacts.
  193. map<string, string> annotations = 15;
  194. }
  195. // Describes a service running at particular address that
  196. // provides a particular version of an API. ApiDeployments have revisions which
  197. // correspond to different configurations of a single deployment in time.
  198. // Revision identifiers should be updated whenever the served API spec or
  199. // endpoint address changes.
  200. message ApiDeployment {
  201. option (google.api.resource) = {
  202. type: "apigeeregistry.googleapis.com/ApiDeployment"
  203. pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}"
  204. };
  205. // Resource name.
  206. string name = 1;
  207. // Human-meaningful name.
  208. string display_name = 2;
  209. // A detailed description.
  210. string description = 3;
  211. // Output only. Immutable. The revision ID of the deployment.
  212. // A new revision is committed whenever the deployment contents are changed.
  213. // The format is an 8-character hexadecimal string.
  214. string revision_id = 4 [
  215. (google.api.field_behavior) = IMMUTABLE,
  216. (google.api.field_behavior) = OUTPUT_ONLY
  217. ];
  218. // Output only. Creation timestamp; when the deployment resource was created.
  219. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  220. // Output only. Revision creation timestamp; when the represented revision was created.
  221. google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  222. // Output only. Last update timestamp: when the represented revision was last modified.
  223. google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  224. // The full resource name (including revision ID) of the spec of the API being
  225. // served by the deployment. Changes to this value will update the revision.
  226. // Format: `apis/{api}/deployments/{deployment}`
  227. string api_spec_revision = 8 [(google.api.resource_reference) = {
  228. type: "apigeeregistry.googleapis.com/ApiSpec"
  229. }];
  230. // The address where the deployment is serving. Changes to this value will
  231. // update the revision.
  232. string endpoint_uri = 9;
  233. // The address of the external channel of the API (e.g., the Developer
  234. // Portal). Changes to this value will not affect the revision.
  235. string external_channel_uri = 10;
  236. // Text briefly identifying the intended audience of the API. Changes to this
  237. // value will not affect the revision.
  238. string intended_audience = 11;
  239. // Text briefly describing how to access the endpoint. Changes to this value
  240. // will not affect the revision.
  241. string access_guidance = 12;
  242. // Labels attach identifying metadata to resources. Identifying metadata can
  243. // be used to filter list operations.
  244. //
  245. // Label keys and values can be no longer than 64 characters
  246. // (Unicode codepoints), can only contain lowercase letters, numeric
  247. // characters, underscores and dashes. International characters are allowed.
  248. // No more than 64 user labels can be associated with one resource (System
  249. // labels are excluded).
  250. //
  251. // See https://goo.gl/xmQnxf for more information and examples of labels.
  252. // System reserved label keys are prefixed with
  253. // `apigeeregistry.googleapis.com/` and cannot be changed.
  254. map<string, string> labels = 14;
  255. // Annotations attach non-identifying metadata to resources.
  256. //
  257. // Annotation keys and values are less restricted than those of labels, but
  258. // should be generally used for small values of broad interest. Larger, topic-
  259. // specific metadata should be stored in Artifacts.
  260. map<string, string> annotations = 15;
  261. }
  262. // Artifacts of resources. Artifacts are unique (single-value) per resource
  263. // and are used to store metadata that is too large or numerous to be stored
  264. // directly on the resource. Since artifacts are stored separately from parent
  265. // resources, they should generally be used for metadata that is needed
  266. // infrequently, i.e., not for display in primary views of the resource but
  267. // perhaps displayed or downloaded upon request. The `ListArtifacts` method
  268. // allows artifacts to be quickly enumerated and checked for presence without
  269. // downloading their (potentially-large) contents.
  270. message Artifact {
  271. option (google.api.resource) = {
  272. type: "apigeeregistry.googleapis.com/Artifact"
  273. pattern: "projects/{project}/locations/{location}/artifacts/{artifact}"
  274. pattern: "projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}"
  275. pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}"
  276. pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}"
  277. pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}"
  278. };
  279. // Resource name.
  280. string name = 1;
  281. // Output only. Creation timestamp.
  282. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  283. // Output only. Last update timestamp.
  284. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  285. // A content type specifier for the artifact.
  286. // Content type specifiers are Media Types
  287. // (https://en.wikipedia.org/wiki/Media_type) with a possible "schema"
  288. // parameter that specifies a schema for the stored information.
  289. // Content types can specify compression. Currently only GZip compression is
  290. // supported (indicated with "+gzip").
  291. string mime_type = 4;
  292. // Output only. The size of the artifact in bytes. If the artifact is gzipped, this is
  293. // the size of the uncompressed artifact.
  294. int32 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  295. // Output only. A SHA-256 hash of the artifact's contents. If the artifact is gzipped,
  296. // this is the hash of the uncompressed artifact.
  297. string hash = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  298. // Input only. The contents of the artifact.
  299. // Provided by API callers when artifacts are created or replaced.
  300. // To access the contents of an artifact, use GetArtifactContents.
  301. bytes contents = 7 [(google.api.field_behavior) = INPUT_ONLY];
  302. }