Closed ibplayn closed 1 year ago
@ibplayn createMultipleNetworkObject
is for Network objects.
I use operation upsertHostObject
for Host objects and upsertNetworkObject
for Network objects.
Thank you @xibriz! It would be nice if these were documented better outside of the FMC itself. I used another issue (#15) to figure out where these were 'defined' in the API. I am opening another issue as now, these two operations (and who know how many others) are not idempotent.
Example error from re-using the same object name:
fatal: [firewall.example.com]: FAILED! => {"changed": false, "msg": "Server returned an error trying to execute createMultipleHostObject operation. Status code: 400. Server response: The object name testansible02 already exists. Enter a new name."}
fatal: [firewall.example.com]: FAILED! => {"changed": false, "msg": "Server returned an error trying to execute upsertHostObject operation. Status code: 400. Server response: The object name testansible02 already exists. Enter a new name."}
@ibplayn I have downloaded the JSON-spec you get when you navigate to /api/api-explorer/
and click "Download Spec" in the upper right corner. Then you can easily find the correct operation
(operationId) for each API-call you want do make :)
Has anyone successfully created host objects with this repo? I cannot seem to get creating host objects to work. FMC version 7.2.4 Playbook:
Error:
fatal: [firewall.example.com]: FAILED! => {"changed": false, "msg": "Server returned an error trying to execute createMultipleNetwork operation. Status code: 400. Server Response: Input type mismatch. You have entered an invalid value 10.10.10.10 for selected type Network."}
Perhaps I am not specifying the correct type, or using the wrong syntax but I have tried multiple variations with no success.