Fixed Json Parser

This commit is contained in:
2025-10-30 08:33:35 +01:00
parent df1c4ca4b4
commit 42a40e8b2e
3 changed files with 53 additions and 46 deletions

View File

@@ -3,9 +3,39 @@ import urllib.request
url = "http://localhost:5000/monitoring/service-discovery"
payload = {
"server_id": 7,
"containers": ["{\"id\":\"6621c5b67c25\",\"image\":\"git.triggermeelmo.com/donpat1to/watcher-agent:v0.1.26\",\"name\":\"watcher-agent\"}",
"{\"id\":\"b8c86fb260bd\",\"image\":\"git.triggermeelmo.com/watcher/watcher-server:v0.1.10\",\"name\":\"watcher\"}"]
"Server_id": 2,
"Containers": [
{
"id": "3e74abf5ce30",
"image": "hello-world:latest",
"name": "serene_nightingale"
},
{
"id": "83cd9d461690",
"image": "postgres:latest",
"name": "distracted_feistel"
},
{
"id": "b296c2ed1213",
"image": "postgres:latest",
"name": "mystifying_jackson"
},
{
"id": "69568181d576",
"image": "hello-world:latest",
"name": "romantic_driscoll"
},
{
"id": "67c37a2b1791",
"image": "hello-world:latest",
"name": "asdf"
},
{
"id": "8f39bae1e316",
"image": "hello-world:latest",
"name": "distracted_mirzakhani"
}
]
}
data = json.dumps(payload).encode("utf-8")