xref: /aosp_15_r20/external/googleapis/google/cloud/dataplex/v1/analyze.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/dataplex/v1/resources.proto";
22import "google/protobuf/duration.proto";
23import "google/protobuf/timestamp.proto";
24
25option go_package = "cloud.google.com/go/dataplex/apiv1/dataplexpb;dataplexpb";
26option java_multiple_files = true;
27option java_outer_classname = "AnalyzeProto";
28option java_package = "com.google.cloud.dataplex.v1";
29
30// Environment represents a user-visible compute infrastructure for analytics
31// within a lake.
32message Environment {
33  option (google.api.resource) = {
34    type: "dataplex.googleapis.com/Environment"
35    pattern: "projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}"
36  };
37
38  // Configuration for the underlying infrastructure used to run workloads.
39  message InfrastructureSpec {
40    // Compute resources associated with the analyze interactive workloads.
41    message ComputeResources {
42      // Optional. Size in GB of the disk. Default is 100 GB.
43      int32 disk_size_gb = 1 [(google.api.field_behavior) = OPTIONAL];
44
45      // Optional. Total number of nodes in the sessions created for this
46      // environment.
47      int32 node_count = 2 [(google.api.field_behavior) = OPTIONAL];
48
49      // Optional. Max configurable nodes.
50      // If max_node_count > node_count, then auto-scaling is enabled.
51      int32 max_node_count = 3 [(google.api.field_behavior) = OPTIONAL];
52    }
53
54    // Software Runtime Configuration to run Analyze.
55    message OsImageRuntime {
56      // Required. Dataplex Image version.
57      string image_version = 1 [(google.api.field_behavior) = REQUIRED];
58
59      // Optional. List of Java jars to be included in the runtime environment.
60      // Valid input includes Cloud Storage URIs to Jar binaries.
61      // For example, gs://bucket-name/my/path/to/file.jar
62      repeated string java_libraries = 2
63          [(google.api.field_behavior) = OPTIONAL];
64
65      // Optional. A list of python packages to be installed.
66      // Valid formats include Cloud Storage URI to a PIP installable library.
67      // For example, gs://bucket-name/my/path/to/lib.tar.gz
68      repeated string python_packages = 3
69          [(google.api.field_behavior) = OPTIONAL];
70
71      // Optional. Spark properties to provide configuration for use in sessions
72      // created for this environment. The properties to set on daemon config
73      // files. Property keys are specified in `prefix:property` format. The
74      // prefix must be "spark".
75      map<string, string> properties = 4
76          [(google.api.field_behavior) = OPTIONAL];
77    }
78
79    // Hardware config
80    oneof resources {
81      // Optional. Compute resources needed for analyze interactive workloads.
82      ComputeResources compute = 50 [(google.api.field_behavior) = OPTIONAL];
83    }
84
85    // Software config
86    oneof runtime {
87      // Required. Software Runtime Configuration for analyze interactive
88      // workloads.
89      OsImageRuntime os_image = 100 [(google.api.field_behavior) = REQUIRED];
90    }
91  }
92
93  // Configuration for sessions created for this environment.
94  message SessionSpec {
95    // Optional. The idle time configuration of the session. The session will be
96    // auto-terminated at the end of this period.
97    google.protobuf.Duration max_idle_duration = 1
98        [(google.api.field_behavior) = OPTIONAL];
99
100    // Optional. If True, this causes sessions to be pre-created and available
101    // for faster startup to enable interactive exploration use-cases. This
102    // defaults to False to avoid additional billed charges. These can only be
103    // set to True for the environment with name set to "default", and with
104    // default configuration.
105    bool enable_fast_startup = 2 [(google.api.field_behavior) = OPTIONAL];
106  }
107
108  // Status of sessions created for this environment.
109  message SessionStatus {
110    // Output only. Queries over sessions to mark whether the environment is
111    // currently active or not
112    bool active = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
113  }
114
115  // URI Endpoints to access sessions associated with the Environment.
116  message Endpoints {
117    // Output only. URI to serve notebook APIs
118    string notebooks = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
119
120    // Output only. URI to serve SQL APIs
121    string sql = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
122  }
123
124  // Output only. The relative resource name of the environment, of the form:
125  // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
126  string name = 1 [
127    (google.api.field_behavior) = OUTPUT_ONLY,
128    (google.api.resource_reference) = {
129      type: "dataplex.googleapis.com/Environment"
130    }
131  ];
132
133  // Optional. User friendly display name.
134  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
135
136  // Output only. System generated globally unique ID for the environment. This
137  // ID will be different if the environment is deleted and re-created with the
138  // same name.
139  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
140
141  // Output only. Environment creation time.
142  google.protobuf.Timestamp create_time = 4
143      [(google.api.field_behavior) = OUTPUT_ONLY];
144
145  // Output only. The time when the environment was last updated.
146  google.protobuf.Timestamp update_time = 5
147      [(google.api.field_behavior) = OUTPUT_ONLY];
148
149  // Optional. User defined labels for the environment.
150  map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
151
152  // Optional. Description of the environment.
153  string description = 7 [(google.api.field_behavior) = OPTIONAL];
154
155  // Output only. Current state of the environment.
156  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
157
158  // Required. Infrastructure specification for the Environment.
159  InfrastructureSpec infrastructure_spec = 100
160      [(google.api.field_behavior) = REQUIRED];
161
162  // Optional. Configuration for sessions created for this environment.
163  SessionSpec session_spec = 101 [(google.api.field_behavior) = OPTIONAL];
164
165  // Output only. Status of sessions created for this environment.
166  SessionStatus session_status = 102
167      [(google.api.field_behavior) = OUTPUT_ONLY];
168
169  // Output only. URI Endpoints to access sessions associated with the
170  // Environment.
171  Endpoints endpoints = 200 [(google.api.field_behavior) = OUTPUT_ONLY];
172}
173
174// Content represents a user-visible notebook or a sql script
175message Content {
176  option (google.api.resource) = {
177    type: "dataplex.googleapis.com/Content"
178    pattern: "projects/{project}/locations/{location}/lakes/{lake}/content/{content}"
179  };
180
181  // Configuration for the Sql Script content.
182  message SqlScript {
183    // Query Engine Type of the SQL Script.
184    enum QueryEngine {
185      // Value was unspecified.
186      QUERY_ENGINE_UNSPECIFIED = 0;
187
188      // Spark SQL Query.
189      SPARK = 2;
190    }
191
192    // Required. Query Engine to be used for the Sql Query.
193    QueryEngine engine = 1 [(google.api.field_behavior) = REQUIRED];
194  }
195
196  // Configuration for Notebook content.
197  message Notebook {
198    // Kernel Type of the Jupyter notebook.
199    enum KernelType {
200      // Kernel Type unspecified.
201      KERNEL_TYPE_UNSPECIFIED = 0;
202
203      // Python 3 Kernel.
204      PYTHON3 = 1;
205    }
206
207    // Required. Kernel Type of the notebook.
208    KernelType kernel_type = 1 [(google.api.field_behavior) = REQUIRED];
209  }
210
211  // Output only. The relative resource name of the content, of the form:
212  // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
213  string name = 1 [
214    (google.api.field_behavior) = OUTPUT_ONLY,
215    (google.api.resource_reference) = {
216      type: "dataplex.googleapis.com/Content"
217    }
218  ];
219
220  // Output only. System generated globally unique ID for the content. This ID
221  // will be different if the content is deleted and re-created with the same
222  // name.
223  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
224
225  // Required. The path for the Content file, represented as directory
226  // structure. Unique within a lake. Limited to alphanumerics, hyphens,
227  // underscores, dots and slashes.
228  string path = 3 [(google.api.field_behavior) = REQUIRED];
229
230  // Output only. Content creation time.
231  google.protobuf.Timestamp create_time = 4
232      [(google.api.field_behavior) = OUTPUT_ONLY];
233
234  // Output only. The time when the content was last updated.
235  google.protobuf.Timestamp update_time = 5
236      [(google.api.field_behavior) = OUTPUT_ONLY];
237
238  // Optional. User defined labels for the content.
239  map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
240
241  // Optional. Description of the content.
242  string description = 7 [(google.api.field_behavior) = OPTIONAL];
243
244  // Only returned in `GetContent` requests and not in `ListContent` request.
245  oneof data {
246    // Required. Content data in string format.
247    string data_text = 9 [(google.api.field_behavior) = REQUIRED];
248  }
249
250  // Types of content
251  oneof content {
252    // Sql Script related configurations.
253    SqlScript sql_script = 100;
254
255    // Notebook related configurations.
256    Notebook notebook = 101;
257  }
258}
259
260// Represents an active analyze session running for a user.
261message Session {
262  option (google.api.resource) = {
263    type: "dataplex.googleapis.com/Session"
264    pattern: "projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}/sessions/{session}"
265  };
266
267  // Output only. The relative resource name of the content, of the form:
268  // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}/sessions/{session_id}
269  string name = 1 [
270    (google.api.field_behavior) = OUTPUT_ONLY,
271    (google.api.resource_reference) = {
272      type: "dataplex.googleapis.com/Session"
273    }
274  ];
275
276  // Output only. Email of user running the session.
277  string user_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
278
279  // Output only. Session start time.
280  google.protobuf.Timestamp create_time = 3
281      [(google.api.field_behavior) = OUTPUT_ONLY];
282
283  // Output only. State of Session
284  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
285}
286