{% extends "layouts/content.html" %} {% load i18n %} {% load utils %} {% block navigation %}
{% endblock %} {% block content %}

Event notifications

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.

About XML-RPC API

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' %}", allow_none=True)
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), allow_none=True)
  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

allow_none=True allows your client to match the server behaviour of handling an empty value as a null (None in Python, undef in Perl etc.) instead of as string like 'None'.

Available functions

Scheduler

{{ methods|get_api_by_section:'scheduler' }}

Results

{% for method in methods.results %} [ {{ method.name }} ] {% endfor %}

System and Authentication

{% for method in methods.system %} [ {{ method.name }} ] {% endfor %}
{% for method in methods.scheduler %}

{{ method.name }}

{{ method.help }}
Available functions
{% endfor %} {% for method in methods.results %}

{{ method.name }}

{{ method.help }}
Available functions
{% endfor %} {% for method in methods.system %}

{{ method.name }}

{{ method.help }}
Available functions
{% endfor %} {% endblock %}