Viewing Spark Job Details
Function
This API is used to view the detailed information of a specified Spark job. It is synchronous. It returns complete information including job ID, job name, job status, job configuration, resource configuration, image configuration, etc. After a successful call, the job details are returned directly.
Calling Method
For details, see Calling APIs.
URI
GET /v2/workspaces/{workspace_id}/spark-jobs/{job_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| workspace_id | Yes | String | Definition: Workspace ID, used for resource isolation. This can be viewed on the workspace page of the console. Constraints: N/A Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
| job_id | Yes | String | Definition: Spark job ID, used to uniquely identify a job. It can be obtained from the job_id in the response of the API for starting a Spark job or from the API for listing Spark jobs. Constraints: N/A Range: 1 to 64 characters. Only hexadecimal characters, hyphens (-), and underscores (_) are allowed. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token. It is obtained by calling the Obtaining an IAM User Token API. Constraints: N/A Range: The value can contain a maximum of 65,534 characters, with no character type restrictions. Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| job_id | String | Definition: Spark job ID, used to uniquely identify a job. Range: 1 to 64 characters. Only hexadecimal characters, hyphens (-), and underscores (_) are allowed. Example: 80ceaaff-3cfc-4162-a56f-70031ea4fa91. |
| client_token | String | Definition: Spark job transaction ID, used to prevent duplicate submissions. Range: UUID format, 36 characters. Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| name | String | Definition: Spark job name, used to identify the job. Range: The value can contain 1 to 128 characters, with no character type restrictions. |
| endpoint_name | String | Definition: Endpoint name, used to specify the Spark job execution environment. Range: 1 to 63 characters. Only lowercase letters, digits, and hyphens (-) are allowed. It must start with a lowercase letter and end with a lowercase letter or digit. |
| endpoint_id | String | Definition: Endpoint ID, which uniquely identifies the Spark job execution environment. Range: UUID format, 36 characters. |
| catalog_name | String | Definition: Catalog name, used to specify the data catalog used by the job. Range: The value can contain 1 to 128 characters, with no character type restrictions. |
| job_agency | String | Definition: Name of the custom agency, used for the job to operate OBS objects, dump logs, access DLI metadata, etc. Range: The value can contain 1 to 64 characters, with no character type restrictions. |
| state | String | Definition: Spark job status, used to identify the current execution status of the job. Range |
| state_message | String | Definition: Job status message, displaying relevant information when the job ends abnormally. Range: The value can contain 0 to 512 characters, with no character type restrictions. |
| job_config | One of:
| Definition: Job configuration information, including job type, entry parameters, dependent packages, etc. |
| resource_config | Definition: Resource configuration information, including resource configuration for the Driver and Executor. | |
| restore_strategy | Definition: Running and recovery policy configuration, including retry count and interval information. | |
| spark_config | Map<String,String> | Definition: Custom Spark parameter configuration. The key in the map is the Spark configuration item name (for example, spark.executor.memory), and the value is the corresponding configuration value. Both key and value are strings, each with a maximum length of 1,024 characters. |
| logging_config | Definition: Logging configuration information, including log level configuration for the Driver and Executor. | |
| image | Definition: Image configuration information, including image ID and version information. | |
| retry_times | Integer | Definition: Job retry count, used to record the number of retries after a job failure. Range: Minimum value: 0. |
| labels | Array of ShowSparkJobLabelResponse objects | Definition: Job tag list, used to identify and categorize jobs. |
| create_time | Long | Definition: Job creation time, used to record when the job was submitted. The value is a Unix timestamp in milliseconds. Range: N/A |
| start_time | Long | Definition: Job start time, used to record when the job actually started execution. The value is a Unix timestamp in milliseconds. Range: N/A |
| end_time | Long | Definition: Job end time, used to record when the job execution completed. The value is a Unix timestamp in milliseconds. Range: N/A |
| create_user | SparkCreateUser object | Definition: Information about the user who creates the job. |
| log_url | String | Definition: Log archive path (OBS URL), used to view job execution logs. Range: OBS URL format, 1 to 1,024 characters. |
| description | String | Definition: Spark job description, used to describe the purpose of the job. Range: The value can contain 0 to 512 characters, with no character type restrictions. |
| Parameter | Type | Description |
|---|---|---|
| main_class | String | Definition: Entry class for the Spark Jar job, used to specify the main class name of the job. Range: Full Java class path format. Example: com.example.SparkJob. |
| main_args | Array of strings | Definition: List of entry class parameters for the Spark Jar job, used to pass job execution parameters. |
| main_jar | String | Definition: OBS path of the Jar package containing the main class of the Spark Jar job, used to specify the main Jar package of the job. Range: OBS URL format, 1 to 512 characters. Example: obs://bucket/jars/spark-job.jar. |
| dependency_jars | Array of strings | Definition: List of dependent Jar packages, used to specify the OBS paths of Jar packages that the Spark job depends on. |
| dependency_files | Array of strings | Definition: List of dependent files, used to specify the OBS paths of files that the Spark job depends on. |
| dependency_archives | Array of strings | Definition: List of dependent archive packages, used to specify the OBS paths of archive packages that the Spark job depends on. |
| dependency_py_files | Array of strings | Definition: List of dependent Python files, used to specify the OBS paths of Python packages that the Spark job depends on. |
| Parameter | Type | Description |
|---|---|---|
| main_python_file | String | Definition: Main Python file path, used to specify the OBS path of the main file for the Python Spark job. Range: OBS URL format, 1 to 512 characters. Example: obs://bucket/pyspark/pySpark_udf_python.py. |
| main_args | Array of strings | Definition: Parameter list of the main file of the Spark Python job, which is used to pass job execution parameters. |
| dependency_jars | Array of strings | Definition: List of dependent Jar packages, used to specify the OBS paths of Jar packages that the Spark job depends on. |
| dependency_files | Array of strings | Definition: List of dependent files, used to specify the OBS paths of files that the Spark job depends on. |
| dependency_archives | Array of strings | Definition: List of dependent archive packages, used to specify the OBS paths of archive packages that the Spark job depends on. |
| dependency_py_files | Array of strings | Definition: List of dependent Python files, used to specify the OBS paths of Python packages that the Spark job depends on. |
| Parameter | Type | Description |
|---|---|---|
| sql_scripting_file | String | Definition: OBS path of the SQL script file for a Spark SQL script job, which specifies the SQL script to be executed by the job. Range: OBS URL format, 1 to 512 characters. Example: obs://bucket/sparksql/script.sql. |
| sql_scripting_parameters | Array of SparkJobSqlScriptParameter objects | Definition: List of SQL script placeholder parameters, used to pass parameter values to placeholders in the SQL script. |
| dependency_jars | Array of strings | Definition: List of dependent Jar packages, used to specify the OBS paths of Jar packages that the Spark job depends on. |
| sql_scripting_result_to_obs | Boolean | Definition: Whether to write SQL script results to OBS, used to control the output method of query results. Range |
| result | Definition: SQL script query result information, including the result format and storage path. |
| Parameter | Type | Description |
|---|---|---|
| result_format | String | Definition: Query SQL result format, used to specify the output format of the result data. Range: The CSV format is supported. |
| result_path | String | Definition: OBS path for query SQL results, used to specify the storage location of the result data. Range: OBS URL format, 1 to 1,024 characters. Example: obs://bucket/results/result.csv. |
| Parameter | Type | Description |
|---|---|---|
| driver_resource_spec | ShowResourceSpecResponse object | Definition: Driver resource configuration, including CPU, memory, disk, and other information. |
| executor_resource_spec | ShowResourceSpecResponse object | Definition: Executor resource configuration, including CPU, memory, disk, and other information. |
| executor_number | Integer | Definition: Maximum number of Executors for the Spark job, used for dynamic resource allocation. Range: 0 to 65535. The value 0 indicates that dynamic resource allocation is disabled. A value greater than 0 indicates the maximum number of executors for dynamic resource allocation, which corresponds to the following Spark parameters: spark.dynamicAllocation.enabled is true, spark.dynamicAllocation.minExecutors is 1, spark.dynamicAllocation.maxExecutors is this value, and spark.dynamicAllocation.initialExecutors is 1. |
| Parameter | Type | Description |
|---|---|---|
| cpu | Integer | Definition: Number of CPU milicores, used to specify the CPU resources for the Driver or Executor. Range: Minimum value: 1000. |
| memory | Integer | Definition: Memory size, used to specify the memory resources for the Driver or Executor. Range: 1024 to 393216, in MB. |
| disk | Integer | Definition: Local disk size, used to specify the local disk capacity for the Driver or Executor. Range: Minimum value: 0. The unit is GB. |
| Parameter | Type | Description |
|---|---|---|
| max_retry | Integer | Definition: Maximum retry count, used to control automatic retries after a job failure. Range: A value greater than 0 enables failure retry. A value of 0 disables retry. |
| retry_delay | Integer | Definition: Retry interval, used to specify the waiting time between each retry. Range: 1 to 3600, in seconds. |
| queued_timeout | Integer | Definition: Queuing timeout duration, used to specify the maximum waiting time after a job is submitted. Range: The unit is minute. The minimum value is 10, and the maximum value is 180. If the job has not started running after this time, the job fails. |
| running_timeout | Integer | Definition: Running timeout duration, used to specify the maximum runtime for the job. Range: 10 to 525600, in minutes. If the job has not completed after this time, the job will be canceled and marked as failed. |
| Parameter | Type | Description |
|---|---|---|
| driver_root_logger_level | String | Definition: Driver root log level, used to control the overall log output level of the Driver. Range |
| driver_loggers_level_of_class | Array of ShowSparkClassLoggerLevelResponse objects | Definition: List of Driver class log level configurations, used to set specific log levels for specified classes. |
| executor_root_logger_level | String | Definition: Executor root log level, used to control the overall log output level of the Executor. Range |
| executor_loggers_level_of_class | Array of ShowSparkClassLoggerLevelResponse objects | Definition: List of Executor class log level configurations, used to set specific log levels for specified classes. |
| Parameter | Type | Description |
|---|---|---|
| logger_name | String | Definition: Name of the class for which logs are output, used to specify the class that requires log level configuration. Range: Full class path format. Example: com.aaa.bbb.ccc. 1 to 256 characters. |
| logger_level | String | Definition: Log level, used to control the log output level for the class. Range |
| Parameter | Type | Description |
|---|---|---|
| image_id | String | Definition: Image ID, which uniquely identifies the image used by a Spark job. Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed. |
| image_version_id | String | Definition: Image version, which specifies the version number of the image. Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed. |
| release_version | String | Definition: Version information of the Spark job (AIDataLake.xxx(Spark x.xx.x, JRE x.xx.x)). Range: 1 to 512 characters. |
| image_version_type | String | Definition: Image version type used by the Spark job. Range |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition: Tag key, used to identify the name of the tag. Range: 1 to 128 characters. |
| value | String | Definition: Tag value, used to identify the specific content of the tag. Range: 0 to 512 characters |
| Parameter | Type | Description |
|---|---|---|
| user_id | String | Definition: User ID of the job creator, used to identify the job creator. Range: The value can contain 1 to 256 characters, with no character type restrictions. |
| user_name | String | Definition: User name of the job creator, used to identify the job creator. Range: The value can contain 1 to 256 characters, with no character type restrictions. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 0 to 64 characters. |
| error_msg | String | Definition: Error description, used to explain the cause of an error. Range: 0 to 512 characters. |
| solution_msg | String | Definition: Solution description. Range: 0 to 4,096 characters. |
Example Requests
View the complete detailed information of a specified Spark job.
GET /v2/workspaces/{workspace_id}/spark-jobs/{job_id} Example Responses
Status code: 200
{
"job_id" : "80ceaaff-3cfc-4162-a56f-70031ea4fa91",
"client_token" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name" : "spark-jar-job-example",
"endpoint_name" : "my-spark-endpoint",
"catalog_name" : "my_catalog",
"state" : "SUCCEED",
"job_agency" : "my_agency",
"job_config" : {
"type" : "SPARK_JAR_JOB",
"main_class" : "com.example.SparkJobDriver",
"main_jar" : "obs://my-bucket/jars/spark-job-1.0.jar",
"main_args" : [ "--input", "obs://my-bucket/input", "--output", "obs://my-bucket/output" ],
"dependency_jars" : [ "obs://my-bucket/jars/utils-1.0.jar" ]
},
"resource_config" : {
"executor_number" : 2,
"driver_resource_spec" : {
"cpu" : 2000,
"memory" : 4096
},
"executor_resource_spec" : {
"cpu" : 4000,
"memory" : 8192,
"disk" : 20
}
},
"image" : {
"image_id" : "90a827a1-ca72-4be8-943b-774f945f22ac",
"image_version_id" : "7a8b9c0d-1e2f-4a5b-8c9d-7e8f9a0b1c2d"
},
"restore_strategy" : {
"max_retry" : 3,
"retry_delay" : 30,
"queued_timeout" : 180,
"running_timeout" : 720
},
"retry_times" : 1,
"labels" : [ {
"key" : "env",
"value" : "production"
}, {
"key" : "team",
"value" : "data-team"
} ],
"logging_config" : {
"driver_root_logger_level" : "INFO",
"executor_root_logger_level" : "INFO"
},
"description" : "Spark job example.",
"create_time" : 1764061598000,
"start_time" : 1764061648000,
"end_time" : 1764061898000,
"create_user" : {
"user_id" : "user123",
"user_name" : "admin"
},
"log_url" : "obs://my-bucket/aidatalake/workspace_52edbbd3e5f6470a9c1b8d2e3f4a5b6c/spark/endpoint_b242c8569d1e4f7a8c3b5d6e2f0a4c71/jobs/logs/2025_11_25/80ceaaff-3cfc-4162-a56f-70031ea4fa91/1/spark_ai-datalake-spark-80ceaaff-driver_spark-job-b242c856/spark.log",
"state_message" : ""
} Status code: 400
{
"error_code" : "AIDataLake.01011001",
"error_msg" : "Invalid parameter job_id",
"solution_msg" : "Please check the input parameters according to the documentation(job_id for spark job)."
} Status code: 401
{
"error_code" : "AIDataLake.01011003",
"error_msg" : "auth token not exists in header",
"solution_msg" : "Please check if auth token is included in the request header."
} Status code: 403
{
"error_code" : "AIDataLake.01011005",
"error_msg" : "current account has no permission",
"solution_msg" : "Please connect administrators to add permission."
} Status code: 500
{
"error_code" : "AIDataLake.01010001",
"error_msg" : "Internal system error",
"solution_msg" : "Contact operations for analysis."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Spark job details are successfully viewed. |
| 400 | Invalid request parameter. |
| 401 | Authentication failed. |
| 403 | Insufficient permissions. |
| 500 | Internal server error. |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot