You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create the source by doing POST director/importsources '{"source_name": "test"}' (I don't even know if this is the right endpoint) and I get the following message.
HTTP/1.1 500 Internal Server Error
Date: Wed, 11 Dec 2024 11:57:56 GMT
Server: Apache
X-Powered-By: PHP/7.3.29
X-Frame-Options: SAMEORIGIN
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json
{"status":"error","message":"Uncaught TypeError: Argument 2 passed to Icinga\\Module\\Director\\Data\\ObjectImporter::import() must be an instance of stdClass, string given, called in \/usr\/share\/icingaweb2\/modules\/director\/library\/Director\/DirectorObject\/Automation\/ImportExport.php on line 131 and defined in \/usr\/share\/icingaweb2\/modules\/director\/library\/Director\/Data\/ObjectImporter.php:42\nStack trace:\n#0 \/usr\/share\/icingaweb2\/modules\/director\/library\/Director\/DirectorObject\/Automation\/ImportExport.php(131): Icinga\\Module\\Director\\Data\\ObjectImporter->import('Icinga\\\\Module\\\\D...', 'test')\n#1 \/usr\/share\/icingaweb2\/modules\/director\/library\/Director\/Db.php(43): Icinga\\Module\\Director\\DirectorObject\\Automation\\ImportExport->Icinga\\Module\\Director\\DirectorObject\\Automation\\{closure}()\n#2 \/usr\/share\/icingaweb2\/modules\/director\/library\/Director\/DirectorObject\/Automation\/ImportExport.php(134): Icinga\\Module\\Director\\Db->runFailSafeTransaction(Object(Closure))\n#3 \/usr\/share\/icingaweb2\/modules\/director\/application\/controllers\/ImportsourcesController."}
Checking in the files where the error occurs, I think it happens because the unserializeImportSources function in the /library/Director/DirectorObject/Automation/ImportExport.php file is passing the arguments in the wrong order to the import function in the /library/Director/Data/ObjectImporter.php file.
Hi I'm trying to add a new Import Source and a new Sync Rule using the Icinga Director's REST API.
Following the documentation provided at https://icinga.com/docs/icinga-director/latest/doc/70-REST-API/ and using the script given there.
Current Behavior
I'm trying to create the source by doing
POST director/importsources '{"source_name": "test"}'
(I don't even know if this is the right endpoint) and I get the following message.Checking in the files where the error occurs, I think it happens because the
unserializeImportSources
function in the/library/Director/DirectorObject/Automation/ImportExport.php
file is passing the arguments in the wrong order to theimport
function in the/library/Director/Data/ObjectImporter.php
file.Possible Solution
I would also like to know if there is a way to know the current endpoints or how can I add a new Sync Rule, because the following does not work.
The text was updated successfully, but these errors were encountered: