VMware Cloud Community
charan25
Contributor
Contributor
Jump to solution

Get the response of a url - vCO workflow

Hello,

Is it possible to get the response from a url though a vCO workflow? I would like to check the keepalive status of a webserver to see if the instance is running or not. All I want is to hit the url, say "https://webserverfqdn:port/keepalive.html/" and parse the response to figure out webserver is running. I don't want to SSH to the webserver to query the status. This is very starlight forward in javascript using xmlHTTPRequest. But, how can I achieve this using vRO?

Thanks

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

Here you go:

var website = new URL("https://webserverfqdn:port/keepalive.html");

var content = website.getContent();

Now "content" is a string that contains your website content that you may now parse as desired.

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
3 Replies
Burke-
VMware Employee
VMware Employee
Jump to solution

Here you go:

var website = new URL("https://webserverfqdn:port/keepalive.html");

var content = website.getContent();

Now "content" is a string that contains your website content that you may now parse as desired.

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

In addition to that: If you need some more fancy HTTP functionality (SSL support, authentication, ...) have a look at the REST Plugin for vRO. With that you can "render" http request very flexible, and easily generate re-usable workflows for these.

However, for your requirements it might be a bit of an overkill compared to Burke's two-liner 🙂

Regards,

Joerg

0 Kudos
charan25
Contributor
Contributor
Jump to solution

This thing worked. I did a workaround to implement the same thing using REST plugin. Adding RESTHost, creating RESTRequest, then parsing the RESTResponse. But, this one is really simple and straight forward. Just make sure to import all certs related to the web server. Thanks Burke

0 Kudos