Main Content

GET Discovery Information

Discover MATLAB functions deployed on the server

Description

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.

Request

HTTP Method

GET

URI

http://host:port/api/discovery

Response

Success

HTTP Status Code

200 OK

Body

For a description of the body, see JSON Response Object.

Error

403 DiscoveryDisabled

Sample Call

HTTP

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"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}

JavaScript

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);

Version History

Introduced in R2018a