Discover MATLAB functions deployed on the server
Use the GET method to view information about the MATLAB® functions that you deploy to the server. You receive information about
all deployed archives with discovery information.
names of the MATLAB functions that each archive contains.
names and MATLAB data types of the inputs and outputs for each of the MATLAB functions.
additional metadata.
If you build a deployable archive (CTF
file) without including
discovery information, it is not discoverable.
In order to use the discovery service, you must enable the discovery service on the
server. Do this by uncommenting the option --enable-discovery
in the
main_config
server configuration file.
GET
http://host:port/api/discovery
403 DiscoveryDisabled
Request:
GET /api/discovery HTTP/1.1 Host: localhost:9910 Response:
{ "discoverySchemaVersion": "1.0.0", "archives": { "mymagic": { "archiveSchemaVersion": "1.1.0", "archiveUuid": "mymagic_73BCCE8B5FFFB984888169285CBA8A31", "name": "mymagic" "matlabRuntimeVersion": "9.5.0" "functions": { "mymagic": { "signatures": [ { "help": "Generate a magic square", "inputs": [ { "name": "in", "mwtype": "double", "mwsize": [], "help": "Dimension of magic square matrix" } ], "outputs": [ { "name": "out", "mwtype": "double", "mwsize": [], "help": "Magic square matrix" } ] } ] } } } } } |
var data = null; var xhr = new XMLHttpRequest(); xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open("GET", "http://localhost:9910/api/discovery"); xhr.send(data); |