VMware Cloud Community
philippbck
Contributor
Contributor

Create REST Host Workflow

Hello,

I would like to build a workflow that only creates a REST host and writes it into an output parameter. I have defined the output parameter of type "REST: RESTHost". The log output shows the created REST host. But the output parameter "restHost" with the Type "REST: RESTHost" is empty. I do not want to use the Inventory of the REST plugin. Any Idea? Thanks for help!

#### Parameter

Input Paramater: restHostUrl (Type: String)                     -> https://api.test.de

Outut Parameter: restHost (Type: REST:RESTHost)       -> Not found

#### Scriptable Task

// Create REST Host

var restHostTemp = RESTHostManager.createHost("dynamicRequest");

restHost = RESTHostManager.createTransientHostFrom(restHostTemp);

restHost.operationTimeout = 60;

restHost.connectionTimeout = 30;

restHost.hostVerification = false;

restHost.url = restHostUrl;

System.log("REST Host: " + restHost);

#### Workflow Log Output

[2018-02-07 15:24:05.204] [I] REST Host: DynamicWrapper (Instance) : [RESTHost]-[class com.vmware.o11n.plugin.rest.RESTHost] -- VALUE : RESTHost [name=dynamicRequest, id=ffa9623a-7dab-4f65-9381-16a44487cffc, url=https://api.test.de, connectionTimeout=30, operationTimeout=60, hostVerification=false, proxyHost=null, proxyPort=-1, schemaRepo=null, resourceId=null, privateKeyId=null]

2 Replies
iiliev
VMware Employee
VMware Employee

Hi,

I think this is the expected behavior. You assign some value to the output parameter, but it is a transient / not persisted host object. So, when your workflow completes and you check the variables tab in the vRO client, it tries to lookup the value stored in the output parameter, which consists of object type (RESTHost) and object ID, and this lookup will find nothing as the host object is not persisted.

JaySpell
Contributor
Contributor

You ever get an answer for this?  Trying to do something similar.

0 Kudos