makeBackbeatRequest - utility function to generate a request going * through backbeat route * @param {object} params - params for making request * @param {string} params.method - request method * @param {string} params.bucket - bucket name * @param {string} params.objectKey - object key * @par
(params, callback)
| 202 | * @return {undefined} - and call callback |
| 203 | */ |
| 204 | function makeBackbeatRequest(params, callback) { |
| 205 | const { method, headers, bucket, objectKey, resourceType, |
| 206 | authCredentials, requestBody, queryObj } = params; |
| 207 | const options = { |
| 208 | authCredentials, |
| 209 | hostname: ipAddress, |
| 210 | port: 8000, |
| 211 | method, |
| 212 | headers, |
| 213 | path: `/_/backbeat/${resourceType}/${bucket}/${objectKey}`, |
| 214 | requestBody, |
| 215 | jsonResponse: true, |
| 216 | queryObj, |
| 217 | }; |
| 218 | makeRequest(options, callback); |
| 219 | } |
| 220 | |
| 221 | module.exports = { |
| 222 | makeRequest, |
nothing calls this directly
no test coverage detected