您列出的第一种格式是正确的,但您必须确保您使用的是步进路径,而不仅仅是块的路径。
假设您通过此调用从部署计划中获取块。
curl -uadmin:password http://localhost:4516/deployit/tasks/v2/28830810-5104-4ab9-9826-22f66dee265d
这将产生结果:
<task id="28830810-5104-4ab9-9826-22f66dee265d" failures="0" state="PENDING" owner="admin">
<description>Initial deployment of Environments/local/TestApp001</description>
<activeBlocks/>
<metadata>
<environment>local</environment>
<taskType>INITIAL</taskType>
<environment_id>Environments/local</environment_id>
<application>TestApp001</application>
<version>1.0</version>
</metadata>
<block id="0" state="PENDING" description="" root="true">
<block id="0_1" state="PENDING" description="Deploy" phase="true">
<block id="0_1_1" state="PENDING" description="Deploy TestApp001 1.0 on environment local"/>
</block>
</block>
<dependencies/>
如果您想查看块 0_1_1 中的步骤,则可以使用此 rest 调用来获取步骤。
curl -uadmin:password http://local6/deployit/tasks/v2/28830810-5104-4ab9-9826-22f66dee265d/block/0_1_1/step
<block id="0_1_1" state="PENDING" description="Deploy TestApp001 1.0 on environment local" current="0">
<step failures="0" state="PENDING" description="Execute Command"/>
<step failures="0" state="PENDING" description="Copy File001.txt to Infrastructure/localhost"/>
这些步骤在块内从 1 开始编号。因此,如果您想跳过该步骤 - 将 File001.txt 复制到 Infrastructure/localhost,则步骤路径为 0_1_1_2。您的 XML 将如下所示:
<list>
<string>0_1_1_2</string>
</list>