content.proto 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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.dataplex.v1;
  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/cloud/dataplex/v1/analyze.proto";
  21. import "google/iam/v1/iam_policy.proto";
  22. import "google/iam/v1/policy.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/field_mask.proto";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "ContentProto";
  28. option java_package = "com.google.cloud.dataplex.v1";
  29. // ContentService manages Notebook and SQL Scripts for Dataplex.
  30. service ContentService {
  31. option (google.api.default_host) = "dataplex.googleapis.com";
  32. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  33. // Create a content.
  34. rpc CreateContent(CreateContentRequest) returns (Content) {
  35. option (google.api.http) = {
  36. post: "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems"
  37. body: "content"
  38. additional_bindings {
  39. post: "/v1/{parent=projects/*/locations/*/lakes/*}/content"
  40. body: "content"
  41. }
  42. };
  43. option (google.api.method_signature) = "parent,content";
  44. }
  45. // Update a content. Only supports full resource update.
  46. rpc UpdateContent(UpdateContentRequest) returns (Content) {
  47. option (google.api.http) = {
  48. patch: "/v1/{content.name=projects/*/locations/*/lakes/*/contentitems/**}"
  49. body: "content"
  50. additional_bindings {
  51. patch: "/v1/{content.name=projects/*/locations/*/lakes/*/content/**}"
  52. body: "content"
  53. }
  54. };
  55. option (google.api.method_signature) = "content,update_mask";
  56. }
  57. // Delete a content.
  58. rpc DeleteContent(DeleteContentRequest) returns (google.protobuf.Empty) {
  59. option (google.api.http) = {
  60. delete: "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}"
  61. additional_bindings {
  62. delete: "/v1/{name=projects/*/locations/*/lakes/*/content/**}"
  63. }
  64. };
  65. option (google.api.method_signature) = "name";
  66. }
  67. // Get a content resource.
  68. rpc GetContent(GetContentRequest) returns (Content) {
  69. option (google.api.http) = {
  70. get: "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}"
  71. additional_bindings {
  72. get: "/v1/{name=projects/*/locations/*/lakes/*/content/**}"
  73. }
  74. };
  75. option (google.api.method_signature) = "name";
  76. }
  77. // Gets the access control policy for a contentitem resource. A `NOT_FOUND`
  78. // error is returned if the resource does not exist. An empty policy is
  79. // returned if the resource exists but does not have a policy set on it.
  80. //
  81. // Caller must have Google IAM `dataplex.content.getIamPolicy` permission
  82. // on the resource.
  83. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  84. option (google.api.http) = {
  85. get: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:getIamPolicy"
  86. additional_bindings {
  87. get: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:getIamPolicy"
  88. }
  89. };
  90. option (google.api.method_signature) = "resource";
  91. }
  92. // Sets the access control policy on the specified contentitem resource.
  93. // Replaces any existing policy.
  94. //
  95. // Caller must have Google IAM `dataplex.content.setIamPolicy` permission
  96. // on the resource.
  97. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  98. option (google.api.http) = {
  99. post: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:setIamPolicy"
  100. body: "*"
  101. additional_bindings {
  102. post: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:setIamPolicy"
  103. body: "*"
  104. }
  105. };
  106. }
  107. // Returns the caller's permissions on a resource.
  108. // If the resource does not exist, an empty set of
  109. // permissions is returned (a `NOT_FOUND` error is not returned).
  110. //
  111. // A caller is not required to have Google IAM permission to make this
  112. // request.
  113. //
  114. // Note: This operation is designed to be used for building permission-aware
  115. // UIs and command-line tools, not for authorization checking. This operation
  116. // may "fail open" without warning.
  117. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  118. option (google.api.http) = {
  119. post: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:testIamPermissions"
  120. body: "*"
  121. additional_bindings {
  122. post: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:testIamPermissions"
  123. body: "*"
  124. }
  125. };
  126. }
  127. // List content.
  128. rpc ListContent(ListContentRequest) returns (ListContentResponse) {
  129. option (google.api.http) = {
  130. get: "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems"
  131. additional_bindings {
  132. get: "/v1/{parent=projects/*/locations/*/lakes/*}/content"
  133. }
  134. };
  135. option (google.api.method_signature) = "parent";
  136. }
  137. }
  138. // Create content request.
  139. message CreateContentRequest {
  140. // Required. The resource name of the parent lake:
  141. // projects/{project_id}/locations/{location_id}/lakes/{lake_id}
  142. string parent = 1 [
  143. (google.api.field_behavior) = REQUIRED,
  144. (google.api.resource_reference) = {
  145. type: "dataplex.googleapis.com/Lake"
  146. }
  147. ];
  148. // Required. Content resource.
  149. Content content = 2 [(google.api.field_behavior) = REQUIRED];
  150. // Optional. Only validate the request, but do not perform mutations.
  151. // The default is false.
  152. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
  153. }
  154. // Update content request.
  155. message UpdateContentRequest {
  156. // Required. Mask of fields to update.
  157. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
  158. // Required. Update description.
  159. // Only fields specified in `update_mask` are updated.
  160. Content content = 2 [(google.api.field_behavior) = REQUIRED];
  161. // Optional. Only validate the request, but do not perform mutations.
  162. // The default is false.
  163. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
  164. }
  165. // Delete content request.
  166. message DeleteContentRequest {
  167. // Required. The resource name of the content:
  168. // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
  169. string name = 1 [
  170. (google.api.field_behavior) = REQUIRED,
  171. (google.api.resource_reference) = {
  172. type: "dataplex.googleapis.com/Content"
  173. }
  174. ];
  175. }
  176. // List content request. Returns the BASIC Content view.
  177. message ListContentRequest {
  178. // Required. The resource name of the parent lake:
  179. // projects/{project_id}/locations/{location_id}/lakes/{lake_id}
  180. string parent = 1 [
  181. (google.api.field_behavior) = REQUIRED,
  182. (google.api.resource_reference) = {
  183. type: "dataplex.googleapis.com/Lake"
  184. }
  185. ];
  186. // Optional. Maximum number of content to return. The service may return fewer than
  187. // this value. If unspecified, at most 10 content will be returned. The
  188. // maximum value is 1000; values above 1000 will be coerced to 1000.
  189. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  190. // Optional. Page token received from a previous `ListContent` call. Provide this
  191. // to retrieve the subsequent page. When paginating, all other parameters
  192. // provided to `ListContent` must match the call that provided the page
  193. // token.
  194. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  195. // Optional. Filter request. Filters are case-sensitive.
  196. // The following formats are supported:
  197. //
  198. // labels.key1 = "value1"
  199. // labels:key1
  200. // type = "NOTEBOOK"
  201. // type = "SQL_SCRIPT"
  202. //
  203. // These restrictions can be coinjoined with AND, OR and NOT conjunctions.
  204. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  205. }
  206. // List content response.
  207. message ListContentResponse {
  208. // Content under the given parent lake.
  209. repeated Content content = 1;
  210. // Token to retrieve the next page of results, or empty if there are no more
  211. // results in the list.
  212. string next_page_token = 2;
  213. }
  214. // Get content request.
  215. message GetContentRequest {
  216. // Specifies whether the request should return the full or the partial
  217. // representation.
  218. enum ContentView {
  219. // Content view not specified. Defaults to BASIC.
  220. // The API will default to the BASIC view.
  221. CONTENT_VIEW_UNSPECIFIED = 0;
  222. // Will not return the `data_text` field.
  223. BASIC = 1;
  224. // Returns the complete proto.
  225. FULL = 2;
  226. }
  227. // Required. The resource name of the content:
  228. // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
  229. string name = 1 [
  230. (google.api.field_behavior) = REQUIRED,
  231. (google.api.resource_reference) = {
  232. type: "dataplex.googleapis.com/Content"
  233. }
  234. ];
  235. // Optional. Specify content view to make a partial request.
  236. ContentView view = 2 [(google.api.field_behavior) = OPTIONAL];
  237. }