@tsuga/cli 1.136.0 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -9
- package/dist/cli.js +89 -89
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -188,15 +188,25 @@ tsuga teams create -d '{"name": "platform", "visibility": "public"}'
|
|
|
188
188
|
tsuga monitors list --limit 500
|
|
189
189
|
tsuga monitors list --limit 500 --offset 500
|
|
190
190
|
|
|
191
|
-
# Follow every page and print one
|
|
191
|
+
# Follow every page and print all items as one page
|
|
192
192
|
tsuga monitors list --all
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
pure JSON, so `| jq` and `-o csv` are unaffected:
|
|
195
|
+
Every command prints the API response as the API returns it: the payload under `data`, and for a paginated command the pagination metadata beside it, so a truncated list is visible in the JSON itself. `--fields` projects the payload under `data`, item by item for a collection:
|
|
197
196
|
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"data": [{"id": "mon-1", "name": "API latency"}],
|
|
200
|
+
"metadata": {"pagination": {"totalCount": 4212, "pageCount": 43}}
|
|
201
|
+
}
|
|
198
202
|
```
|
|
199
|
-
|
|
203
|
+
|
|
204
|
+
`totalCount` is the number of items matching the query and `pageCount` the number of pages for the requested `--limit`. The next page starts at `--offset` plus the number of items in `data`. With `--all`, `data` holds every item and `pageCount` is `1`.
|
|
205
|
+
|
|
206
|
+
When a page leaves items behind, the CLI also prints a notice to **stderr** with the command for the next page, filters included. It is the only truncation signal for tabular output (`-o csv`, `-o tsv`):
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
Showing 100 of 4212 (offset 0). Next page: tsuga monitors list --limit 100 --offset 100
|
|
200
210
|
```
|
|
201
211
|
|
|
202
212
|
For resources with server-side filters, narrowing the query beats paging through everything.
|
|
@@ -218,8 +228,8 @@ For resources with server-side filters, narrowing the query beats paging through
|
|
|
218
228
|
```bash
|
|
219
229
|
tsuga public-tokens create --generate-skeleton > app.json
|
|
220
230
|
# edit app.json
|
|
221
|
-
tsuga public-tokens create -f app.json | jq -r .token
|
|
222
|
-
tsuga public-tokens list | jq -r '.[0].token'
|
|
231
|
+
tsuga public-tokens create -f app.json | jq -r .data.token
|
|
232
|
+
tsuga public-tokens list | jq -r '.data[0].token'
|
|
223
233
|
```
|
|
224
234
|
|
|
225
235
|
### Generating a request skeleton
|
|
@@ -264,7 +274,7 @@ tsuga logs search --from 1704067200 --to 1704153600 --query 'context.service.nam
|
|
|
264
274
|
```
|
|
265
275
|
|
|
266
276
|
```bash
|
|
267
|
-
#
|
|
277
|
+
# Logs under `data`, each projected to selected fields (preserves nested objects)
|
|
268
278
|
tsuga logs search --from=-10m \
|
|
269
279
|
--fields timestamp,level,message,context.k8s.pod.name
|
|
270
280
|
|
|
@@ -524,8 +534,8 @@ tsuga feedback the traces command keeps timing out on large services
|
|
|
524
534
|
Default output is JSON, so you can pipe to `jq`:
|
|
525
535
|
|
|
526
536
|
```bash
|
|
527
|
-
tsuga dashboards list | jq '.[].name'
|
|
528
|
-
tsuga monitors list | jq '.[] | select(.priority == 1)'
|
|
537
|
+
tsuga dashboards list | jq '.data[].name'
|
|
538
|
+
tsuga monitors list | jq '.data[] | select(.priority == 1)'
|
|
529
539
|
```
|
|
530
540
|
|
|
531
541
|
Read from stdin with `-f -`:
|