文档

SubmitSparkApp - 提交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:SubmitSparkAppRead
  • DBClusterLakeVersion
    acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}/resourcegroup/{#ResourceGroup}

请求参数

名称类型必填描述示例值
AppNamestring

应用名称,可自定义字符串,长度不能超过 64 个字符。

TestApp
AppTypestring

应用类型,取值说明:

  • SQL:SQL 应用。
  • STREAMING:流应用。
  • BATCH(默认值):离线应用。
SQL
Datastring

应用模板数据。

说明 应用模板配置,请参见《Spark 应用配置指南》
conf spark.driver.resourceSpec=small; conf spark.executor.instances=1; conf spark.executor.resourceSpec=small; conf spark.app.name=TestApp;
AgentSourcestring

客户端类型。可自定义字符串,长度不能超过 64 个字符。

CONSOLE
AgentVersionstring

应用程序使用的版本。可自定义字符串,长度不能超过 64 个字符。

1.091
DBClusterIdstring

AnalyticDB MySQL 湖仓版(3.0)集群 ID。

说明 您可以调用 DescribeDBClusters 接口可以查询集群 ID。
amv-bp11q28kvl688****
ResourceGroupNamestring

Job 型资源组名称。

说明 您可以调用 DescribeDBResourceGroup 接口查看湖仓版(3.0)集群的资源组 ID。
adb
TemplateFileIdlong

应用模板 ID。

说明 您可以调用 GetSparkTemplateFullTree 接口可以查询应用模板 ID。
15

返回参数

名称类型描述示例值
object

任务列表。

RequestIdstring

请求 ID。

1AD222E9-E606-4A42-BF6D-8A4442913CEF
Dataobject

数据列表。

AppIdstring

应用 ID。

s202204132018hzprec1ac61a000****
AppNamestring

应用名称。

TestApp
Messagestring

返回告警信息,如任务执行失败或资源不足等,无告警时则返回为空。

Insufficient resources.
Statestring

应用执行状态,取值说明:

  • SUBMITTED:已提交。
  • STARTING:开始启动。
  • RUNNING:执行中。
  • FAILING:任务失败,清理环境中。
  • FAILED:失败。
  • KILLING:中止任务,清理环境中。
  • KILLED:中止任务。
  • SUCCEEDING:任务执行结束,清理环境中。
  • COMPLETED:任务执行结束。
  • FATAL:意外失败。
  • UNKNOWN:未知错误。
SUBMITTED

示例

正常返回示例

JSON格式

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "Data": {
    "AppId": "s202204132018hzprec1ac61a000****",
    "AppName": "TestApp",
    "Message": "Insufficient resources.",
    "State": "SUBMITTED"
  }
}

错误码

HTTP status code错误码错误信息描述
400Spark.App.ExceedQuotaLimitationThe requested resource exceeds the maximum limit: %s提交Spark作业时申请资源量超过限制。
400Spark.App.InvalidAppTypeWhenSubmitThe specified AppType is INVALID or NULL. Please refer to the documentation to correct the parameters for %s.AppType类型不合法,请参考使用文档指定适合业务的AppType,请关注配置类型:%s。
400Spark.App.InvalidResourceSpecThe requested resource type is not supported:\n %s不支持申请的资源机型。
400Spark.App.ParameterConflictConflicting parameters submitted:\n %s提交Spark作业的配置参数存在冲突。
400Spark.App.ResourceNegativeErrorThe requested resource MUST be positive: %s申请使用的Spark使用的资源量必须为正整数。
400Spark.Config.InvalidAppFilePathThe main driver file MUST be a valid OSS path. Current is %s.主驱动文件地址必须是合法的OSS地址。
400Spark.Config.invalidConnectorsThe spark.adb.connectors configuration is invalid: %sspark.adb.connectors配置不正确。
400Spark.Config.InvalidDiskConfigThe requested disk mount parameter is invalid: %s磁盘挂载配置错误。
400Spark.Config.InvalidHostAliasConfigThe requested host alias parameter %s is invalid. Example: 127.0.0.1 localhost local域名映射配置错误。
400Spark.Config.InvalidLogOssPathThe OSS address for log storage is illegal: %s存储日志的OSS地址非法。
400Spark.Config.InvalidRoleArnFormatConfigure RoleARN %s invalid format. It should match acs:ram::uid_number:role/role_name配置的RoleARN格式错误。
400Spark.Config.InvalidTimeZoneUnable to parse time zone configuration %s : %s时区配置错误。
400Spark.Config.MainAppFileNotExistsThe main driver file is missing, [file] or [sqls] must be configured.主驱动文件缺失,必须保证file或者sqls配置不为空。
400Spark.Config.OSSPathAccessErrorThe configured OSS address %s cannot be accessed.配置的OSS路径无法访问。
400Spark.Config.OSSPathNotExistsThe OSS address %s requested does not exist or the permissions are insufficient.OSS路径不存在或当前用户无权限访问。
400Spark.Config.RoleArnVerifyFailedRoleARN parameter verification failed. Error msg: %s when verify RoleArn %sRoleARN参数校验失败。
400Spark.Config.SecurityGroupNotFoundThe security group in the configuration does not exist or cannot be accessed. %s.配置的资源组不存在或者因权限不足无法访问。
400Spark.Config.VswitchNotFoundThe vswitch in the configuration does not exist or cannot be accessed. %s.无法找到配置虚拟机交换机,或当前账号权限不足。
400Spark.InvalidParameterInvalid parameter value: %s输入参数不正确。
400Spark.InvalidStateThe object of the operation is in an invalid state: %s操作对象处于非合法状态。
400Spark.RoleArn.Invalid%s is not found, or the RAM role has not been authorized.RoleArn不存在或子账号未授权。
400Spark.SQL.BlankErrorInput sql can not be blank string.提交SQL不能为空。
400Spark.SQL.MultipleSQLErrorElement in field [sqls] can not contain more than one sql statement: %s.提交的Spark SQL包含了多条可执行SQL。
400Spark.SQL.NotFoundExecutableSQLErrorNo executable statements are submitted. Please check the input SQL.Spark作业的SQL信息中不包含可执行语句。
400Spark.SQL.NotFoundExecutableSQLErrorThe execution part is not included in the current submitted SQL, please check the input SQL.提交的SQL中不包含可执行内容。
400Spark.SQL.ParserErrorSubmit spark app failed when parser SQL %s. Error message: %s.解析提交的Spark SQL失败。
403Spark.ForbiddenNo permissions to access the resources: %s权限不足,拒绝访问相关资源。您当前申请访问的信息是:%s。
404Spark.App.ContentNotFoundThe requested content %s of the Spark application is not found.找不到指定Spark作业的提交内容。
404Spark.App.NotFoundThe Spark application %s is not found.未能找到输入的 Spark App。
404Spark.ObjectNotFoundThe object is not found. More information: %s操作对象不存在。关联信息:%s。
500Spark.ServerErrorThe Spark control component system encountered an error, please create a ticket to solve the problem or concat the supported engineer on duty. Error message: %sSpark管控组件系统遇到错误,请提交工单,或联系值班工程师。

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

变更历史

变更时间变更内容概要操作
2023-07-27OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    新增错误码:400
    新增错误码:403
    新增错误码:404
    新增错误码:500
2023-06-28API 内部配置变更,不影响调用看变更集
变更项变更内容
API 内部配置变更,不影响调用
  • 本页导读 (1)
文档反馈