Flink Rest API错误:请求与预期格式JarRunRequestBody不匹配 [英] Flink rest api error: Request did not match expected format JarRunRequestBody

查看:669
本文介绍了Flink Rest API错误:请求与预期格式JarRunRequestBody不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用下面的rest api远程运行flink作业,但抛出错误

Trying to run a flink job remotely using the below rest api but its throwing error

curl -X POST -H 'Content-Type: application/json' --data '
{
    "type": "object",
    "id": "urn:jsonschema:org:apache:flink:runtime:webmonitor:handlers:JarRunRequestBody",
    "properties": {
    "programArgsList" : {
      "type" : "array",
      "items" : [
        "input-kafka-server": "****",
        "input-kafka-topics": "****",
        "input-job-name": "****"

    }
  }
}
' http://x.x.x.x:8081/jars/810ac968-5d5f-450d-aafc-22655238d617.jar/run

{错误":[请求与预期的格式JarRunRequestBody格式不匹配."]}

预先感谢.

推荐答案

您找到 JSON模式jar运行消息的规范.您需要在请求中指定的只是properties,而不是"type""id"字段.因此,您的请求应如下所示:

The description of the request body for the jar run handler you find here is the JSON schema specification of the jar run message. What you need to specify in your request are only the properties and not the "type" and "id" fields. Thus, your request should look like:

curl -X POST -H 'Content-Type: application/json' --data '
{
  "programArgsList" : [
    "--input-kafka-server",
    "value-input-kafka-server",
    "--input-kafka-topics",
    "value-kafka-topics",
    "--input-job-name",
    "value-job-name"
  ],
"parallelism": 30
}
' http://x.x.x.x:8081/jars/810ac968-5d5f-450d-aafc-22655238d617.jar/run

这篇关于Flink Rest API错误:请求与预期格式JarRunRequestBody不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆