Skip to content
Snippets Groups Projects
Commit 6cff03ff authored by Patrick Godwin's avatar Patrick Godwin
Browse files

add options to enable auth, https for inspiral aggregators

parent 8a436307
No related branches found
No related tags found
No related merge requests found
Pipeline #63626 passed
......@@ -200,6 +200,8 @@ def parse_command_line():
parser.add_option("--influx-hostname", help = "Specify the hostname for the influxDB database. Required if --data-backend = influx.")
parser.add_option("--influx-port", help = "Specify the port for the influxDB database. Required if --data-backend = influx.")
parser.add_option("--influx-database-name", help = "Specify the database name for the influxDB database. Required if --data-backend = influx.")
parser.add_option("--enable-auth", action = "store_true", default=False, help = "If set, enables authentication for the influx aggregator.")
parser.add_option("--enable-https", action = "store_true", default=False, help = "If set, enables HTTPS connections for the influx aggregator.")
options, filenames = parser.parse_args()
......@@ -356,7 +358,13 @@ for ifo in channel_dict:
"influx-database-name": options.influx_database_name,
"influx-hostname": options.influx_hostname,
"influx-port": options.influx_port,
"enable-auth": options.enable_auth,
"enable-https": options.enable_https,
})
if options.enable_auth:
common_opts.update({"enable-auth": ""})
if options.enable_https:
common_opts.update({"enable-https": ""})
dagparts.DAGNode(dqJob, dag, [], opts = common_opts)
......@@ -536,6 +544,10 @@ if options.agg_data_backend == 'influx':
"influx-hostname": options.influx_hostname,
"influx-port": options.influx_port,
})
if options.enable_auth:
agg_options.update({"enable-auth": ""})
if options.enable_https:
agg_options.update({"enable-https": ""})
# define routes used for aggregation jobs
snr_routes = ["%s_snr_history" % ifo for ifo in channel_dict]
......
......@@ -65,6 +65,8 @@ def parse_command_line():
parser.add_option("--influx-hostname", help = "Specify the hostname for the influxDB database. Required if --data-backend = influx.")
parser.add_option("--influx-port", help = "Specify the port for the influxDB database. Required if --data-backend = influx.")
parser.add_option("--influx-database-name", help = "Specify the database name for the influxDB database. Required if --data-backend = influx.")
parser.add_option("--enable-auth", action = "store_true", default=False, help = "If set, enables authentication for the influx aggregator.")
parser.add_option("--enable-https", action = "store_true", default=False, help = "If set, enables HTTPS connections for the influx aggregator.")
options, filenames = parser.parse_args()
......@@ -178,7 +180,7 @@ if __name__ == '__main__':
# set up aggregator sink
if options.data_backend == 'influx':
agg_sink = io.influx.Aggregator(hostname=options.influx_hostname, port=options.influx_port, db=options.influx_database_name)
agg_sink = io.influx.Aggregator(hostname=options.influx_hostname, port=options.influx_port, db=options.influx_database_name, auth=options.enable_auth, https=options.enable_https)
else: ### hdf5 data backend
agg_sink = io.hdf5.Aggregator(rootdir=options.out_path, num_processes=options.num_threads)
......
......@@ -60,6 +60,8 @@ def parse_command_line():
parser.add_argument("--influx-hostname", help = "Specify the hostname for the influxDB database. Required if --data-backend = influx.")
parser.add_argument("--influx-port", help = "Specify the port for the influxDB database. Required if --data-backend = influx.")
parser.add_argument("--influx-database-name", help = "Specify the database name for the influxDB database. Required if --data-backend = influx.")
parser.add_argument("--enable-auth", action = "store_true", help = "If set, enables authentication for the influx aggregator.")
parser.add_argument("--enable-https", action = "store_true", help = "If set, enables HTTPS connections for the influx aggregator.")
args = parser.parse_args()
......@@ -100,7 +102,7 @@ if __name__ == '__main__':
# set up aggregator sink
if options.data_backend == 'influx':
agg_sink = io.influx.Aggregator(hostname=options.influx_hostname, port=options.influx_port, db=options.influx_database_name)
agg_sink = io.influx.Aggregator(hostname=options.influx_hostname, port=options.influx_port, db=options.influx_database_name, auth=options.enable_auth, https=options.enable_https)
else: ### hdf5 data backend
agg_sink = io.hdf5.Aggregator(rootdir=options.base_dir, num_processes=options.num_threads)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment