Hello everyone
I am relatively new to using the API
We want to create hosts via the API, which works quite well.
But unfortunately we are not able to activate them via the API.
We use httpie for the API calls as suggested by CheckMK.
But now we get the message during activation:
{
"detail": "ETag didn't match. Expected 2198ee82fff7d885b58f042a50521dff2937601fe0b1a22bb22f46d1dc74b4d6. Probable cause: Object changed by another user.",
"status": 412,
"title": "Precondition failed"
}
Now we ask ourselves where we get this ETag from. The ETag from the creation of the host does not fit:
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 3694
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' ssh: rdp:; img-src 'self' data: https://*.tile.openstreetmap.org/ ; connect-src 'self' https://crash.checkmk.com/ https://license.checkmk.com/api/verify; frame-ancestors 'self' ; base-uri 'self'; form-action 'self' javascript: 'unsafe-inline'; object-src 'self'; worker-src 'self' blob:
Content-Type: application/json
Date: Tue, 07 Nov 2023 08:09:11 GMT
ETag: "20cdceb46cac77c98753a74eb775d740b12c53990cb67740deac15b61d2085cb"
Keep-Alive: timeout=5, max=100
Permissions-Policy: accelerometer=(), autoplay=(), camera=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), usb=()
Referrer-Policy: origin-when-cross-origin
Server: Apache
X-Checkmk-Edition: cee
X-Checkmk-Version: 2.2.0p12
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Wo oder wie müssen wir diesen ETag auslesen?
Oder gibt es eine Möglichkeit eine Aktivierung zu machen ohne diesen ETag?
Besten Dank im Voraus für euer Hilfe
Roman