Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
API method to get a specific object by name
-
I am trying to determine if an Otter server object has been created, and am using the recommended (non-native) API to do this.
At the moment, in order to perform this test (at least as per the documentation), I have to issue an
/api/infrastructure/servers/list
call and loop through all the results, matching on theName
property.As this project grows, this is going to amount to a whole heap of JSON parsing, and the list is only going to get longer and longer. That's going to have a growing impact on the memory and processing time of my scripts, not to mention the log storage (as each API call response appears to be logged).
Instead, I would like to call an API method which returns the given object by name (I believe name is unique within Otter).
I've already tried to see if an undocumented RESTful or RPC-like method already exists, but both...
/api/infrastructure/servers/SERVERNAME
/api/infrastructure/servers/get/SERVERNAME
...return
HTTP/400 Invalid action type
(I have also tried RPC-like methodssearch
andfind
, with the same result). I had hoped that one of them might return HTTP/200 and the JSON of the single found object; or HTTP/404 if it did not exist.Can I please raise the request that something along these lines be considered for the recommended API?
Or if it already exists, could the documentation be updated to include it?
-
Hi @jimbobmcgee,
We don't currently support via the API; it's not terribly complex/risky to do, but also not trivial.
I'll add this to the "Otter 2023 wishlist", and it probably also get pushed to BuildMaster as well, since we want the API to be the same in both products.
FYI - we would most certainly prioritize/implement this for a paying user (*wink* *wink*), but for now we'll keep it on the internal wishlist.
-
Hi @jimbobmcgee,
I just wanted to let you know that we just released Otter 2023 and it includes the name filter on the List action type on the Infrastructure API.
Thanks,
Rich