Last active
November 4, 2019 23:32
-
-
Save srynobio/d2715c60126d6222152a2d7c55e230a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## I've testing adding sample as a name and as a path to a file. | |
## I have ran this code and `response.ok` returns true, but the project has no change at the sample level | |
## https://mosaic-staging.chpc.utah.edu/#/projects/459/ | |
def post_sample(mosaic_meta, sample, project_id): | |
path = "{}/projects/{}/samples" | |
url = path.format(mosaic_meta['url'], project_id) | |
headers = { | |
'Authorization' : mosaic_meta['authorization'], | |
} | |
data = { | |
'name' : sample, | |
} | |
params = { | |
'project_id' : project_id, | |
} | |
response = requests.get(url, headers=headers, data=data, params=params) | |
if response.ok: | |
print('Project updated with sample {}'.format(sample)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment