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