首页 > 解决方案 > 是否可以通过 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

但它实际上应用了新状态。

提前致谢!

标签: apicurlsalt-stacksalt

解决方案


怎么样curl -sSk http://salt:8000/run而不是curl -sSk http://salt:8000

您是否\在每个选项的末尾使用?

否则看起来不错,你运行的是什么版本的盐?

https://salt-sproxy.readthedocs.io/en/latest/salt_api.html <= 好读


推荐阅读