PowerJob/others/doc/OpenApiGuide.md
2020-05-11 21:07:17 +08:00

770 B
Raw Blame History

STEP4: OpenAPI

OpenAPI允许开发者通过接口来完成手工的操作让系统整体变得更加灵活启用OpenAPI需要依赖oh-my-scheduler-client库。

<dependency>
  <groupId>com.github.kfcfans</groupId>
  <artifactId>oh-my-scheduler-client</artifactId>
  <version>${oms.client.latest.version}</version>
</dependency>

简单示例

// 初始化 client需要server地址和应用名称作为参数
OhMyClient ohMyClient = new OhMyClient("127.0.0.1:7700", "oms-test");
// 调用相关的API
ohMyClient.stopInstance(1586855173043L)