📦
Storage service
  • Introduction
  • How-to: basic operations
    • Ingest a bag into the storage service
    • Look up an already-stored bag in the storage service
    • Look up the versions of a bag in the storage service
  • How to: advanced usage
    • Getting notifications of newly stored bags
  • How to: debugging errors
    • Where to find application logs
    • Manually marking ingests as failed
  • Reference/design decisison
    • The semantics of bags, ingests and ingest types
    • How identifiers work in the storage service
    • How files are laid out in the underlying storage
    • Compressed vs uncompressed bags, and the choice of tar.gz
  • Developer information/workflow
    • An API reference for the user-facing storage service APIs
    • Key technologies
    • Inter-app messaging with SQS and SNS
    • How requests are routed from the API to app containers
    • Repository layout
    • How Docker images are published to ECR
  • Wellcome-specific information
    • Our storage configuration
      • Our three replicas: S3, Glacier, and Azure
      • Using multiple storage tiers for cost-efficiency (A/V, TIFFs)
      • Small fluctuations in our storage bill
      • Delete protection on the production storage service
    • Wellcome-specific debugging
      • Why did my callback to Goobi return a 401 Unauthorized?
    • Recovering files from our Azure replica
    • Awkward files and bags
    • Deleting files or bags bags from the storage service
Powered by GitBook
On this page
  1. How-to: basic operations

Look up the versions of a bag in the storage service

This guide explains how to look up a bag which has been stored in the storage service.

You need to know:

  • The space and external identifier of the bag

  • The API URL for your storage service instance

  • The token URL for your storage service instance

  • A client ID and secret for the storage service

  • An upload bucket for the storage service

To look up a bag in the storage service:

  1. Fetch an access token for the OAuth2 credentials grant:

    curl -X POST "$TOKEN_URL" \
      --data grant_type=client_credentials \
      --data client_id="$CLIENT_ID" \
      --data client_secret="$CLIENT_SECRET"

    This will return a response like:

    {"access_token":"eyJraWQi...","expires_in":3600,"token_type":"Bearer"}

    Remember the access_token.

  2. Make a GET request to the /bags API, passing the space and external identiifer in the path:

    curl "$API_URL/bags/$SPACE/$EXTERNAL_IDENTIFIER/versions" \
      --header "Authorization: $ACCESS_TOKEN"

    This will return a list of versions, or a 404 error if there are no versions.

PreviousLook up an already-stored bag in the storage serviceNextGetting notifications of newly stored bags

Last updated 2 years ago