cycledash icon indicating copy to clipboard operation
cycledash copied to clipboard

Submitting duplicate BAMs needs to be improved

Open ihodes opened this issue 9 years ago • 1 comments

cf. https://github.com/hammerlab/cycledash/blob/master/cycledash/bams.py#L34

BAMs should be unique on project_id, uri, not just uri.

A duplicate BAM submission should return HTTP 409 ("conflict") not 400 (as it does now, "malformed request").

ihodes avatar May 07 '15 14:05 ihodes

I think this must have been addressed as some point, but now I can just re-submit the same BAM again and again and each time it gets a new ID

arahuja:~ arahuja$ http -a username:password -f POST http://cycledash.demeter.hpc.mssm.edu/api/bams projectName=pmma uri=/datasets/Set/bamfiles/CR_1_T.bam name=CR_1_T
HTTP/1.1 201 CREATED
Connection: keep-alive
Content-Length: 190
Content-Type: application/json
Date: Wed, 21 Oct 2015 20:54:16 GMT
Server: nginx/1.0.15
Set-Cookie: session=eyJfaWQiOnsiIGIiOiJOR000TkdGak1UQTFabUppTldNeE1HVTBZemt3TjJWaU1EVmpNemN4WkdZPSJ9fQ.CQmM-A.W_AmiPn0z17XnSBkxUEezE9q_00; HttpOnly; Path=/

{
    "id": 410,
    "name": "CR_1_T",
    "normal": false,
    "notes": null,
    "projectId": 16,
    "resectionDate": null,
    "tissues": null,
    "uri": "/datasets/Set/bamfiles/CR_1_T.bam"
}

arahuja:~ arahuja$ http -a username:password -f POST http://cycledash.demeter.hpc.mssm.edu/api/bams projectName=pmma uri=/datasets/Set/bamfiles/CR_1_T.bam name=CR_1_T
HTTP/1.1 201 CREATED
Connection: keep-alive
Content-Length: 190
Content-Type: application/json
Date: Wed, 21 Oct 2015 20:54:20 GMT
Server: nginx/1.0.15
Set-Cookie: session=eyJfaWQiOnsiIGIiOiJOR000TkdGak1UQTFabUppTldNeE1HVTBZemt3TjJWaU1EVmpNemN4WkdZPSJ9fQ.CQmM_A.dhRMj1JyglXDlD7ak9bPZrWYH6Y; HttpOnly; Path=/

{
    "id": 411,
    "name": "CR_1_T",
    "normal": false,
    "notes": null,
    "projectId": 16,
    "resectionDate": null,
    "tissues": null,
    "uri": "/datasets/Set/bamfiles/CR_1_T.bam"
}

arahuja:~ arahuja$ http -a username:password -f POST http://cycledash.demeter.hpc.mssm.edu/api/bams projectName=pmma uri=/datasets/Set/bamfiles/CR_1_T.bam name=CR_1_T
HTTP/1.1 201 CREATED
Connection: keep-alive
Content-Length: 190
Content-Type: application/json
Date: Wed, 21 Oct 2015 20:54:27 GMT
Server: nginx/1.0.15
Set-Cookie: session=eyJfaWQiOnsiIGIiOiJOR000TkdGak1UQTFabUppTldNeE1HVTBZemt3TjJWaU1EVmpNemN4WkdZPSJ9fQ.CQmNAw.esNMpnoTwdl8K4qZxyKp425pP2E; HttpOnly; Path=/

{
    "id": 412,
    "name": "CR_1_T",
    "normal": false,
    "notes": null,
    "projectId": 16,
    "resectionDate": null,
    "tissues": null,
    "uri": "/datasets/Set/bamfiles/CR_1_T.bam"
}

arahuja avatar Oct 21 '15 20:10 arahuja