본문 바로가기
FortiGate/REST API

Rest API 쿼리에 대한 응답 항목 수가 너무 많을 경우

by 에티버스이비티 2025. 5. 15.

FortiGate API 쿼리할 때 반환되는 항목 수는 요청당 1,000개로 제한된다.

하지만 일부 query의 경우 응답수가 1,000개를 넘어 가는 경우가 있다,.

 

예를 들어 Microsoft-Azure(id=327786)에 대한 ISDB 리스트는 약 4만개를 넘는데, 쿼리 결과는 1,000개만 반환하게 된다.

 

전체 카운트는 아래 명령어로 확인 가능하다.

GET /api/v2/monitor/firewall/internet-service-details?id=<service_id>&summary_only=1

테스트 장비는 45,646개의 리스트가 있음

 

테스트 장비의 Microsoft-Azure(id=327786)에 대한 ISDB 리스트는 45,646개 이지만, 아래와 같이 1,000개만 리턴된다.

 

이럴 경우 아래의 방식을 1,000개 단위로 끊어서 순차적으로 결과를 받아 올수 있다.

GET /api/v2/monitor/firewall/internet-service-details?id=327786&count=1000&start=0&vdom=root
GET /api/v2/monitor/firewall/internet-service-details?id=327786&count=1000&start=1000&vdom=root
GET /api/v2/monitor/firewall/internet-service-details?id=327786&count=1000&start=2000&vdom=root
...

댓글