2016-05-24 48 views
0

我有一個安裝了CHEF插件的vRealize Orchestrator環境。我想調用API以在vRealize Orchestrator中啓動CHEF工作流。傳遞CHEF時的問題:vRealize Orchestrator API中Chef工作流的ChefHost參數

說我想打電話給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"的正確語法。我總是得到一個400錯誤與描述The request sent by the client was syntactically incorrect.

是否有任何文件顯示如何創建一個CHEF:ChefHost類型?

回答

1

我在vmware社區問過同樣的問題,我從那裏得到了一個answer

廚師主機,任何其他插件中的對象,作爲被唯一地由它們的類型和id標識SDK對象的對象屬性傳遞

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