Commit 05746732 by 文鑫

增加获取数据源id方法

parent 8935151d
import requests
import re
def get_SourceId(sourceName):
response = requests.get('http://10.197.236.159:8014/web/data-source/base/find-pools')
data = response.json()['data']
text = ''
for i in data:
if i['dataSourceName'] == sourceName:
# print(i)
text = i
pattern = re.compile("'dataSourceId': '(\d+)'")
id = ''.join(pattern.findall(str(text)))
return id
# print(id)
# print('http://10.197.236.159:8014/web/data-source/base/remove/'+id)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment