Lines Matching full:json

73 std::vector<RegistrySeverity> getSeverities(const nlohmann::json& severity)  in getSeverities()
160 uint16_t getSRCReasonCode(const nlohmann::json& src, const std::string& name) in getSRCReasonCode()
175 uint8_t getSRCType(const nlohmann::json& src, const std::string& name) in getSRCType()
192 bool getSRCDeconfigFlag(const nlohmann::json& src) in getSRCDeconfigFlag()
197 bool getSRCCheckstopFlag(const nlohmann::json& src) in getSRCCheckstopFlag()
203 getSRCHexwordFields(const nlohmann::json& src, const std::string& name) in getSRCHexwordFields()
251 const nlohmann::json& src, const std::string& name) in getSRCSymptomIDFields()
283 const nlohmann::json& pelEntry, const std::string& name) in getComponentID()
317 * @brief Says if the JSON is the format that contains AdditionalData keys
320 * @param[in] json - The highest level callout JSON
324 bool calloutUsesAdditionalData(const nlohmann::json& json) in calloutUsesAdditionalData() argument
326 return (json.contains("ADName") && in calloutUsesAdditionalData()
327 json.contains("CalloutsWithTheirADValues")); in calloutUsesAdditionalData()
377 * @param[in] json - The callout JSON
379 * @param[out] calloutLists - The JSON array which will hold the calloutlist to
382 * @return - Throws runtime exception if json is not an array or if calloutLists
385 static void findCalloutList(const nlohmann::json& json, in findCalloutList() argument
387 nlohmann::json& calloutLists) in findCalloutList()
389 if (!json.is_array()) in findCalloutList()
391 throw std::runtime_error{"findCalloutList was not passed a JSON array"}; in findCalloutList()
397 for (const auto& callouts : json) in findCalloutList()
450 "Could not find a CalloutList JSON for this error and system name"}; in findCalloutList()
455 * @brief Creates a RegistryCallout based on the input JSON.
457 * The JSON looks like:
466 * @param[in] json - The JSON dictionary entry for a callout
470 RegistryCallout makeRegistryCallout(const nlohmann::json& json) in makeRegistryCallout() argument
477 if (json.contains("Priority")) in makeRegistryCallout()
479 callout.priority = json["Priority"].get<std::string>(); in makeRegistryCallout()
482 if (json.contains("LocCode")) in makeRegistryCallout()
484 callout.locCode = json["LocCode"].get<std::string>(); in makeRegistryCallout()
487 if (json.contains("Procedure")) in makeRegistryCallout()
489 callout.procedure = json["Procedure"].get<std::string>(); in makeRegistryCallout()
491 else if (json.contains("SymbolicFRU")) in makeRegistryCallout()
493 callout.symbolicFRU = json["SymbolicFRU"].get<std::string>(); in makeRegistryCallout()
495 else if (json.contains("SymbolicFRUTrusted")) in makeRegistryCallout()
498 json["SymbolicFRUTrusted"].get<std::string>(); in makeRegistryCallout()
501 if (json.contains("UseInventoryLocCode")) in makeRegistryCallout()
503 callout.useInventoryLocCode = json["UseInventoryLocCode"].get<bool>(); in makeRegistryCallout()
517 * The JSON looks like:
547 * @param[in] json - The callout JSON
553 const nlohmann::json& json, const std::vector<std::string>& systemNames) in getCalloutsWithoutAD() argument
557 nlohmann::json calloutLists = nlohmann::json::array(); in getCalloutsWithoutAD()
560 findCalloutList(json, systemNames, calloutLists); in getCalloutsWithoutAD()
575 * The JSON looks like:
601 * @param[in] json - The callout JSON
608 const nlohmann::json& json, const std::vector<std::string>& systemNames, in getCalloutsUsingAD() argument
612 auto keyName = json["ADName"].get<std::string>(); in getCalloutsUsingAD()
620 lg2::warning("The PEL message registry callouts JSON " in getCalloutsUsingAD()
628 const auto& callouts = json["CalloutsWithTheirADValues"]; in getCalloutsUsingAD()
632 callouts.begin(), callouts.end(), [adValue](const nlohmann::json& j) { in getCalloutsUsingAD()
642 if (json.contains("CalloutsWhenNoADMatch")) in getCalloutsUsingAD()
644 return getCalloutsWithoutAD(json["CalloutsWhenNoADMatch"], in getCalloutsUsingAD()
657 * The JSON looks like:
672 * @param json - The journal capture JSON
675 JournalCapture getJournalCapture(const nlohmann::json& json) in getJournalCapture() argument
680 if (json.contains("NumLines")) in getJournalCapture()
682 capt = json.at("NumLines").get<size_t>(); in getJournalCapture()
684 else if (json.contains("Sections")) in getJournalCapture()
687 for (const auto& capture : json.at("Sections")) in getJournalCapture()
711 std::optional<nlohmann::json> registryTmp; in lookup()
731 [&name, &type](const nlohmann::json& j) { in lookup()
740 // Fill in the Entry structure from the JSON. Most, but not all, fields in lookup()
830 // If there are callouts defined, save the JSON for later in lookup()
861 std::optional<nlohmann::json> Registry::readRegistry( in readRegistry()
866 nlohmann::json registry; in readRegistry()
881 registry = nlohmann::json::parse(file); in readRegistry()
885 lg2::error("Error parsing message registry JSON. Error: {ERROR}", in readRegistry()
893 const nlohmann::json& calloutJSON, in getCallouts()
897 // The JSON may either use an AdditionalData key in getCallouts()