ListSparkApps - 查询Spark应用列表

更新时间:

查看Spark应用列表。

接口说明

  • 地域的公网接入地址:adb.<region-id>.aliyuncs.com。示例:adb.cn-hangzhou.aliyuncs.com

  • 地域的 VPC 接入地址:adb-vpc.<region-id>.aliyuncs.com。示例:adb-vpc.cn-hangzhou.aliyuncs.com

说明

如果华北 1(青岛)、华南 1(深圳)、华南 3(广州)、中国香港发起请求时,遇到 409 错误,请联系技术支持。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

adb:ListSparkApps

list

*DBClusterLakeVersion

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

请求参数

名称

类型

必填

描述

示例值

DBClusterId

string

企业版、基础版或湖仓版集群 ID。

amv-bp11q28kvl688****

ResourceGroupName

string

Job 型资源组名称。

test_instance

PageNumber

integer

页码,取值为正整数。默认值为 1

1

PageSize

integer

每页记录数,取值:

  • 10(默认值)

  • 50

  • 100

30

Filters

string

以 JSON 格式的字符串来定义过滤条件,在 JSON 中可以使用的合法的 KEY 值和业务含义如下:

  • SubmittedTimeRange:开始时间。

  • TerminatedTimeRange: 结束时间。

  • AppStates:Spark 作业的状态。

  • AppId:Spark 作业的 ID。

  • AppNameRegex: Spark 作业的名称的正则表达式。

  • Tag:tag 信息。

  • ResourceGroupName:资源组名称。

其中开始时间和结束时间过滤条件,通过如下的子结构来输入范围:

  • Min:时间范围的下限,null 代表无限制。

  • Max:时间范围的上限,null 代表无限制。

{ "SubmittedTimeRang": { "Max": 10000, "Min": 0 }, "TerminatedTimeRange": { "Max": 10000, "Min": 0 }, "AppStates": ["STARTING"], "AppId": "adc", "AppNameRegex": "cde", "AttemptId": "abc-001" }

返回参数

名称

类型

描述

示例值

object

Schema of Response

PageNumber

integer

页码。

1

PageSize

integer

每页记录数。

10

TotalCount

integer

总记录条数。

1

RequestId

string

请求 ID。

D65A809F-34CE-4550-9BC1-0ED21ETG380

Data

object

返回数据。

AppInfoList

array

应用信息列表。返回参数说明:

  • Data:Spark 应用模板数据。

  • EstimateExecutionCpuTimeInSeconds:执行 Spark 应用消耗 CPU 的时长,单位毫秒(ms)。

  • LogRootPath:日志文件存储路径。

  • LastAttemptId:重试 ID。

  • WebUiAddress:Web UI 地址。

  • SubmittedTimeInMillis:提交 Spark 应用的时间,Unix 时间戳,单位毫秒(ms)。

  • StartedTimeInMillis:Spark 应用的创建时间,Unix 时间戳,单位毫秒(ms)。

  • LastUpdatedTimeInMillis:最近一次更新 Spark 应用的时间,Unix 时间戳,单位毫秒(ms)。

  • TerminatedTimeInMillis:Spark 应用终止执行的时间,Unix 时间戳,单位毫秒(ms)。

  • DBClusterId:执行 Spark 应用的集群 ID。

  • ResourceGroupName:Job 型资源组名称。

  • DurationInMillis:Spark 应用执行耗时,单位毫秒(ms)。

SparkAppInfo

应用信息列表。返回参数说明:

  • Data:Spark 应用模板数据。

  • EstimateExecutionCpuTimeInSeconds:执行 Spark 应用消耗 CPU 的时长,单位毫秒(ms)。

  • LogRootPath:日志文件存储路径。

  • LastAttemptId:重试 ID。

  • WebUiAddress:Web UI 地址。

  • SubmittedTimeInMillis:提交 Spark 应用的时间,Unix 时间戳,单位毫秒(ms)。

  • StartedTimeInMillis:Spark 应用的创建时间,Unix 时间戳,单位毫秒(ms)。

  • LastUpdatedTimeInMillis:最近一次更新 Spark 应用的时间,Unix 时间戳,单位毫秒(ms)。

  • TerminatedTimeInMillis:Spark 应用终止执行的时间,Unix 时间戳,单位毫秒(ms)。

  • DBClusterId:执行 Spark 应用的集群 ID。

  • ResourceGroupName:Job 型资源组名称。

  • DurationInMillis:Spark 应用执行耗时,单位毫秒(ms)。

{ "AppId": "test-app-id", "State": "Running", "Detail": { "LastAttemptId": "0001", "WebUiAddress": "http://spark-ui:4040", "SubmittedTimeInMillis": 1644805200260, "DBClusterId": "db", "EstimateExecutionCpuTimeInSeconds": 1644812400, "AppConf": "{}", "StartedTimeInMillis": 1644806400260, "LastUpdatedTimeInMillis": 1644808800260, "ResourceGroupName": "rg" }, "AppName": "test app name" }

PageNumber

integer

页码。

1

PageSize

integer

每页记录数。

10

TotalCount

integer

总记录数。

1

示例

正常返回示例

JSON格式

{
  "PageNumber": 1,
  "PageSize": 10,
  "TotalCount": 1,
  "RequestId": "D65A809F-34CE-4550-9BC1-0ED21ETG380",
  "Data": {
    "AppInfoList": [
      {
        "AppId": "s202207151211hz0c****",
        "AppName": "SparkTest",
        "Priority": "NORMAL",
        "State": "SUBMITTED",
        "Message": "WARN: Disk is full.",
        "Detail": {
          "Data": "{     \"name\": \"SparkPi\",     \"file\": \"local:///tmp/spark-examples.jar\",     \"className\": \"org.apache.spark.examples.SparkPi\",     \"args\": [         \"1000000\"     ],     \"conf\": {         \"spark.driver.resourceSpec\": \"small\",         \"spark.executor.instances\": 1,         \"spark.executor.resourceSpec\": \"small\"     } }",
          "EstimateExecutionCpuTimeInSeconds": 100,
          "LogRootPath": "oss:///logs/driver",
          "LastAttemptId": "s202204291426hzpre60****-0003",
          "WebUiAddress": "https://adbsparkui-cn-hangzhou.aliyuncs.com/?token=****",
          "SubmittedTimeInMillis": 1651213645000,
          "StartedTimeInMillis": 1651213645010,
          "LastUpdatedTimeInMillis": 1651213645200,
          "TerminatedTimeInMillis": 1651213645300,
          "DBClusterId": "amv-bp11q28kvl688****",
          "ResourceGroupName": "spark-rg",
          "DurationInMillis": 100,
          "AppType": "BATCH"
        },
        "DBClusterId": "amv-23xxxx"
      }
    ],
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 1
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 Spark.InvalidParameter Invalid parameter value: %s 输入参数不正确:%s。
400 Spark.InvalidState The object of the operation is in an invalid state: %s 操作对象处于非合法状态。
500 Spark.ServerError The Spark control component system encountered an error, please create a ticket to solve the problem or concat the supported engineer on duty. Error message: %s Spark管控组件系统遇到错误,请提交工单,或联系值班工程师。
403 Spark.Forbidden No permissions to access the resources: %s 权限不足,拒绝访问相关资源。您当前申请访问的信息是:%s。
404 Spark.ObjectNotFound The object is not found. More information: %s 操作对象不存在。关联信息:%s。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情