REST endpoints changes
Shiny380 opened this issue · comments
REST endpoint changes to conform with other projects
ALL:
api_prefix = 'api/bacnet'
SERVER:
server
endpoints need/server/...
in all- other changes
server_api_prefix = f'{api_prefix}/server'
api.add_resource(BACnetServer, f'/{server_api_prefix}')
api.add_resource(BACnetPointPlural, f'/{server_api_prefix}/points')
api.add_resource(BACnetPointSingular, f'/{server_api_prefix}/points/uuid/<string:uuid>')
api.add_resource(BACnetPointObject, f'/{server_api_prefix}/points/object/<string:object_type>/<string:address>')
api.add_resource(BACnetPointName, f'/{server_api_prefix}/points/name/<string:object_name>')
MASTER:
master
endpoints need/master/...
in all- other changes
master_api_prefix = f'{api_prefix}/master/'
api.add_resource(NetworkList, f'/{master_api_prefix}/networks')
api.add_resource(Network, f'/{master_api_prefix}/networks/uuid/<string:uuid>')
api.add_resource(NetworksIds, f'/{master_api_prefix}/networks/ids')
api.add_resource(DeviceList, f'/{master_api_prefix}/devices')
api.add_resource(Device, f'/{master_api_prefix}/devices/uuid/<string:uuid>')
api.add_resource(DevicePoints, f'/{master_api_prefix}/devices/uuid/<string:uuid>/points')
api.add_resource(DevicePoint, f'/{master_api_prefix}/devices/uuid/<string:uuid>/points/object/<string:obj>/<string:obj_instance>/<string:prop>')
api.add_resource(PointWritePresentValue, f'/{master_api_prefix}/devices/uuid/<string:uuid>/points/write/object/<string:obj>/<string:obj_instance>/<string:value>')
to add:
api.add_resource(Point, f'/{master_api_prefix}/points')
api.add_resource(Point, f'/{master_api_prefix}/points/uuid/<string:uuid>')
SYSTEM:
/system/ping
->/system
(leave old one in for now)
system_api_prefix = f'{api_prefix}/system'
api.add_resource(Ping, f'/{system_api_prefix}', f'/{system_api_prefix}/ping')