Is there a way to see all the segments that are in...
# general
c
Is there a way to see all the segments that are in a bad status using the API? If I could just get a list of all the segments and their status I could use jq to narrow down the list.
m
Seems like a good api to add. In the meanwhile, you could get the external view and find segments that are in ERROR/OFFLINE state.
c
@Mayank What is the "external view"
@Mayank Ah this. Can I access this information with the API or pinot-admin.sh?
@Mayank Found it. Thanks this is exactly what I need.
Copy code
curl -X 'GET' \
  '<http://10.10.10.62:9000/tables/load1AnalyticsEventsV1/externalview?tableType=realtime>' \
  -H 'accept: application/json' \
  -H 'Authorization: YWRkeyMWEy'
m
Yeah, all api’s are listed in Swagger UI.
c
For any other noobs out there. This is how I found all segments that had a bad status
Copy code
curl -X 'GET' \
  '<http://ipAddress:9000/tables/load1AnalyticsEventsV1/externalview?tableType=realtime>' \
  -H 'accept: application/json' \
  -H 'Authorization: token' \
  | jq '.REALTIME, .OFFLINE | with_entries(select(.value | values | any(. == "ERROR")))'
🙏 1