Si vous souhaitez pouvoir effectuer toutes les opérations avec un workflow, vous devez trouver ce workflow dans l'inventaire Orchestrator et récupérer sa définition. La définition répertorie les paramètres d'entrée et de sortie du workflow, et comporte des liens vers les exécutions de workflow disponibles, la présentation du workflow et les autres objets.
Conditions préalables
Vérifiez que vous avez importé le modèle de paquet de workflows dans Orchestrator. Ce paquet est inclus dans le modèle de fichier ZIP Orchestrator que vous pouvez télécharger depuis la page de la documentation Orchestrator.
Procédure
Rechercher le workflow Send Hello
Vous pouvez rechercher le workflow Send Hello et récupérer sa définition :
Pour rechercher le workflow Send Hello, soumettez une demande GET au niveau de l'URL du service Workflow en appliquant un filtre :
GET https://localhost:8281/vco/api/workflows?conditions=name~Hello
Vous obtenez une liste des workflows dont le nom contient le terme Hello :
<xml version="1.0" encoding="UTF-8" standalone="yes"> <inventory-items xmlns="http://www.vmware.com/vco" total="2"> <link rel="down" href="https://localhost:8281/vco/api/catalog/System/Workflow/CF808080808080808080808080808080E6808080013086668236014a0614d16e1/"> <attributes> <attribute name="id" value="CF808080808080808080808080808080E6808080013086668236014a0614d16e1"/> <attribute name="canExecute" value="true" /> <attribute name="description" value="" /> <attribute name="name" value="Interactive Hello World" /> <attribute name="type" value="Workflow"/> <attribute name="canEdit" value="true"/> </attributes> </link> <link rel="down" href="https://localhost:8281/vco/api/catalog/System/Workflow/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/"> <attributes> <attribute name="id" value="CF808080808080808080808080808080DA808080013086668236014a0614d16e1"/> <attribute name="canExecute" value="true" /> <attribute name="description" value="" /> <attribute name="name" value="Send Hello" /> <attribute name="type" value="Workflow"/> <attribute name="canEdit" value="true"/> </attributes> </link> </inventory-items>
Soumettez une demande GET au niveau de l'URL de l'élément d'inventaire du workflow Send Hello :
GET https://localhost:8281/vco/api/catalog/System/Workflow/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/
Vous obtenez l'élément d'inventaire du workflow Send Hello dans la réponse :
<xml version="1.0" encoding="UTF-8" standalone="yes"> <inventory-item xmlns="http://www.vmware.com/vco" href="https://localhost:8281/vco/api/catalog/System/Workflow/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/"> <relations> <link rel="down" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/" /> </relations> <attributes> <attribute name="id" value="CF808080808080808080808080808080DA808080013086668236014a0614d16e1"/> <attribute name="canExecute" value="true" /> <attribute name="description" value="" /> <attribute name="name" value="Send Hello" /> <attribute name="type" value="Workflow"/> <attribute name="canEdit" value="true"/> </attributes> </inventory-item>
Pour récupérer la définition du workflow, soumettez une demande GET au niveau de son URL :
GET https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/
Vous obtenez la définition du workflow Send Hello dans la réponse :
<xml version="1.0" encoding="UTF-8" standalone="yes"> <workflow xmlns="http://www.vmware.com/vco" customized-icon="false" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/"> <relations> <link rel="up" href="https://localhost:8281/vco/api/inventory/System/Workflows/Samples/HelloWorld/" /> <link rel="add" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/executions/" /> <link rel="down" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/executions/" /> <link rel="down" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/presentation/" /> <link rel="down" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/tasks/" /> <link rel="down" href="https://localhost:8281/vco/api/workflows/CF808080808080808080808080808080DA808080013086668236014a0614d16e1/icon/" /> </relations> <input-parameters> <parameter name="name" type="string" /> </input-parameters> <output-parameters> <parameter name="message" type="string" /> </output-parameters> <name>Send Hello</name> <description></description> </workflow>