Simple get Orchestrator Version workflow

Simple get Orchestrator Version workflow

The attached workflow retrieves some system info from Orchestrator, then performs a simple GET request to /vco/api/about and parses the result to return the version and build number.

Screen Shot 2015-05-22 at 11.25.43 AM.png

Get URL Code:

var vROIP = Config.getNetworkInterfaces().getBindInterface();

var vROPort = Config.getNetworkInterfaces().getBindPort();

var getUrl = "https://"+vROIP+":"+vROPort+"/vco/api/about";

Parse Results Code:

System.debug(aboutResult);

System.debug("============");

var aboutObj = JSON.parse(aboutResult);

System.debug("Version: "+aboutObj["version"]);

var version = aboutObj["version"];

System.debug("Build Number: "+aboutObj["build-number"]);

var build = aboutObj["build-number"];

System.debug("Build Date: "+aboutObj["build-date"]);

System.debug("API Version: "+aboutObj["api-version"]);

Workflow Output parameters:

version (string)

build (string)

Attachments
Comments

What is the equivalent for 7.x servers? 

The only part of the code listed there that won't work on 7.x is the first two lines, the rest should be fine.

This is my updated code... seems to handle all versions.  Just starting with port 8281 and if it doesn't work falling back to 443.

var getUrl = "https://localhost:8281/vco/api/about";

var urlObject = new URL(getUrl);

try {

  System.debug("Trying port 8281...");

  var aboutResult = urlObject.getContent() ;

}

catch (err) {

  System.error("err:" + err);

  getUrl = "https://localhost:443/vco/api/about";

  urlObject = new URL(getUrl);

  var aboutResult = urlObject.getContent() ;

}

// parse results

System.debug(aboutResult);

System.debug("============");

var aboutObj = JSON.parse(aboutResult);

System.debug("Version: "+aboutObj["version"]);

var version = aboutObj["version"];

System.debug("Build Number: "+aboutObj["build-number"]);

var build = aboutObj["build-number"];

System.debug("Build Date: "+aboutObj["build-date"]);

System.debug("API Version: "+aboutObj["api-version"]);

return version;

Version history
Revision #:
1 of 1
Last update:
‎05-22-2015 08:22 AM
Updated by: