private_catalog.proto 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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.cloud.privatecatalog.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/longrunning/operations.proto";
  21. import "google/protobuf/struct.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option csharp_namespace = "Google.Cloud.PrivateCatalog.V1Beta1";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/privatecatalog/v1beta1;privatecatalog";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "PrivateCatalogProto";
  27. option java_package = "com.google.cloud.privatecatalog.v1beta1";
  28. option php_namespace = "Google\\Cloud\\PrivateCatalog\\V1beta1";
  29. option ruby_package = "Google::Cloud::PrivateCatalog::V1beta1";
  30. // `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product`
  31. // and `Version` resources under a target resource context.
  32. //
  33. // `Catalog` is computed based on the [Association][]s linked to the target
  34. // resource and its ancestors. Each association's
  35. // [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a
  36. // `Catalog`. If multiple associations have the same parent
  37. // [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are
  38. // de-duplicated into one `Catalog`. Users must have
  39. // `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource
  40. // context in order to access catalogs. `Catalog` contains the resource name and
  41. // a subset of data of the original
  42. // [google.cloud.privatecatalogproducer.v1beta.Catalog][].
  43. //
  44. // `Product` is child resource of the catalog. A `Product` contains the resource
  45. // name and a subset of the data of the original
  46. // [google.cloud.privatecatalogproducer.v1beta.Product][].
  47. //
  48. // `Version` is child resource of the product. A `Version` contains the resource
  49. // name and a subset of the data of the original
  50. // [google.cloud.privatecatalogproducer.v1beta.Version][].
  51. service PrivateCatalog {
  52. option (google.api.default_host) = "cloudprivatecatalog.googleapis.com";
  53. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  54. // Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the
  55. // scope of the consumer cloud resource hierarchy context.
  56. rpc SearchCatalogs(SearchCatalogsRequest) returns (SearchCatalogsResponse) {
  57. option (google.api.http) = {
  58. get: "/v1beta1/{resource=projects/*}/catalogs:search"
  59. additional_bindings {
  60. get: "/v1beta1/{resource=organizations/*}/catalogs:search"
  61. }
  62. additional_bindings {
  63. get: "/v1beta1/{resource=folders/*}/catalogs:search"
  64. }
  65. };
  66. }
  67. // Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the
  68. // scope of the consumer cloud resource hierarchy context.
  69. rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {
  70. option (google.api.http) = {
  71. get: "/v1beta1/{resource=projects/*}/products:search"
  72. additional_bindings {
  73. get: "/v1beta1/{resource=organizations/*}/products:search"
  74. }
  75. additional_bindings {
  76. get: "/v1beta1/{resource=folders/*}/products:search"
  77. }
  78. };
  79. }
  80. // Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the
  81. // scope of the consumer cloud resource hierarchy context.
  82. rpc SearchVersions(SearchVersionsRequest) returns (SearchVersionsResponse) {
  83. option (google.api.http) = {
  84. get: "/v1beta1/{resource=projects/*}/versions:search"
  85. additional_bindings {
  86. get: "/v1beta1/{resource=organizations/*}/versions:search"
  87. }
  88. additional_bindings {
  89. get: "/v1beta1/{resource=folders/*}/versions:search"
  90. }
  91. };
  92. }
  93. }
  94. // Request message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs].
  95. message SearchCatalogsRequest {
  96. // Required. The name of the resource context. It can be in following formats:
  97. //
  98. // * `projects/{project}`
  99. // * `folders/{folder}`
  100. // * `organizations/{organization}`
  101. string resource = 1 [(google.api.field_behavior) = REQUIRED];
  102. // The query to filter the catalogs. The supported queries are:
  103. //
  104. // * Get a single catalog: `name=catalogs/{catalog}`
  105. string query = 2;
  106. // The maximum number of entries that are requested.
  107. int32 page_size = 3;
  108. // A pagination token returned from a previous call to SearchCatalogs that
  109. // indicates where this listing should continue from.
  110. string page_token = 4;
  111. }
  112. // Response message for [PrivateCatalog.SearchCatalogs][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs].
  113. message SearchCatalogsResponse {
  114. // The `Catalog`s computed from the resource context.
  115. repeated Catalog catalogs = 1;
  116. // A pagination token returned from a previous call to SearchCatalogs that
  117. // indicates from where listing should continue.
  118. string next_page_token = 2;
  119. }
  120. // Request message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts].
  121. message SearchProductsRequest {
  122. // Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
  123. // for details.
  124. string resource = 1 [(google.api.field_behavior) = REQUIRED];
  125. // The query to filter the products.
  126. //
  127. // The supported queries are:
  128. // * List products of all catalogs: empty
  129. // * List products under a catalog: `parent=catalogs/{catalog}`
  130. // * Get a product by name:
  131. // `name=catalogs/{catalog}/products/{product}`
  132. string query = 2;
  133. // The maximum number of entries that are requested.
  134. int32 page_size = 3;
  135. // A pagination token returned from a previous call to SearchProducts that
  136. // indicates where this listing should continue from.
  137. string page_token = 4;
  138. }
  139. // Response message for [PrivateCatalog.SearchProducts][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts].
  140. message SearchProductsResponse {
  141. // The `Product` resources computed from the resource context.
  142. repeated Product products = 1;
  143. // A pagination token returned from a previous call to SearchProducts that
  144. // indicates from where listing should continue.
  145. string next_page_token = 2;
  146. }
  147. // Request message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions].
  148. message SearchVersionsRequest {
  149. // Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource]
  150. // for details.
  151. string resource = 1 [(google.api.field_behavior) = REQUIRED];
  152. // Required. The query to filter the versions.
  153. //
  154. // The supported queries are:
  155. // * List versions under a product:
  156. // `parent=catalogs/{catalog}/products/{product}`
  157. // * Get a version by name:
  158. // `name=catalogs/{catalog}/products/{product}/versions/{version}`
  159. string query = 2 [(google.api.field_behavior) = REQUIRED];
  160. // The maximum number of entries that are requested.
  161. int32 page_size = 3;
  162. // A pagination token returned from a previous call to SearchVersions
  163. // that indicates where this listing should continue from.
  164. string page_token = 4;
  165. }
  166. // Response message for [PrivateCatalog.SearchVersions][google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions].
  167. message SearchVersionsResponse {
  168. // The `Version` resources computed from the resource context.
  169. repeated Version versions = 1;
  170. // A pagination token returned from a previous call to SearchVersions that
  171. // indicates from where the listing should continue.
  172. string next_page_token = 2;
  173. }
  174. // The readonly representation of a catalog computed with a given resource
  175. // context.
  176. message Catalog {
  177. option (google.api.resource) = {
  178. type: "cloudprivatecatalog.googleapis.com/Catalog"
  179. pattern: "catalogs/{catalog}"
  180. };
  181. // Output only. The resource name of the target catalog, in the format of
  182. // `catalogs/{catalog}'.
  183. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  184. // Output only. The descriptive name of the catalog as it appears in UIs.
  185. string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  186. // Output only. The description of the catalog.
  187. string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  188. // Output only. The time when the catalog was created.
  189. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  190. // Output only. The time when the catalog was last updated.
  191. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  192. }
  193. // The readonly representation of a product computed with a given resource
  194. // context.
  195. message Product {
  196. option (google.api.resource) = {
  197. type: "cloudprivatecatalog.googleapis.com/Product"
  198. pattern: "products/{product}"
  199. };
  200. // Output only. The resource name of the target product, in the format of
  201. // `products/[a-z][-a-z0-9]*[a-z0-9]'.
  202. //
  203. // A unique identifier for the product under a catalog.
  204. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  205. // Output only. The type of the product asset. It can be one of the following values:
  206. //
  207. // * `google.deploymentmanager.Template`
  208. // * `google.cloudprivatecatalog.ListingOnly`
  209. // * `google.cloudprivatecatalog.Terraform`
  210. string asset_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  211. // Required. Output only. The display metadata to describe the product. The JSON schema of the
  212. // metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type].
  213. // When the type is `google.deploymentmanager.Template`, the schema is as
  214. // follows:
  215. //
  216. // ```
  217. // "$schema": http://json-schema.org/draft-04/schema#
  218. // type: object
  219. // properties:
  220. // name:
  221. // type: string
  222. // minLength: 1
  223. // maxLength: 64
  224. // description:
  225. // type: string
  226. // minLength: 1
  227. // maxLength: 2048
  228. // tagline:
  229. // type: string
  230. // minLength: 1
  231. // maxLength: 100
  232. // support_info:
  233. // type: string
  234. // minLength: 1
  235. // maxLength: 2048
  236. // creator:
  237. // type: string
  238. // minLength: 1
  239. // maxLength: 100
  240. // documentations:
  241. // type: array
  242. // items:
  243. // type: object
  244. // properties:
  245. // url:
  246. // type: string
  247. // pattern:
  248. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  249. // title:
  250. // type: string
  251. // minLength: 1
  252. // maxLength: 64
  253. // description:
  254. // type: string
  255. // minLength: 1
  256. // maxLength: 2048
  257. // required:
  258. // - name
  259. // - description
  260. // additionalProperties: false
  261. //
  262. // ```
  263. //
  264. // When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema
  265. // is as follows:
  266. //
  267. // ```
  268. // "$schema": http://json-schema.org/draft-04/schema#
  269. // type: object
  270. // properties:
  271. // name:
  272. // type: string
  273. // minLength: 1
  274. // maxLength: 64
  275. // description:
  276. // type: string
  277. // minLength: 1
  278. // maxLength: 2048
  279. // tagline:
  280. // type: string
  281. // minLength: 1
  282. // maxLength: 100
  283. // support_info:
  284. // type: string
  285. // minLength: 1
  286. // maxLength: 2048
  287. // creator:
  288. // type: string
  289. // minLength: 1
  290. // maxLength: 100
  291. // documentations:
  292. // type: array
  293. // items:
  294. // type: object
  295. // properties:
  296. // url:
  297. // type: string
  298. // pattern:
  299. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  300. // title:
  301. // type: string
  302. // minLength: 1
  303. // maxLength: 64
  304. // description:
  305. // type: string
  306. // minLength: 1
  307. // maxLength: 2048
  308. // signup_url:
  309. // type: string
  310. // pattern:
  311. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  312. // required:
  313. // - name
  314. // - description
  315. // - signup_url
  316. // additionalProperties: false
  317. //
  318. // ```
  319. //
  320. // When the asset type is `google.cloudprivatecatalog.Terraform`, the schema
  321. // is as follows:
  322. //
  323. // ```
  324. // "$schema": http://json-schema.org/draft-04/schema#
  325. // type: object
  326. // properties:
  327. // name:
  328. // type: string
  329. // minLength: 1
  330. // maxLength: 64
  331. // description:
  332. // type: string
  333. // minLength: 1
  334. // maxLength: 2048
  335. // tagline:
  336. // type: string
  337. // minLength: 1
  338. // maxLength: 100
  339. // support_info:
  340. // type: string
  341. // minLength: 1
  342. // maxLength: 2048
  343. // creator:
  344. // type: string
  345. // minLength: 1
  346. // maxLength: 100
  347. // documentations:
  348. // type: array
  349. // items:
  350. // type: object
  351. // properties:
  352. // url:
  353. // type: string
  354. // pattern:
  355. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  356. // title:
  357. // type: string
  358. // minLength: 1
  359. // maxLength: 64
  360. // description:
  361. // type: string
  362. // minLength: 1
  363. // maxLength: 2048
  364. // required:
  365. // - name
  366. // - description
  367. // additionalProperties: true
  368. google.protobuf.Struct display_metadata = 3 [
  369. (google.api.field_behavior) = REQUIRED,
  370. (google.api.field_behavior) = OUTPUT_ONLY
  371. ];
  372. // Output only. The icon URI of the product.
  373. string icon_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  374. // Output only. A collection of assets referred by a product.
  375. // This field is set for Terraform Products only.
  376. repeated AssetReference asset_references = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  377. // Output only. The time when the product was created.
  378. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  379. // Output only. The time when the product was last updated.
  380. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  381. }
  382. // Defines the reference of an asset belonging to a product.
  383. message AssetReference {
  384. // Possible validation steates of an asset reference.
  385. enum AssetValidationState {
  386. // Unknown state.
  387. ASSET_VALIDATION_STATE_UNSPECIFIED = 0;
  388. // The validation is still in process.
  389. PENDING = 1;
  390. // The validation is done and the asset reference is valid.
  391. VALID = 2;
  392. // The validation is done and the asset reference is invalid.
  393. INVALID = 3;
  394. }
  395. // Output only. A unique identifier among asset references in a product.
  396. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  397. // Output only. The human-readable description of the referenced asset. Maximum 256
  398. // characters in length.
  399. string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  400. // Output only. The definition of input parameters to hydrate the asset template.
  401. Inputs inputs = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  402. // Output only. The current state of the asset reference.
  403. AssetValidationState validation_status = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  404. // Output only. The validation process metadata.
  405. google.longrunning.Operation validation_operation = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  406. // The destination of the asset.
  407. oneof source {
  408. // Output only. The asset resource name if an asset is hosted by Private Catalog.
  409. string asset = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  410. // Output only. The cloud storage object path.
  411. string gcs_path = 11 [
  412. deprecated = true,
  413. (google.api.field_behavior) = OUTPUT_ONLY
  414. ];
  415. // Output only. The git source.
  416. GitSource git_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  417. }
  418. // Output only. The cloud storage source.
  419. GcsSource gcs_source = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  420. // Output only. The creation timestamp of the asset reference.
  421. google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  422. // Output only. The last update timestamp of the asset reference.
  423. google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  424. // The version of the source used for this asset reference.
  425. string version = 14 [deprecated = true];
  426. }
  427. // Defines definition of input parameters of asset templates.
  428. message Inputs {
  429. // Output only. The JSON schema defining the inputs and their formats.
  430. google.protobuf.Struct parameters = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  431. }
  432. // Defines how to access Cloud Storage source.
  433. message GcsSource {
  434. // Output only. the cloud storage object path.
  435. string gcs_path = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  436. // Output only. Generation of the object, which is set when the content of an object starts
  437. // being written.
  438. int64 generation = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  439. // Output only. The time when the object metadata was last changed.
  440. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  441. }
  442. // Defines how to access a Git Source.
  443. message GitSource {
  444. // Location of the Git repo to build.
  445. string repo = 1;
  446. // Directory, relative to the source root, in which to run the build.
  447. //
  448. // This must be a relative path. If a step's `dir` is specified and is an
  449. // absolute path, this value is ignored for that step's execution.
  450. string dir = 2;
  451. // The revision to fetch from the Git repository such as a branch, a tag, a
  452. // commit SHA, or any Git ref.
  453. oneof ref {
  454. // The revision commit to use.
  455. string commit = 3;
  456. // The revision branch to use.
  457. string branch = 4;
  458. // The revision tag to use.
  459. string tag = 5;
  460. }
  461. }
  462. // The consumer representation of a version which is a child resource under a
  463. // `Product` with asset data.
  464. message Version {
  465. option (google.api.resource) = {
  466. type: "cloudprivatecatalog.googleapis.com/Version"
  467. pattern: "catalogs/{catalog}/products/{product}/versions/{version}"
  468. };
  469. // Output only. The resource name of the version, in the format
  470. // `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]'.
  471. //
  472. // A unique identifier for the version under a product.
  473. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  474. // Output only. The user-supplied description of the version. Maximum of 256
  475. // characters.
  476. string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  477. // Output only. The asset which has been validated and is ready to be
  478. // provisioned. See
  479. // [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details.
  480. google.protobuf.Struct asset = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  481. // Output only. The time when the version was created.
  482. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  483. // Output only. The time when the version was last updated.
  484. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  485. }