createPipeline method
Creates a pipeline using a JSON pipeline definition.
May throw ConflictException.
May throw ResourceLimitExceeded.
May throw ResourceNotFound.
Parameter pipelineName :
The name of the pipeline.
Parameter roleArn :
The Amazon Resource Name (ARN) of the role used by the pipeline to access
and create resources.
Parameter clientRequestToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the operation. An idempotent operation completes no more
than one time.
Parameter parallelismConfiguration :
This is the configuration that controls the parallelism of the pipeline.
If specified, it applies to all runs of this pipeline by default.
Parameter pipelineDefinition :
The JSON
pipeline definition of the pipeline.
Parameter pipelineDefinitionS3Location :
The location of the pipeline definition stored in Amazon S3. If specified,
SageMaker will retrieve the pipeline definition from this location.
Parameter pipelineDescription :
A description of the pipeline.
Parameter pipelineDisplayName :
The display name of the pipeline.
Parameter tags :
A list of tags to apply to the created pipeline.
Implementation
Future<CreatePipelineResponse> createPipeline({
required String pipelineName,
required String roleArn,
String? clientRequestToken,
ParallelismConfiguration? parallelismConfiguration,
String? pipelineDefinition,
PipelineDefinitionS3Location? pipelineDefinitionS3Location,
String? pipelineDescription,
String? pipelineDisplayName,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.CreatePipeline'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PipelineName': pipelineName,
'RoleArn': roleArn,
'ClientRequestToken':
clientRequestToken ?? _s.generateIdempotencyToken(),
if (parallelismConfiguration != null)
'ParallelismConfiguration': parallelismConfiguration,
if (pipelineDefinition != null)
'PipelineDefinition': pipelineDefinition,
if (pipelineDefinitionS3Location != null)
'PipelineDefinitionS3Location': pipelineDefinitionS3Location,
if (pipelineDescription != null)
'PipelineDescription': pipelineDescription,
if (pipelineDisplayName != null)
'PipelineDisplayName': pipelineDisplayName,
if (tags != null) 'Tags': tags,
},
);
return CreatePipelineResponse.fromJson(jsonResponse.body);
}