MCPcopy Index your code
hub / github.com/scality/cloudserver / constructPutResponse

Function constructPutResponse

lib/routes/routeBackbeat.js:260–284  ·  view source on GitHub ↗

* Helper to create the response object for putObject and completeMPU * * @param {object} params - response info * @param {string} params.dataStoreName - name of location * @param {string} params.dataStoreType - location type (e.g. "aws_s3") * @param {string} params.key - object key * @param {n

(params)

Source from the content-addressed store, hash-verified

258 * @return {object} - the response object to serialize and send back
259 */
260function constructPutResponse(params) {
261 // FIXME: The main data locations array may eventually resemble
262 // locations stored in replication info object, i.e. without
263 // size/start for cloud locations, which could ease passing
264 // standard location objects across services. For now let's just
265 // create the location as they are usually stored in the
266 // "locations" attribute, with size/start info.
267
268 const location = [
269 {
270 dataStoreName: params.dataStoreName,
271 dataStoreType: params.dataStoreType,
272 key: params.key,
273 start: 0,
274 size: params.size,
275 dataStoreETag: params.dataStoreETag,
276 dataStoreVersionId: params.dataStoreVersionId,
277 },
278 ];
279 return {
280 // TODO: Remove '' when versioning implemented for Azure.
281 versionId: params.dataStoreVersionId || '',
282 location,
283 };
284}
285
286function handleTaggingOperation(request, response, type, dataStoreVersionId, log, callback) {
287 const storageLocation = request.headers['x-scal-storage-class'];

Callers 2

putObjectFunction · 0.85
completeMultipartUploadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected