Skip to content

Commit

Permalink
print instead of log
Browse files Browse the repository at this point in the history
  • Loading branch information
nikellepetrillo committed Dec 10, 2024
1 parent d6359fb commit c0f5000
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions scripts/firecloud_api/firecloud_api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,22 @@ def submit_job(self, submission_data_file):

print(f"POST request to URL: {uri}")

try:
response = requests.post(uri, json=submission_data_file, headers=self.headers)
print(f"Response received. Status code: {response.status_code}")
print(f"Response text: {response.text}")
#print the submission data file
print(f"Submission data file: {json.dumps(submission_data_file, indent=2)}")


# Check if the submission was created successfully
if response.status_code != 201:
print(f"Failed to submit job. Status code: {response.status_code}. Response: {response.text}")
raise Exception("Submission failed.")
submission_id = response.json().get("submissionId")
print(f"Received submission ID: {submission_id}")
print(f"Job submitted successfully. Submission ID: {submission_id}")
return submission_id
except Exception as e:
print(f"Received submission ID: {submission_id}")
raise
response = requests.post(uri, json=submission_data_file, headers=self.headers)
print(f"Response received. Status code: {response.status_code}")
#print(f"Response text: {response.text}")
#print the submission data file
print(f"Submission data file: {json.dumps(submission_data_file, indent=2)}")


# Check if the submission was created successfully
if response.status_code != 201:
print(f"Failed to submit job. Status code: {response.status_code}. Response: {response.text}")
raise Exception("Submission failed.")
submission_id = response.json().get("submissionId")
print(f"Received submission ID: {submission_id}")
print(f"Job submitted successfully. Submission ID: {submission_id}")
return submission_id


def upload_test_inputs(self, pipeline_name, test_inputs, branch_name):
"""
Expand Down

0 comments on commit c0f5000

Please sign in to comment.