我正在寻找通过CLI或anypoint REST API通过anypoint平台公开的端点的列表。即使它是应用程序的端点列表,我也可以将它们一起编译。
您基本上可以通过遍历流程来获取端点列表。就我而言,我只有接受POST和GET请求的端点,因此我的示例基于此:
Collection<FlowConstruct> flowConstructs = muleEventContext.getMuleContext()
.getRegistry()
.lookupFlowConstructs();
Iterator<FlowConstruct> iterator = flowConstructs.iterator();
while (iterator.hasNext()) {
String flowName = iterator.next().getName();
if (flowName.startsWith("post:") || flowName.startsWith("get:")) {
Flow flow = muleEventContext.getMuleContext().getRegistry().get(flowName);
// You can process the flowName to extract endpoint
}
}