Changes between Version 1 and Version 2 of GuiRpc


Ignore:
Timestamp:
May 26, 2007, 2:12:28 PM (18 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GuiRpc

    v1 v2  
    33The BOINC core client provides a set of RPCs (remote procedure calls) for control and state interrogation. This enables the development of GUI (graphical user interface) programs separately from the core client. These RPCs send XML request and reply messages over a TCP connection. The XML formats are not documented, but can be deduced from the source code.
    44
    5 BOINC provides a C++ interface to these RPCs, consisting of the GUI_RPC class. The interface is in lib/gui_rpc_client.h, and the program boinc_cmd.C gives a usage example). All member functions return an integer error code. To create an RPC connection, call
     5BOINC provides a C++ interface to these RPCs, consisting of the GUI_RPC class. The interface is in lib/gui_rpc_client.h, and the program boinc_cmd.C gives a usage example). All member functions return an integer error code.
     6It should be easy fairly easy to generate client interfaces in languages other than C++. GUI programs connect to the core client by opening a TCP socket at port 31416. They can then do repeated RPCs over this connection. Each reply message ends with the character '\003.
     7
     8To create an RPC connection, call
    69{{{
    710init(char* host)
     
    2427}}}
    2528
    26         Do authorization sequence with the peer, using given password
     29Do authorization sequence with the peer, using given password
    2730
    2831== RPC list ==
     
    3235}}}
    3336
    34         Get the core client's 'static' state, i.e. its projects, apps, app_versions, workunits and results. This call is relatively slow and should only be done initially, and when needed later (see below).
     37Get the core client's 'static' state, i.e. its projects, apps, app_versions, workunits and results. This call is relatively slow and should only be done initially, and when needed later (see below).
    3538
    3639{{{
     
    3841}}}
    3942
    40         Exchange version info with the core client. The core client's version info is returned.
     43Exchange version info with the core client. The core client's version info is returned.
    4144
    4245{{{
     
    5760   
    5861
    59         Return a structure containing the network status, a flag if there was an account manager password error, and data about task and network suspension.
     62Return a structure containing the network status, a flag if there was an account manager password error, and data about task and network suspension.
    6063
    6164{{{
     
    6366}}}
    6467
    65         Get a list of results. Those that are in progress will have information such as CPU time and fraction done. Each result includes a name; use CC_STATE::lookup_result() to find this result in the current static state; if it's not there, call get_state() again.
     68Get a list of results. Those that are in progress will have information such as CPU time and fraction done. Each result includes a name; use CC_STATE::lookup_result() to find this result in the current static state; if it's not there, call get_state() again.
    6669
    6770{{{
     
    6972}}}
    7073
    71         Return screensaver mode (values listed in ss_logic.h)
     74Return screensaver mode (values listed in ss_logic.h)
    7275
    7376{{{
     
    7780}}}
    7881
    79         If enabled is true, the core client should try to get an application to provide screensaver graphics. Blank screen after blank_time seconds.
     82If enabled is true, the core client should try to get an application to provide screensaver graphics. Blank screen after blank_time seconds.
    8083
    8184{{{
     
    8386}}}
    8487
    85         Get a list of file transfers in progress. Each is linked by name to a project; use CC_STATE::lookup_project() to find this project in the current state; if it's not there, call get_state() again.
     88Get a list of file transfers in progress. Each is linked by name to a project; use CC_STATE::lookup_project() to find this project in the current state; if it's not there, call get_state() again.
    8689
    8790{{{
     
    8992}}}
    9093
    91         Return the list of projects and of active results.
     94Return the list of projects and of active results.
    9295
    9396{{{
     
    9598}}}
    9699
    97         Get a list of projects, with only basic fields filled in.
     100Get a list of projects, with only basic fields filled in.
    98101
    99102{{{
     
    101104}}}
    102105
    103         Get a list of projects, with disk usage fields filled in.
     106Get a list of projects, with disk usage fields filled in.
    104107
    105108{{{
     
    107110}}}
    108111
    109         Get proxy settings
     112Get proxy settings
    110113
    111114{{{
     
    113116}}}
    114117
    115         Return bitmap of reasons why computation and network are suspended. Deprecated - for 5.5.13 and later, use cc_status() instead. In 5.5.10 and earlier, it returns bool (suspended) rather than bitmap.
     118Return bitmap of reasons why computation and network are suspended. Deprecated - for 5.5.13 and later, use cc_status() instead. In 5.5.10 and earlier, it returns bool (suspended) rather than bitmap.
    116119
    117120{{{
     
    119122}}}
    120123
    121         Returns a list of messages to be displayed to the user. Each message has a sequence number (1, 2, ...), a priority (1=informational, 2=error) and a timestamp. The RPC requests the messages with sequence numbers greater than 'seqno', in order of increasing sequence number.
     124Returns a list of messages to be displayed to the user. Each message has a sequence number (1, 2, ...), a priority (1=informational, 2=error) and a timestamp. The RPC requests the messages with sequence numbers greater than 'seqno', in order of increasing sequence number.
    122125
    123126{{{
     
    125128}}}
    126129
    127         Get information about host hardware and usage
     130Get information about host hardware and usage
    128131
    129132{{{
     
    131134}}}
    132135
    133         Get information about project credit history (the PROJECT::statistics field is populated)
     136Get information about project credit history (the PROJECT::statistics field is populated)
    134137
    135138{{{
     
    137140}}}
    138141
    139         Find whether the core client has, needs, or is done with a physical network connection. Deprecated - for 5.5.13 and later, use cc_status() instead.
     142Find whether the core client has, needs, or is done with a physical network connection. Deprecated - for 5.5.13 and later, use cc_status() instead.
    140143
    141144{{{
     
    143146}}}
    144147
    145         Get a string describing newer versions of the core client, if any.
     148Get a string describing newer versions of the core client, if any.
    146149
    147150The following operations require authentication for both local and remote clients:
     
    151154}}}
    152155
    153         Request that the application processing the given result create a graphics window
     156Request that the application processing the given result create a graphics window
    154157
    155158{{{
     
    157160}}}
    158161
    159         Perform a control operation on the given project. op is one of "suspend", "resume", "reset", "detach", or "update".
     162Perform a control operation on the given project. op is one of "suspend", "resume", "reset", "detach", or "update".
    160163
    161164{{{
     
    167170}}}
    168171
    169         Attach to the given project. If 'use_config_file' is true, use the project URL (and account key, if present) in the project_init.xml file.
     172Attach to the given project. If 'use_config_file' is true, use the project URL (and account key, if present) in the project_init.xml file.
    170173
    171174{{{
     
    173176}}}
    174177
    175         Set the run mode (never/auto/always). If duration is zero, mode is permanent. Otherwise revert to last permanent mode after duration seconds elapse.
     178Set the run mode (never/auto/always). If duration is zero, mode is permanent. Otherwise revert to last permanent mode after duration seconds elapse.
    176179
    177180{{{
     
    179182}}}
    180183
    181         Set the network mode (never/auto/always).
     184Set the network mode (never/auto/always).
    182185
    183186{{{
     
    185188}}}
    186189
    187         Run benchmarks
     190Run benchmarks
    188191
    189192{{{
     
    191194}}}
    192195
    193         Set proxy settings
     196Set proxy settings
    194197
    195198{{{
     
    197200}}}
    198201
    199         Tells the core client that a network connection is available, and that it should do as much network activity as it can.
     202Tells the core client that a network connection is available, and that it should do as much network activity as it can.
    200203
    201204{{{
     
    203206}}}
    204207
    205         Perform a control operation on a file transfer. op is one of "abort" or "retry".
     208Perform a control operation on a file transfer. op is one of "abort" or "retry".
    206209
    207210{{{
     
    209212}}}
    210213
    211         Perform a control operation on an active result. op is one of "suspend", "resume", or "abort".
     214Perform a control operation on an active result. op is one of "suspend", "resume", or "abort".
    212215
    213216{{{
     
    215218}}}
    216219
    217         Tell the core client to exit.
     220Tell the core client to exit.
    218221
    219222{{{
     
    226229}}}
    227230
    228         Do an Account Manager RPC to the given URL, passing the given name/password. If use_cached_credentials is true, then the existing url, username, and password are used and the core client updates the project information from the account manager. If the RPC is successful, save the account info on disk (it can be retrieved later using acct_mgr_info(), see below). If URL is the empty string, remove account manager info from disk.
     231Do an Account Manager RPC to the given URL, passing the given name/password. If use_cached_credentials is true, then the existing url, username, and password are used and the core client updates the project information from the account manager. If the RPC is successful, save the account info on disk (it can be retrieved later using acct_mgr_info(), see below). If URL is the empty string, remove account manager info from disk.
    229232
    230233{{{
     
    232235}}}
    233236
    234         Return the URL/name of the current account manager (if any), and the user name and password.
     237Return the URL/name of the current account manager (if any), and the user name and password.
    235238
    236239{{{
     
    238241}}}
    239242
    240         Tells the core client to reread the 'global_prefs_override.xml' file, modifying the global preferences according to its contents.
     243Tells the core client to reread the 'global_prefs_override.xml' file, modifying the global preferences according to its contents.
    241244
    242245{{{
     
    244247}}}
    245248
    246         Reads the contents of the global preferences override file into the given string. Return an error code if the file is not present.
     249Reads the contents of the global preferences override file into the given string. Return an error code if the file is not present.
    247250
    248251{{{
     
    250253}}}
    251254
    252         Write the given contents to the global preferences override file. If the argment is an empty string, delete the file. Otherwise the argument must be a valid <global_preferences> element.
     255Write the given contents to the global preferences override file. If the argment is an empty string, delete the file. Otherwise the argument must be a valid <global_preferences> element.
    253256
    254257{{{
     
    256259}}}
    257260
    258         Return the contents of the global preferences override file, parsed into a structure. Default values are zero. Returns an error code if the file is not present.
     261Return the contents of the global preferences override file, parsed into a structure. Default values are zero. Returns an error code if the file is not present.
    259262
    260263{{{
    261264set_global_prefs_override_struct(GLOBAL_PREFS&)
    262265}}}
    263         Convert the given structure to XML and write it to the global preferences override file.
    264 
    265 The RPC mechanism uses XML requests and replies. It should be easy fairly easy to generate client interfaces in languages other than C++. GUI programs connect to the core client by opening a TCP socket at port 31416. They can then do repeated RPCs over this connection. Each reply message ends with the character '\003.
     266Convert the given structure to XML and write it to the global preferences override file.
     267
     268{{{
     269set_debts(std::vector<PROJECT>)
     270}}}
     271Set the short- and long-term debts of the given projects
     272(only the master_url, short_term_debt, and long_term_debt fields
     273are used in the PROJECT structs).