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