Jitin Kodian
Jitin Kodian

Reputation: 541

Issue in passing CHEF:ChefHost parameter for Chef Workflow in vRealize Orchestrator API

I have an environment with vRealize Orchestrator with CHEF plugin installed. I want to call the API for initiating a CHEF workflow in vRealize Orchestrator.

Say I want to call the CHEF workflow Add New Role. The input parameters for this workflow are

<input-parameters>
  <parameter description="Chef Server" type="CHEF:ChefHost" name="host"/>
  <parameter description="Name of new role" type="string" name="role"/>
  <parameter description="(Optional) Description of new role" type="string" name="description"/>
</input-parameters>

The format for sending parameters of the form type="string" is

  1. In JSON

    {
    "value":{"string":{"value": "role name"}},
    "type": "string",
    "name": "role"
    }
    
  2. In XML

    <execution-context  xmlns="http://www.vmware.com/vco">
       <parameters>
          <parameter name="role" type="string">
             <string>Role Name</string>
           </parameter>
        </parameters>
    </execution-context>
    

The problem I'm facing is with the parameter type="CHEF:ChefHost". I can't get the correct syntax for type="CHEF:ChefHost". I'm always getting a 400 error with description The request sent by the client was syntactically incorrect.

Is there any document which shows how to create a CHEF:ChefHost type?

Upvotes: 0

Views: 109

Answers (1)

Jitin Kodian
Jitin Kodian

Reputation: 541

I had asked the same question in vmware community and I got an answer from there.

Chef hosts, as any other plug-in objects, are passed as sdk-object objects that are uniquely identified by their type and id attributes

<execution-context xmlns="http://www.vmware.com/vco">  
<parameters>  
    <parameter name="host" type="CHEF:ChefHost">  
        <sdk-object type="Chef:Host" id=<Enter host id>/>  
    </parameter>  
</parameters>  

Upvotes: 1

Related Questions