How to get vcaccafe host using vro
get cafeHost
System.log("cafeHost found by type: "+cafeHost.displayName);
//
cafeHost = null;
var cafeHost =
vCACCAFEEntitiesFinder.getHostForEntity(catalogItem);
System.log("cafeHost found by catalogItem: "+cafeHost.displayName);
//
cafeHost = null;
var tenantName = "lab";
var cafeHosts = Server.findAllForType("VCACCAFE:VCACHost");
if (!cafeHosts[0]){throw "ERROR -
Unable to find an IaaS Host";}
for each (var
cafeHost in cafeHosts){
if(cafeHost.tenant
== tenantName){
var
tenantCafeHost = cafeHost;
break;
}
}
if (!tenantCafeHost){
throw
"ERROR - Unable to find a CAFE Host for:
" + tenantName;
}else{
System.log("found cafeHost for tenant \""+tenantName+"\"
: "+tenantCafeHost.displayName);
}
//
cafeHost = null;
Comments
Post a Comment