ghost2loggerloopback.py 文件源码

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

项目:stackstorm-ghost2logger 作者: StackStorm-Exchange 项目源码 文件源码
def _ghost2loggergetGUID(self):
        # Let's deal with the JSON API calls here

        HEADERS = {"Content-Type": 'application/json'}

        _URL = self._ghost_url + "/v1/guid"
        try:
            r = requests.get(_URL, headers=HEADERS, verify=False,
                             auth=(self._username, self._password))
            _data = r.json()
            if _data['host'] == "GUID":
                for _item in _data['pattern']:
                    _guid = str(_item)

                return str(_guid)
            else:
                return ""

        except Exception as e:
            self._logger.info('[Ghost2logger]: Cannot get GUID: ' +
                              str(e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号