instantiateInline method
- WorkflowTemplate request,
- String parent, {
- String? requestId,
- String? $fields,
Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.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:
parent
- Required. The resource name of the region or location, as
described in https://cloud.google.com/apis/design/resource_names. For
projects.regions.workflowTemplates,instantiateinline, the resource name of
the region has the following format:
projects/{project_id}/regions/{region} For
projects.locations.workflowTemplates.instantiateinline, the resource name
of the location has the following format:
projects/{project_id}/locations/{location}
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$
.
requestId
- Optional. A tag that prevents multiple concurrent workflow
instances with the same tag from running. This mitigates risk of
concurrent instances started due to retries.It is recommended to always
set this value to a UUID
(https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must
contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and
hyphens (-). The maximum length is 40 characters.
$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> instantiateInline(
WorkflowTemplate request,
core.String parent, {
core.String? requestId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (requestId != null) 'requestId': [requestId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' +
core.Uri.encodeFull('$parent') +
'/workflowTemplates:instantiateInline';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}