api - 是否可以通过 salt-api 进行测试 state.apply?
问题描述
有没有办法:
salt '*' state.apply nginx test=True
通过salt-api
?
我正在这样做:
curl -sSk http://salt:8000
-H 'Accept: application/x-yaml'
-H 'X-Auth-Token: token'
-d client=local
-d tgt='*'
-d fun=state.apply
-d arg=nginx
-d test=True
但它实际上应用了新状态。
提前致谢!
解决方案
怎么样curl -sSk http://salt:8000/run
而不是curl -sSk http://salt:8000
您是否\
在每个选项的末尾使用?
否则看起来不错,你运行的是什么版本的盐?
https://salt-sproxy.readthedocs.io/en/latest/salt_api.html <= 好读
推荐阅读
- r - 逐行添加具有特定值的行
- docker - 部署角度后总是响应 nginx 索引
- python-3.x - 如何让 Pandas 数据框与 numpy 和 scipy 用户定义函数一起使用?
- javascript - 总和动态字段名称中始终显示零值
- android - 为什么我不能从 AsyncTask 访问全局变量?
- javascript - 重新加载页面反应
- azure-devops - VSTS\TFS 2017 Release 定义无法在“C:\Agents\DA_CID22\r1\a”处创建 Release 工件目录
- ms-access - Access-VBA - 使用 ConcatRelated 编译错误 - 以前工作过
- java - 我可以在 Android Studio 中使用 C# 吗?
- java - 使用未指定的索引