fix(route-lab): record host channel reuse limits
This commit is contained in:
@@ -257,6 +257,34 @@ crm_curl_json() {
|
||||
curl "${curl_args[@]}"
|
||||
}
|
||||
|
||||
crm_curl_capture() {
|
||||
local method="$1"
|
||||
local path="$2"
|
||||
local header_path="$3"
|
||||
local body_path="$4"
|
||||
local payload="${5:-}"
|
||||
local -a curl_args
|
||||
curl_args=(-sS -D "$header_path" -o "$body_path" -X "$method")
|
||||
if [[ -n "${crm_token:-}" ]]; then
|
||||
curl_args+=(-H "Authorization: Bearer $crm_token")
|
||||
elif [[ -n "${crm_cookie_jar:-}" ]]; then
|
||||
curl_args+=(-b "$crm_cookie_jar" -c "$crm_cookie_jar")
|
||||
else
|
||||
echo "missing CRM auth: set CRM_ADMIN_TOKEN or CRM_COOKIE_JAR/CRM_ADMIN_USERNAME+CRM_ADMIN_PASSWORD" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ -n "$payload" ]]; then
|
||||
curl_args+=(
|
||||
-H 'Content-Type: application/json'
|
||||
"${CRM_BASE}${path}"
|
||||
-d "$payload"
|
||||
)
|
||||
else
|
||||
curl_args+=("${CRM_BASE}${path}")
|
||||
fi
|
||||
curl "${curl_args[@]}"
|
||||
}
|
||||
|
||||
ensure_crm_session_cookie() {
|
||||
if [[ -n "$CRM_COOKIE_JAR" ]]; then
|
||||
crm_cookie_jar="$CRM_COOKIE_JAR"
|
||||
@@ -555,11 +583,7 @@ print(json.dumps({
|
||||
PY
|
||||
)"
|
||||
|
||||
curl -sS -D "$ART/02-import.headers.txt" -o "$ART/03-import.body.json" -X POST \
|
||||
-H "Authorization: Bearer $crm_token" \
|
||||
-H 'Content-Type: application/json' \
|
||||
"$CRM_BASE/api/providers/$provider_id/import" \
|
||||
-d "$payload"
|
||||
crm_curl_capture POST "/api/providers/$provider_id/import" "$ART/02-import.headers.txt" "$ART/03-import.body.json" "$payload"
|
||||
sanitize_headers_file "$ART/02-import.headers.txt"
|
||||
|
||||
batch_id="$(python3 - "$ART/03-import.body.json" <<'PY'
|
||||
|
||||
Reference in New Issue
Block a user