VMware Cloud Community
sbeaver
Leadership
Leadership

Dynamic Type Plug-in Generator

Good Monday Morning to everyone,

I am working on creating a Dynamic Plug-in for Service Now via Rest and I am struggling once we get to the FindRelationURL.  I have been able to do the standard tasks via the REST plug-in and what I believe is the problem is that ServiceNow requires Headers to perform the action.  Namely it needs an Accept and Authorization headers to perform the rest calls.

Any idea where I can configure that for the plug-in creation to use and be able to connect and query successfully?

Thanks

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
6 Replies
cdecanini_
VMware Employee
VMware Employee

You can duplicate the executeRequestJson action. Edit it to remove the lines that are running another action and add your specific headers.

Then you run "Set a custom request action for a host", specify your REST host and your action.

For each call on this host your custom action will be run and add the headers.

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
sbeaver
Leadership
Leadership

Thanks for pointing out the direction to explore.  I will look at editing the action and see where I can get

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
sbeaver
Leadership
Leadership

ok I suck!!!  I am getting no where editing the executeRequestJson action   It goes from bad request to no response.  Any examples or suggestions by chance?

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

I would advise that you first use a REST plug-in for a web browser to make sure you get the headers, URL, URL parameters right.

Then you can edit the duplicated action accordingly.

If you do not manage it post here a sample of the API documentation and the errors you get.

Other users may be able to provide examples since I have implemented this feature after getting a request from a plug-in generator user.

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
Reply
0 Kudos
sbeaver
Leadership
Leadership

OK I think I am on to something in that there appears to be a certain order that the find releationships URL is done.  That is what it is looking like right now.

Also FYI the executeRequestJsonText has a typo towards the top

if (url == null || restHost == null || namespace == null) {

  if (debug == true) System.getModule("com.vmware.coe.tools").profile("executeRequestJsonText", startDate, "Null params");

  return nill

}

I believe you meant to return null 

Smiley Happy

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

Good catch. It is going to return undefined instead of null. I do not think it is going to error but yes I'd better fix this one.

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
Reply
0 Kudos