instantiate method
- InstantiateWorkflowTemplateRequest request,
- String name, {
- String? $fields,
Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get.
The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.
request
- The metadata request object.
Request parameters:
name
- Required. The resource name of the workflow template, as
described in https://cloud.google.com/apis/design/resource_names. For
projects.regions.workflowTemplates.instantiate, the resource name of the
template has the following format:
projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For
projects.locations.workflowTemplates.instantiate, the resource name of the
template has the following format:
projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/workflowTemplates/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Operation> instantiate(
InstantiateWorkflowTemplateRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':instantiate';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}