GET Discovery Information
发现服务器上部署的 MATLAB 函数
描述
使用 GET 方法查看有关您部署到服务器的 MATLAB® 函数的信息。您收到有关
所有已部署的存档均包含发现信息。
每个存档包含的 MATLAB 函数的名称。
每个 MATLAB 函数的输入和输出的名称和 MATLAB 数据类型。
额外的元数据。
如果您构建可部署存档(CTF 文件)而不包含发现信息,则它是不可发现的。
为了使用发现服务,您必须在服务器上启用发现服务。通过取消注释 --enable-discovery 服务器配置文件中的选项 main_config 来执行此操作。
请求
HTTP 方法
GET
URI
http://host:port/api/discovery
示例调用
HTTP
| 请求:
GET /api/discovery HTTP/1.1 Host: localhost:9910 响应:
{
"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); |
版本历史记录
在 R2018a 中推出