Skip to content

Instantly share code, notes, and snippets.

@chelnak
Last active September 16, 2015 07:18
Show Gist options
  • Select an option

  • Save chelnak/b2d11c07f6daccd139ac to your computer and use it in GitHub Desktop.

Select an option

Save chelnak/b2d11c07f6daccd139ac to your computer and use it in GitHub Desktop.
Get rest hosts and operations by name
//get REST host by name
//Input: [String]name - The name of the rest host
//Output: [RESTHost]host - The rest host object
var hostsIds = RESTHostManager.getHosts();
for(var currentHostId in hostsIds){
var currentHost = RESTHostManager.getHost(hostsIds[currentHostId]);
System.log(currentHost.name);
if(currentHost.name == name){
host = currentHost;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment