Available in VPC
Create a job.Request
This section describes the request format. The method and URI are as follows:
| Method | URI |
|---|---|
| POST | /api/v1/jobs |
Request headers
For information about the request headers common to all Data Flow APIs, see Data Flow request headers.
Request body
You can include the following data in the body of your request:
| Field | Type | Required | Description |
|---|---|---|---|
name |
String | Required | Job name
|
type |
String | Required | Job type
|
maxConcurrentRuns |
Integer | Optional | Maximum number of concurrent executions |
jobCondition |
Object | Optional | Job execution settings |
jobCondition.numWorker |
Integer | Optional | Number of workers
|
jobCondition.timeout |
Integer | Optional | Execution timeout (minute)
|
jobCondition.nrn |
String | Optional | NAVER Cloud Platform resource identification value for job |
jobCondition.scriptPath |
String | Optional | Job execution script storage path |
jobCondition.logPath |
String | Optional | Job execution history storage path |
jobCondition.parameters |
Object | Optional | Job parameters (SCRIPT jobs only)
|
nodes |
Array | Optional | Job node information
|
code |
String | Optional | SCRIPT job execution code |
Request example
The request example is as follows:
curl --location --request POST 'https://dataflow.apigw.ntruss.com/api/v1/jobs' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--data '{
"name": "daily_sales_job",
"type": "SCRIPT",
"maxConcurrentRuns": 3,
"jobCondition": {
"numWorker": 2,
"timeout": 360,
"nrn": "nrn:PUB:IAM::*******:Role/********",
"scriptPath": "dataflow-2706412-****/scripts/",
"logPath": "dataflow-2706412-****/sparkHistoryLogs/",
"parameters": {
"target_date": "2025-03-21",
"input_path": "dataflow/sales/",
"output_format": "parquet"
}
},
"code": "import argparse\nfrom pyspark.sql import SparkSession\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--target_date\")\nparser.add_argument(\"--input_path\")\nparser.add_argument(\"--output_format\")\nparser.add_argument(\"--JOB_ID\")\nparser.add_argument(\"--JOB_EXECUTION_ID\")\nparser.add_argument(\"--JOB_NAME\")\nargs, _ = parser.parse_known_args()\n\nspark = SparkSession.builder.getOrCreate()\nprint(args.target_date, args.input_path, args.output_format)\n"
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
| Field | Type | Required | Description |
|---|---|---|---|
jobId |
String | - | Job ID |
name |
String | - | Job name |
type |
String | - | Job type - VISUAL | SCRIPT |
status |
String | - | Job status
|
nodes |
Array | - | Job node information
|
runCondition |
Object | - | Job execution option |
runCondition.numWorker |
Integer | - | Number of workers
|
runCondition.timeout |
Integer | - | Execution timeout (minute)
|
runCondition.nrn |
String | - | NAVER Cloud Platform resource identification value for job |
runCondition.scriptPath |
String | - | Job execution script storage path |
runCondition.logPath |
String | - | Job execution history storage path |
runCondition.parameters |
Object | - | Default parameters stored in the job
|
createdDate |
String | - | Job creation date and time
|
updatedDate |
String | - | Job modification date and time
|
Response status codes
For information about the response status codes common to all Data Flow APIs, see Data Flow response status codes.
Response example
The response example is as follows:
{
"jobId": "5Yns7J******",
"name": "daily_sales_job",
"type": "SCRIPT",
"status": "READY",
"maxConcurrentRuns": 3,
"nodes": [],
"runCondition": {
"numWorker": 2,
"timeout": 360,
"nrn": "nrn:PUB:IAM::*******:Role/********",
"scriptPath": "dataflow-2706412-****/scripts/",
"logPath": "dataflow-2706412-****/sparkHistoryLogs/",
"parameters": {
"target_date": "2025-03-21",
"input_path": "aitems/sales/",
"output_format": "parquet"
}
},
"createdDate": "2025-03-21T10:02:02+09:00",
"updatedDate": "2025-03-21T10:02:02+09:00"
}