MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CustomVariableValuesAccessor

Method CustomVariableValuesAccessor

lib/livestatus/servicestable.cpp:1059–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057}
1058
1059Value ServicesTable::CustomVariableValuesAccessor(const Value& row)
1060{
1061 Service::Ptr service = static_cast<Service::Ptr>(row);
1062
1063 if (!service)
1064 return Empty;
1065
1066 Dictionary::Ptr vars = service->GetVars();
1067
1068 ArrayData result;
1069
1070 if (vars) {
1071 ObjectLock olock(vars);
1072 for (const Dictionary::Pair& kv : vars) {
1073 if (kv.second.IsObjectType<Array>() || kv.second.IsObjectType<Dictionary>())
1074 result.push_back(JsonEncode(kv.second));
1075 else
1076 result.push_back(kv.second);
1077 }
1078 }
1079
1080 return new Array(std::move(result));
1081}
1082
1083Value ServicesTable::CustomVariablesAccessor(const Value& row)
1084{

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected