最近更新时间:2023.05.11 16:26:02
首次发布时间:2023.05.11 16:17:41
调用 ListApplication 接口,查询符合条件的 Spark 任务列表。
您必须是目标项目的项目成员,否则无法查询到 Spark 任务列表。相关文档,请参见权限概述。
参数 | 类型 | 是否必填 | 示例值 | 说明 |
---|---|---|---|---|
ProjectId | string | 是 | w4***rd65 | 项目 ID。 |
SortField | string | 否 | CreateTime | 根据某个字段进行排序,例如任务的创建时间 |
SortOrder | string | 否 | DESC | 排序的方式:
|
PageSize | int | 否 | 1 | 页数。 |
PageNum | int | 否 | 10 | 每页能展示的 Spark 任务数量。 |
State | string | 否 | CREATED | 根据任务状态进行筛选。
|
ApplicationTrn | string | 否 | 1646***3459458 | 任务 ID。 |
ApplicationType | string | 否 | SPARK_BATCH_SQL | 任务类型。可能的取值如下:
|
ApplicationName | string | 否 | spark-application-2 | 任务名称。 |
object(POSTApiV1AppListResult) Result 数据结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Total | string | 2 | 符合查询条件的 Spark 任务总数。 |
Pagesize | string | 10 | 每页能展示的 Spark 任务数量。 |
Current | string | 1 | 当前页。 |
records | list | - | Spark 任务列表,详情请参见 POSTApiV1AppListResultrecordsItem 数据结构。 |
POSTApiV1AppListResultrecordsItem 数据结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
IsLatestVersion | boolean | true | 当前任务是否是最新版本。
|
ApplicationName | string | spark-application-2 | 任务名称。 |
MainClass | string | com.bytedance.openplatform.SparkPi | Jar 类型任务的启动类。 |
Args | string | 3 60 | 任务启动类的参数。 |
ApplicationTrn | string | 1647**4065 | 任务 ID。 |
RestUrl | string | /ui/spark-history-server:18080/history/s-164**601/jobs | 任务相对路径。 |
Jar | string | 5eb5896a**70108933 | 任务资源文件路径或元数据 ID。
|
UserId | string | 6e224069***1892cc1517306a | 任务创建者的 ID。 |
State | string | CREATED | 任务状态,可能的取值如下:
|
Dependency | object | {"Files": ["e2e2e8009caea"]* | 任务的依赖文件。 |
VersionName | string | Version 0 | 任务当前版本。 |
EngineVersion | string | SPARK_VERSION_3_0_1_OS | 引擎版本。可能的取值如下:
|
ApplicationType | string | SPARK_BATCH_SQL | 任务类型。可能的取值如下:
|
ProjectId | string | w4***rd65 | 任务所属项目的 ID。 |
Conf | map<string,string> | { | 任务额外自定义配置参数。 |
DeployRequest | object(POSTApiV1AppUpdateDeployRequest) | - | 任务部署策略,详情请参见 POSTApiV1AppUpdateDeployRequest 数据结构。 |
Alert | boolean | false | 任务是否存在告警。
|
SqlText | string | select * from | SQL 语句。 |
LatestVersion | string | Version 0 | 任务的最新版本。 |
POSTApiV1AppUpdateDeployRequest 数据结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Priority | string | 3 | 任务优先级。 |
ResourcePoolTrn | string | doc-resource-1-***226 | 任务运行资源池的唯一标识符。 |
SchedulePolicy | string | GANG | 任务调度策略。
|
ScheduleTimeout | string | 0 | 设置为 GANG 调度策略时,对应的调度时长,单位为秒。 |
POST https://open.volcengineapi.com?Action=ListApplication&Version=2021-06-01 Content-Type: application/json Region: cn-beijing ServiceName: spark { "ProjectId": "w4***rd65", "SortField": "CreateTime", "SortOrder": "DESC", "State": "CREATED" }
{ "ResponseMetadata": { "RequestId": "2023041719251280054E2D2C1A8C777A73", "Action": "ListApplication", "Version": "2021-06-01", "Service": "spark", "Region": "cn-beijing" }, "Result": { "Current": "1", "PageSize": "10", "Total": "2", "Records": [ { "IsLatestVersion": true, "ApplicationName": "spark-application-2", "ApplicationTrn": "1647**4065", "State": "CREATED", "VersionName": "Version 0", "EngineVersion": "SPARK_VERSION_3_0_1_OS", "ApplicationType": "SPARK_BATCH_SQL", "ProjectId": "w4***rd65", "Alert": false, "SqlText": "select * from `docdb`.`hivetable`;", "LatestVersion": "Version 0", "Conf": {}, "DeployRequest": { "Priority": "4", "ResourcePoolTrn": "doc-resource-1-***226", "SchedulePolicy": "DRF", "ScheduleTimeout": "0" }, "UserId": "6e224069***1892cc1517306a" }, { "IsLatestVersion": true, "ApplicationName": "spark-application-1", "ApplicationTrn": "1646**9458", "State": "CREATED", "VersionName": "Version 0", "EngineVersion": "SPARK_VERSION_3_0_1_OS", "ApplicationType": "SPARK_BATCH_SQL", "ProjectId": "w4***rd65", "Alert": false, "SqlText": "select * from `docdb`.`hivetable`;", "LatestVersion": "Version 0", "Conf": {}, "DeployRequest": { "Priority": "3", "ResourcePoolTrn": "doc-resource-1-***226", "SchedulePolicy": "GANG", "ScheduleTimeout": "0" }, "UserId": "6e224069***92cc1517306a" } ] } }