Skip to content

Commit 2d16518

Browse files
authored
PROGX-573: Add job import/export endpoints (#1022)
2 parents c2759f6 + b4e8483 commit 2d16518

File tree

6 files changed

+144
-1
lines changed

6 files changed

+144
-1
lines changed

content/files/Akeneo PIM API.postman_collection.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5031,6 +5031,75 @@
50315031
}
50325032
]
50335033
},
5034+
{
5035+
"name": "Job (Serenity only)",
5036+
"item": [
5037+
{
5038+
"name": "Launch export",
5039+
"request": {
5040+
"method": "POST",
5041+
"header": [
5042+
{
5043+
"key": "Authorization",
5044+
"value": "Bearer {{token}}"
5045+
},
5046+
{
5047+
"key": "Content-type",
5048+
"value": "application/json"
5049+
}
5050+
],
5051+
"url": {
5052+
"raw": "{{url}}/api/rest/v1/jobs/export/csv_product_export",
5053+
"host": [
5054+
"{{url}}"
5055+
],
5056+
"path": [
5057+
"api",
5058+
"rest",
5059+
"v1",
5060+
"jobs",
5061+
"export"
5062+
]
5063+
}
5064+
},
5065+
"response": []
5066+
},
5067+
{
5068+
"name": "Launch import",
5069+
"request": {
5070+
"method": "POST",
5071+
"header": [
5072+
{
5073+
"key": "Authorization",
5074+
"value": "Bearer {{token}}"
5075+
},
5076+
{
5077+
"key": "Content-type",
5078+
"value": "application/json"
5079+
}
5080+
],
5081+
"body": {
5082+
"mode": "raw",
5083+
"raw": "{\n \"import_mode\": \"create_only\"\n}"
5084+
},
5085+
"url": {
5086+
"raw": "{{url}}/api/rest/v1/jobs/import/csv_product_import",
5087+
"host": [
5088+
"{{url}}"
5089+
],
5090+
"path": [
5091+
"api",
5092+
"rest",
5093+
"v1",
5094+
"jobs",
5095+
"import"
5096+
]
5097+
}
5098+
},
5099+
"response": []
5100+
}
5101+
]
5102+
},
50345103
{
50355104
"name": "Authentification by password",
50365105
"event": [

content/swagger/akeneo-web-api.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

content/swagger/paths.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
/api/rest/v1/media-files/{code}/download:
3838
$ref: ./resources/media_files/routes/media_files_code_download.yaml
3939

40+
/api/rest/v1/jobs/export/{code}:
41+
$ref: ./resources/jobs/routes/export.yaml
42+
/api/rest/v1/jobs/import/{code}:
43+
$ref: ./resources/jobs/routes/import.yaml
44+
4045
/api/rest/v1/families:
4146
$ref: ./resources/families/routes/families.yaml
4247
/api/rest/v1/families/{code}:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
post:
2+
summary: Launch export job by code
3+
operationId: "post_job_export"
4+
tags:
5+
- Jobs
6+
x-versions:
7+
- "SaaS"
8+
description: This endpoint allows you to launch an export job by code.
9+
parameters:
10+
- name: code
11+
in: path
12+
type: string
13+
description: Job code
14+
required: true
15+
responses:
16+
200:
17+
description: OK
18+
x-details: Returns the execution ID for the launched job
19+
x-examples-per-version:
20+
- x-version: 'SaaS'
21+
x-example: {"execution_id": "12345"}
22+
400:
23+
$ref: "#/responses/400Error"
24+
403:
25+
$ref: "#/responses/403Error"
26+
404:
27+
$ref: "#/responses/404Error"
28+
422:
29+
$ref: "#/responses/422Error"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
post:
2+
summary: Launch import job by code
3+
operationId: "post_job_import"
4+
tags:
5+
- Jobs
6+
x-versions:
7+
- "SaaS"
8+
description: This endpoint allows you to launch an import job by code.
9+
x-body-by-line: "The body is optional and can be be empty. If empty, the import profile options will be used."
10+
parameters:
11+
- name: code
12+
in: path
13+
type: string
14+
description: Job code
15+
required: true
16+
- name: body
17+
in: body
18+
schema:
19+
properties:
20+
import_mode:
21+
type: string
22+
description: "Change the import mode for this job by overriding the profile value.
23+
Available values are: <em>create_only</em>, <em>update_only<em> and <em>create_or_update</em>"
24+
responses:
25+
200:
26+
description: OK
27+
x-details: Returns the execution ID for the launched job
28+
x-examples-per-version:
29+
- x-version: 'SaaS'
30+
x-example: {"execution_id": "12345"}
31+
400:
32+
$ref: "#/responses/400Error"
33+
403:
34+
$ref: "#/responses/403Error"
35+
404:
36+
$ref: "#/responses/404Error"
37+
422:
38+
$ref: "#/responses/422Error"

tasks/reference.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ function determineCategory(tag){
8282
return 'Catalogs for Apps';
8383
case 'UI Extensions':
8484
return 'Extensions';
85+
case 'Jobs':
86+
return 'Jobs';
8587
default:
8688
return 'Utilities';
8789
}

0 commit comments

Comments
 (0)