Rest client java code to fetch all indices

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Describe the issue:
Please give a working java code that can fetch all indices of a cluster using java rest client version 2.1

Configuration:

Relevant Logs or Screenshots:

@hello Is that what you’re looking for?