Commit ff92e538 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Code cleanup

parent c8356911
......@@ -755,6 +755,7 @@ void amf_app::handle_itti_message(itti_sbi_update_amf_configuration& itti_msg) {
Logger::amf_app().debug(
"AMF configuration:\n %s", response_data["content"].dump().c_str());
response_data["httpResponseCode"] = 200; // TODO:
// TODO: Send message to update AMF profile at NRF
} else {
response_data["httpResponseCode"] = 400; // TODO:
oai::amf::model::ProblemDetails problem_details = {};
......@@ -983,7 +984,7 @@ void amf_app::generate_amf_profile() {
// generate UUID
generate_uuid();
nf_instance_profile.set_nf_instance_id(amf_instance_id);
nf_instance_profile.set_nf_instance_name("OAI-AMF");
nf_instance_profile.set_nf_instance_name(amf_cfg.amf_name);
nf_instance_profile.set_nf_type("AMF");
nf_instance_profile.set_nf_status("REGISTERED");
nf_instance_profile.set_nf_heartBeat_timer(50);
......
......@@ -49,10 +49,6 @@ void AMFConfigurationApi::setupRoutes() {
*router, base + amf_cfg.sbi_api_version + "/configuration/",
Routes::bind(&AMFConfigurationApi::update_configuration_handler, this));
Routes::Put(
*router, base + amf_cfg.sbi_api_version + "/configuration/nssai",
Routes::bind(&AMFConfigurationApi::create_nssai_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(
&AMFConfigurationApi::configuration_api_default_handler, this));
......@@ -97,26 +93,6 @@ void AMFConfigurationApi::update_configuration_handler(
}
}
void AMFConfigurationApi::create_nssai_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response) {
try {
auto json_data = nlohmann::json::parse(request.body());
this->create_nssai(json_data, response);
} catch (nlohmann::detail::exception& e) {
// send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError& e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception& e) {
// send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void AMFConfigurationApi::configuration_api_default_handler(
const Pistache::Rest::Request&, Pistache::Http::ResponseWriter response) {
response.send(
......
......@@ -48,9 +48,6 @@ class AMFConfigurationApi {
void update_configuration_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
void create_nssai_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
void configuration_api_default_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
......@@ -61,8 +58,6 @@ class AMFConfigurationApi {
virtual void update_configuration(
nlohmann::json& configuration_info,
Pistache::Http::ResponseWriter& response) = 0;
virtual void create_nssai(
nlohmann::json& json_data, Pistache::Http::ResponseWriter& response) = 0;
};
} // namespace oai::amf::api
......
......@@ -173,7 +173,4 @@ void AMFConfigurationApiImpl::update_configuration(
}
}
void AMFConfigurationApiImpl::create_nssai(
nlohmann::json& json_data, Pistache::Http::ResponseWriter& response) {}
} // namespace oai::amf::api
......@@ -44,8 +44,6 @@ class AMFConfigurationApiImpl : public oai::amf::api::AMFConfigurationApi {
void update_configuration(
nlohmann::json& configuration_info,
Pistache::Http::ResponseWriter& response);
void create_nssai(
nlohmann::json& json_data, Pistache::Http::ResponseWriter& response);
};
} // namespace oai::amf::api
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment