For a project I need to write in a json file with python but all I have already seen (json.dump) don't match with what I want to do...
I have a structure and I just want to add something inside. I want to add a service with a input for example :
{
"Serial_011": "011",
"Servers_011":
[
{
"hostname": "srv-a.11",
"ipv4_address": "0.0.0.0",
"services":
[
{
"uri": "http://www.google.fr/1",
"expected_code": 200
},
{
"uri": "http://www.google.fr/2",
"expected_code": 200
}
]
},
{
"hostname": "nsc-srv-b.11",
"ipv4_address": "0.0.0.0",
"services":
[
{
"uri": "http://www.google.fr/3",
"expected_code": 200
},
{
"uri": "http://www.google.fr/4",
"expected_code": 200
}
]
}
]
}
Thanks in advance