Changes between Version 1 and Version 2 of GuiRpc
- Timestamp:
- May 26, 2007, 2:12:28 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GuiRpc
v1 v2 3 3 The 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. 4 4 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 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. 6 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. 7 8 To create an RPC connection, call 6 9 {{{ 7 10 init(char* host) … … 24 27 }}} 25 28 26 29 Do authorization sequence with the peer, using given password 27 30 28 31 == RPC list == … … 32 35 }}} 33 36 34 37 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). 35 38 36 39 {{{ … … 38 41 }}} 39 42 40 43 Exchange version info with the core client. The core client's version info is returned. 41 44 42 45 {{{ … … 57 60 58 61 59 62 Return a structure containing the network status, a flag if there was an account manager password error, and data about task and network suspension. 60 63 61 64 {{{ … … 63 66 }}} 64 67 65 68 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. 66 69 67 70 {{{ … … 69 72 }}} 70 73 71 74 Return screensaver mode (values listed in ss_logic.h) 72 75 73 76 {{{ … … 77 80 }}} 78 81 79 82 If enabled is true, the core client should try to get an application to provide screensaver graphics. Blank screen after blank_time seconds. 80 83 81 84 {{{ … … 83 86 }}} 84 87 85 88 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. 86 89 87 90 {{{ … … 89 92 }}} 90 93 91 94 Return the list of projects and of active results. 92 95 93 96 {{{ … … 95 98 }}} 96 99 97 100 Get a list of projects, with only basic fields filled in. 98 101 99 102 {{{ … … 101 104 }}} 102 105 103 106 Get a list of projects, with disk usage fields filled in. 104 107 105 108 {{{ … … 107 110 }}} 108 111 109 112 Get proxy settings 110 113 111 114 {{{ … … 113 116 }}} 114 117 115 118 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. 116 119 117 120 {{{ … … 119 122 }}} 120 123 121 124 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. 122 125 123 126 {{{ … … 125 128 }}} 126 129 127 130 Get information about host hardware and usage 128 131 129 132 {{{ … … 131 134 }}} 132 135 133 136 Get information about project credit history (the PROJECT::statistics field is populated) 134 137 135 138 {{{ … … 137 140 }}} 138 141 139 142 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. 140 143 141 144 {{{ … … 143 146 }}} 144 147 145 148 Get a string describing newer versions of the core client, if any. 146 149 147 150 The following operations require authentication for both local and remote clients: … … 151 154 }}} 152 155 153 156 Request that the application processing the given result create a graphics window 154 157 155 158 {{{ … … 157 160 }}} 158 161 159 162 Perform a control operation on the given project. op is one of "suspend", "resume", "reset", "detach", or "update". 160 163 161 164 {{{ … … 167 170 }}} 168 171 169 172 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. 170 173 171 174 {{{ … … 173 176 }}} 174 177 175 178 Set the run mode (never/auto/always). If duration is zero, mode is permanent. Otherwise revert to last permanent mode after duration seconds elapse. 176 179 177 180 {{{ … … 179 182 }}} 180 183 181 184 Set the network mode (never/auto/always). 182 185 183 186 {{{ … … 185 188 }}} 186 189 187 190 Run benchmarks 188 191 189 192 {{{ … … 191 194 }}} 192 195 193 196 Set proxy settings 194 197 195 198 {{{ … … 197 200 }}} 198 201 199 202 Tells the core client that a network connection is available, and that it should do as much network activity as it can. 200 203 201 204 {{{ … … 203 206 }}} 204 207 205 208 Perform a control operation on a file transfer. op is one of "abort" or "retry". 206 209 207 210 {{{ … … 209 212 }}} 210 213 211 214 Perform a control operation on an active result. op is one of "suspend", "resume", or "abort". 212 215 213 216 {{{ … … 215 218 }}} 216 219 217 220 Tell the core client to exit. 218 221 219 222 {{{ … … 226 229 }}} 227 230 228 231 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. 229 232 230 233 {{{ … … 232 235 }}} 233 236 234 237 Return the URL/name of the current account manager (if any), and the user name and password. 235 238 236 239 {{{ … … 238 241 }}} 239 242 240 243 Tells the core client to reread the 'global_prefs_override.xml' file, modifying the global preferences according to its contents. 241 244 242 245 {{{ … … 244 247 }}} 245 248 246 249 Reads the contents of the global preferences override file into the given string. Return an error code if the file is not present. 247 250 248 251 {{{ … … 250 253 }}} 251 254 252 255 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. 253 256 254 257 {{{ … … 256 259 }}} 257 260 258 261 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. 259 262 260 263 {{{ 261 264 set_global_prefs_override_struct(GLOBAL_PREFS&) 262 265 }}} 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. 266 Convert the given structure to XML and write it to the global preferences override file. 267 268 {{{ 269 set_debts(std::vector<PROJECT>) 270 }}} 271 Set the short- and long-term debts of the given projects 272 (only the master_url, short_term_debt, and long_term_debt fields 273 are used in the PROJECT structs).