endpoint.py 文件源码

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

项目:threatdetectionservice 作者: flyballlabs 项目源码 文件源码
def get(self, _device_):
        #Lookup Company
        company = "Flyball-Labs"
        assetSearch = company + "_" + _device_ + "_*"
        assetFullQueryURL = assetQueryURL + "/" + assetSearch
        print(assetFullQueryURL)
        try:
            response = requests.get(assetFullQueryURL, headers={"Accept" : "application/json"})
            jData = response.json()
        except:
            return "Server Down"
        counter = 0
        decodedList  = []
        for row in jData['Row']:
            # Decode the key into ascii
            #rowKey = base64.b64decode(row['key']).decode('ascii')
            dColumn = {}
            for cell in row['Cell']:
               columnname = base64.b64decode(cell['column']).decode('ascii')
               value = base64.b64decode(cell['$']).decode('ascii')
               dColumn[columnname] = value 
            decodedList.append (dColumn) 
        return jsonify(decodedList)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号