CDLUC3 / mrt-doc

Documentation and Information regarding the Merritt repository
8 stars 4 forks source link

Augment "Object File Listing" in Admin Tool with a call to storage to see if a new version is in progress #849

Open terrywbrady opened 3 years ago

terrywbrady commented 3 years ago

Invoke storage object state command to see the highest version for an object.

dloy commented 3 years ago

Getting the current version number using storage

From storage this process requires knowing the ark and the node.

This process requires issuing an http request to any storage service with the node and ark. From the json response extract the "obj:numVersions" value.

Once the current version number is known then all the inv database can then be queried based on that value to determine if inventory on this latest version is complete, status of replication and status of audit.

Example Request

Basic request service/"state"/node/ark"?j=json"

curl -X GET uc3-mrtstore05x2-prd:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t?t=json | jq

Example Response

{
  "obj:objectState": {
    "xmlns:obj": "http://uc3.cdlib.org/ontology/mrt/store/object",
    "obj:lastAddVersion": "2018-08-16T06:38:30-07:00",
    "obj:identifier": "ark:/13030/qt4wp7186t",
    "obj:numFiles": 54,
    "obj:versionStates": {
      "obj:versionState": [
        "http://store-do.cdlib.org:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t/1",
        "http://store-do.cdlib.org:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t/2",
        "http://store-do.cdlib.org:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t/3",
        "http://store-do.cdlib.org:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t/4",
        "http://store-do.cdlib.org:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t/5"
      ]
    },
    "obj:totalActualSize": 1940560,
    "obj:numActualFiles": 28,
    "obj:currentVersionState": "http://store-do.cdlib.org:35121/state/9501/ark%3A%2F13030%2Fqt4wp7186t/5",
    "obj:numVersions": 5,
    "obj:nodeID": 9501,
    "obj:nodeState": "http://store-do.cdlib.org:35121/state/9501",
    "obj:object": "http://store-do.cdlib.org:35121/content/9501/ark%3A%2F13030%2Fqt4wp7186t",
    "obj:size": 3224486
  }
}