saltstack-api日常操作#yyds干货盘点#

【saltstack-api日常操作#yyds干货盘点#】业无高卑志当坚,男儿有求安得闲?这篇文章主要讲述saltstack-api日常操作#yyds干货盘点#相关的知识,希望能为你提供帮助。

获取token(只有给10.3.8.6服务器8000端口通就可以执行)
curl -k https://10.3.9.8:8000/login -d username=saltapi -d password=saltapi -d eauth=pam
curl -k https://10.9.12.7:8000/login -d username=saltapi -d password=saltapi -d eauth=pam
curl -k https://10.2.12.25:8000/login -d username=saltapi -d password=saltapi -d eauth=pam

获取客户端的基本属性
curl -k https://10.3.9.8:8001-H "Accept: application/x-yaml"-H "X-Auth-Token: ac9143f49a97e58a187378f1d3da401b6adafbf5"-d client=local-d tgt=10.23.98.10-d fun=grains.item



获取客户端的磁盘信息
curl -k https://10.3.9.8:8001-H "Accept: application/x-yaml"-H "X-Auth-Token: ac9143f49a97e58a187378f1d3da401b6adafbf5"-d client=local-d tgt=10.23.98.10-d fun=status.diskusage



推送命令
curl -k https://10.9.12.7:8000-H "Accept: application/x-yaml"-H "X-Auth-Token: 5f8bbc2274063bd98ea8b06ad6c81ac21bc2f12a"-d client=local-d tgt=10.19.253.240-d fun=cmd.run -d arg="df -h"

TryqTyl123

是否存活
curl -k https://10.9.2.1:8000-H "Accept: application/x-yaml"-H "X-Auth-Token: 5f8bbc2274063bd98ea8b06ad6c81ac21bc2f12a"-d client=local-d tgt=10.19.242.24-d fun=test.ping


    推荐阅读