同步化¶
本节介绍数据和元数据的提取和推送。
数据值推送¶
要将数据值推送到远程服务器,必须首先配置 系统设置 > 中相关服务器的 URL 和凭据 同步,然后向以下资源发出 POST 请求:
/ api / 33 / synchronization / dataPush
元数据拉取¶
要从远程 JSON 文档中启动元数据拉取,您可以创建一个 使用 url 作为请求负载的 POST 请求到以下资源:
/ api / 33 / synchronization / metadataPull
注
提供的 URL 将根据
dhis.conf文件中的配置属性system.remote_servers_allowed进行检查。 如果基本 URL 不在允许的配置服务器之列,则不允许执行操作。请看下面的失败示例。
配置集为system.remote_servers_allowed=https://server1.org/,https://server2.org/的一些示例 - 提供https://server1.org/path/to/resource-> 这将被接受 - 提供https://server2.org/resource/path-> 这将被接受 - 提供https://oldserver.org/resource/path-> 这将被拒绝失败响应示例
Most notably the sequence has only a single item. Information on top level object and the object in the sequence both originate from the job configuration.
可用性检查¶
检查远程数据服务器的可用性并验证用户 您可以向以下资源发出 GET 请求:
/ api / 33 /同步/可用性