在 vRealize Orchestrator API 中为 Chef Workflow 传递 CHEF:ChefHost 参数时出现问题

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

我有一个安装了 CHEF 插件的 vRealize Orchestrator 环境。我想调用 API 在 vRealize Orchestrator 中启动 CHEF 工作流。

假设我想调用 CHEF 工作流 Add New Role。此工作流的输入参数是

<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>

type="string"形式的参数发送格式为

  1. 在JSON

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

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

我面临的问题是参数 type="CHEF:ChefHost"。我无法获得 type="CHEF:ChefHost" 的正确语法。我总是收到描述 The request sent by the client was syntactically incorrect.

400 错误

是否有说明如何创建 CHEF:ChefHost 类型的文档?

我在 vmware 社区问过同样的问题,我从那里得到了一个 answer

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>