CE-2891: Introduce inventory calculation endpoint
Introducing new Inventory calculation endpoint
The endpoint is put to the AWX grouping on the swagger UI (top right corner, the dropdown) - to not to generate the endpoint for regular clients, if generating a client, like the FE
The endpoint can be reached via the "/api/v1/inventory" URL.
Has an optional FQDN parameter for searching for IOCs that has been, or is being deployed to that host.
The response gives back all IOCs that are successfully deployed to hosts, or are being queued, or the deployment is running, or the (deployment) job is created.
The response contains 3 "sections":
- the hostvars is has the (deployed) IOCs group by the hostname. If the FQDN parameter for the endpoint is being filled, it filters down to that host
- all->host shows all the hosts that can be fetched from NetBox - not filtered
- iocs -> it is just there as placeholder, for some reason AWX needs that param
Response is a bit slow because needs to fetch all hosts from NetBox, what takes around 14 sec on TEST