Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 09ea109

Browse files
feat: add Content APIs (#11)
- [ ] Regenerate this pull request now. 1. Content APIs. 2. Create|Update|Delete Metadata APIs (e.g. Entity and/or Partition). PiperOrigin-RevId: 429081053 Source-Link: googleapis/googleapis@7b42fd0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3f71d2df5c102ee1fe82f492de545cd3a3dc7f79 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2Y3MWQyZGY1YzEwMmVlMWZlODJmNDkyZGU1NDVjZDNhM2RjN2Y3OSJ9 feat: add Create|Update|Delete Metadata APIs (e.g. Entity and/or Partition).
1 parent 8e51e0b commit 09ea109

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

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

0 commit comments

Comments
 (0)