def step_impl(context): resp = common.send_api_request( context, 'GET', 'v1/jobs/%s/runs/%s' % (context.job_id, context.job_run_id)) common.check_response_status(resp, 200) exp = dict( completedAt=None, createdAt=re.compile(r'20.*'), id=re.compile(r'%s-[0-9]+' % context.job_id), jobId=context.job_id, status='FAILED', tasks=[], ) if not common.validate_response_content(resp.json(), exp): raise Exception('Did not find expected FAILED response')
def step_impl(context): resp = common.send_api_request(context, 'GET', 'v1/jobs/%s/runs' % context.job_id) common.check_response_status(resp, 200) # Look for one matching item in the response for item in resp.json(): exp = dict( completedAt=re.compile(r'20.*'), createdAt=re.compile(r'20.*'), id=re.compile(r'%s-[0-9]+' % context.job_id), jobId=context.job_id, status='COMPLETED', tasks=[ re.compile(r'%s-[0-9]+-.+' % context.job_id), ], ) if common.validate_response_content(item, exp): return True raise Exception('Job run ID not found in list of job runs')
def step_impl(context): resp = common.send_api_request(context, 'GET', 'v1/jobs') context.response = resp
def step_impl(context): context.job_id = context.table[0]['job'] resp = common.send_api_request(context, 'POST', 'v1/jobs/%s/runs' % context.job_id) common.check_response_status(resp, 201) context.job_run_id = resp.json().get('id', None)
def step_impl(context): resp = common.send_api_request(context, 'GET', 'v1/jobs/%s' % context.job_id) common.check_response_status(resp, 404)
def step_impl(context): context.job_id = context.table[0]['job'] resp = common.send_api_request(context, 'DELETE', 'v1/jobs/%s' % context.job_id) context.response = resp
def step_impl(context): # Purposeful delay to give all jobs a chance to run before we hit max retry attempts time.sleep(2) context.response = common.send_api_request(context, 'GET', 'v1/jobs?embed=history') common.check_response_status(context.response, 200)
def step_impl(context): context.job_id = context.table[0]['job'] context.response = common.send_api_request( context, 'GET', 'v1/jobs/%s?embed=history' % context.job_id) common.check_response_status(context.response, 200)