Undo Import Run
curl --request POST \
--url https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"origin": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"adapter": "<string>",
"file_name": "<string>",
"file_size": 123,
"file_sha256": "<string>",
"file_purged": false,
"phase": "<string>",
"progress_done": 0,
"progress_total": 123,
"counts": {},
"error": "<string>",
"error_code": "<string>",
"cancel_requested": false,
"confirmed_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"undo_until": "2023-11-07T05:31:56Z",
"mapping_sha256": "<string>",
"undone_at": "2023-11-07T05:31:56Z"
},
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Imports
Undo Import Run
Annulla l’intero import (D5: entro undo_until): il run va in
undoing, che tiene il lucchetto del negozio, e il worker va all’indietro
dal giornale. Un altro import in corso → 409 import.run.busy; oltre la
scadenza → 409 import.undo.expired; senza il permesso di ogni entità
dell’import → 403 auth.permission_required. Alla fine il worker annota
import.undone e manda il webhook import.undone (D8).
POST
/
api
/
v1
/
admin
/
import-runs
/
{run_id}
/
undo
Undo Import Run
curl --request POST \
--url https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/import-runs/{run_id}/undo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"origin": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"adapter": "<string>",
"file_name": "<string>",
"file_size": 123,
"file_sha256": "<string>",
"file_purged": false,
"phase": "<string>",
"progress_done": 0,
"progress_total": 123,
"counts": {},
"error": "<string>",
"error_code": "<string>",
"cancel_requested": false,
"confirmed_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"undo_until": "2023-11-07T05:31:56Z",
"mapping_sha256": "<string>",
"undone_at": "2023-11-07T05:31:56Z"
},
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Autorizzazioni
Risposta
Successful Response