Hi Guys,
I ask for your help with an API call.
Since upgrading to 2.13.6 the /v1/config/packages API endpoint fails when the hostname contains a dot (.) and for this reason the package will not be created.
curl -k -s -u xx:xx -H ‘Accept: application/json’ -X POST ‘url…/v1/config/packages/test.host.com?pretty=1’
{
“error”: 400,
“status”: “Invalid package name ‘test.host.com’.”
}
If I replace the dot with underscore, then the API accepts it.
{
“results”: [
{
“code”: 200,
“package”: “test_host_com”,
“status”: “Created package.”
}
]
}
Since we have ca. 150 hosts already defined with the dot (.) in the package name, it causes now a bit of a headache for us.
Is it a feature or a bug?
I tried with the %2E escape character but this gives us the same result unfortunately.
curl -k -s -u xx:xx -H ‘Accept: application/json’ -X POST ‘url/v1/config/packages/test%2Ehost%2Ecom?pretty=1’
{
“error”: 400,
“status”: “Invalid package name ‘test.host.com’.”
}
Any idea how to use the dot with this API call in the future?
Best regards!
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.6-1)
Version: 2.13.6-1+ubuntu20.04
Ubuntu 20.04.5 LTS (Focal Fossa)
Enabled features: api checker command ido-mysql mainlog notification syslog