API Docs for RESTful Ingest

 

Authorization

The REST server uses HTTP basic auth as a means of authorization. Each node has a username and password which are used when making a REST call.

ex:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
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:

    {
        "name": "8e55f5c4-a65c-4eb1-9aa4-a9c3742af8b3",
        "depositor": "dartmouth",
        "location": "dartmouth/8e55f5c4-a65c-4eb1-9aa4-a9c3742af8b3",
        "tokenLocation": "",
        "fixityAlgorithm": "SHA-256",
        "size": 18672592,
        "totalFiles": 10,
        "requiredReplications": 3,
        "id": 1
    }

Get All Bags

  • Purpose: Provides a list of all bags registered to the Ingest Server
  • 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:

    {
        "content": [
            {
                "name": "bb0102820h",
                "depositor": "prodtest000",
                "location": "prodtest000/bb0102820h",
                "tokenLocation": "prodtest000/bb0102820h2015-06-04",
                "fixityAlgorithm": "SHA-256",
                "size": 18672592,
                "totalFiles": 10,
                "requiredReplications": 3,
                "id": 1
            },
            {
                "name": "acadis_20150419",
                "depositor": "ncar",
                "location": "ncar/acadis_20150419",
                "tokenLocation": "ncar/acadis_201504192015-06-06",
                "fixityAlgorithm": "SHA-256",
                "size": 1030783586432,
                "totalFiles": 173357,
                "requiredReplications": 3,
                "id": 2
            },
            ...
        ],
        "totalPages": 1,
        "totalElements": 2,
        "last": true,
        "sort": null,
        "numberOfElements": 2,
        "first": true,
        "size": 20,
        "number": 0
    }

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:

    {
        "name": "bb0102820h",
        "depositor": "prodtest000",
        "location": "prodtest000/bb0102820h",
        "tokenLocation": "prodtest000/bb0102820h2015-06-04",
        "fixityAlgorithm": "SHA-256",
        "size": 18672592,
        "totalFiles": 10,
        "requiredReplications": 3,
        "id": 1
    }

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:

    {
        "content": [
            {
                "id": 1,
                "status": "SUCCESS",
                "bagLink": "chronopolis@chron-ingest.ucsd.edu:/export/outgoing/bags/prodtest000/bb0102820h",
                "tokenLink": "chronopolis@chron-ingest.ucsd.edu:/export/outgoing/tokens/prodtest000/bb0102820h2015-06-04",
                "protocol": "rsync",
                "receivedTagFixity": "c1d96946d276079b300ccc05118f63fb04eaec256df9a7faa3438e785e388525",
                "receivedTokenFixity": "8bcc01d4ec3651da33e6e127821ced0a69e38a8b15c3b63e93ced8903169a555",
                "nodeUsername": "umiacs",
                "bagId": 1
            },
            {
                "id": 5,
                "status": "SUCCESS",
                "bagLink": "chronopolis@chron-ingest.ucsd.edu:/export/outgoing/bags/ncar/acadis_20150419",
                "tokenLink": "chronopolis@chron-ingest.ucsd.edu:/export/outgoing/tokens/ncar/acadis_201504192015-06-06",
                "protocol": "rsync",
                "receivedTagFixity": "c9680a2ec9a367f2f218a3d90dbcde3bcff9ed3eb8f7d9c61e525ba1735270da",
                "receivedTokenFixity": "67593e0c4b02a2cbeb1c2440589373654a44b7ef93c889f6290569e92ced21ea",
                "nodeUsername": "umiacs",
                "bagId": 2
            },
            ...
        ],
        "totalPages": 1,
        "totalElements": 2,
        "last": true,
        "sort": null,
        "numberOfElements": 2,
        "first": true,
        "size": 20,
        "number": 0
    }

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": "SUCCESS",
        "bagLink": "chronopolis@chron-ingest.ucsd.edu:/export/outgoing/bags/prodtest000/bb0102820h",
        "tokenLink": "chronopolis@chron-ingest.ucsd.edu:/export/outgoing/tokens/prodtest000/bb0102820h2015-06-04",
        "protocol": "rsync",
        "receivedTagFixity": "c1d96946d276079b300ccc05118f63fb04eaec256df9a7faa3438e785e388525",
        "receivedTokenFixity": "8bcc01d4ec3651da33e6e127821ced0a69e38a8b15c3b63e93ced8903169a555",
        "nodeUsername": "umiacs",
        "bagId": 1
    }

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