added new protocols of datasource into API
parent
be1ab059a1
commit
0e483b674e
|
@ -104,7 +104,7 @@ class DataSourceCollection:
|
||||||
'mongodb',
|
'mongodb',
|
||||||
'influxdb'):
|
'influxdb'):
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
||||||
description='API.INVALID_DATA_SOURCE_PROTOCOL.')
|
description='API.INVALID_DATA_SOURCE_PROTOCOL')
|
||||||
protocol = new_values['data']['protocol']
|
protocol = new_values['data']['protocol']
|
||||||
|
|
||||||
if 'connection' not in new_values['data'].keys() or \
|
if 'connection' not in new_values['data'].keys() or \
|
||||||
|
@ -278,10 +278,25 @@ class DataSourceItem:
|
||||||
|
|
||||||
if 'protocol' not in new_values['data'].keys() \
|
if 'protocol' not in new_values['data'].keys() \
|
||||||
or new_values['data']['protocol'] not in \
|
or new_values['data']['protocol'] not in \
|
||||||
('modbus-tcp', 'modbus-rtu', 'bacnet-ip', 's7', 'profibus', 'profinet', 'opc-ua', 'lora', 'simulation',
|
('modbus-tcp',
|
||||||
'controllogix', 'weather'):
|
'modbus-rtu',
|
||||||
|
'bacnet-ip',
|
||||||
|
's7',
|
||||||
|
'profibus',
|
||||||
|
'profinet',
|
||||||
|
'opc-ua',
|
||||||
|
'lora',
|
||||||
|
'simulation',
|
||||||
|
'controllogix',
|
||||||
|
'weather',
|
||||||
|
'mysql',
|
||||||
|
'sqlserver',
|
||||||
|
'postgresql',
|
||||||
|
'oracle',
|
||||||
|
'mongodb',
|
||||||
|
'influxdb'):
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
||||||
description='API.INVALID_DATA_SOURCE_PROTOCOL.')
|
description='API.INVALID_DATA_SOURCE_PROTOCOL')
|
||||||
protocol = new_values['data']['protocol']
|
protocol = new_values['data']['protocol']
|
||||||
|
|
||||||
if 'connection' not in new_values['data'].keys() or \
|
if 'connection' not in new_values['data'].keys() or \
|
||||||
|
|
Loading…
Reference in New Issue