Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schiavi-siae/issue103 #123

Merged
merged 7 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions server/controllers/BasicServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

var utils = require('../utils/writer.js');
var BasicServices = require('onf-core-model-ap-bs/basicServices/BasicServicesService');
var responseBuilder = require('onf-core-model-ap/applicationPattern/rest/server/ResponseBuilder');
var RestResponseBuilder = require('onf-core-model-ap/applicationPattern/rest/server/ResponseBuilder');
var responseCodeEnum = require('onf-core-model-ap/applicationPattern/rest/server/ResponseCode');
var restResponseHeader = require('onf-core-model-ap/applicationPattern/rest/server/ResponseHeader');
var RestResponseHeader = require('onf-core-model-ap/applicationPattern/rest/server/ResponseHeader');
var ExecutionAndTraceService = require('onf-core-model-ap/applicationPattern/services/ExecutionAndTraceService');

module.exports.embedYourself = async function embedYourself(req, res, next, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.NO_CONTENT;
let responseCode = responseCodeEnum.code.OK;
let responseBodyToDocument = {};

await BasicServices.embedYourself(body, user, xCorrelator, traceIndicator, customerJourney, req.url)
Expand Down Expand Up @@ -223,7 +224,7 @@ module.exports.registerYourself = async function registerYourself(req, res, nex
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.NO_CONTENT;
let responseBodyToDocument = {};
if (Object.keys(req.body).length === 0) {
if (Object.keys(req.body).length === 0) {
body = req.body;
user = req.headers["user"];
originator = req.headers["originator"];
Expand Down
14 changes: 7 additions & 7 deletions server/controllers/IndividualServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var utils = require('../utils/writer.js');
var IndividualServices = require('../service/IndividualServicesService');
var executionAndTraceService = require('onf-core-model-ap/applicationPattern/services/ExecutionAndTraceService');
var responseCodeEnum = require('onf-core-model-ap/applicationPattern/rest/server/ResponseCode');
var restResponseHeader = require('onf-core-model-ap/applicationPattern/rest/server/ResponseHeader');
var restResponseBuilder = require('onf-core-model-ap/applicationPattern/rest/server/ResponseBuilder');
var ResponseHeader = require('onf-core-model-ap/applicationPattern/rest/server/ResponseHeader');
var ResponseBuilder = require('onf-core-model-ap/applicationPattern/rest/server/ResponseBuilder');
const RequestBuilder = require('onf-core-model-ap/applicationPattern/rest/client/RequestBuilder');


Expand Down Expand Up @@ -44,7 +44,7 @@ module.exports.provideListOfNetworkElementInterfacesOnPath = async function prov
responseCode = sentResp.code;
responseBodyToDocument = sentResp.body;
});
//executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);

};

Expand All @@ -64,7 +64,7 @@ module.exports.provideListOfNetworkElementInterfacesOnPathInGenericRepresentatio
responseCode = sentResp.code;
responseBodyToDocument = sentResp.body;
});
//executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
};

module.exports.provideMacTableOfAllDevices = async function provideMacTableOfAllDevices (req, res, next, user, originator, xCorrelator, traceIndicator, customerJourney) {
Expand All @@ -83,7 +83,7 @@ module.exports.provideMacTableOfAllDevices = async function provideMacTableOfAll
responseCode = sentResp.code;
responseBodyToDocument = sentResp.body;
});
//executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
};

module.exports.provideMacTableOfSpecificDevice = async function provideMacTableOfSpecificDevice (req, res, next, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
Expand All @@ -102,7 +102,7 @@ module.exports.provideMacTableOfSpecificDevice = async function provideMacTableO
responseCode = sentResp.code;
responseBodyToDocument = sentResp.body;
});
//executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
};

module.exports.readCurrentMacTableFromDevice = async function readCurrentMacTableFromDevice (req, res, next, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
Expand All @@ -121,5 +121,5 @@ module.exports.readCurrentMacTableFromDevice = async function readCurrentMacTabl
responseCode = sentResp.code;
responseBodyToDocument = sentResp.body;
});
//executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
executionAndTraceService.recordServiceRequest(xCorrelator, traceIndicator, user, originator, req.url, responseCode, req.body, responseBodyToDocument);
};
Loading
Loading