VMware Cloud Community
bdamian
Expert
Expert
Jump to solution

NSX-v DynamicTypes plug-in V2 - find and return an object

I'm using the NSX-v DynamicTypes plug-in V2 plugin.

Inside a workflow, I'm looking for a pre-created object using:

var object = Server.findForType("DynamicTypes:NSX.pool",hostid + '/' + edgeId + '/' + poolId);

System.log(object.name); //and I can see the correct data

then I assign the object to an out-param:

outPool = object;  //(outPool = "DynamicTypes:NSX.pool")

In another workflow I have an Attribute of type "DynamicTypes:NSX.pool", when I call the first workflow binding the out-param to the attribute, it receive nothing. I can't access any property of the object.

How can I accomplish this?

Thanks a lot,

D.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

It seems you do what I do in most of my workflows. Now I am wondering if they work fine :smileyshocked:

Can you please try to use the DynamicTypesManager.getObject() method instead and let me know if this fixed your issue ?

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

0 Kudos
5 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

It seems you do what I do in most of my workflows. Now I am wondering if they work fine :smileyshocked:

Can you please try to use the DynamicTypesManager.getObject() method instead and let me know if this fixed your issue ?

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
bdamian
Expert
Expert
Jump to solution

I've been trying that but how can I cast from DynamicTypes:DynamicObject to DynamicTypes:NSX.pool object?

D.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos
bdamian
Expert
Expert
Jump to solution

PERFECT!!!!

Thank you very much! (as always)

D.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Good it worked for you but do you think I need to fix the same way the workflows I provided in the plug-in ?

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
bdamian
Expert
Expert
Jump to solution

If the behaviour I have is the same for everyone else, I guess so.

Is just change this:

var object = Server.findForType(type,nsxHost.id + '/' + edgeId + '/' + poolId);

for this:

var object = DynamicTypesManager.getObject("NSX" , "pool" , poolId);

It seems more correct.

Thanks again!

D.

PS: I'm provisioning this object as an Item in vRealize Automation, and it shows it like in the screenshot. Is there any way to change the name of the category showed on the left? (Id like to show "Networking")

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos