MCPcopy
hub / github.com/scality/cloudserver / createMPU

Function createMPU

tests/unit/utils/mpuUtils.js:79–106  ·  view source on GitHub ↗
(namespace, bucketName, objectKey, logger, cb)

Source from the content-addressed store, hash-verified

77}
78
79function createMPU(namespace, bucketName, objectKey, logger, cb) {
80 let testUploadId;
81 async.waterfall([
82 next => {
83 const initiateMPURequest = createinitiateMPURequest(namespace,
84 bucketName,
85 objectKey);
86 initiateMultipartUpload(authInfo, initiateMPURequest, logger, next);
87 },
88 (result, corsHeaders, next) => xml2js.parseString(result, next),
89 (json, next) => {
90 testUploadId = json.InitiateMultipartUploadResult.UploadId[0];
91 const partRequest =
92 createPutPartRequest(namespace, bucketName, objectKey, 1, testUploadId);
93 objectPutPart(authInfo, partRequest, undefined, logger, next);
94 },
95 (hexDigest, corsHeaders, next) => {
96 const completeRequest =
97 createCompleteRequest(namespace, bucketName, objectKey, testUploadId);
98 completeMultipartUpload(authInfo, completeRequest, logger, next);
99 },
100 ], err => {
101 assert.ifError(err);
102 cb(null, testUploadId);
103 });
104
105 return testUploadId;
106}
107
108
109module.exports = {

Callers

nothing calls this directly

Calls 6

createinitiateMPURequestFunction · 0.85
createPutPartRequestFunction · 0.85
objectPutPartFunction · 0.85
createCompleteRequestFunction · 0.85
initiateMultipartUploadFunction · 0.50
completeMultipartUploadFunction · 0.50

Tested by

no test coverage detected