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

Function _getBackend

lib/api/apiUtils/object/getReplicationInfo.js:5–17  ·  view source on GitHub ↗
(objectMD, site)

Source from the content-addressed store, hash-verified

3const { replicationBackends } = require('arsenal').constants;
4
5function _getBackend(objectMD, site) {
6 const backends = objectMD ? objectMD.replicationInfo.backends : [];
7 const backend = backends.find(o => o.site === site);
8 // If the backend already exists, just update the status.
9 if (backend) {
10 return Object.assign({}, backend, { status: 'PENDING' });
11 }
12 return {
13 site,
14 status: 'PENDING',
15 dataStoreVersionId: '',
16 };
17}
18
19function _getStorageClasses(s3config, rule) {
20 if (rule.storageClass) {

Callers 1

_getReplicationInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected