diff --git a/docs/source/protocol/index.rst b/docs/source/protocol/index.rst index 0ec3dbb58ae1dd95b59fc4093a1ae47b4e794309..370ec063c4bf9dc13791577bc6a37c8bc81070ab 100644 --- a/docs/source/protocol/index.rst +++ b/docs/source/protocol/index.rst @@ -29,9 +29,10 @@ API modules :caption: Contents: classifier - poller lg data jobs msr - lnetd \ No newline at end of file + lnetd + +.. automodule:: inventory_provider.routes.poller diff --git a/docs/source/protocol/poller.rst b/docs/source/protocol/poller.rst deleted file mode 100644 index 7b9040ad8e720f1e4f431652df76642a25520a65..0000000000000000000000000000000000000000 --- a/docs/source/protocol/poller.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. poller endpoint docs - - -BRIAN support Endpoints -========================= - -These endpoints are intended for use by BRIAN. - -.. contents:: :local: - -/poller/interfaces</hostname> ---------------------------------- - -.. autofunction:: inventory_provider.routes.poller.interfaces - - -/poller/speeds</hostname> ---------------------------------- - -.. autofunction:: inventory_provider.routes.poller.interface_speeds - - -/poller/eumetsat-multicast ---------------------------------- - -.. autofunction:: inventory_provider.routes.poller.eumetsat_multicast diff --git a/inventory_provider/routes/poller.py b/inventory_provider/routes/poller.py index 18275d9f60f6d16d452bf765ab2fe0d93ea35678..5fa9bf17869b2a2b3ad06928c27836cdb1bc3243 100644 --- a/inventory_provider/routes/poller.py +++ b/inventory_provider/routes/poller.py @@ -1,3 +1,35 @@ +""" +BRIAN support Endpoints +========================= + +These endpoints are intended for use by BRIAN. + +.. contents:: :local: + +/poller/interfaces</hostname> +--------------------------------- + +.. autofunction:: inventory_provider.routes.poller.interfaces + + +/poller/speeds</hostname> +--------------------------------- + +.. autofunction:: inventory_provider.routes.poller.interface_speeds + + +/poller/eumetsat-multicast +--------------------------------- + +.. autofunction:: inventory_provider.routes.poller.eumetsat_multicast + + +/poller/gws/direct +--------------------------------- + +.. autofunction:: inventory_provider.routes.poller.gws_direct + +""" import json import logging import re @@ -577,6 +609,23 @@ def eumetsat_multicast(hostname=None): @routes.route("/gws/direct", methods=['GET', 'POST']) @common.require_accepts_json def gws_direct(): + """ + Handler for `/poller/gws/direct` which returns required for polling + customer equipment counters for ISP connetions. + + The response is a list of nren/isp/counter structures that must be + polled. + + .. asjson:: + inventory_provider.routes.poller.GWS_DIRECT_DATA_SCHEMA + + This method returns essentially hard-coded data, + based on the information in POL1-422. + + TODO: this hard-coded data should be in the config file + + :return: + """ data = [ { "nren": "ARNES",