Ingest a bag into the storage service
Last updated
Last updated
This guide explains how to store a bag in the storage service.
You need:
A bag in . This bag should have a single External-Identifier in the .
There is an example bag with the External-Identifier test_bag
in the same directory as this guide.
You need to know:
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
You need to choose:
A storage space. A space is an identifier that groups bags with similar content, e.g. digitised
or born-digital
.
To store a bag in the storage service:
If not already compressed, tar-gzip compress your BagIt bag:
Upload the bag to your uploads bucket.
Fetch an access token for the OAuth2 credentials grant:
This will return a response like:
Remember the access_token
.
Send a POST request to the /ingests API to create an ingest. This asks the storage service to store your bag.
If this is the first bag with this (space, external identifier) pair, use ingest type "create"
. If there is already a bag with this (space, external identifier) pair, use ingest type "update"
.
This returns a response like:
Remember the id
-- this is the ingest ID.
Use the ingest ID to query the state of the ingest:
This will return an ingest.
You can poll this API repeatedly to see the state of your ingest as it moves through the storage service.