Viewing Job Details

Sample Code

You can use the API to view details of a job. Sample code is as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
// Import classes:
import com.huaweicloud.cs.java.v1.client.ApiException;
import com.huaweicloud.cs.java.v1.JobApi;


JobApi apiInstance = new JobApi(apiClient);//apiClient is created when initializing a CS API client.
String xProjectId = "xProjectId_example"; // String | Project ID used for obtaining the token for the project.
Long jobId = 789L; // Long | Job ID.
try {
    GetJobDetailResponse result = apiInstance.getJobDetail(xProjectId, jobId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling JobApi#getJobDetail");
    System.err.println(e.getResponseBody());
    e.printStackTrace();
}

Parameter Description

Table 1 Parameters

Parameter

Mandatory

Type

Description

xProjectId

Yes

String

Project ID. This parameter is used to obtain the token for the project.

jobId

Yes

Integer

Job ID.

Table 2 Parameters involved in GetJobDetailResponse

Parameter

Mandatory

Type

Description

messageId

No

String

Message type ID.

message

No

String

Message content.

currentTime

No

Integer

Current time, expressed by milliseconds.

payload

No

-

For details about parameter types, see Table 3.

Table 3 Parameters involved in JobDetailEntity

Parameter

Mandatory

Type

Description

jobId

No

Integer

Job ID.

name

No

String

Job name.

desc

No

String

Job description.

jobType

No

String

Job type.

status

No

String

Job status.

statusDesc

No

String

Description of job status.

createTime

No

Integer

Time when a job is created.

startTime

No

Integer

Time when a job is started. 0 indicates that a job has not been started.

userId

No

String

ID of the user who creates the job.

clusterId

No

Integer

Resource ID of an exclusive cluster. Ensure that the current user has been authorized to use resources of the exclusive cluster.

projectId

No

String

ID of the project to which a job belongs.

sqlBody

No

String

Stream SQL statement.

runMode

No

String

Job running mode. The options are as follows:

  • sharedCluster: A job is running on a shared cluster.
  • exclusiveCluster: A job is running on an exclusive cluster.
  • edgeNode: A job is running on an edge node.

jobConfig

No

-

Job configuration. This parameter is available only when showDetail is set to true in section Querying the List of Jobs Running in an Exclusive Cluster. For details about parameter types, see Table 4.

jarUrl

No

String

OBS path of the JAR package.

mainClass

No

String

OBS path where users are authorized to save the snapshot. This parameter is valid only when checkpoint_enabled is set to true.

args

No

String

Job running parameter of the JAR package.

executionGraph

No

String

Job execution plan.

updateTime

No

Long

Time when a job is updated.

Table 4 Parameters involved in JobConfig

Parameter

Mandatory

Type

Description

checkpointEnabled

No

Boolean

Whether to enable the automatic job snapshot function. The default value is false.

  • true: The automatic job snapshot function is enabled.
  • false: The automatic job snapshot function is disabled.

checkpointMode

No

String

Snapshot mode. The following two options are available: exactly_once and at_least_once.

checkpointInterval

No

Integer

Snapshot interval, expressed by seconds.

logEnabled

No

Boolean

Whether to enable the log storage function.

obsBucket

No

String

Name of an OBS bucket.

smnTopic

No

String

SMN topic name.

rootId

No

Integer

Parent job ID.

edgeGroupIds

No

String

List of edge computing group IDs that are separated by commas (,).

managerSpu

No

Integer

Number of SPUs of the management unit.

spuNumber

No

Integer

Number of SPUs selected for a job. This parameter is available only when showDetail is set to true in section Querying the List of Jobs Running in an Exclusive Cluster.

  • Minimum value: 2
  • Maximum value: 400

parallelNumber

No

Integer

Number of parallel jobs set by a user. This parameter is available only when showDetail is set to true in section Querying the List of Jobs Running in an Exclusive Cluster.

  • Minimum value: 1
  • Maximum value: 2000