You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

API Docs for RESTful Ingest

TODO: Add in examples of Response when using pages

 

General Operations

Create Bag

  • Purpose: Notifies the Ingest Server that a bag is ready to be created
  • Request: POST https://host:port/api/bags
  • Request Body: JSON in format:

    {
        "depositor": "dartmouth",
        "name": "8e55f5c4-a65c-4eb1-9aa4-a9c3742af8b3",
        "location": "dartmouth/8e55f5c4-a65c-4eb1-9aa4-a9c3742af8b3",
    }
    
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
            "id": 1,
            "name": "bag-0",
            "depositor": "test-depositor",
            "location": "bags/test-bag-0",
            "tokenLocation": "tokens/test-bag-0-tokens",
            "fixityAlgorithm": "SHA-256",
            "size": 14821
    }

Get All Bags

  • Purpose: Provides the current version of the Bridge App
  • Request: GET https://host:port/api/bags/
  •  Query Parameters 
    • page: The page number to return, starting at 1. For use with page_size
    • page_size: Maximum number of results per page
    • status: The status of the bag to filter by (can be one of STAGED, TOKENIZED, REPLICATED, REPLICATING, ERROR)
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {[{
            "id": 1,
            "name": "bag-0",
            "depositor": "test-depositor",
            "location": "bags/test-bag-0",
            "tokenLocation": "tokens/test-bag-0-tokens",
            "fixityAlgorithm": "SHA-256",
            "size": 14821
    },...
    ]}

Get A Single Bag

  • Purpose: Get information about a single bag
  • Request: GET https://host:port/api/bags/{bagID}
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
            "id": 1,
            "name": "bag-0",
            "depositor": "test-depositor",
            "location": "bags/test-bag-0",
            "tokenLocation": "tokens/test-bag-0-tokens",
            "fixityAlgorithm": "SHA-256",
            "size": 14821
    }

Get Replication Requests

  • Purpose: Get all replication requests for your node
  • Request: GET https://host:port/api/replications
  •  Query Parameters 
    • page: The page number to return, starting at 1. For use with page_size
    • page_size: Maximum number of results per page
    • status: The status of the bag to filter by (can be one of PENDING, STARTED, TRANSFERRED, SUCCESS, FAILURE_TOKEN_STORE, FAILURE_TAG_MANIFEST, FAILURE)
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {[{
            "id": 1,
            "status": "STARTED",
            "bagID": 4,
            "bagLink": "chrono@chronopolis-stage:/export/bags/test-bag-0",
            "tokenLink": "chrono@chronopolis-stage:/export/tokens/test-bag-0-tokens",
            "protocol": "rsync",
            "receivedTagFixity": "",
            "receivedTokenFixity": ""
    },...
    ]}

Get A Single Replication Request

  • Purpose: Get information about a single replication request
  • Request: GET https://host:port/api/replications/{replicationID}
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
            "id": 1,
            "status": "STARTED",
            "bagID": 4,
            "bagLink": "chrono@chronopolis-stage:/export/bags/test-bag-0",
            "tokenLink": "chrono@chronopolis-stage:/export/tokens/test-bag-0-tokens",
            "protocol": "rsync",
            "receivedTagFixity": "",
            "receivedTokenFixity": ""
    }

Update Replication Request

  • Purpose: Update information about a replication request
  • Request: POST https://host:port/api/replications/{replicationId}
  •  Request Body: JSON:

    {
            "id": 1,
            "status": "STARTED",
            "bagID": 4,
            "bagLink": "chrono@chronopolis-stage:/export/bags/test-bag-0",
            "tokenLink": "chrono@chronopolis-stage:/export/tokens/test-bag-0-tokens",
            "protocol": "rsync",
            "receivedTagFixity": "0a0c1cab94bbae183b694853dc144abe61b911f71a6c0d52af308be9b2f0959f",
            "receivedTokenFixity": "f1eaf7f041826579bff4090d1ae0d544dfb70d5c83ae9f6c9d2a268df02396d6"
    }
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
            "id": 1,
            "status": "SUCCESS",
            "bagID": 4,
            "bagLink": "chrono@chronopolis-stage:/export/bags/test-bag-0",
            "tokenLink": "chrono@chronopolis-stage:/export/tokens/test-bag-0-tokens",
            "protocol": "rsync",
            "receivedTagFixity": "0a0c1cab94bbae183b694853dc144abe61b911f71a6c0d52af308be9b2f0959f",
            "receivedTokenFixity": "f1eaf7f041826579bff4090d1ae0d544dfb70d5c83ae9f6c9d2a268df02396d6"
    }

 

  • No labels