@@ -110,74 +110,7 @@ curl --request GET \
110110 --header ' accept: application/json'
111111```
112112
113- ### Detailed Cluster and VM Usage
114- Depending on the type of information you are looking for you can use the
115- following endpoints to obtain active and historical CMX usage information.
116- Each of these endpoints supports pagination and filtering. You can use the
117- following query parameters to filter the results:
118-
119- - ** Pagination:** Use the ` pageSize ` and ` currentPage ` query parameters to
120- paginate through the results:
121-
122- ``` shell
123- curl --request GET \
124- --url ' https://api.replicated.com/vendor/v3/cmx/history?pageSize=10¤tPage=1' \
125- --header ' Authorization: $REPLICATED_API_TOKEN' \
126- --header ' accept: application/json'
127- ```
128-
129- - ** Filter by date:** Use the ` start-time ` and ` end-time ` query parameters to
130- filter the results by a specific date range:
131-
132- ``` shell
133- curl --request GET \
134- --url ' https://api.replicated.com/vendor/v3/cmx/history?start-time=2025-01-01T00:00:00Z&end-time=2025-01-31T23:59:59Z' \
135- --header ' Authorization: $REPLICATED_API_TOKEN' \
136- --header ' accept: application/json'
137- ```
138-
139- - ** Sort by:** Use the ` tag-sort-key ` query parameter to sort the results by a
140- specific field. The field can be any of the fields returned in the response.
141- - By default the results are sorted in ascending order, use
142- ` sortDesc=true ` to sort in descending order:
143-
144- ``` shell
145- curl --request GET \
146- --url ' https://api.replicated.com/vendor/v3/cmx/history?tag-sort-key=created_at&sortDesc=true' \
147- --header ' Authorization: $REPLICATED_API_TOKEN' \
148- --header ' accept: application/json'
149- ```
150-
151- - ** Tag filters:** Use the ` tag-filter ` query parameter to filter the results by
152- a specific tag:
153-
154- ``` shell
155- curl --request GET \
156- --url ' https://api.replicated.com/vendor/v3/cmx/history?tag-filter=tag1' \
157- --header ' Authorization: $REPLICATED_API_TOKEN' \
158- --header ' accept: application/json'
159- ```
160-
161- - ** Actor filters:** Use the ` actor-filter ` query parameter to filter the actor
162- that created the resource, or the type of actor such as ` Web UI ` or
163- ` Replicated CLI ` :
164-
165- ``` shell
166- curl --request GET \
167- --url ' https://api.replicated.com/vendor/v3/cmx/history?actor-filter=name' \
168- --header ' Authorization: $REPLICATED_API_TOKEN' \
169- --header ' accept: application/json'
170- ```
171-
172-
173- ::: note
174- If any filter is passed for an object that does not exist, no warning is given.
175- For example, if you filter by ` actor-filter=name ` and there are no results
176- the response will be empty.
177- :::
178-
179-
180- #### Currently Active Clusters
113+ ### Currently Active Clusters
181114To get a list of currently active clusters, the ` /v3/clusters ` endpoint can be
182115used:
183116
@@ -255,3 +188,73 @@ curl --request GET \
255188 --header ' Authorization: $REPLICATED_API_TOKEN' \
256189 --header ' accept: application/json'
257190```
191+
192+ ### Filtering Endpoint Results
193+ Depending on the type of information you are looking for you can use the
194+ following endpoints to obtain active and historical CMX usage information.
195+ Each of these endpoints supports pagination and filtering. You can use the
196+ following query parameters to filter the results. Each of the examples below
197+ uses the ` v3/cmx/history ` endpoint, but the same query parameters can be used
198+ with the other endpoints as well.
199+
200+ - ** Pagination:** Use the ` pageSize ` and ` currentPage ` query parameters to
201+ paginate through the results:
202+
203+ ``` shell
204+ curl --request GET \
205+ --url ' https://api.replicated.com/vendor/v3/cmx/history?pageSize=10¤tPage=1' \
206+ --header ' Authorization: $REPLICATED_API_TOKEN' \
207+ --header ' accept: application/json'
208+ ```
209+
210+ - ** Filter by date:** Use the ` start-time ` and ` end-time ` query parameters to
211+ filter the results by a specific date range:
212+
213+ ``` shell
214+ curl --request GET \
215+ --url ' https://api.replicated.com/vendor/v3/cmx/history?start-time=2025-01-01T00:00:00Z&end-time=2025-01-31T23:59:59Z' \
216+ --header ' Authorization: $REPLICATED_API_TOKEN' \
217+ --header ' accept: application/json'
218+ ```
219+
220+ - ** Sort by:** Use the ` tag-sort-key ` query parameter to sort the results by a
221+ specific field. The field can be any of the fields returned in the response.
222+ - By default the results are sorted in ascending order, use
223+ ` sortDesc=true ` to sort in descending order:
224+
225+ ``` shell
226+ curl --request GET \
227+ --url ' https://api.replicated.com/vendor/v3/cmx/history?tag-sort-key=created_at&sortDesc=true' \
228+ --header ' Authorization: $REPLICATED_API_TOKEN' \
229+ --header ' accept: application/json'
230+ ```
231+
232+ - ** Tag filters:** Use the ` tag-filter ` query parameter to filter the results by
233+ a specific tag:
234+
235+ ``` shell
236+ curl --request GET \
237+ --url ' https://api.replicated.com/vendor/v3/cmx/history?tag-filter=tag1' \
238+ --header ' Authorization: $REPLICATED_API_TOKEN' \
239+ --header ' accept: application/json'
240+ ```
241+
242+ - ** Actor filters:** Use the ` actor-filter ` query parameter to filter the actor
243+ that created the resource, or the type of actor such as ` Web UI ` or
244+ ` Replicated CLI ` :
245+
246+ ``` shell
247+ curl --request GET \
248+ --url ' https://api.replicated.com/vendor/v3/cmx/history?actor-filter=name' \
249+ --header ' Authorization: $REPLICATED_API_TOKEN' \
250+ --header ' accept: application/json'
251+ ```
252+
253+
254+ ::: note
255+ If any filter is passed for an object that does not exist, no warning is given.
256+ For example, if you filter by ` actor-filter=name ` and there are no results
257+ the response will be empty.
258+ :::
259+
260+
0 commit comments