生成Flink SQL作业的静态流图
功能介绍
该API用于生成Flink SQL作业的静态流图。
URI
- URI格式
- 参数说明
表1 URI参数说明 参数名称
是否必选
参数类型
说明
project_id
是
String
项目编号,用于资源隔离。获取方式请参考获取项目ID。
请求消息
参数名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
sql_body |
是 |
String |
SQL。 |
cu_number |
否 |
Integer |
CU总数。 |
manager_cu_number |
否 |
Integer |
管理单元CU数。 |
parallel_number |
否 |
Integer |
最大并行度。 |
tm_cus |
否 |
Integer |
单个taskManagerCU数量。 |
tm_slot_num |
否 |
Integer |
单个taskManager Slot数量。 |
operator_config |
否 |
String |
算子的配置。 |
static_estimator |
否 |
Boolean |
是否静态资源预估。 |
job_type |
否 |
String |
作业类型。 只支持flink_opensource_sql_job类型作业。 |
graph_type |
否 |
String |
流图类型。当前支持以下两种流图类型。
|
static_estimator_config |
否 |
String |
每个算子的流量/命中率配置,json格式的字符串。 |
flink_version |
否 |
String |
Flink版本。当前只支持1.10和1.12。 |
响应消息
参数名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
is_success |
是 |
Boolean |
执行请求是否成功。“true”表示请求执行成功。 |
message |
是 |
String |
系统提示信息,执行成功时,信息可能为空。 |
error_code |
是 |
String |
错误码。 |
stream_graph |
是 |
String |
静态流图的描述信息。 |
请求示例
生成Flink SQL作业的静态流图,流图的类型为静态流图。
{ "cu_number": 4, "manager_cu_number": 1, "parallel_number": 4, "tm_cus": 1, "tm_slot_num": 1, "sql_body": "", "operator_config": "", "static_estimator": true, "job_type": "flink_opensource_sql_job", "graph_type": "job_graph" }
响应示例
{ "is_success": true, "message": "", "error_code": "", "stream_graph": "{\n \"nodes\" : [ {\n \"id\" : 1,\n \"operator_id\" : \"bc764cd8ddf7a0cff126f51c16239658\",\n \"type\" : \"Source\",\n \"contents\" : \"kafkaSource\",\n \"parallelism\" : 1\n }, {\n \"id\" : 2,\n \"operator_id\" : \"0a448493b4782967b150582570326227\",\n \"type\" : \"select\",\n \"contents\" : \"car_id, car_owner, car_brand, car_speed\",\n \"parallelism\" : 1,\n \"predecessors\" : [ {\n \"id\" : 1\n } ]\n }, {\n \"id\" : 4,\n \"operator_id\" : \"6d2677a0ecc3fd8df0b72ec675edf8f4\",\n \"type\" : \"Sink\",\n \"contents\" : \"kafkaSink\",\n \"parallelism\" : 1,\n \"predecessors\" : [ {\n \"id\" : 2\n } ]\n } ]\n}" }
错误码
调用接口出错后,将不会返回上述结果,而是返回错误码和错误信息,更多介绍请参见错误码。