You need to enable JavaScript to run this app.
导航
ListApplicationInstance - 查询作业实例列表
最近更新时间:2024.11.06 00:31:11首次发布时间:2024.10.31 11:30:33

查询作业实例列表

使用说明

获取作业实例列表,可指定筛选条件。

注意事项

  1. 注意指定分页参数

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

ListApplicationInstance

要执行的操作,取值:ListApplicationInstance。

Version
String

2025-01-01

API的版本,取值:2025-01-01。

PageSize
String

5

单页大小

PageNum
String

1

起始页码,从1开始。

SortField
String

StartTime

排序字段,默认按照 StartTime 字段排序,支持其他 APP 字段属性,比如 JobType, JobName等;

SortOrder
String

asc

排序规则,支持正序或者倒序(asc 或者 desc),默认是 desc

ProjectId
String

cja21wx8gr9q

项目Id, QueryParam 和 RequestBody 中必须要有一个 ProjectId

JobId
Long

1808882380912050177

appId

State
String

RUNNING

app instance状态:

  • STARTING 启动中
  • RUNNING 运行中
  • FAILED 已失败
  • CANCELLING 取消中
  • SUCCEEDED 已成功
  • STOPPED 已停止
  • UNKNOWN 未知状态
ResourcePool
String

o-0080kuwxxx

资源池名称

JobName
String

sql_test_16

作业实例名称,保证和 app 名称一致

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
Total
Integer

20

总记录数

Size
Integer

5

分页大小

Current
Integer

1

当前页

Records
Array of Object

[{
"Id": "1840646077740994561",
"JobId": "1808882380912050177",
"JobType": "FLINK_STREAMING_SQL",
"ProjectId": "cja21wx8gr9q",
"AccountId": "2101007020",
"UserId": "f75c80a288084c91b22b04c25e36a2c8",
"JobName": "sql_test_16",
"DeployRequest": {
"Queue": "o-0080kuwxxx",
"Priority": "3",
"ResourcePool": "rs-pool-a",
"SchedulePolicy": "GANG",
"ScheduleTimeout": "60"
},
"EngineVersion": "FLINK_VERSION_1_16",
"SqlText": "create table orders (\n f0 varchar\n) WITH (\n 'connector' = 'datagen'\n);\n\ninsert into hive.flink.t1\nselect * from orders;",
"Dependency": {},
"Conf": {
"taskmanager.memory.process.size": "4096mb",
"kubernetes.taskmanager.cpu": "1",
"jobmanager.memory.process.size": "4096mb",
"kubernetes.jobmanager.cpu": "1",
"taskmanager.numberOfTaskSlots": "2"
},
"State": "RUNNING",
"DeploymentId": "0389aeb7e5d64220ac5b6e9b78ed7c1b",
"ApplicationId": "s-1840646077740994561",
"CompleteRestUrl": "https://flink-3e287e.flink.volces.com:443/login-server/ui/s-1840646077740994561-rest.o-0080kuwluaa5:8081/",
"StartTime": "2024-09-30 14:53:17"
}]

作业实例信息列表

请求示例

POST /?Action=ListApplicationInstance&Version=2025-01-01&PageSize=5&PageNum=1&SortField=StartTime&SortOrder=asc&ProjectId=cja21wx8gr9q HTTP/1.1
Host: open.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20241028T081243Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20241028/${Region}/flink/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{
  "JobId": 1808882380912050200,
  "State": "RUNNING"
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "20241028161313244063130044CBDE39",
    "Action": "ListApplicationInstance",
    "Version": "2025-01-01",
    "Service": "flink",
    "Region": "${Region}"
  },
  "Result": {
    "Total": 20,
    "Size": 5,
    "Current": 1,
    "Records": [
      {
        "Id": 1840646077740994600,
        "JobId": "1808882380912050177",
        "AccountId": "2101007020",
        "ProjectId": "cja21wx8gr9q",
        "UserId": "f75c80a288084c91b22b04c25e36a2c8",
        "JobName": "sql_test_16",
        "JobType": "支持的作业类型:\n流式作业: \n1. FLINK_STREAMING_JAR\n2. FLINK_STREAMING_SQL \n批式作业:\n1. FLINK_BATCH_SQL \n2. FLINK_BATCH_JAR",
        "EngineVersion": "FLINK_VERSION_1_16",
        "State": "RUNNING/STOPPED",
        "ApplicationId": "s-1840646077740994561",
        "DeploymentId": "0389aeb7e5d64220ac5b6e9b78ed7c1b",
        "DeployRequest": {
          "Priority": 5,
          "ResourcePool": "test-resource-pool",
          "SchedulePolicy": "GANG",
          "ScheduleTimeout": "60",
          "Namespace": "o-0080sv6hfmn6",
          "Queue": "\"o-00g0ouqtg9n7\""
        },
        "StartTime": "2024-09-30 14:53:17",
        "EndTime": "2024-09-30 14:53:17",
        "SqlText": "create table orders (\\n f0 varchar\\n) WITH (\\n 'connector' = 'datagen'\\n);\\n\\ninsert into hive.flink.t1\\nselect * from orders;",
        "Jar": "tos://bucket/flink-test.jar",
        "MainClass": "com.a.b.flink.DatagenToPrint",
        "Args": "--topic test-flink --bootstrap.servers kafka-xxx.kafka.ivolces.com:9092",
        "CompleteRestUrl": "https://endpoint:443/login-server/ui/s-1840646077740994561-rest.o-0080kuwluaa5:8081/",
        "Dependency": {
          "Jars": [
            "[\"tos://a.jar\", \"tos://b.jar\"]"
          ],
          "PyLibraries": [
            "lhu5G"
          ]
        },
        "Conf": {}
      }
    ]
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
200
default system error
list app instance error

获取实例列表失败,具体原因参考 error message