Updated on 2024-11-06 GMT+08:00

Viewing a Job File

Function

This API is used to check whether there are jobs and scripts in the job file to be imported from OBS to DLF.

URI

  • URI format

    POST /v1/{project_id}/jobs/check-file

  • Parameter description
    Table 1 URI parameter

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain a project ID, see Project ID and Account ID.

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

path

Yes

String

If OBS is deployed, the job definition file is stored on OBS, for example, obs://myBucket/jobs.zip.

workspace

No

String

Workspace ID

  • If this parameter is not set, data in the default workspace is queried by default.
  • To query data in other workspaces, this header must be carried.

Response Parameters

Table 3 Response parameters

Parameter

Mandatory

Type

Description

jobs

No

List<Job>

Job information. For details, see Table 4.

scripts

No

List<Script>

Script information. For details, see Table 5.

Table 4 job data structure description

Parameter

Mandatory

Type

Description

params

No

Map<String,String>

Job parameter.

name

Yes

String

Job name.

path

Yes

String

Path of the job

Table 5 Data structure description of Script

Parameter

Mandatory

Type

Description

name

Yes

String

Script name.

path

Yes

String

Path of the script.

Example Request

Query the parameter definitions in the job file on OBS. The OBS path of the job definition file is obs://aaaaa/DLF_myJob.zip.
POST /v1/b384b9e9ab9b4ee8994c8633aabc9505/jobs/check-file
{
"path": "obs://aaaaa/DLF_myJob.zip"
}

Example Response

  • Success response
    {
        "jobs":[
            {
                "name":"test",
                "path":"/test",
                "params":{
                    "ddd":"dddd"
                }
            },
            {
                "name":"test1",
                "path":"/test",
                "params":{
                    "ddd":"dddd"
                }
            }
        ],
        "scripts":[
            {
                "name":"script1",
                "path":"/path1"
            },
            {
                "name":"script2",
                "path":"/path1"
            }
        ]
    }
  • Failure response

    HTTP status code 400

    {
        "error_code":"DLF.0815",
        "error_msg":"Fail to read OBS file."
    }

Status Codes

See Status Codes.