VMware Cloud Community
SergeyNN
Contributor
Contributor

vRO REST API: Fetching values for affected fields to execute workflow

Hello,

Some workflows have "affected" fields. I mean that available values for some input parameter of workflow depend on values of other related parameters.
For example to execute "Delete datastore" workflow in vRO client the user on first step provide correct host name.
After that on second step he can select value from list of the available datastore names for that host.

It is not clear for me how to perform such workflow using REST API calls.

What I try to do:
1) Retrieve the definition of the workflow:
   GET https://{orchestrator_host}:{port}/vco/api/workflows/{workflowID}/
2) Retrieve the definition of the workflow presentation
   GET https://{orchestrator_host}:{port}/vco/api/workflows/{workflowID}/presentation/
3) At this point we know that workflow has 2 input parameters:
  - "host" with type "VC:HostSystem". It also has "datastoreName" as "affected-fields";
  - "datastoreName" with type "string".
4) Using Catalog API we can help user to fill in "host" parameter and verify that it is correct with
   POST https://{orchestrator_host}:{port}/vco/api/workflows/{workflowID}/presentation/instances/{executionID}/

How to get list of available strings for "affected" parameter when user provide values for all related input parameters ("datastoreName" parameter in example above)?
What REST API should I use for this?

0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee

Hi,

The computed values for dependent parameters are available in the response body of start presentation API  (POST https://{orchestrator_host}:{port}/vco/api/workflows/{workflowID}/presentation/instances/) and  update presentation API  (POST https://{orchestrator_host}:{port}/vco/api/workflows/{workflowID}/presentation/instances/{executionID}/)

0 Kudos
SergeyNN
Contributor
Contributor

Thanks!
0 Kudos