커서 조회

지정한 쿼리 ID의 쿼리 결과를 조회합니다.

필요 권한

사용자 이상의 계정으로 이용할 수 있습니다.

HTTP 요청

GET /api/sonar/cursors/:id
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
     "https://HOSTNAME/api/sonar/cursors/109?offset=0&limit=10"
요청 매개변수
필수타입설명비고
idO32비트 정수로그프레소 쿼리 ID
offsetX64비트 정수건너뛸 갯수최소 0. 기본값 0
limitX64비트 정수최대 갯수최소 0. 기본값 1000
formatX문자열출력 형식html, txt, xml, csv, json, json-single 중 하나

정상 응답

아래는 system tables | fields table 쿼리의 응답 예시입니다. format을 별도로 지정하지 않으면 개행으로 구분된 JSON 형식으로 출력합니다.

{"table":"sonar_event_00001"}
{"table":"sonar_raw_event_00001"}

쿼리 결과의 전체 건수와 같거나 그보다 큰 offset을 지정하면 아무 것도 조회되지 않으므로, 쿼리 상태 조회rows 건수 범위 내에서 조회해야 합니다.

오류 응답

지정된 커서를 조회할 수 없는 경우

HTTP 상태 코드 403 응답. 쿼리가 존재하지 않거나 다른 계정에서 실행한 쿼리의 경우 쿼리 결과를 조회할 수 없습니다.

{
  "error_code": "invalid-query-id",
  "error_msg": "cannot access query 42"
}
쿼리 ID가 정수가 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-param-type",
  "error_msg": "query id should be integer type"
}
offset, limit 값이 정수가 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "offset should be long type."
}
offset, limit 값이 음수인 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "offset should be non-negative integer."
}
format 값이 잘못 지정된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "format should be one of html, txt, xml, csv, json or json-single."
}