curl --request POST \
--url http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close",
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 := "http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close"
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("http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"received": 1,
"deleted": 1,
"quarantined": 1
}Cerrar el run y dar de baja lo que no vino
Al cerrar, toda entidad de ese tipo que la conexión tenía y no vino en el run se da de baja: tombstone y outbox con operación de borrado. Por eso un run a medias no se cierra — expira a las 24 h sin borrar nada, que es la diferencia entre «el proveedor borró todo» y «se me cortó la conexión».
curl --request POST \
--url http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close",
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 := "http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close"
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("http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/connections/{connection_id}/snapshots/{run_id}/close")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"received": 1,
"deleted": 1,
"quarantined": 1
}Autorizaciones
Un conector custom (ADR 0013 §4). El token nace del alta de la conexión (POST /internal/v1/custom-connections), vale para una conexión y sólo escribe en ella: presentado contra otra conexión es 401.
Parámetros de ruta
La conexión de CrossUp.
1El run de snapshot abierto para esta conexión y esta entidad.
^snp_.+Respuesta
El cierre, con lo que entró y lo que se dio de baja.
Al cerrar, toda entidad de ese tipo que la conexión tenía y no vino en el run se da de baja (tombstone + outbox de borrado). Es lo único que detecta borrados cuando el proveedor no los avisa.