* checks if object data is available or if it's in cold storage * @param {ObjectMD} objMD Object metadata * @returns {ArsenalError|null} error if object data is not available
(objMD)
| 274 | * @returns {ArsenalError|null} error if object data is not available |
| 275 | */ |
| 276 | function verifyColdObjectAvailable(objMD) { |
| 277 | // return error when object is cold |
| 278 | if (objMD.archive && |
| 279 | // Object is in cold backend |
| 280 | (!objMD.archive.restoreRequestedAt || |
| 281 | // Object is being restored |
| 282 | (objMD.archive.restoreRequestedAt && !objMD.archive.restoreCompletedAt))) { |
| 283 | const err = errorInstances.InvalidObjectState |
| 284 | .customizeDescription('The operation is not valid for the object\'s storage class'); |
| 285 | return err; |
| 286 | } |
| 287 | return null; |
| 288 | } |
| 289 | |
| 290 | module.exports = { |
| 291 | startRestore, |
no outgoing calls
no test coverage detected