【问题标题】:How to discover edge nodes on iOS如何在 iOS 上发现边缘节点
【发布时间】:2021-09-27 02:45:50
【问题描述】:

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

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

【问题讨论】:

    标签: edgeengine


    【解决方案1】:

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

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

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

    curl -i -H 'Authorization: Bearer <edgeEngine access token>’ http://localhost:<$port-number>/<MCM.BASE_API_PATH>/localDevices
    

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

        /**
         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

    【讨论】:

      猜你喜欢
      • 2022-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-15
      • 1970-01-01
      相关资源
      最近更新 更多