workflow_templates.proto 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. // Copyright 2021 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.dataproc.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/dataproc/v1/clusters.proto";
  21. import "google/cloud/dataproc/v1/jobs.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/duration.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/timestamp.proto";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1;dataproc";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "WorkflowTemplatesProto";
  29. option java_package = "com.google.cloud.dataproc.v1";
  30. // The API interface for managing Workflow Templates in the
  31. // Dataproc API.
  32. service WorkflowTemplateService {
  33. option (google.api.default_host) = "dataproc.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  35. // Creates new workflow template.
  36. rpc CreateWorkflowTemplate(CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
  37. option (google.api.http) = {
  38. post: "/v1/{parent=projects/*/locations/*}/workflowTemplates"
  39. body: "template"
  40. additional_bindings {
  41. post: "/v1/{parent=projects/*/regions/*}/workflowTemplates"
  42. body: "template"
  43. }
  44. };
  45. option (google.api.method_signature) = "parent,template";
  46. }
  47. // Retrieves the latest workflow template.
  48. //
  49. // Can retrieve previously instantiated template by specifying optional
  50. // version parameter.
  51. rpc GetWorkflowTemplate(GetWorkflowTemplateRequest) returns (WorkflowTemplate) {
  52. option (google.api.http) = {
  53. get: "/v1/{name=projects/*/locations/*/workflowTemplates/*}"
  54. additional_bindings {
  55. get: "/v1/{name=projects/*/regions/*/workflowTemplates/*}"
  56. }
  57. };
  58. option (google.api.method_signature) = "name";
  59. }
  60. // Instantiates a template and begins execution.
  61. //
  62. // The returned Operation can be used to track execution of
  63. // workflow by polling
  64. // [operations.get][google.longrunning.Operations.GetOperation].
  65. // The Operation will complete when entire workflow is finished.
  66. //
  67. // The running workflow can be aborted via
  68. // [operations.cancel][google.longrunning.Operations.CancelOperation].
  69. // This will cause any inflight jobs to be cancelled and workflow-owned
  70. // clusters to be deleted.
  71. //
  72. // The [Operation.metadata][google.longrunning.Operation.metadata] will be
  73. // [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
  74. // Also see [Using
  75. // WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
  76. //
  77. // On successful completion,
  78. // [Operation.response][google.longrunning.Operation.response] will be
  79. // [Empty][google.protobuf.Empty].
  80. rpc InstantiateWorkflowTemplate(InstantiateWorkflowTemplateRequest) returns (google.longrunning.Operation) {
  81. option (google.api.http) = {
  82. post: "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate"
  83. body: "*"
  84. additional_bindings {
  85. post: "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate"
  86. body: "*"
  87. }
  88. };
  89. option (google.api.method_signature) = "name";
  90. option (google.api.method_signature) = "name,parameters";
  91. option (google.longrunning.operation_info) = {
  92. response_type: "google.protobuf.Empty"
  93. metadata_type: "WorkflowMetadata"
  94. };
  95. }
  96. // Instantiates a template and begins execution.
  97. //
  98. // This method is equivalent to executing the sequence
  99. // [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
  100. // [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
  101. //
  102. // The returned Operation can be used to track execution of
  103. // workflow by polling
  104. // [operations.get][google.longrunning.Operations.GetOperation].
  105. // The Operation will complete when entire workflow is finished.
  106. //
  107. // The running workflow can be aborted via
  108. // [operations.cancel][google.longrunning.Operations.CancelOperation].
  109. // This will cause any inflight jobs to be cancelled and workflow-owned
  110. // clusters to be deleted.
  111. //
  112. // The [Operation.metadata][google.longrunning.Operation.metadata] will be
  113. // [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
  114. // Also see [Using
  115. // WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
  116. //
  117. // On successful completion,
  118. // [Operation.response][google.longrunning.Operation.response] will be
  119. // [Empty][google.protobuf.Empty].
  120. rpc InstantiateInlineWorkflowTemplate(InstantiateInlineWorkflowTemplateRequest) returns (google.longrunning.Operation) {
  121. option (google.api.http) = {
  122. post: "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline"
  123. body: "template"
  124. additional_bindings {
  125. post: "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline"
  126. body: "template"
  127. }
  128. };
  129. option (google.api.method_signature) = "parent,template";
  130. option (google.longrunning.operation_info) = {
  131. response_type: "google.protobuf.Empty"
  132. metadata_type: "WorkflowMetadata"
  133. };
  134. }
  135. // Updates (replaces) workflow template. The updated template
  136. // must contain version that matches the current server version.
  137. rpc UpdateWorkflowTemplate(UpdateWorkflowTemplateRequest) returns (WorkflowTemplate) {
  138. option (google.api.http) = {
  139. put: "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}"
  140. body: "template"
  141. additional_bindings {
  142. put: "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}"
  143. body: "template"
  144. }
  145. };
  146. option (google.api.method_signature) = "template";
  147. }
  148. // Lists workflows that match the specified filter in the request.
  149. rpc ListWorkflowTemplates(ListWorkflowTemplatesRequest) returns (ListWorkflowTemplatesResponse) {
  150. option (google.api.http) = {
  151. get: "/v1/{parent=projects/*/locations/*}/workflowTemplates"
  152. additional_bindings {
  153. get: "/v1/{parent=projects/*/regions/*}/workflowTemplates"
  154. }
  155. };
  156. option (google.api.method_signature) = "parent";
  157. }
  158. // Deletes a workflow template. It does not cancel in-progress workflows.
  159. rpc DeleteWorkflowTemplate(DeleteWorkflowTemplateRequest) returns (google.protobuf.Empty) {
  160. option (google.api.http) = {
  161. delete: "/v1/{name=projects/*/locations/*/workflowTemplates/*}"
  162. additional_bindings {
  163. delete: "/v1/{name=projects/*/regions/*/workflowTemplates/*}"
  164. }
  165. };
  166. option (google.api.method_signature) = "name";
  167. }
  168. }
  169. // A Dataproc workflow template resource.
  170. message WorkflowTemplate {
  171. option (google.api.resource) = {
  172. type: "dataproc.googleapis.com/WorkflowTemplate"
  173. pattern: "projects/{project}/regions/{region}/workflowTemplates/{workflow_template}"
  174. pattern: "projects/{project}/locations/{location}/workflowTemplates/{workflow_template}"
  175. history: ORIGINALLY_SINGLE_PATTERN
  176. };
  177. string id = 2 [(google.api.field_behavior) = REQUIRED];
  178. // Output only. The resource name of the workflow template, as described
  179. // in https://cloud.google.com/apis/design/resource_names.
  180. //
  181. // * For `projects.regions.workflowTemplates`, the resource name of the
  182. // template has the following format:
  183. // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
  184. //
  185. // * For `projects.locations.workflowTemplates`, the resource name of the
  186. // template has the following format:
  187. // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
  188. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  189. // Optional. Used to perform a consistent read-modify-write.
  190. //
  191. // This field should be left blank for a `CreateWorkflowTemplate` request. It
  192. // is required for an `UpdateWorkflowTemplate` request, and must match the
  193. // current server version. A typical update template flow would fetch the
  194. // current template with a `GetWorkflowTemplate` request, which will return
  195. // the current template with the `version` field filled in with the
  196. // current server version. The user updates other fields in the template,
  197. // then returns it as part of the `UpdateWorkflowTemplate` request.
  198. int32 version = 3 [(google.api.field_behavior) = OPTIONAL];
  199. // Output only. The time template was created.
  200. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  201. // Output only. The time template was last updated.
  202. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  203. // Optional. The labels to associate with this template. These labels
  204. // will be propagated to all jobs and clusters created by the workflow
  205. // instance.
  206. //
  207. // Label **keys** must contain 1 to 63 characters, and must conform to
  208. // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
  209. //
  210. // Label **values** may be empty, but, if present, must contain 1 to 63
  211. // characters, and must conform to
  212. // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
  213. //
  214. // No more than 32 labels can be associated with a template.
  215. map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
  216. // Required. WorkflowTemplate scheduling information.
  217. WorkflowTemplatePlacement placement = 7 [(google.api.field_behavior) = REQUIRED];
  218. // Required. The Directed Acyclic Graph of Jobs to submit.
  219. repeated OrderedJob jobs = 8 [(google.api.field_behavior) = REQUIRED];
  220. // Optional. Template parameters whose values are substituted into the
  221. // template. Values for parameters must be provided when the template is
  222. // instantiated.
  223. repeated TemplateParameter parameters = 9 [(google.api.field_behavior) = OPTIONAL];
  224. // Optional. Timeout duration for the DAG of jobs, expressed in seconds (see
  225. // [JSON representation of
  226. // duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
  227. // The timeout duration must be from 10 minutes ("600s") to 24 hours
  228. // ("86400s"). The timer begins when the first job is submitted. If the
  229. // workflow is running at the end of the timeout period, any remaining jobs
  230. // are cancelled, the workflow is ended, and if the workflow was running on a
  231. // [managed
  232. // cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster),
  233. // the cluster is deleted.
  234. google.protobuf.Duration dag_timeout = 10 [(google.api.field_behavior) = OPTIONAL];
  235. }
  236. // Specifies workflow execution target.
  237. //
  238. // Either `managed_cluster` or `cluster_selector` is required.
  239. message WorkflowTemplatePlacement {
  240. // Required. Specifies where workflow executes; either on a managed
  241. // cluster or an existing cluster chosen by labels.
  242. oneof placement {
  243. // A cluster that is managed by the workflow.
  244. ManagedCluster managed_cluster = 1;
  245. // Optional. A selector that chooses target cluster for jobs based
  246. // on metadata.
  247. //
  248. // The selector is evaluated at the time each job is submitted.
  249. ClusterSelector cluster_selector = 2;
  250. }
  251. }
  252. // Cluster that is managed by the workflow.
  253. message ManagedCluster {
  254. // Required. The cluster name prefix. A unique cluster name will be formed by
  255. // appending a random suffix.
  256. //
  257. // The name must contain only lower-case letters (a-z), numbers (0-9),
  258. // and hyphens (-). Must begin with a letter. Cannot begin or end with
  259. // hyphen. Must consist of between 2 and 35 characters.
  260. string cluster_name = 2 [(google.api.field_behavior) = REQUIRED];
  261. // Required. The cluster configuration.
  262. ClusterConfig config = 3 [(google.api.field_behavior) = REQUIRED];
  263. // Optional. The labels to associate with this cluster.
  264. //
  265. // Label keys must be between 1 and 63 characters long, and must conform to
  266. // the following PCRE regular expression:
  267. // [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
  268. //
  269. // Label values must be between 1 and 63 characters long, and must conform to
  270. // the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
  271. //
  272. // No more than 32 labels can be associated with a given cluster.
  273. map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
  274. }
  275. // A selector that chooses target cluster for jobs based on metadata.
  276. message ClusterSelector {
  277. // Optional. The zone where workflow process executes. This parameter does not
  278. // affect the selection of the cluster.
  279. //
  280. // If unspecified, the zone of the first cluster matching the selector
  281. // is used.
  282. string zone = 1 [(google.api.field_behavior) = OPTIONAL];
  283. // Required. The cluster labels. Cluster must have all labels
  284. // to match.
  285. map<string, string> cluster_labels = 2 [(google.api.field_behavior) = REQUIRED];
  286. }
  287. // A job executed by the workflow.
  288. message OrderedJob {
  289. // Required. The step id. The id must be unique among all jobs
  290. // within the template.
  291. //
  292. // The step id is used as prefix for job id, as job
  293. // `goog-dataproc-workflow-step-id` label, and in
  294. // [prerequisiteStepIds][google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids] field from other
  295. // steps.
  296. //
  297. // The id must contain only letters (a-z, A-Z), numbers (0-9),
  298. // underscores (_), and hyphens (-). Cannot begin or end with underscore
  299. // or hyphen. Must consist of between 3 and 50 characters.
  300. string step_id = 1 [(google.api.field_behavior) = REQUIRED];
  301. // Required. The job definition.
  302. oneof job_type {
  303. // Optional. Job is a Hadoop job.
  304. HadoopJob hadoop_job = 2 [(google.api.field_behavior) = OPTIONAL];
  305. // Optional. Job is a Spark job.
  306. SparkJob spark_job = 3 [(google.api.field_behavior) = OPTIONAL];
  307. // Optional. Job is a PySpark job.
  308. PySparkJob pyspark_job = 4 [(google.api.field_behavior) = OPTIONAL];
  309. // Optional. Job is a Hive job.
  310. HiveJob hive_job = 5 [(google.api.field_behavior) = OPTIONAL];
  311. // Optional. Job is a Pig job.
  312. PigJob pig_job = 6 [(google.api.field_behavior) = OPTIONAL];
  313. // Optional. Job is a SparkR job.
  314. SparkRJob spark_r_job = 11 [(google.api.field_behavior) = OPTIONAL];
  315. // Optional. Job is a SparkSql job.
  316. SparkSqlJob spark_sql_job = 7 [(google.api.field_behavior) = OPTIONAL];
  317. // Optional. Job is a Presto job.
  318. PrestoJob presto_job = 12 [(google.api.field_behavior) = OPTIONAL];
  319. }
  320. // Optional. The labels to associate with this job.
  321. //
  322. // Label keys must be between 1 and 63 characters long, and must conform to
  323. // the following regular expression:
  324. // [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
  325. //
  326. // Label values must be between 1 and 63 characters long, and must conform to
  327. // the following regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
  328. //
  329. // No more than 32 labels can be associated with a given job.
  330. map<string, string> labels = 8 [(google.api.field_behavior) = OPTIONAL];
  331. // Optional. Job scheduling configuration.
  332. JobScheduling scheduling = 9 [(google.api.field_behavior) = OPTIONAL];
  333. // Optional. The optional list of prerequisite job step_ids.
  334. // If not specified, the job will start at the beginning of workflow.
  335. repeated string prerequisite_step_ids = 10 [(google.api.field_behavior) = OPTIONAL];
  336. }
  337. // A configurable parameter that replaces one or more fields in the template.
  338. // Parameterizable fields:
  339. // - Labels
  340. // - File uris
  341. // - Job properties
  342. // - Job arguments
  343. // - Script variables
  344. // - Main class (in HadoopJob and SparkJob)
  345. // - Zone (in ClusterSelector)
  346. message TemplateParameter {
  347. // Required. Parameter name.
  348. // The parameter name is used as the key, and paired with the
  349. // parameter value, which are passed to the template when the template
  350. // is instantiated.
  351. // The name must contain only capital letters (A-Z), numbers (0-9), and
  352. // underscores (_), and must not start with a number. The maximum length is
  353. // 40 characters.
  354. string name = 1 [(google.api.field_behavior) = REQUIRED];
  355. // Required. Paths to all fields that the parameter replaces.
  356. // A field is allowed to appear in at most one parameter's list of field
  357. // paths.
  358. //
  359. // A field path is similar in syntax to a [google.protobuf.FieldMask][google.protobuf.FieldMask].
  360. // For example, a field path that references the zone field of a workflow
  361. // template's cluster selector would be specified as
  362. // `placement.clusterSelector.zone`.
  363. //
  364. // Also, field paths can reference fields using the following syntax:
  365. //
  366. // * Values in maps can be referenced by key:
  367. // * labels['key']
  368. // * placement.clusterSelector.clusterLabels['key']
  369. // * placement.managedCluster.labels['key']
  370. // * placement.clusterSelector.clusterLabels['key']
  371. // * jobs['step-id'].labels['key']
  372. //
  373. // * Jobs in the jobs list can be referenced by step-id:
  374. // * jobs['step-id'].hadoopJob.mainJarFileUri
  375. // * jobs['step-id'].hiveJob.queryFileUri
  376. // * jobs['step-id'].pySparkJob.mainPythonFileUri
  377. // * jobs['step-id'].hadoopJob.jarFileUris[0]
  378. // * jobs['step-id'].hadoopJob.archiveUris[0]
  379. // * jobs['step-id'].hadoopJob.fileUris[0]
  380. // * jobs['step-id'].pySparkJob.pythonFileUris[0]
  381. //
  382. // * Items in repeated fields can be referenced by a zero-based index:
  383. // * jobs['step-id'].sparkJob.args[0]
  384. //
  385. // * Other examples:
  386. // * jobs['step-id'].hadoopJob.properties['key']
  387. // * jobs['step-id'].hadoopJob.args[0]
  388. // * jobs['step-id'].hiveJob.scriptVariables['key']
  389. // * jobs['step-id'].hadoopJob.mainJarFileUri
  390. // * placement.clusterSelector.zone
  391. //
  392. // It may not be possible to parameterize maps and repeated fields in their
  393. // entirety since only individual map values and individual items in repeated
  394. // fields can be referenced. For example, the following field paths are
  395. // invalid:
  396. //
  397. // - placement.clusterSelector.clusterLabels
  398. // - jobs['step-id'].sparkJob.args
  399. repeated string fields = 2 [(google.api.field_behavior) = REQUIRED];
  400. // Optional. Brief description of the parameter.
  401. // Must not exceed 1024 characters.
  402. string description = 3 [(google.api.field_behavior) = OPTIONAL];
  403. // Optional. Validation rules to be applied to this parameter's value.
  404. ParameterValidation validation = 4 [(google.api.field_behavior) = OPTIONAL];
  405. }
  406. // Configuration for parameter validation.
  407. message ParameterValidation {
  408. // Required. The type of validation to be performed.
  409. oneof validation_type {
  410. // Validation based on regular expressions.
  411. RegexValidation regex = 1;
  412. // Validation based on a list of allowed values.
  413. ValueValidation values = 2;
  414. }
  415. }
  416. // Validation based on regular expressions.
  417. message RegexValidation {
  418. // Required. RE2 regular expressions used to validate the parameter's value.
  419. // The value must match the regex in its entirety (substring
  420. // matches are not sufficient).
  421. repeated string regexes = 1 [(google.api.field_behavior) = REQUIRED];
  422. }
  423. // Validation based on a list of allowed values.
  424. message ValueValidation {
  425. // Required. List of allowed values for the parameter.
  426. repeated string values = 1 [(google.api.field_behavior) = REQUIRED];
  427. }
  428. // A Dataproc workflow template resource.
  429. message WorkflowMetadata {
  430. // The operation state.
  431. enum State {
  432. // Unused.
  433. UNKNOWN = 0;
  434. // The operation has been created.
  435. PENDING = 1;
  436. // The operation is running.
  437. RUNNING = 2;
  438. // The operation is done; either cancelled or completed.
  439. DONE = 3;
  440. }
  441. // Output only. The resource name of the workflow template as described
  442. // in https://cloud.google.com/apis/design/resource_names.
  443. //
  444. // * For `projects.regions.workflowTemplates`, the resource name of the
  445. // template has the following format:
  446. // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
  447. //
  448. // * For `projects.locations.workflowTemplates`, the resource name of the
  449. // template has the following format:
  450. // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
  451. string template = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  452. // Output only. The version of template at the time of
  453. // workflow instantiation.
  454. int32 version = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  455. // Output only. The create cluster operation metadata.
  456. ClusterOperation create_cluster = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  457. // Output only. The workflow graph.
  458. WorkflowGraph graph = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  459. // Output only. The delete cluster operation metadata.
  460. ClusterOperation delete_cluster = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  461. // Output only. The workflow state.
  462. State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  463. // Output only. The name of the target cluster.
  464. string cluster_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  465. // Map from parameter names to values that were used for those parameters.
  466. map<string, string> parameters = 8;
  467. // Output only. Workflow start time.
  468. google.protobuf.Timestamp start_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  469. // Output only. Workflow end time.
  470. google.protobuf.Timestamp end_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  471. // Output only. The UUID of target cluster.
  472. string cluster_uuid = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  473. // Output only. The timeout duration for the DAG of jobs, expressed in seconds (see
  474. // [JSON representation of
  475. // duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
  476. google.protobuf.Duration dag_timeout = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  477. // Output only. DAG start time, only set for workflows with [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when DAG
  478. // begins.
  479. google.protobuf.Timestamp dag_start_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  480. // Output only. DAG end time, only set for workflows with [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when DAG ends.
  481. google.protobuf.Timestamp dag_end_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  482. }
  483. // The cluster operation triggered by a workflow.
  484. message ClusterOperation {
  485. // Output only. The id of the cluster operation.
  486. string operation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  487. // Output only. Error, if operation failed.
  488. string error = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  489. // Output only. Indicates the operation is done.
  490. bool done = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  491. }
  492. // The workflow graph.
  493. message WorkflowGraph {
  494. // Output only. The workflow nodes.
  495. repeated WorkflowNode nodes = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  496. }
  497. // The workflow node.
  498. message WorkflowNode {
  499. // The workflow node state.
  500. enum NodeState {
  501. // State is unspecified.
  502. NODE_STATE_UNSPECIFIED = 0;
  503. // The node is awaiting prerequisite node to finish.
  504. BLOCKED = 1;
  505. // The node is runnable but not running.
  506. RUNNABLE = 2;
  507. // The node is running.
  508. RUNNING = 3;
  509. // The node completed successfully.
  510. COMPLETED = 4;
  511. // The node failed. A node can be marked FAILED because
  512. // its ancestor or peer failed.
  513. FAILED = 5;
  514. }
  515. // Output only. The name of the node.
  516. string step_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  517. // Output only. Node's prerequisite nodes.
  518. repeated string prerequisite_step_ids = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  519. // Output only. The job id; populated after the node enters RUNNING state.
  520. string job_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  521. // Output only. The node state.
  522. NodeState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  523. // Output only. The error detail.
  524. string error = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  525. }
  526. // A request to create a workflow template.
  527. message CreateWorkflowTemplateRequest {
  528. // Required. The resource name of the region or location, as described
  529. // in https://cloud.google.com/apis/design/resource_names.
  530. //
  531. // * For `projects.regions.workflowTemplates.create`, the resource name of the
  532. // region has the following format:
  533. // `projects/{project_id}/regions/{region}`
  534. //
  535. // * For `projects.locations.workflowTemplates.create`, the resource name of
  536. // the location has the following format:
  537. // `projects/{project_id}/locations/{location}`
  538. string parent = 1 [
  539. (google.api.field_behavior) = REQUIRED,
  540. (google.api.resource_reference) = {
  541. child_type: "dataproc.googleapis.com/WorkflowTemplate"
  542. }
  543. ];
  544. // Required. The Dataproc workflow template to create.
  545. WorkflowTemplate template = 2 [(google.api.field_behavior) = REQUIRED];
  546. }
  547. // A request to fetch a workflow template.
  548. message GetWorkflowTemplateRequest {
  549. // Required. The resource name of the workflow template, as described
  550. // in https://cloud.google.com/apis/design/resource_names.
  551. //
  552. // * For `projects.regions.workflowTemplates.get`, the resource name of the
  553. // template has the following format:
  554. // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
  555. //
  556. // * For `projects.locations.workflowTemplates.get`, the resource name of the
  557. // template has the following format:
  558. // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
  559. string name = 1 [
  560. (google.api.field_behavior) = REQUIRED,
  561. (google.api.resource_reference) = {
  562. type: "dataproc.googleapis.com/WorkflowTemplate"
  563. }
  564. ];
  565. // Optional. The version of workflow template to retrieve. Only previously
  566. // instantiated versions can be retrieved.
  567. //
  568. // If unspecified, retrieves the current version.
  569. int32 version = 2 [(google.api.field_behavior) = OPTIONAL];
  570. }
  571. // A request to instantiate a workflow template.
  572. message InstantiateWorkflowTemplateRequest {
  573. // Required. The resource name of the workflow template, as described
  574. // in https://cloud.google.com/apis/design/resource_names.
  575. //
  576. // * For `projects.regions.workflowTemplates.instantiate`, the resource name
  577. // of the template has the following format:
  578. // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
  579. //
  580. // * For `projects.locations.workflowTemplates.instantiate`, the resource name
  581. // of the template has the following format:
  582. // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
  583. string name = 1 [
  584. (google.api.field_behavior) = REQUIRED,
  585. (google.api.resource_reference) = {
  586. type: "dataproc.googleapis.com/WorkflowTemplate"
  587. }
  588. ];
  589. // Optional. The version of workflow template to instantiate. If specified,
  590. // the workflow will be instantiated only if the current version of
  591. // the workflow template has the supplied version.
  592. //
  593. // This option cannot be used to instantiate a previous version of
  594. // workflow template.
  595. int32 version = 2 [(google.api.field_behavior) = OPTIONAL];
  596. // Optional. A tag that prevents multiple concurrent workflow
  597. // instances with the same tag from running. This mitigates risk of
  598. // concurrent instances started due to retries.
  599. //
  600. // It is recommended to always set this value to a
  601. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
  602. //
  603. // The tag must contain only letters (a-z, A-Z), numbers (0-9),
  604. // underscores (_), and hyphens (-). The maximum length is 40 characters.
  605. string request_id = 5 [(google.api.field_behavior) = OPTIONAL];
  606. // Optional. Map from parameter names to values that should be used for those
  607. // parameters. Values may not exceed 1000 characters.
  608. map<string, string> parameters = 6 [(google.api.field_behavior) = OPTIONAL];
  609. }
  610. // A request to instantiate an inline workflow template.
  611. message InstantiateInlineWorkflowTemplateRequest {
  612. // Required. The resource name of the region or location, as described
  613. // in https://cloud.google.com/apis/design/resource_names.
  614. //
  615. // * For `projects.regions.workflowTemplates,instantiateinline`, the resource
  616. // name of the region has the following format:
  617. // `projects/{project_id}/regions/{region}`
  618. //
  619. // * For `projects.locations.workflowTemplates.instantiateinline`, the
  620. // resource name of the location has the following format:
  621. // `projects/{project_id}/locations/{location}`
  622. string parent = 1 [
  623. (google.api.field_behavior) = REQUIRED,
  624. (google.api.resource_reference) = {
  625. child_type: "dataproc.googleapis.com/WorkflowTemplate"
  626. }
  627. ];
  628. // Required. The workflow template to instantiate.
  629. WorkflowTemplate template = 2 [(google.api.field_behavior) = REQUIRED];
  630. // Optional. A tag that prevents multiple concurrent workflow
  631. // instances with the same tag from running. This mitigates risk of
  632. // concurrent instances started due to retries.
  633. //
  634. // It is recommended to always set this value to a
  635. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
  636. //
  637. // The tag must contain only letters (a-z, A-Z), numbers (0-9),
  638. // underscores (_), and hyphens (-). The maximum length is 40 characters.
  639. string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
  640. }
  641. // A request to update a workflow template.
  642. message UpdateWorkflowTemplateRequest {
  643. // Required. The updated workflow template.
  644. //
  645. // The `template.version` field must match the current version.
  646. WorkflowTemplate template = 1 [(google.api.field_behavior) = REQUIRED];
  647. }
  648. // A request to list workflow templates in a project.
  649. message ListWorkflowTemplatesRequest {
  650. // Required. The resource name of the region or location, as described
  651. // in https://cloud.google.com/apis/design/resource_names.
  652. //
  653. // * For `projects.regions.workflowTemplates,list`, the resource
  654. // name of the region has the following format:
  655. // `projects/{project_id}/regions/{region}`
  656. //
  657. // * For `projects.locations.workflowTemplates.list`, the
  658. // resource name of the location has the following format:
  659. // `projects/{project_id}/locations/{location}`
  660. string parent = 1 [
  661. (google.api.field_behavior) = REQUIRED,
  662. (google.api.resource_reference) = {
  663. child_type: "dataproc.googleapis.com/WorkflowTemplate"
  664. }
  665. ];
  666. // Optional. The maximum number of results to return in each response.
  667. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  668. // Optional. The page token, returned by a previous call, to request the
  669. // next page of results.
  670. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  671. }
  672. // A response to a request to list workflow templates in a project.
  673. message ListWorkflowTemplatesResponse {
  674. // Output only. WorkflowTemplates list.
  675. repeated WorkflowTemplate templates = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  676. // Output only. This token is included in the response if there are more
  677. // results to fetch. To fetch additional results, provide this value as the
  678. // page_token in a subsequent <code>ListWorkflowTemplatesRequest</code>.
  679. string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  680. }
  681. // A request to delete a workflow template.
  682. //
  683. // Currently started workflows will remain running.
  684. message DeleteWorkflowTemplateRequest {
  685. // Required. The resource name of the workflow template, as described
  686. // in https://cloud.google.com/apis/design/resource_names.
  687. //
  688. // * For `projects.regions.workflowTemplates.delete`, the resource name
  689. // of the template has the following format:
  690. // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
  691. //
  692. // * For `projects.locations.workflowTemplates.instantiate`, the resource name
  693. // of the template has the following format:
  694. // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
  695. string name = 1 [
  696. (google.api.field_behavior) = REQUIRED,
  697. (google.api.resource_reference) = {
  698. type: "dataproc.googleapis.com/WorkflowTemplate"
  699. }
  700. ];
  701. // Optional. The version of workflow template to delete. If specified,
  702. // will only delete the template if the current server version matches
  703. // specified version.
  704. int32 version = 2 [(google.api.field_behavior) = OPTIONAL];
  705. }