当前位置:网站首页>Chapter ten find and record the REST API
Chapter ten find and record the REST API
2022-07-29 12:19:00 【yaoxin521123】
文章目录
第十章 发现和记录 REST API
This chapter discusses how to discover what is available on an instance REST service and how to REST The service generates documentation.
使用 /api/mgmnt 服务发现 REST 服务
/api/mgmnt Services include available for discovery REST Service class and enable REST 的 Web 应用程序的调用.
发现 REST 服务
要使用 /api/mgmnt service to discover what's available on the instance REST 服务,请使用以下 REST 调用:
- 对于
HTTP操作,选择或指定GET. - 对于
URL,请指定以下形式的URL:
http://localhost:52773/api/mgmnt/v2/
或者,If you want to check only one namespace:
http://localhost:52773/api/mgmnt/v2/:namespace
其中 localhost 是服务器的名称,52773 是运行 IRIS 的 Web 服务器端口,namespace is the namespace to check.
(请注意,These calls ignore hand-coded ones REST 服务.To discover the manual coding REST 应用程序,请使用调用 GET /api/mgmnt/ 和 GET /api/mgmnt/:v1/:namespace/restapps.)
如果调用成功,IRIS 以 JSON format returns a list REST array of services.例如:
[
{
"name": "%Api.Mgmnt.v2",
"webApplications": "/api/mgmnt",
"dispatchClass": "%Api.Mgmnt.v2.disp",
"namespace": "%SYS",
"swaggerSpec": "/api/mgmnt/v2/%25SYS/%Api.Mgmnt.v2"
},
{
"name": "myapp",
"webApplications": "/api/myapp",
"dispatchClass": "myapp.disp",
"namespace": "USER",
"swaggerSpec": "/api/mgmnt/v2/USER/myapp"
}
]
发现支持 REST 的 Web 应用程序
要使用 /api/mgmnt service to discover the support available on the instance REST 的 Web 应用程序,请使用以下 REST 调用:
- 对于
HTTP操作,选择或指定GET. - 对于
URL,请指定以下形式的URL:
http://localhost:52773/api/mgmnt
或者,If you want to check only one namespace:
http://localhost:52773/api/mgmnt/v1/:namespace/restapps
其中 localhost 是服务器的名称,52773 是运行 IRIS 的 Web 服务器端口,namespace is the namespace to check.
使用 %REST.API 类发现 REST 服务
%REST.API Classes available for discovery REST Service class and enable REST 的 Web 应用程序的方法.
发现 REST 服务类
要使用 %REST.API class to discover what's available on the instance REST 服务,Please use the following methods of this class:
GetAllRESTApps()
GetAllRESTApps(Output appList As %ListOfObjects) as %Status
Returns on this server REST List of services as output.输出参数 applist 是 %ListOfObjects 的实例,Every item in the list is %REST.Application 的实例,其中包含有关 REST 服务的信息.This includes no association Web any application REST 服务.This method ignores any manual encoding REST 服务.
GetRESTApps()
GetRESTApps(namespace as %String,
Output appList As %ListOfObjects) as %Status
Returns in the namespace indicated by namespace as output REST 服务列表.
发现支持 REST 的 Web 应用程序
要使用 %REST.API class to discover the support available on the instance REST 的 Web 应用程序,Please use the following methods of this class:
GetAllWebRESTApps()
GetAllWebRESTApps(Output appList As %ListOfObjects) as %Status
Returns enabled on this server REST 的 Web List of applications as output.输出参数 applist 是 %ListOfObjects 的实例,Every item in the list is %REST.Application 的实例,其中包含有关 Web 应用程序的信息.
GetWebRESTApps()
GetWebRESTApps(namespace as %String,
Output appList As %ListOfObjects) as %Status
作为输出,Returns support in the namespace indicated by the namespace REST 的 Web 应用程序的列表.请参阅 GetAllWebRESTApps().
为 REST The service provides documentation
记录任何 API 很有用,so that it can be easily used by developers API.对于遵循 OpenAPI 2.0 规范的 REST API,可以使用 Swagger Open source frameworks are yours according to the content of the specification API Provides interactive documentation.
一种选择是使用 Swagger UI and provide a hosted copy of the documentation.对于演示:
- 转到 https://swagger.io/tools/swagger-ui/
- 单击
Live Demo - in the box at the top of the page,以
JSON格式输入REST服务的OpenAPI 2.0规范的URL.
例如,在 IRIS 服务器上使用 GET/api/mgmnt/v2/:namespace/:application 调用.
- The document is then displayed in the lower part of the page,如以下示例所示:

在这里,Detailed information about each call can be viewed、Test the call and see the response.
Other third-party tools enable static generation HTML. There is no specific recommendation for this.
边栏推荐
- Basic Concepts of Kubernetes
- 2022-07-29 Daily: The latest major progress of AlphaFold: complete almost all known protein structure predictions of more than 200 million, fully open
- DAY 27 丨 daily SQL clock 】 【 every visit to the number of transactions "difficulty difficult - released in advance"
- 【年中总结】创业3年,越来越穷,还是坚持架构平台
- 网络层和传输层限制
- 【实用工具】Image Assistant下载指定页面的所有图片
- DAY 25 丨 daily SQL clock 】 【 o team number [difficult medium]
- 关于栈迁移的那些事儿
- GDB使用详解
- MarkDown高阶语法手册
猜你喜欢
随机推荐
How much is the test environment, starting from the actual needs
socket+websocket
DAY 22 丨 page daily clock in SQL 】 【 recommend 【 difficulty moderate 】
TiFlash 源码阅读(五) DeltaTree 存储引擎设计及实现分析 - Part 2
【每日SQL打卡】DAY 24丨找到连续区间的开始和结束数字【难度中等】
DAY 26 daily SQL clock 】 【 丨 advertisement effect difficult simple 】 【
基础架构之分布式配置中心
QCon大会广州站它来了!独家定制双肩背包等你领取!
金仓数据库 KingbaseES 客户端编程接口指南 - ODBC 驱动使用
shell if else 使用
递归-八皇后问题
【第三次自考】——总结
redis数据库基本知识学习——基础、常用
路径依赖 - 偶然决策导致的依赖。
【每日SQL打卡】DAY 24丨不同国家的天气类型【难度简单】
使用Tenserboard可视化深度学习训练过程
微信云托管入门与实践
【每日SQL打卡】DAY 23丨学生们参加各科测试的次数【难度简单】
【每日SQL打卡】DAY 25丨求团队人数【难度中等】
一文带你搞懂JSON和TCP/IP









