Add SSL support for InfluxDB connection.

Added ssl and verify_ssl options to influxdb config

Task: 44888
Story: 2009950
Change-Id: Icfe06233a178a5383441db6d87d46b93b6a63757
changes/87/835887/1
Mirek Malinowski 8 months ago
parent 1e67714731
commit 87938f738e
  1. 3
      monasca_persister/README.md
  2. 6
      monasca_persister/conf/influxdb.py
  3. 10
      monasca_persister/repositories/influxdb/abstract_repository.py

@ -104,6 +104,7 @@ sudo chmod 640 /etc/monasca/monasca-persister.conf
Most of the configuration options should be left at default, but at a
minimum, the following should be changed:
The default value for influxdb ssl and verify_ssl is False. Only add/change if your influxdb is using SSL.
```
[zookeeper]
@ -121,6 +122,8 @@ ip_address =
port =
user =
password =
ssl =
verify_ssl =
```
### Running

@ -36,6 +36,12 @@ influxdb_opts = [
cfg.PortOpt('port',
help='port to influxdb',
default=8086),
cfg.BoolOpt('ssl',
help='Boolean',
default=False),
cfg.BoolOpt('verify_ssl',
help='Boolean',
default=False),
cfg.StrOpt('user',
help='influxdb user ',
default='mon_persister'),

@ -28,10 +28,12 @@ class AbstractInfluxdbRepository(abstract_repository.AbstractRepository, metacla
super(AbstractInfluxdbRepository, self).__init__()
self.conf = cfg.CONF
self._influxdb_client = influxdb.InfluxDBClient(
self.conf.influxdb.ip_address,
self.conf.influxdb.port,
self.conf.influxdb.user,
self.conf.influxdb.password)
host=self.conf.influxdb.ip_address,
port=self.conf.influxdb.port,
username=self.conf.influxdb.user,
password=self.conf.influxdb.password,
ssl=self.conf.influxdb.ssl,
verify_ssl=self.conf.influxdb.verify_ssl)
if self.conf.influxdb.db_per_tenant:
self.data_points_class = data_points.DataPointsAsDict
else:

Loading…
Cancel
Save