The vCloud plug-in for vCenter Orchestrator 5 provides an action named "createEvent" whose scripting tab gives the following details:
//Auto generated script, cannot be modified !
actionResult = System.getModule("com.vmware.library.vCloud.schema.objects").createEvent(ownerArg,serviceNamespaceArg,successArg,typeFullArg,userArg) ;
There are no details on what type of enitites should be bound to each of the parameters. Any help in this will be much appreciated.
And I noticed I did not use tha action in the library because it is missing a parameter (this is a bug I reported previously).
Replace it with a scriptable task doing:
vcdEvent = new VclEvent();
vcdEvent.owner = ownerArg.getReference();
vcdEvent.serviceNamespace = serviceNamespaceArg;
vcdEvent.success = successArg;
vcdEvent.type = typeArg;
vcdEvent.typeFull = typeFullArg;
vcdEvent.user = userArg.getReference();
Set vcdEvent as output parameter of the scriptable task
then use vcdEvent as the input of createEventAdminOrg as below
I use it in a workflow. I will get back to you in the next couple of hours.
ownerArg : An object this event refers to (i.e vApp)
serviceNamespaceArg : a string identifying the service generating the event (i.e com.vmware.vco)
successArg : a boolean (true for success, false for failure)
typeFullArg : a string indicating the event details
userArg: a vCD user object reference
Also note that the action returns a VclEvent object.
To create the event use the createEventAdminOrg action with passing an admin org and the vclEvent you created.
And I noticed I did not use tha action in the library because it is missing a parameter (this is a bug I reported previously).
Replace it with a scriptable task doing:
vcdEvent = new VclEvent();
vcdEvent.owner = ownerArg.getReference();
vcdEvent.serviceNamespace = serviceNamespaceArg;
vcdEvent.success = successArg;
vcdEvent.type = typeArg;
vcdEvent.typeFull = typeFullArg;
vcdEvent.user = userArg.getReference();
Set vcdEvent as output parameter of the scriptable task
then use vcdEvent as the input of createEventAdminOrg as below
Thank you for the code - this is very helpful. I am new to using the vCD APIs. Appreciate if you could provide help with the following:
Thanks again for you help.
1 - VclUser is the javascrip object type
2 - The vCD 5.1 API doc is very helpful. The API Schema Reference is good to have in addition to vCO API explorer.