【Mistral】 workflow实例一, yaml文件里的变量定义,action调用等

这篇博客介绍了Mistral workflow的一个实例,来源于https://github.com/openstack/mistral-extra,重点讲解了YAML文件中的变量定义(包括string类型)、变量引用以及task调用。适合已有基础的读者参考,对于不熟悉的读者,建议先阅读官方文档:https://docs.openstack.org/mistral/latest/user/wf_lang_v2.html 和 https://yaml.org/spec/1.2/spec.html。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下实例引用自https://github.com/openstack/mistral-extra/blob/master/examples/v2/calculator/calculator.yaml

实例中,对于变量定义,string类型,变量引用,task返回都有涉及。

---
version: "2.0"

name: calculator

actions:
  calc_summ:
    description: HTTP request to the server.
    base: std.http
    base-input:
      url: 'http://<% $.vm_ip %>:5000/summ'
      method: POST
      body:
        arguments: <% $.arguments %>
    output:
      summ_result: <% $.content.result %>
    input:
      - vm_ip
      - arguments

  run_calculator_server:
    description: SSH command to run the server.
    base: std.ssh
    base-input:
      host: <% $.host %>
      username: <% $.username %>
      password: <% $.password %>
      cmd: 'nohup python ~/web_app.py > web_app.log &'
    input:
      
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值