wiki:WebRpc

Version 23 (modified by feet1st, 9 years ago) (diff)

experimenting with coloration

Web Remote Procedure Calls (RPCs)

BOINC projects export a number of Web RPCs for creating, querying and updating accounts and host records, and miscellaneous other purposes. These can be used for account management systems and credit statistics web sites.

BOINC's RPC mechanisms have the following conventions:

  • Each RPC is an HTTP GET transaction.
  • The input is the GET arguments, i.e. a string of the form
?param1=val1&param2=val2&...&paramn=valn

where param1 ... paramN are the parameter names, and val1 ... valn are the values. Parameter values must be URL-encoded (for example, using PHP's urlencode function).

  • The output is XML.
  • If the project's get_project_config.php file includes a <rpc_prefix> element, its content should be used as the URL prefix; otherwise use the project's master URL.
  • Optional values are shown enclosed in square brackets.
  • If an RPC fails, the returned XML document is
<error>
    <error_num>N</error_num>
    <error_string>xxx</error_string>
</error>

where N is a BOINC error number and xxx is a textual description. BOINC error numbers are in lib/error_numbers.h; common errors are:

-1
Generic error (error_string may have more info)
-112
Invalid XML (e.g., the preferences passed to am_set_info.php are invalid)
-136
Item not found in database (bad ID of any sort, or ID refers to an item not owned by the caller)
-137
Name is not unique (Can't create account because email address already in use, or can't create team because name is in use)
-138
Can't access database (treat same as -183)
-161
Item not found (deprecated; treat same as -136)
-183
Project is temporarily down
-205
Email address has invalid syntax
-206
Wrong password
-207
Non-unique email address (treat same as -137)
-208
Account creation disabled

Project configuration

URL
project_url/get_project_config.php
input
none.
examples

http://setiathome.berkeley.edu/get_project_config.php

output

This file is created by make_project, and in most cases you don't have to change it.

This document has this structure:

<project_config>
    <name>Project name</name>
    <master_url>URL</master_url>
    [ <local_revision>12345</local_revision> ]
    [ <web_stopped>0|1</web_stopped> ]
    [ <account_creation_disabled/> ]
    [ <client_account_creation_disabled/> ]
    [ <min_passwd_length>N</min_passwd_length> ]
    [ <account_manager/> ]
    [ <uses_username/> ]
    [ <rpc_prefix>URL</rpc_prefix> ]
    [ <error_num>N</error_num> ]
    [
      <platforms>
        <platform>
          <platform_name>i686-apple-darwin</platform_name>
          <user_friendly_name>Mac OS X (Intel)</user_friendly_name>
        </platform>
        <platform>
          <platform_name>i686-pc-linux-gnu</platform_name>
          <user_friendly_name>Linux/x86</user_friendly_name>
        </platform>
        ...
      </platforms>
    ]
    [ <sched_stopped>0|1</sched_stopped> ]
    [
      <system_requirements>
        [ <p_fpops>N</p_fpops> ]
        [ <p_iops>N</p_iops> ]
        [ <p_membw>N</p_membw> ]
        [ <m_nbytes>N</m_nbytes> ]
        [ <m_swap>N</m_swap> ]
        [ <d_free>N</d_free> ]
        [ <bwup>N</bwup> ]
        [ <bwdown>N</bwdown> ]
      </system_requirements>
    ]
</project_config>

The elements are:

HTML parsing error: bad end tag: u&#34;&lt;/teams\n}}}\n\n '''action'''::\n\tTeams with names matching *string* will be returned. A maximum of 100 teams will be returned.\n\n\n== Look up team by ID == #team_lookup_id\n\n\n '''URL'''::\n\tproject/team_lookup.php\n '''input'''::\n\t{{{team_id}}}:\n '''examples'''::\n\thttp://boinc.bakerlab.org/rosetta/team_lookup.php?team_id=111\n '''output'''::\n\t\n{{{\n&lt;team&gt;&#34;: line 364, column 0
</teams