VMware {code} Community
ZackZhang
Contributor
Contributor
Jump to solution

vCO plugin, which interface corresponds to the action when the "reload" menuitem is clicked for a node in the inventory?

Hi,

     The vCO plugin I'm working on has an inventory implementation, just like the inventory vCenter Server plugin has provided.

1.png

My question is that, when the "Reload" button for a node is clicked (like the screenshot shown above) , in the IPluginFactory implementation, which "unique" method will be invoked.

When I say "unique", I mean a method that will only be triggered when "Reload" button is clicked. In this method I'd like to clear the cache and reload the node and its children nodes.

I do know that some methods within IPluginFactory are invoked, for example find(...), findRelation(...), but it doesn't not make sense to clear cache and reload in those methods as they are not unique (meaning that they would be triggered in other places where no clearing cache should be intended).

So please let me know which method is hooked specifically for the "Reload" menuitem, or any other solution to implement what I wanted. Thanks in advance!

Reply
0 Kudos
1 Solution

Accepted Solutions
tschoergez
Leadership
Leadership
Jump to solution

Hi,

that would be the invalidate(String type, String id) and invalidateAll() methods in the PluginFactory.

Cheers,

Joerg

View solution in original post

Reply
0 Kudos
6 Replies
tschoergez
Leadership
Leadership
Jump to solution

Hi,

that would be the invalidate(String type, String id) and invalidateAll() methods in the PluginFactory.

Cheers,

Joerg

Reply
0 Kudos
ZackZhang
Contributor
Contributor
Jump to solution

Wonderful, that's what I'm looking for. Thanks.

I thought of the method invalidate() before but I didn't see it being invoked when I clicked the reload menuitem, now I confirmed it does, guess I was too careless Smiley Happy

Reply
0 Kudos
AntLeguy
Enthusiast
Enthusiast
Jump to solution

Hello there !

I wondered : is there a way to access this reload functionnality from within the API ?

Thanks !

Reply
0 Kudos
sanchezs
VMware Employee
VMware Employee
Jump to solution

Unfortunately no, (AFAIK) there's no way so far... unless a specific plug-in decides to make those methods (or their functionality) available for its inventory items somehow.

Reply
0 Kudos
AntLeguy
Enthusiast
Enthusiast
Jump to solution

Thanks for your reply. Because the reload() methods of datacenter,cluster, vms, etc... doesn't seem to do what they're meant for because i can't refresh my data between 2 workflow executiions.

Reply
0 Kudos
sanchezs
VMware Employee
VMware Employee
Jump to solution

Is it possible that even trying to reload the data from those objects with the method "reload()" the objects haven't changed actually? Is the action that causes the change in the object's state triggered by vCO through a workflow or directly/manually from the vCenter? In the 1st case the vCenter plug-in should keep the objects up to date, and in the 2nd case then the method "reload()" should be invoked... but if none of both cases is working then it could be a bug.

Reply
0 Kudos