Mjsonrpc: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
(47 intermediate revisions by 6 users not shown)
Line 1: Line 1:
test
The midas documentation has moved. The new documentation about the JSON-RPC interface is in:
 
* [https://midas.triumf.ca/docs/develop/api/rpc/jsonrpc/ mjsonrpc schema] (all JSON-RPC methods, and calling them from other languages), including:
<pre>
** [https://midas.triumf.ca/docs/develop/api/rpc/jsonrpc/#array-indices-in-odb-paths Array indices in ODB paths]
$ curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","id":null,"method":"db_get_values","params":{"paths":["/runinfo/run number"]}}' 'http://localhost:8080?mjsonrpc'
** [https://midas.triumf.ca/docs/develop/api/rpc/jsonrpc/#how-values-are-encoded How values are encoded] (hexadecimal strings, 64-bit integers, NaN and Infinity)
{"jsonrpc": "2.0","result":{"data":[324],"status":[1],"last_written":[1443570804]},"id":null}
** [https://midas.triumf.ca/docs/develop/api/rpc/jsonrpc/#key-names-in-db_get_values-results Key names in db_get_values results]
$
** [https://midas.triumf.ca/docs/develop/api/rpc/jsonrpc/#reading-only-values-that-have-changed Reading only values that have changed] (omit_old_timestamp)
</pre>
** [https://midas.triumf.ca/docs/develop/api/rpc/jsonrpc/#sending-several-requests-at-once Sending several requests at once]
 
* [https://midas.triumf.ca/docs/develop/features/core_system/odb/programming/#json-encodings-of-odb-data JSON encodings of ODB data] on the ODB: programming page (the "save", "values" and "ls" formats)
{| class="wikitable" border=1
* [https://midas.triumf.ca/docs/develop/features/core_system/odb/programming/ ODB: programming] (examples of reading and writing ODB values and arrays)
|+List of MIDAS JSON-RPC methods
* [https://midas.triumf.ca/docs/develop/api/javascript/midas/ midas.js] (the JavaScript functions that call them)
|-
* [https://midas.triumf.ca/docs/develop/api/javascript/#pages-that-arent-served-by-mhttpd Pages that aren't served by mhttpd] on the Midas JavaScript API page (calling mhttpd from another web server)
! method name
!colspan=3| description
|-
||
|-
| echo
|colspan="3"| echo the request parameters back to the caller
|-
! || parameters || type || description
|-
| || - || object || any object
|-
! || returns || type || description
|-
| || - || object || parameters object
|-
||
|-
| null
|colspan=3| always return a null
|-
! || parameters || type || description
|-
| || - || anything || any object (object)
|-
! || returns || type || description
|-
| || null || null || always returns a null value
|-
||
|-
| db_copy
|colspan="3"| get a copy of ODB in JSON format
|-
! || parameters || type || description
|-
| || names || array of strings || odb paths to copy
|-
! || returns || type || description
|-
| || data || array of objects || odb data for each entry in names[]
|-
| || last_written || array of numbers || odb last_written for each entry in names[]
|-
| || status || array of numbers || odb get status for each entry in names[]
|}

Latest revision as of 22:01, 30 October 2026

The midas documentation has moved. The new documentation about the JSON-RPC interface is in: