michalpawlak
Enthusiast
Enthusiast

Problem with establishing connection to vCACHost in code

Hi All,

I would like to connecet to VCAC host in order to get some data.

For example list of business groups:

var host = Server.findForType("vCAC:VCACHost","29566cc7-f1c3-4e25-b60d-5c0dd0a55db9");

var groups = vCACCAFEEntitiesFinder.getBusinessGroups(host);

always ends with an error:

Error in (Workflow:**** / Scriptable task (item1)#4) Cannot convert {Connection: 29566cc7-f1c3-4e25-b60d-5c0dd0a55db9, Connection info: {Id: 29566cc7-f1c3-4e25-b60d-5c0dd0a55db9,Name: vRealize IAAS - prod,Host: *****: com.vmware.o11n.plugin.dynamicops.configuration.authentication.SSOAuthentication@48294063,Accept all certificates: false,}, Factory: class com.vmware.o11n.plugin.dynamicops.VcacPluginFactory @2836b897-ee83-4e62-a7cc-3275ab1a792c; Tue Jun 14 13:55:51 UTC 2016} to com.vmware.o11n.plugin.vcac.model.VCACHost

I have also passed host as attribut, but result is the same.

Have any of you experince the same?

 

 

 

var hostLocal = Server.findForType("vCAC:VCACHost","29566cc7-f1c3-4e25-b60d-5c0dd0a55db9");
var groups = vCACCAFEEntitiesFinder.getBusinessGroups(hostLocal);
0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

Hi,

I don't have a working vRA environment at hand to check, but from the documentation in vRO API Explorer it seems that vCACCAFEEntitiesFinder.getBusinessGroups(host) expects as an argument not vCAC:VCACHost but vCACCAFE:VCACHost. These are 2 different types, so I think this is the reason why you code fails.

0 Kudos