createPipeline method
Creates a new pipeline in the specified workspace. A pipeline defines a directed acyclic graph (DAG) of compute nodes, where each node references a task and can declare dependencies on other nodes. Cyclic dependencies are not allowed. Nodes without dependencies run in parallel, while nodes with dependencies wait for all upstream nodes to complete successfully before starting.
You can set environment variables at the pipeline level that are shared across all compute nodes, and override them at the individual compute node level.
May throw AccessDeniedException.
May throw ConflictingOperationException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter computations :
The list of compute nodes that form the pipeline DAG. Each compute node
references a task and can declare dependencies on other nodes.
Parameter pipelineName :
The name of the pipeline to create. Must be unique within the workspace.
Parameter workspaceName :
The name of the workspace.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If you retry a request that completed
successfully using the same client token, the server returns the cached
result from the original successful request without performing the
operation again.
Parameter description :
A description of the pipeline.
Parameter environmentVariables :
Environment variables shared across all compute nodes in the pipeline.
Individual compute nodes can override these values with their own
environment variables.
Parameter tags :
A list of key-value pairs that contain metadata for the pipeline. For more
information, see Tagging
your AWS IoT SiteWise resources in the AWS IoT SiteWise User Guide.
Implementation
Future<CreatePipelineResponse> createPipeline({
required List<ComputeNode> computations,
required String pipelineName,
required String workspaceName,
String? clientToken,
String? description,
Map<String, String>? environmentVariables,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'computations': computations,
'pipelineName': pipelineName,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (environmentVariables != null)
'environmentVariables': environmentVariables,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/workspaces/${Uri.encodeComponent(workspaceName)}/pipelines',
hostPrefix: 'api.',
exceptionFnMap: _exceptionFns,
);
return CreatePipelineResponse.fromJson(response);
}