* bucketGetVersioning - Return Versioning Configuration for bucket * @param {AuthInfo} authInfo - Instance of AuthInfo class with requester's info * @param {object} request - http request object * @param {object} log - Werelogs logger * @param {function} callback - callback to respond to http re
(authInfo, request, log, callback)
| 47 | * @return {undefined} |
| 48 | */ |
| 49 | function bucketGetVersioning(authInfo, request, log, callback) { |
| 50 | log.debug('processing request', { method: 'bucketGetVersioning' }); |
| 51 | |
| 52 | const bucketName = request.bucketName; |
| 53 | |
| 54 | const metadataValParams = { |
| 55 | authInfo, |
| 56 | bucketName, |
| 57 | requestType: request.apiMethods || 'bucketGetVersioning', |
| 58 | request, |
| 59 | }; |
| 60 | |
| 61 | standardMetadataValidateBucket(metadataValParams, request.actionImplicitDenies, log, (err, bucket) => { |
| 62 | const corsHeaders = collectCorsHeaders(request.headers.origin, |
| 63 | request.method, bucket); |
| 64 | if (err) { |
| 65 | log.debug('error processing request', |
| 66 | { method: 'bucketGetVersioning', error: err }); |
| 67 | monitoring.promMetrics( |
| 68 | 'GET', bucketName, err.code, 'getBucketVersioning'); |
| 69 | return callback(err, null, corsHeaders); |
| 70 | } |
| 71 | const versioningConfiguration = bucket.getVersioningConfiguration(); |
| 72 | const xml = convertToXml(versioningConfiguration); |
| 73 | pushMetric('getBucketVersioning', log, { |
| 74 | authInfo, |
| 75 | bucket: bucketName, |
| 76 | }); |
| 77 | monitoring.promMetrics( |
| 78 | 'GET', bucketName, '200', 'getBucketVersioning'); |
| 79 | return callback(null, xml, corsHeaders); |
| 80 | }); |
| 81 | } |
| 82 | |
| 83 | module.exports = bucketGetVersioning; |
nothing calls this directly
no test coverage detected