.. _Platforms-Endpoints: =================== Platforms Endpoints =================== Platforms endpoints expose functionality associated with specific VOLTTRON platforms. As all functionality of VOLTTRON is the purview of one or another platform, the /platforms tree forms the core of the VOLTTRON User Interface API. Other top level partitions of the API consist of convenience methods which refer to endpoints within /platforms. The platforms tree currently provides access to four major categories of endpoint, each of which are described in detail through the following links: * :ref:`Agents `: Endpoints pertaining to a specific agent (e.g. RPC) * :ref:`Devices `: Endpoints for discovering, getting, and setting data about the current state of devices on the platform. * :ref:`Historians `: Endpoints for querying data from historians. * :ref:`PubSub `: Endpoints for subscription and publication to message bus topics. * :ref:`Status `: Endpoints for retrieving and clearing status of all agents on the platform. .. attention:: All endpoints in this tree require authorization using a JWT bearer token provided by the ``POST /authenticate`` or ``PUT /authenticate`` endpoints. -------------------------------------------------------------------------------- GET /platforms ============== Obtain routes for connected platforms. A ``GET`` request to the ``/platforms`` endpoint will return a JSON object containing routes to available platforms. Available routes are included in a "route_options" object. The keys of the "route_options" object are the name of each platform which is currently reachable through the API, and the values contain a route to an endpoint for the platform. Request: -------- - Authorization: ``BEARER `` Response: --------- * **With valid BEARER token on success:** ``200 OK`` - Content Type: ``application/json`` - Body: .. code-block:: JSON { "route_options": { "": "/platforms/", "": "/platforms/" } } * **With valid BEARER token on failure:** ``400 Bad Request`` - Content Type: ``application/json`` - Body: .. code-block:: JSON { "error": "" } * **With invalid BEARER token:** ``401 Unauthorized`` --------------------------------------------------------------------------------------------------------------------- GET /platforms/:platform ======================== Obtain routes available for a specific platform. A ``GET`` request to the ``/platforms/:platform`` endpoint (where ``:platform`` is the instance name of a specific platform) will return a JSON object containing routes to endpoints which are available for the requested platform. Available routes are included in a "route_options" object. The keys of the "route_options" object are the name of each endpoint which the platform supports, and the values contain a route to that endpoint for this platform. The currently implemented possibilities include: :ref:`agents `, :ref:`devices `, :ref:`historians `, :ref:`pubsub ` and :ref:`status `. Request: -------- - Authorization: ``BEARER `` Response: --------- * **With valid BEARER token on success:** ``200 OK`` - Content Type: ``application/json`` - Body: .. code-block:: JSON { "route_options": { "": "/platforms/:platform/", "": "/platforms/:platform/" } } * **With valid BEARER token on failure:** ``400 Bad Request`` - Content Type: ``application/json`` - Body: .. code-block:: JSON { "error": "" } * **With invalid BEARER token:** ``401 Unauthorized`` .. toctree:: :hidden: Agents Configs Devices Health Historians Pubsub Status