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

Function loadRemoteOverlay

lib/management/poll.js:18–41  ·  view source on GitHub ↗
(
    managementEndpoint, instanceId, remoteToken, cachedOverlay, log, cb)

Source from the content-addressed store, hash-verified

16const pullConfigurationOverlayDelay = 60000;
17
18function loadRemoteOverlay(
19 managementEndpoint, instanceId, remoteToken, cachedOverlay, log, cb) {
20 log.debug('loading remote overlay');
21 const opts = {
22 headers: {
23 'x-instance-authentication-token': remoteToken,
24 'x-scal-request-id': log.getSerializedUids(),
25 },
26 json: true,
27 };
28 request.get(`${managementEndpoint}/${instanceId}/config/overlay`, opts,
29 (error, response, body) => {
30 if (error) {
31 return cb(error);
32 }
33 if (response.statusCode === 200) {
34 return cb(null, cachedOverlay, body);
35 }
36 if (response.statusCode === 404) {
37 return cb(null, cachedOverlay, {});
38 }
39 return cb(arsenal.errors.AccessForbidden, cachedOverlay, {});
40 });
41}
42
43// TODO save only after successful patch
44function applyConfigurationOverlay(

Callers 1

Calls 2

debugMethod · 0.80
getSerializedUidsMethod · 0.80

Tested by

no test coverage detected