Olá pessoal, gostaria da ajuda de vocês para entender como posso percorrer esse JSON e gerar os itens via LLD. Eu consigo fazer quando tem uma chave em comum dentro dos das métricas a serem monitoradas, no entanto, este array me retorna o nome de cada servidor em um array separado. Gostaria de saber se é possível trabalhar com arrays desse tipo. Segue o JSON de origem.
{"items": [
{
"name": "AdminServer",
"applicationRuntimes": {"items": [
{
"healthState": {"state": "ok"},
"applicationName": "wls-management-services"
},
{
"healthState": {"state": "ok"},
"applicationName": "mejb"
},
{
"healthState": {"state": "ok"},
"applicationName": "wls-exporter-srvWebLogic01"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-xa-adp"
},
{
"healthState": {"state": "ok"},
"applicationName": "consoleapp"
},
{
"healthState": {"state": "ok"},
"applicationName": "bea_wls_internal"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-notran-adp"
}
]}
},
{
"name": "RMS01",
"applicationRuntimes": {"items": [
{
"healthState": {"state": "ok"},
"applicationName": "wls-exporter-srvWebLogic01"
},
{
"healthState": {"state": "ok"},
"applicationName": "wls-management-services"
},
{
"healthState": {"state": "ok"},
"applicationName": "bea_wls_internal"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-xa-adp"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-notran-adp"
},
{
"healthState": {"state": "ok"},
"applicationName": "bea_wls_deployment_internal"
}
]}
}
]}
{"items": [
{
"name": "AdminServer",
"applicationRuntimes": {"items": [
{
"healthState": {"state": "ok"},
"applicationName": "wls-management-services"
},
{
"healthState": {"state": "ok"},
"applicationName": "mejb"
},
{
"healthState": {"state": "ok"},
"applicationName": "wls-exporter-srvWebLogic01"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-xa-adp"
},
{
"healthState": {"state": "ok"},
"applicationName": "consoleapp"
},
{
"healthState": {"state": "ok"},
"applicationName": "bea_wls_internal"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-notran-adp"
}
]}
},
{
"name": "RMS01",
"applicationRuntimes": {"items": [
{
"healthState": {"state": "ok"},
"applicationName": "wls-exporter-srvWebLogic01"
},
{
"healthState": {"state": "ok"},
"applicationName": "wls-management-services"
},
{
"healthState": {"state": "ok"},
"applicationName": "bea_wls_internal"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-xa-adp"
},
{
"healthState": {"state": "ok"},
"applicationName": "jms-internal-notran-adp"
},
{
"healthState": {"state": "ok"},
"applicationName": "bea_wls_deployment_internal"
}
]}
}
]}
Comment