Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starter kit DRS does not support /objects/<drs_id>/access/<access_id> #37

Open
ianfore opened this issue Jun 26, 2022 · 1 comment
Open

Comments

@ianfore
Copy link
Collaborator

ianfore commented Jun 26, 2022

I got Part 2 visas working on another machine. The Passport UI wasn't working when I tried on Friday.

With the passport token from the UI successfully got a response to http://localhost:5000/ga4gh/drs/v1/objects/HG00740.1000genomes.lowcov.downsampled.cram

{
    "id": "HG00740.1000genomes.lowcov.downsampled.cram",
    "description": "Low coverage, downsampled CRAM file for sample HG00740",
    "created_time": "2022-06-26T11:06:31Z",
    "mime_type": "application/cram",
    "name": "HG00740 1000 Genomes Downsampled Low Coverage CRAM file",
    "size": 5582919,
    "updated_time": "2022-06-26T11:06:31Z",
    "version": "1.0.0",
    "aliases": ["HG00740 low coverage downsampled CRAM"],
    "checksums": [
        {
            "checksum": "07e0f2598f0663380296d62a2c7f4839b5fc457a",
            "type": "sha1"
        },
        {
            "checksum": "0c0d0eaaf052417f131d5401924f8cab9847d96e22f702a9abef38adc3021f2a",
            "type": "sha256"
        },
        {
            "checksum": "28ffe6386b78fffb7cd0a7b2d0a79846",
            "type": "md5"
        }
    ],
    "self_uri": "drs://localhost:5000/HG00740.1000genomes.lowcov.downsampled.cram",
    "access_methods": [
        {
            "access_url": {"url": "s3://ga4gh-ismb-tutorial-2022/data/1000genomes/cram/lowcov/HG00740.lowcoverage.downsampled.cram"},
            "type": "s3",
            "region": "us-east-2"
        }
    ]
}

One should then be able to make the following call
http://localhost:5000/ga4gh/drs/v1/objects/HG00740.1000genomes.lowcov.downsampled.cram/access/<access_id>
Where access_id is the access method the user wants to use.

Two issues arise from this:

  • The response above to /objects does not include the access_id for each access methods.
  • Calling /objects/objects/HG00740.1000genomes.lowcov.downsampled.cram/access/s3 gives the error below
 {
    "timestamp": "2022-06-26T15:59:54Z",
    "statusCode": 405,
    "error": "Method Not Allowed",
    "message": "Request method 'POST' not supported"
}
@emre-f
Copy link
Collaborator

emre-f commented Jul 6, 2022

As far as I know an object can have multiple access methods with the same type (for example s3), that is why I don't think /objects/<drs_id>/access/s3 is a suitable solution since we wouldn't be able to distinguish between them.

I think the best solution is to have a separate <access_id> for every access method. While writing tests I have already written the code to extract the type of access in question and send the correct request depending on the type. The same code could be the used to find which access method is requested from the <access_id> and then construct the URL according to the type before sending it back.

So far that code only covers these three access types: https, s3 and file. It can always be extended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants