gpt4 book ai didi

google-cloud-platform - Flink rest api 错误 : Request did not match expected format JarRunRequestBody

转载 作者:行者123 更新时间:2023-12-01 12:08:26 24 4
gpt4 key购买 nike

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

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

{"errors":["请求与预期格式 JarRunRequestBody 不匹配。"]}

最佳答案

您找到的 jar 运行处理程序的请求主体的描述 hereJSON schema specification jar 运行消息。您需要在请求中指定的只是 properties 而不是 "type""id" 字段。因此,您的请求应如下所示:

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

关于google-cloud-platform - Flink rest api 错误 : Request did not match expected format JarRunRequestBody,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54348050/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com