kong のプラグインから API を呼び出すサンプルになります
ここではrestriction-check
という upstream を呼び出す前に規制情報を API から取得し、その値に応じてレスポンスを返すプラグインを作成しています
詳しくはZenn の記事をご覧ください
docker compose up -d --build
curl -i -X POST -H "Content-Type: application/json" -d '{"test": "test"}' http://localhost:8000/httpbin/post
>>>
HTTP/1.1 503 Service Temporarily Unavailable
{
"message": "This API is under maintenance."
}