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

Compare with Current View Page History

« Previous Version 50 Next »

Bridge Application

General Operations

Initialize

  • Purpose: Provides all information needed to initialization the Bridge Ingest App
  • Request: POST https://host:port/bridge/init
  • Request Body: JSON in format:

    {
      "originatorEmailAddress" : "${bridge.originatorEmailAddress}",
      "duracloudEmailAddresses" : ["${bridge.duracloudEmailAddress}"],
      "dpnEmailAddresses" : ["${bridge.dpnEmailAddress}"],
      "duracloudUsername" : "${bridge.duracloudUsername}",
      "duracloudPassword" : "${bridge.duracloudPassword}",
      "awsAccessKey" : "${aws.accessKey}",
      "awsSecretKey" : "${aws.secretKey}",
      "databaseUser" : "${bridge.database.username}",
      "databasePassword" : "${bridge.database.password}",
      "databaseURL" : "${bridge.database.url}",
      "contentDirRoot" : "${bridge.contentDirRoot}",
      "clean" : "${bridge.clean}"
      "snapshotFinalizerPeriodMs": "${bridge.snapshotFinalizerPeriodMs}" # optional, default is 3600000 (1 hour)
    }
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {"message" : "success!"}

Version

  • Purpose: Provides the current version of the Bridge App
  • Request: GET https://host:port/bridge/version
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {"version" : "1.0.0"}
Ingest Operations

Create Snapshot

  • Purpose: Performs a snapshot action
  • Request: PUT https://host:port/bridge/snapshot/(snapshotId)
    • snapshotId - Identifier of the snapshot

  • Request Body: JSON:

    {
      "host" : "",
      "port" : "",
      "storeId" : "",
      "spaceId" : "",
      "description" : "",
      "userEmail" : ""
    } 
    • host - DNS host of DuraCloud instance from which snapshot can be taken
    • port - Port on which DuraCloud applications are available
    • storeID - Identifier of Chronopolis staging storage provider on DuraCloud instance
    • spaceID - Identifier of space in which snapshot content resides
    • description - User-supplied description of the snapshot
    • userEmail - User's email address, for notifications
  • Response Code: 200 or 201 on success (201 if snapshot request did not already exist)
  • Response Body: JSON:

    {
      "snapshotId" : "",
      "status": ""
    }

List All Snapshots

  • Purpose: Retrieves a list of all snapshots
  • Request: GET https://host:port/bridge/snapshot ? host=(host)

    •  host - Account host for which snapshot listing should be provided

  • Response Body: JSON:

    {
      "snapshots" : [
        {
          "snapshotId" : "",  
          "description" : "",
          "status" : ""
        }, 
        ...,
        ...  
      ]
    }

List Snapshot Contents

  • Purpose: Retrieves a list of content items which were included in a snapshot
  • Request:  GET https://host:port/bridge/snapshot/(snapshotId)/content ? page=(pageNumber) & pageSize=(pageSize) & prefix=(prefix)

    • snapshotId - Identifier of the snapshot
    • pageNumber - Page number of content listing
    • pageSize - Number of content items to return in a single response

    • prefix - Limit content list to items which begin with this value

  • Response Body: JSON:

{ 
  "contentItems" : [
    { "contentId" : "",
      "contentProperties" : {"" : ""}
    }
  ]
}

 

List Snapshot History

  • Purpose: Retrieves a list of content items which were included in a snapshot
  • Request: GET https://host:port/bridge/snapshot/(snapshotId)/history ? page=(pageNumber) & pageSize=(pageSize)
    • snapshotId - Identifier of the snapshot
    • pageNumber - Page number of history set
    • pageSize - Number of history items to return in a single response
  • Response Body: JSON:
{ 
  "totalCount" : (Long) # of historyItems
  "historyItems" : [
    { "historyDate" : (Long) epoch time,
      "history" : "${history item string}"
    },
  ]
}

 

Get Snapshot Details

  • Purpose: Provides the status of a snapshot action
  • Request: GET https://host:port/bridge/snapshot/(snapshotId)
    • snapshotId - Identifier of the snapshot
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "snapshotId" : "",
      "snapshotDate" : "",
      "status" : "",
      "sourceHost" : "",
      "sourceSpaceId" : "",
      "sourceStoreId" : "",
      "description" : "",
      "contentItemCount" : "",
      "totalSizeInBytes" : ""
    }

    Possible values for status:

    • INITIALIZED

    • TRANSFERRING_FROM_DURACLOUD

    • WAITING_FOR_DPN

    • CLEANING_UP

    • SNAPSHOT_COMPLETE

    • FAILED_TO_TRANSFER_FROM_DURACLOUD

Snapshot Complete

  • Purpose: Enables DPN provider to notify bridge app that snapshot content has been successfully transferred to DPN storage and can now be removed from the bridge storage area (and DuraCloud)
  • Request: POST https://host:port/bridge/snapshot/(snapshotId)/complete
    • snapshotId - Identifier of the snapshot
  • Request Body: JSON:

    {
      "alternateIds": ["alternate-id-1", "alternate-id-2"]
    }
    • A Snapshot can be mapped to zero or more alternate identifiers. Likely this will be a set of DPN bag IDs, which contain the content in this snapshot.

  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "status" : "SNAPSHOT_COMPLETE",
      "details" : ""
    }

Snapshot Error

  • Purpose: Enables DPN provider to notify bridge app that processing of the snapshot has resulted in an error
  • Request: POST https://host:port/bridge/snapshot/(snapshotId)/error
    • snapshotId - Identifier of the snapshot
  • Request Body: JSON:

    {
      "error": ""
    }
    •  

  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "status" : "SNAPSHOT_ERROR",
      "details" : ""
    }

Restart Snapshot

  • Purpose: Enables restart of snapshots that failed to transfer successfully from DuraCloud.
  • Request: POST https://host:port/bridge/snapshot/(snapshotId)/restart
    • snapshotId - Identifier of the snapshot
  • Request Body: JSON:

    {}
    •  

  • Response Code: 202 (on success)
  • Response Body: JSON:

    {
      "status" : "INITIALIZED",
      "description" : ""
    }

Cancel Snapshot

  • Purpose: Enables cancellation of a snapshot that is underway. Calls to this method will fail if the snapshot is in the CLEANING_UP or COMPLETE states.
  • Request: POST https://host:port/bridge/snapshot/(snapshotId)/cancel
    • snapshotId - Identifier of the snapshot
  • Request Body: JSON:

    {}
    •  

  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "status" : "CANCELLED",
      "description" : ""
    }

Snapshot History Update

  • Purpose: Enables DPN provider to notify bridge app that a DPN Bag Id (through the alternateIds in snapshotComplete) has an "update" to its history. Whether a bag was replicated, succesfully stored, checksumed, etc... this is the REST call to handle any and all updates to the history of a particular Snapshot/DPN Bag
  • Request: POST https://host:port/bridge/snapshot/(identifier)/history
    • identifier - Either the snapshot ID or an alternate ID (such as a DPN bag ID) which was associated with the snapshot in the Snapshot Complete call
  • Request Body: JSON:

    • Parameters
      • 'history' - single escaped JSON string that can contain a JSON array of objects or strings - the history event we're trying to record
      • 'alternate' - whether the snapshot ID in the URL is the alternate ID or the original snapshot ID.
    • Preferred format (using name/value pairs)

      {"history": "[ {'key1' : 'value1'},{'key2' : 'value2'} ]", "alternate": "false"}
    • Alternative formats (also supported, but UI display may not be ideal)

      {"history": "[ 'value1', 'value2' ]", "alternate": "false"}
      OR 
      {"history": "[ {'key1': 'value1'}, 'value2' ]", "alternate": "false"}
      OR
      {"history": "value1", "alternate": "false"}
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "snapshot" : {SnapshotSummary},
      "history" : "${the history string that was just inserted}"
    }
Restore Operations

Restore Snapshot

  • Purpose: Enables user to initiate the restoration of a snapshot
  • Request: PUT https://host:port/bridge/restore

    {
      "host" : "",
      "port" : "",
      "storeId" : "",
      "spaceId" : "",
      "snapshotId" : "",
      "userEmail" : ""
    } 
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "restoreId" : ""
      "status" : ""
    }

     Possible value for status (see Get Restore Details)

Restore Complete

  • Purpose: Enables DPN provider to notify bridge app that a snapshot has been restored to bridge storage.
  • Request: POST https://host:port/bridge/restore/(restoreId)/complete
    • restoreId - Identifier of the restoration
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "status" : ""
      "details" : ""
    }

Get Restore Details

  • Purpose: Provides the status of a restoration action
  • Request: GET https://host:port/bridge/restore/(restoreId)
    • restoreId - Identifier of the restoration
  • Response Code: 200 (on success)
  • Response Body: JSON:

    {
      "restoreId" : "",
      "snapshotId" : "",
      "status" : "",
      "startDate" : "",
      "endDate" : "",
      "statusText" : "",
      "destinationHost" : "",
      "destinationPort" : "",
      "destinationStoreId" : "",
      "destinationSpaceId" : ""
    }

    Possible values for status:

    • INITIALIZED

    • WAITING_FOR_DPN

    • DPN_TRANSFER_COMPLETE

    • TRANSFERRING_TO_DURACLOUD

    • TRANSFER_TO_DURACLOUD_COMPLETE

    • VERIFYING_TRANSFERRED_CONTENT

    • CLEANING_UP

    • ERROR

    • RESTORATION_COMPLETE

 


  • No labels