Compare commits

...

2 Commits

Author SHA1 Message Date
bbuchanan9 9bcb046326 enable transition in pensieve 2019-02-21 16:15:49 -08:00
Jonathan Gramain a0d94f8408 feature: ZENKO-1420 get locations from putObject backbeat route
Return the locations array in the API of multiple backend putobject
command, so that transition policies can use it to update metadata
with the new location as-is.
2019-02-19 16:31:52 -08:00
2 changed files with 18 additions and 0 deletions

View File

@ -402,9 +402,26 @@ function putObject(request, response, log, callback) {
if (contentMD5 !== md5) { if (contentMD5 !== md5) {
return callback(errors.BadDigest); return callback(errors.BadDigest);
} }
// stealing some code from createAndStoreObject.js to
// create a valid locations array
const { key, dataStoreName, dataStoreType, dataStoreETag,
dataStoreVersionId } = retrievalInfo;
const prefixedDataStoreETag = dataStoreETag
? `1:${dataStoreETag}`
: `1:${md5}`;
const location = [{
key,
size: payloadLen,
start: 0,
dataStoreName,
dataStoreType,
dataStoreETag: prefixedDataStoreETag,
dataStoreVersionId,
}];
const dataRetrievalInfo = { const dataRetrievalInfo = {
// TODO: Remove '' when versioning implemented for Azure. // TODO: Remove '' when versioning implemented for Azure.
versionId: retrievalInfo.dataStoreVersionId || '', versionId: retrievalInfo.dataStoreVersionId || '',
location,
}; };
return _respond(response, dataRetrievalInfo, log, callback); return _respond(response, dataRetrievalInfo, log, callback);
}); });

View File

@ -37,6 +37,7 @@ function getCapabilities() {
locationTypeNFS: true, locationTypeNFS: true,
preferredReadLocation: true, preferredReadLocation: true,
managedLifecycle: true, managedLifecycle: true,
managedLifecycleTransition: true,
secureChannelOptimizedPath: hasWSOptionalDependencies(), secureChannelOptimizedPath: hasWSOptionalDependencies(),
s3cIngestLocation: true, s3cIngestLocation: true,
}; };