chelnak
9/15/2015 - 4:05 PM

Get rest hosts and operations by name

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;
	}
}