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

Updated response-body of /v1/regard-application #577

Merged
merged 4 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions server/service/IntegerProfileService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
'use strict';
const createHttpError = require('http-errors');
const fileOperation = require('onf-core-model-ap/applicationPattern/databaseDriver/JSONDriver');
const IntegerProfile = require('onf-core-model-ap/applicationPattern/onfModel/models/profile/IntegerProfile');


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async function RequestForInquiringTopologyChangeInformationWithDefaultKey(applic
let responseCode = response.status;
if (!responseCode.toString().startsWith("2")) {
result["successfully-connected"] = false;
result["reason-of-failure"] = `ALT_NOT_REACHABLE`;
result["reason-of-failure"] = `ALT_DID_NOT_REACH_NEW_APPLICATION`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!responseCode.toString().startsWith("2")) , then you have to check whether the if responseCode.toString() == "408" to confirm that the application is actually not reachable. ( Note : Include the response code for which a not reachable scenario happen)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if(responseCode.toString() == "401") {
console.log(`${forwardingName} is failed with response code ${responseCode}. \n Probably, links to the regarded application is already available and operation-keys in server and client would have updated \n Proceeding to further callbacks`);
}
Expand Down Expand Up @@ -220,7 +220,7 @@ async function RequestForInquiringTopologyChangeInformation(applicationName, rel
let responseCode = response.status;
if (!responseCode.toString().startsWith("2")) {
PrathibaJee marked this conversation as resolved.
Show resolved Hide resolved
result["successfully-connected"] = false;
result["reason-of-failure"] = `ALT_NOT_REACHABLE`;
result["reason-of-failure"] = `ALT_DID_NOT_REACH_NEW_APPLICATION`;
} else {
let isControlConstructUpdated = await UpdateControlConstructAndLinksInDataBase(response.data, applicationName, releaseNumber, requestHeaders);
if(!isControlConstructUpdated) {
Expand Down Expand Up @@ -451,7 +451,7 @@ function processResponseForCreatingLinkService(response) {
if (!responseCode.toString().startsWith("2")) {
if (responseCode.toString() == "404" || responseCode.toString() == "408") {
result["successfully-connected"] = false;
result["reason-of-failure"] = `ALT_NOT_REACHABLE`;
result["reason-of-failure"] = `ALT_DID_NOT_REACH_ALT`;
} else {
result["successfully-connected"] = false;
result["reason-of-failure"] = `ALT_ALT_UNKNOWN`;
Expand Down
Loading