我正在使用InfluxDB来收集时间序列数据。InfluxDB是否支持RestAPI?如果没有,如何为InfluxDB配置REST?
AK
发布于 2017-04-21 20:14:10
是的,InfluxDB提供了REST API。你可以在这里看到它的引用:
您可能还需要检查:
发布于 2017-10-24 15:16:57
是的,如上所述,可以通过命令行完成,另一个好的和简单的选择是使用基于web的管理界面(通常在端口8083监听)。您可以在网页上编写查询,并通过“生成查询URL”按钮生成REST调用。下面是我生成的查询的示例:http://myserver.com:8086/query?q=select+*+from+myteable&db=mydb
发布于 2018-04-12 11:27:26
当然,看看下面的代码:
def write(self, data, params=None, expected_response_code=204,
protocol='json'):
headers = self._headers
headers['Content-type'] = 'application/octet-stream'
if params:
precision = params.get('precision')
else:
precision = None
if protocol == 'json':
data = make_lines(data, precision).encode('utf-8')
elif protocol == 'line':
data = ('\n'.join(data) + '\n').encode('utf-8')
self.request(
url="write",
method='POST',
params=params,
data=data,
expected_response_code=expected_response_code,
headers=headers
)
return True这个函数是influxdb-python如何将数据写入influxdb.We创建一个字典,如:{“测量”:"xxx",“标签”:{...},“字段”:{...},“时间”:...},然后会被influxdb-python模块转换成restful请求。
https://stackoverflow.com/questions/43493117
复制相似问题