REST Resource: projects.locations.batches

资源:批处理

表示服务中的批量工作负载。

JSON 表示法
{
  "name": string,
  "uuid": string,
  "createTime": string,
  "runtimeInfo": {
    object (RuntimeInfo)
  },
  "state": enum (State),
  "stateMessage": string,
  "stateTime": string,
  "creator": string,
  "labels": {
    string: string,
    ...
  },
  "runtimeConfig": {
    object (RuntimeConfig)
  },
  "environmentConfig": {
    object (EnvironmentConfig)
  },
  "operation": string,
  "stateHistory": [
    {
      object (StateHistory)
    }
  ],

  // Union field batch_config can be only one of the following:
  "pysparkBatch": {
    object (PySparkBatch)
  },
  "sparkBatch": {
    object (SparkBatch)
  },
  "sparkRBatch": {
    object (SparkRBatch)
  },
  "sparkSqlBatch": {
    object (SparkSqlBatch)
  }
  // End of list of possible types for union field batch_config.
}
字段
name

string

仅限输出。批处理的资源名称。

uuid

string

仅限输出。批次 UUID(通用唯一标识符)。该服务会在创建批处理时生成此值。

createTime

string (Timestamp format)

仅限输出。批次的创建时间。

时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z"

runtimeInfo

object (RuntimeInfo)

仅限输出。有关批量执行的运行时信息。

state

enum (State)

仅限输出。批处理的状态。

stateMessage

string

仅限输出。批处理状态详情,例如,如果状态为 FAILED,则包含失败说明。

stateTime

string (Timestamp format)

仅限输出。批处理进入当前状态的时间。

时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z"

creator

string

仅限输出。创建批处理的用户的电子邮件地址。

labels

map (key: string, value: string)

可选。要与此批次关联的标签。标签必须包含 1 到 63 个字符,并且必须符合 RFC 1035 的要求。标签可以为空,但如果存在,则必须包含 1 到 63 个字符,并且必须符合 RFC 1035。与批处理关联的标签不得超过 32 个。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

runtimeConfig

object (RuntimeConfig)

可选。批量执行的运行时配置。

environmentConfig

object (EnvironmentConfig)

可选。批量执行的环境配置。

operation

string

仅限输出。与此批处理关联的操作的资源名称。

stateHistory[]

object (StateHistory)

仅限输出。批处理的历史状态信息。

联合字段 batch_config。批处理配置的应用/框架专用部分。batch_config 只能是下列其中一项:
pysparkBatch

object (PySparkBatch)

可选。PySpark 批处理配置。

sparkBatch

object (SparkBatch)

可选。Spark 批处理配置。

sparkRBatch

object (SparkRBatch)

可选。SparkR 批处理配置。

sparkSqlBatch

object (SparkSqlBatch)

可选。SparkSql 批处理配置。

PySparkBatch

用于运行 Apache PySpark 批处理工作负载的配置。

JSON 表示法
{
  "mainPythonFileUri": string,
  "args": [
    string
  ],
  "pythonFileUris": [
    string
  ],
  "jarFileUris": [
    string
  ],
  "fileUris": [
    string
  ],
  "archiveUris": [
    string
  ]
}
字段
mainPythonFileUri

string

必需。要用作 Spark 驱动程序的主 Python 文件的 HCFS URI。必须是 .py 文件。

args[]

string

可选。要传递给驱动程序的参数。请勿添加可设置为批量属性的参数(例如 --conf),因为这可能会导致发生冲突,从而导致批量提交不正确。

pythonFileUris[]

string

可选。要传递给 PySpark 框架的 Python 文件的 HCFS 文件 URI。支持的文件类型:.py.egg.zip

jarFileUris[]

string

可选。要添加到 Spark 驱动程序和任务的类路径的 JAR 文件的 HCFS URI。

fileUris[]

string

可选。要放入各个执行程序的工作目录中的文件的 HCFS URI。

archiveUris[]

string

可选。要提取到每个执行程序的工作目录中的归档文件的 HCFS URI。支持的文件类型:.jar.tar.tar.gz.tgz.zip

SparkBatch

用于运行 Apache Spark 批处理工作负载的配置。

JSON 表示法
{
  "args": [
    string
  ],
  "jarFileUris": [
    string
  ],
  "fileUris": [
    string
  ],
  "archiveUris": [
    string
  ],

  // Union field driver can be only one of the following:
  "mainJarFileUri": string,
  "mainClass": string
  // End of list of possible types for union field driver.
}
字段
args[]

string

可选。要传递给驱动程序的参数。请勿添加可设置为批量属性的参数(例如 --conf),因为这可能会导致发生冲突,从而导致批量提交不正确。

jarFileUris[]

string

可选。要添加到 Spark 驱动程序和任务的类路径的 JAR 文件的 HCFS URI。

fileUris[]

string

可选。要放入各个执行程序的工作目录中的文件的 HCFS URI。

archiveUris[]

string

可选。要提取到每个执行程序的工作目录中的归档文件的 HCFS URI。支持的文件类型:.jar.tar.tar.gz.tgz.zip

联合字段 driver。用于调用以驱动 Spark 工作负载的主要方法的规范。指定包含主类的 jar 文件或主类名称。如需同时传递主 jar 和该 jar 中的主类,请将 jar 添加到 jar_file_uris,然后在 main_class 中指定主类名称。driver 只能是下列其中一项:
mainJarFileUri

string

可选。包含主类的 jar 文件的 HCFS URI。

mainClass

string

可选。驱动程序主类的名称。包含该类的 jar 文件必须位于类路径中或在 jarFileUris 中指定。

SparkRBatch

用于运行 Apache SparkR 批处理工作负载的配置。

JSON 表示法
{
  "mainRFileUri": string,
  "args": [
    string
  ],
  "fileUris": [
    string
  ],
  "archiveUris": [
    string
  ]
}
字段
mainRFileUri

string

必需。要用作驱动程序的主要 R 文件的 HCFS URI。必须是 .R.r 文件。

args[]

string

可选。要传递给 Spark 驱动程序的参数。请勿添加可设置为批量属性的参数(例如 --conf),因为这可能会导致发生冲突,从而导致批量提交不正确。

fileUris[]

string

可选。要放入各个执行程序的工作目录中的文件的 HCFS URI。

archiveUris[]

string

可选。要提取到每个执行程序的工作目录中的归档文件的 HCFS URI。支持的文件类型:.jar.tar.tar.gz.tgz.zip

SparkSqlBatch

用于将 Apache Spark SQL 查询作为批处理工作负载运行的配置。

JSON 表示法
{
  "queryFileUri": string,
  "queryVariables": {
    string: string,
    ...
  },
  "jarFileUris": [
    string
  ]
}
字段
queryFileUri

string

必需。包含要执行的 Spark SQL 查询的脚本的 HCFS URI。

queryVariables

map (key: string, value: string)

可选。将查询变量名称映射到值(相当于 Spark SQL 命令:SET name="value";)。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

jarFileUris[]

string

可选。要添加到 Spark CLASSPATH 的 JAR 文件的 HCFS URI。

批处理状态。

枚举
STATE_UNSPECIFIED 批处理状态未知。
PENDING 系统会在运行前创建批处理。
RUNNING 批处理正在运行。
CANCELLING 批处理正在取消。
CANCELLED 批量取消操作已成功。
SUCCEEDED 批量处理已成功完成。
FAILED 由于出现错误,批处理作业已停止运行。

StateHistory

历史状态信息。

JSON 表示法
{
  "state": enum (State),
  "stateMessage": string,
  "stateStartTime": string
}
字段
state

enum (State)

仅限输出。历史记录中此时间点的批处理状态。

stateMessage

string

仅限输出。有关历史记录中此时间点状态的详细信息。

stateStartTime

string (Timestamp format)

仅限输出。批次进入历史状态的时间。

时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z"

方法

create

创建以异步方式执行的批处理工作负载。

delete

删除批处理工作负载资源。

get

获取批量工作负载资源表示法。

list

列出批处理工作负载。