首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在iOS上发现边缘节点

如何在iOS上发现边缘节点
EN

Stack Overflow用户
提问于 2021-09-27 02:45:50
回答 1查看 44关注 0票数 1

我希望在我的iOS应用程序上重新创建与sample iOS app相同的设置。在示例应用程序中,有一个API调用http://{localhost}/{clientId}/example/v1/drives?type=nearby,它返回应用程序要使用的EdgeEngineNodes列表。

我需要在我的微服务上实现这一点吗?还是在edgeEngine中有一个内置的函数调用?

EN

回答 1

Stack Overflow用户

发布于 2021-09-27 17:15:22

问题:调用edgeEngine本地发现服务。

原因:获取edgeEngine群集中的设备列表。

补救措施:从已部署的边缘微服务调用edgeEngine localDevices接口。或者,在mimik客户端库返回的服务链接处直接从iOS应用程序调用相同的API。

代码语言:javascript
复制
curl -i -H 'Authorization: Bearer <edgeEngine access token>’ http://localhost:<$port-number>/<MCM.BASE_API_PATH>/localDevices

iOS的mimik客户端库提供了一个返回当前edgeEngine服务链接的edgeEngine:

代码语言:javascript
复制
    /**
     Service link to the edgeEngine instance. For example when configuring microservices for deployment.
     
     - Returns: Service link to the edgeEngine instance.
     - Note: Once the service link has been established, it will never change.
     - Note: For example http://127.0.0.1:[port-number]
     - Warning: The port number is randomly generated when queried the first time, then stored for subsequent restarts and can never change again.
     */
    @objc public func edgeEngineServiceLink() -> String

注意:请在此处查看如何在您的边缘微服务中实现此功能的完整示例:https://developer.mimik.com/first-edge-microservice/#title6

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69340654

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档