Skip to content

Instantly share code, notes, and snippets.

@deangrant
Last active July 18, 2022 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deangrant/f9303de2b850c9758dab53154fa6fdfe to your computer and use it in GitHub Desktop.
Save deangrant/f9303de2b850c9758dab53154fa6fdfe to your computer and use it in GitHub Desktop.
com.deangrant.http-rest/getRestHostByName
// Returns a collection of REST:RESTHost object types from the inventory service plugin
var getHosts = RESTHostManager.getHosts()
// Iterates the collection to return the REST:RESTHost object type and perform a match on the name attribute provided as an input parameter and returns the REST:RESTHost type if true.
for(var restHostId in getHosts){
var restHost = RESTHostManager.getHost(getHosts[restHostId])
if(restHost.name == name){
return restHost
} // if(restHost.name == name)
} // var restHost = RESTHostManager.getHost(getHosts[restHostId])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment