reportTaskRunnerHeartbeat method

Future<ReportTaskRunnerHeartbeatOutput> reportTaskRunnerHeartbeat({
  1. required String taskrunnerId,
  2. String? hostname,
  3. String? workerGroup,
})

Task runners call ReportTaskRunnerHeartbeat every 15 minutes to indicate that they are operational. If the AWS Data Pipeline Task Runner is launched on a resource managed by AWS Data Pipeline, the web service can use this call to detect when the task runner application has failed and restart a new instance.

May throw InternalServiceError. May throw InvalidRequestException.

Parameter taskrunnerId : The ID of the task runner. This value should be unique across your AWS account. In the case of AWS Data Pipeline Task Runner launched on a resource managed by AWS Data Pipeline, the web service provides a unique identifier when it launches the application. If you have written a custom task runner, you should assign a unique identifier for the task runner.

Parameter hostname : The public DNS name of the task runner.

Parameter workerGroup : The type of task the task runner is configured to accept and process. The worker group is set as a field on objects in the pipeline when they are created. You can only specify a single value for workerGroup. There are no wildcard values permitted in workerGroup; the string must be an exact, case-sensitive, match.

Implementation

Future<ReportTaskRunnerHeartbeatOutput> reportTaskRunnerHeartbeat({
  required String taskrunnerId,
  String? hostname,
  String? workerGroup,
}) async {
  ArgumentError.checkNotNull(taskrunnerId, 'taskrunnerId');
  _s.validateStringLength(
    'taskrunnerId',
    taskrunnerId,
    1,
    1024,
    isRequired: true,
  );
  _s.validateStringLength(
    'hostname',
    hostname,
    1,
    1024,
  );
  _s.validateStringLength(
    'workerGroup',
    workerGroup,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DataPipeline.ReportTaskRunnerHeartbeat'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'taskrunnerId': taskrunnerId,
      if (hostname != null) 'hostname': hostname,
      if (workerGroup != null) 'workerGroup': workerGroup,
    },
  );

  return ReportTaskRunnerHeartbeatOutput.fromJson(jsonResponse.body);
}