{% extends "layouts/content.html" %} {% load i18n %} {% block navigation %}
{% endblock %} {% block content %}Event notifications are handled by the lava-publisher service on the master. You can subscribe to these events through lava-publisher service and receive events such as:
To subscribe to these events, you can get the lava-publisher protocol and port via XML-RPC call from the server [ scheduler.get_publisher_event_socket ].
For more information, visit lava-publisher docs.
LAVA Server offers API services as an XML-RPC server. You can interact with it using any XML-RPC client. For example, in python3 you can do this:
import xmlrpc.client server = xmlrpc.client.ServerProxy("{{ site_url }}{% url 'lava.api_handler' %}") print(server.system.listMethods())
The following python3 code shows how to authenticate using an XML-RPC client, when a method requires authentication.
WARNING: https://
scheme
is recommended when using authentication.
import xmlrpc.client username = "USERNAME" token = "TOKEN_STRING" hostname = "HOSTNAME" # {{ site_domain }} server = xmlrpc.client.ServerProxy("{{ site_scheme }}://%s:%s@%s{% url 'lava.api_handler' %}" % (username, token, hostname)) print(server.system.listMethods())
NOTE: USERNAME
is a valid username
in the specified LAVA instance. TOKEN_STRING
is a valid token
associated with the above username in the same LAVA
instance. HOSTNAME
is the fully qualified domain name
or IP address of the same LAVA instance.
In the above code snippet the ServerProxy string
is constructed from different components, with separators, which are
clearly illustrated as follows:
USERNAME:TOKEN_STRING@HOSTNAME/HANDLER