analyze.proto 10 KB

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