Creating a Job Object

Function

This API is used to create a job object. This API is compatible with Sahara.

URI

Request

Table 2 Request parameter description

Parameter

Mandatory

Type

Description

name

Yes

String

Job object name

Contains 1 to 64 characters and consists of letters, digits, hyphens (-), and underscores (_) only.

mains

No

Array

Executable program set of a job object

If the job type is Hive or Spark Script, the value of mains must not be empty.

For details on how to obtain the executable program, see Creating a Job Binary Object.

libs

No

Array

Dependency package set of a job object

If the job type is MapReduce or Spark, the value of libs must not be empty.

For details on how to obtain the dependency package, see Creating a Job Binary Object.

is_protected

No

Bool

Whether a job object is protected

  • true
  • false

The current version does not support this function.

interface

No

Array

User-defined interface set

The current version does not support this function.

is_public

No

Bool

Whether a job object is public

  • true
  • false

The current version does not support this function.

type

Yes

String

Job object type

  • MapReduce
  • Spark
  • Hive (not supported currently)
  • hql
  • DistCp
  • SparkScript
  • SparkSql (not supported in this API currently)

description

No

String

Job object description

Contains a maximum of 65535 characters.

Response

Table 3 Response parameter description

Parameter

Type

Description

description

String

Job object description

tenant_id

String

Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

created_at

String

Job object creation time

updated_at

String

Job object update time

mains

Array

Executable program set of a job object

libs

Array

Dependency package set of a job object

is_protected

Bool

Whether a job object is protected

  • true
  • false

The current version does not support this function.

interface

Array

User-defined interface set

is_public

Bool

Whether a job object is public

  • true
  • false

The current version does not support this function.

type

String

Job object type

id

String

Job object ID

name

String

Job object name

Example

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status code

Description

202

The job object has been successfully created.

For the description about error status codes, see Status Codes.