# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
if setup_query_content["stack_created"]:
self.setup_done = True
LOG.debug("stack_created: %s",
if setup_query_content["stack_created"]:
self.setup_done = True
LOG.debug("stack_created: %s",
setup_res = requests.post('http://%s:5000/api/v1.0/configurations'
% self.target, json=env_args)
setup_res = requests.post('http://%s:5000/api/v1.0/configurations'
% self.target, json=env_args)
if setup_res.status_code != 200:
raise RuntimeError("Failed to create a stack, error message:",
if setup_res.status_code != 200:
raise RuntimeError("Failed to create a stack, error message:",
"""Query the status of the supplied job_id and report on metrics"""
LOG.info("Fetching report for %s...", job_id)
report_res = requests.get('http://{}:5000/api/v1.0/jobs'.format
"""Query the status of the supplied job_id and report on metrics"""
LOG.info("Fetching report for %s...", job_id)
report_res = requests.get('http://{}:5000/api/v1.0/jobs'.format
if report_res.status_code != 200:
raise RuntimeError("Failed to fetch report, error message:",
report_res_content["message"])
else:
if report_res.status_code != 200:
raise RuntimeError("Failed to fetch report, error message:",
report_res_content["message"])
else:
if job_res.status_code != 200:
raise RuntimeError("Failed to start a job, error message:",
if job_res.status_code != 200:
raise RuntimeError("Failed to start a job, error message:",
raise RuntimeError("Failed to start a job, error message:",
terminate_res_content["message"])
raise RuntimeError("Failed to start a job, error message:",
terminate_res_content["message"])
raise RuntimeError("Failed to reset environment, error message:",
teardown_res_content['message'])
raise RuntimeError("Failed to reset environment, error message:",
teardown_res_content['message'])