VMware Cloud Community
standVM
Contributor
Contributor
Jump to solution

createEvent action details

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.

0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

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

Screen Shot 2013-01-30 at 9.07.09 PM.png

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

I use it in a workflow. I will get back to you in the next couple of hours.

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
cdecanini_
VMware Employee
VMware Employee
Jump to solution

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.

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
cdecanini_
VMware Employee
VMware Employee
Jump to solution

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

Screen Shot 2013-01-30 at 9.07.09 PM.png

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
standVM
Contributor
Contributor
Jump to solution

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:

  1. What is the entity/class used for "user"
  2. Where can I find more details on the vCD APIs (besides the API explorer).

Thanks again for you help.

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

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.

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