sendPipelineExecutionStepFailure method
Notifies the pipeline that the execution of a callback step failed, along with a message describing why. When a callback step is run, the pipeline generates a callback token and includes the token in a message sent to Amazon Simple Queue Service (Amazon SQS).
May throw ConflictException.
May throw ResourceLimitExceeded.
May throw ResourceNotFound.
Parameter callbackToken :
The pipeline generated token from the Amazon SQS queue.
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 failureReason :
A message describing why the step failed.
Implementation
Future<SendPipelineExecutionStepFailureResponse>
sendPipelineExecutionStepFailure({
required String callbackToken,
String? clientRequestToken,
String? failureReason,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.SendPipelineExecutionStepFailure'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'CallbackToken': callbackToken,
'ClientRequestToken':
clientRequestToken ?? _s.generateIdempotencyToken(),
if (failureReason != null) 'FailureReason': failureReason,
},
);
return SendPipelineExecutionStepFailureResponse.fromJson(jsonResponse.body);
}