zoukankan      html  css  js  c++  java
  • rest_cherrypy

    一、简介

    A REST API FOR SALT

    二、安装,配置

    yum -y install salt-api
    rest_cherrypy:
      port: 1559
      # disable_ssl: True
      ssl_crt: /etc/pki/tls/certs/localhost.crt
      ssl_key: /etc/pki/tls/certs/localhost.key
    external_auth:
      pam:
        tabops:
          #- .*
          - "@wheel"
          - "@runner"
          - grains.*

    启动服务

    service salt-master restart;service salt-api start

    三、认证、调用API

    curl -sSk https://127.0.0.1:1559/login 
        -H 'Accept: application/x-yaml' 
        -d username=tabops 
        -d password=tabops 
        -d eauth=pam

    复制得到的token

    curl -sSk https://127.0.0.1:1559 
        -H 'Accept: application/x-yaml' 
        -H 'X-Auth-Token: 7abf0ec365c7257aba0024bb7212200a863aabb9' 
        -d client=local 
        -d tgt='SCYD-10.25.172.131' 
        -d fun=cmd.run 
        -d arg='ls'

    PS:

    salt version

    2016.11.8

  • 相关阅读:
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    How to build and run ARM Linux on QEMU from scratch
    How to debug Android Native Application with eclipse
  • 原文地址:https://www.cnblogs.com/metasequoia/p/9750645.html
Copyright © 2011-2022 走看看