tower-server-registration.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:cloudcenter-content 作者: datacenter 项目源码 文件源码
def add_host(host_name, inventory):
    s = requests.Session()

    url = tower_base_url+"hosts/"

    headers = {
        'content-type': "application/json"
    }

    payload = {
        "name": host_name,
        "enabled": True,
        "inventory": inventory
    }

    s.request("POST", url, headers=headers, data=json.dumps(payload), verify=False,
              auth=HTTPBasicAuth(args.tower_username, args.tower_password))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号