{% extends "layouts/content-bootstrap.html" %} {% load i18n %} {% block title %} {{ block.super }} | {% trans "XML-RPC" %} {% endblock %} {% block breadcrumbs %} {{ block.super }}
LAVA Server offers API services as an XML-RPC server. You can interact with it using any XML-RPC client. For example, in python you can do this:
import xmlrpclib server = xmlrpclib.ServerProxy("{{ site_url }}{% url 'lava.api_handler' %}") print server.system.listMethods()
The following python code shows how to authenticate using an XML-RPC client, when a method requires authentication.
import xmlrpclib username = "USERNAME" token = "TOKEN_STRING" hostname = "HOSTNAME" server = xmlrpclib.ServerProxy("http://%s:%s@%s{% url 'lava.api_handler' %}" % (username, token, hostname)) print server.system.listMethods()
NOTE: USERNAME
is a valid username
in this LAVA instance. TOKEN_STRING
is a valid token
associated with the above username in this LAVA
instance. HOSTNAME
is the fully qualified domain name
or IP address of this 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
WARNING: https://
scheme
is preferred as some calls require authentication.