# Add query parameter "level" to the IndicesStatsRequest using the 7.17 transport client

**URL:** <https://discuss.elastic.co/t/add-query-parameter-level-to-the-indicesstatsrequest-using-the-7-17-transport-client/334782>\
**Category:** Elasticsearch\
**Created:** [May 31, 2023, 9:57am UTC](https://discuss.elastic.co/t/add-query-parameter-level-to-the-indicesstatsrequest-using-the-7-17-transport-client/334782 "2023-05-31T09:57:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)\
**Post date:** [May 31, 2023, 9:57am UTC](https://discuss.elastic.co/t/add-query-parameter-level-to-the-indicesstatsrequest-using-the-7-17-transport-client/334782/1 "2023-05-31T09:57:08Z")

</div>

Hey!

We are using Elasticsearch 7.17 + the corresponding transport client.  
I try to calculate the consumed disk space from Elasticsearch without the cat API and came up with this solution ([documentation](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-stats.html)):

```auto
curl -H 'Content-type: application/json' -XGET 'http://localhost/_all/_stats/store?level=cluster'

```

Which works perfectly fine when using curl.

So, I want to mimic that behavior with the java transport client with the `IndicesStatsRequest` but it seems, the query parameter `level` does not exist there. All other query parameters mentioned in the documentation are present (`indicesStatsRequest.fieldDataFields()`, `indicesStatsRequest.groups()`,... to name a view)

My question is, how can add the `level` query parameter to the request using the java transport client?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 31, 2023, 10:43am UTC](https://discuss.elastic.co/t/add-query-parameter-level-to-the-indicesstatsrequest-using-the-7-17-transport-client/334782/2 "2023-05-31T10:43:11Z")

</div>

There is no `level` parameter in the transport protocol. You always get all the detail.

(also the transport client has been deprecated for a very long time, I recommend moving to the HTTP client)

---

<div class="post-metadata">

**Author:** ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)\
**Post date:** [May 31, 2023, 11:23am UTC](https://discuss.elastic.co/t/add-query-parameter-level-to-the-indicesstatsrequest-using-the-7-17-transport-client/334782/3 "2023-05-31T11:23:38Z")

</div>

Thank you David for clarifying. It was driving me crazy to not find the option. Now, I have the confirmation though.

Just FYI, we are in the progress of migrating to the http client, but sadly it's not so easy, given a lot of the interfaces changed or do not exist anymore 😕

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 28, 2023, 11:24am UTC](https://discuss.elastic.co/t/add-query-parameter-level-to-the-indicesstatsrequest-using-the-7-17-transport-client/334782/4 "2023-06-28T11:24:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
