最近更新时间:2023.05.11 16:26:02
首次发布时间:2023.05.11 16:17:42
调用 ListAppInstance 接口,查询任务的实例列表。
一般是由运维人员(Project_OPS)负责任务启动、停止、下线等运维工作,请确保操作者已添加项目成员并为其关联角色,请参见权限概述。
参数 | 类型 | 是否必填 | 示例值 | 说明 |
---|---|---|---|---|
ProjectId | string | 是 | qh8i**e0xt | 任务所属项目的 ID。 |
PageSize | int | 是 | 10 | 每页展示任务实例的数量。 |
PageNum | int | 是 | 1 | 起始页码,从 1 开始。 |
SortField | string | 否 | StartTime | 根据某个字段进行排序。 |
SortOrder | string | 否 | DESC | 排序的方式:
|
ResourcePoolTrn | string | 是 | doc-resource-1-***226 | 任务运行资源池的唯一标识符。 |
EngineVersion | string | 否 | SPARK_VERSION_3_0_1_OS | 引擎版本。可能的取值如下:
|
InstanceId | string | 否 | 16481**30828290 | 具体的某个任务实例的 ID。 |
ApplicationTrn | string | 否 | 16481***787090945 | Spark 任务的 ID。 |
State | string | 否 | SUCCEEDED | 任务实例的状态。可能的取值如下:
|
ApplicationName | string | 否 | spark-application-1 | 任务名称。 |
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Total | int | 2 | 符合查询条件的任务实例总数。 |
Size | int | 10 | 每页能展示的任务实例数量。 |
Current | int | 1 | 当前页码。 |
Records | list | - | 任务实例列表,详情请参见 POSTApiV1AppInstanceListRecordsItem 数据结构。 |
POSTApiV1AppInstanceListRecordsItem 数据结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Duration | Long | 190000 | 任务运行时长,格式为毫秒级时间戳。 |
ApplicationType | string | SPARK_BATCH_SQL | 任务类型。可能的取值如下:
|
UserId | string | 6e224069****cc1517306a | 任务创建者的 ID。 |
SqlText | string | select * from | SQL 语句。 |
Image | string | 192.168..:30004/open_platform/streamx:888 | 用户自定义镜像。 |
StartTime | string | 2023-04-18 10:40:37 | 任务实例启动时间。 |
ApplicationTrn | string | 1646***3459458 | 任务 ID。 |
ApplicationName | string | spark-application-1 | 任务名称。 |
Args | string | 3 60 | 任务启动类的参数。 |
InstanceId | string | 16481***30828290 | 任务实例 ID。 |
EndTime | string | 2023-04-18 10:43:47 | 任务实例停止时间。 |
State | string | SUCCEEDED | 任务实例的状态。可能的取值如下:
|
Jar | string | 5eb5896a**70108933 | 任务资源文件路径或元数据 ID。
|
DeployRequest | object(POSTApiV1AppInstanceListRecordsItemDeployRequest) | - | 任务部署策略,详情请参见 POSTApiV1AppInstanceListRecordsItemDeployRequest 数据结构。 |
EngineVersion | string | SPARK_VERSION_3_0_1_OS | 引擎版本。可能的取值如下:
|
VersionId | Long | 162541**800990722 | 作业实例内容的版本号,版本号由每次作业从草稿状态上线到作业时产生。 |
DeploymentId | string | 2cd894a3***da17a591227 | 任务实例的 DeploymentId。 |
MainClass | string | com.bytedance.openplatform.SparkPi | Jar 类型任务的启动类。 |
Dependency | object(POSTApiV1AppInstanceListRecordsItemDependency) | - | 任务的依赖文件,详情请参见 POSTApiV1AppInstanceListRecordsItemDependency 数据结构。 |
Conf | Map<String,String> | { | 任务额外自定义配置参数。 |
ProjectId | string | w4***rd65 | 任务所属项目的 ID。 |
RestUrl | string | /ui/s-166209-driver-svc.doc-spark-pool-q0xt-00**5:4040/jobs | 任务相对路径。 |
POSTApiV1AppInstanceListRecordsItemDeployRequest 数据结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Priority | string | 3 | 任务优先级。 |
ResourcePoolTrn | string | doc-resource-1-***226 | 任务运行资源池的唯一标识符。 |
SchedulePolicy | string | GANG | 任务调度策略:
|
ScheduleTimeout | string | 0 | 设置为 GANG 调度策略时,需要设置调度时长,单位为秒。 |
POSTApiV1AppInstanceListRecordsItemDependency 数据结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Archives | list | ["file_id", "tos://***"] | Spark 任务的依赖文件,支持文件路径或元数据 ID。 |
Jars | list | ["file_id", "tos://***"] | Spark 任务的依赖文件,支持文件路径或元数据 ID。 |
Files | list | ["file_id", "tos://***"] | Spark 任务的依赖文件,支持文件路径或元数据 ID。 |
PyFiles | list | ["file_id", "tos://***"] | Spark 任务的依赖文件,支持文件路径或元数据 ID。 |
POST https://open.volcengineapi.com?Action=ListAppInstance&Version=2021-06-01 Content-Type: application/json Region: cn-beijing ServiceName: spark { "ProjectId": "qh8i**e0xt", "PageSize": 10, "PageNum": 1, "SortField": "StartTime", "SortOrder": "DESC", "ResourcePoolTrn": "doc-resource-1-***226", "ApplicationTrn": "164815**7090945" }
{ "ResponseMetadata": { "RequestId": "202304181139433188E26FC53DBF8839F1", "Action": "ListAppInstance", "Version": "2021-06-01", "Service": "spark", "Region": "cn-beijing" }, "Result": { "Records": [ { "InstanceId": "164815***206209", "ApplicationType": "SPARK_BATCH_SQL", "ProjectId": "qh8i**0xt", "AccountId": "210**734", "UserId": "6e2240691f1***cc1517306a", "ApplicationName": "spark-application-1", "DeployRequest": { "Priority": "3", "ResourcePoolTrn": "doc-resource-1-***226", "SchedulePolicy": "GANG", "ScheduleTimeout": "0" }, "EngineVersion": "SPARK_VERSION_3_0_1_OS", "SqlText": "select * from `docdb`.`hivetable`;", "Conf": {}, "State": "SUCCEEDED", "Cluster": "16a119e0d**cd041ae2627b0", "DeploymentId": "2cd894a3**dda17a591227", "RestUrl": "/ui/spark-history-server:18080/history/s-1648**209/jobs", "ApplicationTrn": "1648154**7090945", "StartTime": "2023-04-18 10:40:37", "EndTime": "2023-04-18 10:43:47", "Duration": 190000 }, { "InstanceId": "16481**1549954", "ApplicationType": "SPARK_BATCH_SQL", "ProjectId": "qh8**e0xt", "AccountId": "2100***0734", "UserId": "6e2240691f1**cc1517306a", "ApplicationName": "spark-application-1", "DeployRequest": { "Priority": "5", "ResourcePoolTrn": "doc-resource-1-***226", "SchedulePolicy": "DRF", "ScheduleTimeout": "0" }, "EngineVersion": "SPARK_VERSION_3_0_1_OS", "SqlText": "select * from `docdb`.`hivetable`;", "Conf": {}, "State": "SUCCEEDED", "Cluster": "16a119e0d5**cd041ae2627b0", "DeploymentId": "6102014**ddfae1209d93", "RestUrl": "/ui/spark-history-server:18080/history/s-164**9954/jobs", "ApplicationTrn": "1648**090945", "StartTime": "2023-04-18 10:50:50", "EndTime": "2023-04-18 10:53:47", "Duration": 177000 } ], "Total": 2, "Size": 10, "Current": 1 } }