def put_continuation_token()

in infra/src/lambda_poller/lambda_function.py [0:0]


def put_continuation_token(job_id: str, user_parameters: str):
    """
Puts continuation token for the jobid.
    :param job_id: The job id
    :param user_parameters: A json formatted string of user params
    """
    code_pipeline = boto3.client('codepipeline')

    training_type = json.loads(user_parameters)['training_type']
    # Start polling if we know the job name
    if training_type is not None:
        code_pipeline.put_job_success_result(jobId=job_id, continuationToken=user_parameters)
    # Flag error if 'training_job_name' is not supplied
    else:
        print('No "training_type" in CodePipeline parameter. Cannot check job status. {}'.format(user_parameters))
        code_pipeline.put_job_failure_result(jobId=job_id, failureDetails={
            'type': 'JobFailed',
            'message': 'Unable to check job. No "training_job_name" in CodePipeline parameter.'
        })