fix: Shield tools → Shield Zone API (/shield/shield-zone), client.py에 put 추가
All checks were successful
CI / build (push) Successful in 2m6s

구 API(Pull Zone ShieldDDosProtectionEnabled 필드)는 읽기 전용이라 Shield 설정 변경 불가.
새 Shield Zone API: bunny_shield_list, bunny_shield_status(by shieldZoneId),
bunny_shield_create, bunny_shield_update(PUT), bunny_waf_rules, bunny_waf_logs.
waf_logs 엔드포인트도 /shield/event-logs/{shieldZoneId}로 수정.
This commit is contained in:
kappa
2026-04-13 10:03:14 +09:00
parent 93ce5acede
commit 1edc063cd9
2 changed files with 86 additions and 42 deletions

View File

@@ -34,6 +34,15 @@ class BunnyClient:
)
return self._handle(resp)
async def put(self, path: str, json: dict | None = None) -> dict | list | str:
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as c:
resp = await c.put(
f"{self._base}{path}",
headers=self._headers,
json=json,
)
return self._handle(resp)
async def delete(self, path: str) -> dict | str:
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as c:
resp = await c.delete(