vortex-cli 8.3.0__tar.gz → 8.4.1__tar.gz

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.
Files changed (61) hide show
  1. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/PKG-INFO +31 -6
  2. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/README.md +30 -5
  3. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/pyproject.toml +1 -1
  4. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/clone.py +44 -2
  5. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/stats.py +70 -10
  6. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/webdesign.py +24 -0
  7. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex_cli.egg-info/PKG-INFO +31 -6
  8. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/LICENSE +0 -0
  9. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/setup.cfg +0 -0
  10. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/__init__.py +0 -0
  11. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/__main__.py +0 -0
  12. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/cli.py +0 -0
  13. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/colour.py +0 -0
  14. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/__init__.py +0 -0
  15. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/agenda.py +0 -0
  16. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/app.py +0 -0
  17. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/clean.py +0 -0
  18. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/code.py +0 -0
  19. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/compile.py +0 -0
  20. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/db.py +0 -0
  21. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/diff.py +0 -0
  22. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/docs.py +0 -0
  23. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/execute.py +0 -0
  24. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/fetch.py +0 -0
  25. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/file.py +0 -0
  26. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/info.py +0 -0
  27. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/keyword.py +0 -0
  28. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/libs.py +0 -0
  29. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/log.py +0 -0
  30. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/object_.py +0 -0
  31. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/pull.py +0 -0
  32. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/search.py +0 -0
  33. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/servers.py +0 -0
  34. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/use.py +0 -0
  35. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/watch.py +0 -0
  36. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/commands/weblog.py +0 -0
  37. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/constants.py +0 -0
  38. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/docs/Blackbook v2.md +0 -0
  39. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/docs/Blackbook.pdf +0 -0
  40. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/docs/index.html +0 -0
  41. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/docs/marked.min.js +0 -0
  42. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/git.py +0 -0
  43. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/lib/puakma-6.0.40.jar +0 -0
  44. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/libs.py +0 -0
  45. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/logging.py +0 -0
  46. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/main.py +0 -0
  47. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/models.py +0 -0
  48. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/output.py +0 -0
  49. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/registry.py +0 -0
  50. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/schedule.py +0 -0
  51. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/server_options.py +0 -0
  52. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/soap.py +0 -0
  53. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/spinner.py +0 -0
  54. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/sync.py +0 -0
  55. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/util.py +0 -0
  56. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex/workspace.py +0 -0
  57. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex_cli.egg-info/SOURCES.txt +0 -0
  58. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex_cli.egg-info/dependency_links.txt +0 -0
  59. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex_cli.egg-info/entry_points.txt +0 -0
  60. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex_cli.egg-info/requires.txt +0 -0
  61. {vortex_cli-8.3.0 → vortex_cli-8.4.1}/vortex_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vortex_cli
3
- Version: 8.3.0
3
+ Version: 8.4.1
4
4
  Summary: Vortex CLI
5
5
  Author-email: Jordan Amos <jordan.amos@gmail.com>
6
6
  License: MIT License
@@ -106,6 +106,17 @@ While it is possible to use without it, this software has been purposefully desi
106
106
  java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
107
107
  ```
108
108
 
109
+ ## Upgrading to 8.4
110
+
111
+ - **`vortex stats` shows the server's disk space** after the statistics: each mounted local
112
+ filesystem's size, used and available space and Use%, as `df -h` shows them, with the
113
+ Puakma root's disk marked (see [Server statistics](#server-statistics)); `--json` adds them
114
+ as `disks`. It needs vortex/gateway 0.3.0, which adds them to `GET stats`; with an older
115
+ gateway the overview says so in one line.
116
+ - **8.4.1: `vortex clone` ignores case in a TemplateName or `group/name`.** `vortex clone
117
+ ui20complete/mastercustom` clones `ui20Complete/MasterCustom`; the name must still match in
118
+ full. If two applications differ only in case, the one typed exactly wins.
119
+
109
120
  ## Upgrading to 8.3
110
121
 
111
122
  - **`vortex weblog`** reads the server's HTTP access log (`HTTPTextLog`) through the gateway:
@@ -579,7 +590,8 @@ vortex weblog -k -n 0 only lines written from now on
579
590
 
580
591
  `vortex stats` is a health check from the terminal: the time series each loaded addin keeps
581
592
  in memory (the admin app's performance chart), through the gateway's `GET stats`
582
- (`GatewaySystem`). One request per run, one row per statistic:
593
+ (`GatewaySystem`), then the server's disk space. One request per run, one row per statistic
594
+ and per disk:
583
595
 
584
596
  ```
585
597
  $ vortex stats -s dev
@@ -593,6 +605,10 @@ http.bytesouttotal 83.1M
593
605
  http.hitsperminute 27 13 22.2 176 61m ▁▁▂▁▆▃▁▁▁▁▁▂▁▁█▁▁▅▅▅
594
606
  ...
595
607
 
608
+ Disk Size Used Avail Use% Type
609
+ --------------------- ------ ------ ------- ------ ------
610
+ /puakma (Puakma root) 24G 17G 7.3G 70% ext4
611
+
596
612
  vortex stats --addin HTTP one addin (a short name, or its class name)
597
613
  vortex stats --key stats.cpuusageperminute
598
614
  vortex stats -k poll every 5 seconds and reprint (^C stops)
@@ -606,13 +622,21 @@ vortex stats -k poll every 5 seconds and reprint (^C stops)
606
622
  - **In memory only.** The server keeps a limited window (about the last hour of a
607
623
  per-minute statistic) and starts again on a restart, so a short `Span` means a recent
608
624
  restart.
625
+ - **Disks** (gateway 0.3.0). Every mounted local filesystem the server's JVM sees, read when
626
+ the request is answered, as `df -h` shows them: `Used` is size minus free, `Avail` what a
627
+ non-root user can still write, `Use%` used / (used + avail). The disk holding the Puakma
628
+ root is marked. One disk seen through several mounts (a container's overlay root over its
629
+ host disk) is listed once; memory, kernel, read-only and network filesystems are left out.
630
+ No history - the gateway keeps none. `--addin` and `--key` narrow the request to statistics,
631
+ so they show no disks; an older gateway sends none, which the overview says once.
609
632
  - **`-k`** re-polls every `-d` seconds (default 5) and reprints, clearing the screen when the
610
633
  output is a terminal.
611
634
  - **`--json`**: `data` is the addins as the gateway sends them, every key present -
612
635
  `[{name, class, statistics: [{key, captureType, created, lastUpdated, entries: [{from, to,
613
636
  value}]}]}]` (`captureType`: `once`, `per-second`, `per-minute`, `per-hour`, `per-day`; a
614
- `once` entry has no `from`/`to`) - and `time` (the server's clock) beside it. With `-k`, one
615
- envelope per poll, one per line.
637
+ `once` entry has no `from`/`to`) - and `time` (the server's clock) beside it, and `disks`
638
+ when the gateway sent them (`[{mount, name, type, totalBytes, usableBytes, freeBytes,
639
+ usedPct, puakmaRoot}]`). With `-k`, one envelope per poll, one per line.
616
640
  - **Refusals.** `NOT_FOUND`: no addin of that name is loaded (`vortex stats` lists them).
617
641
  `NOT_EXPOSED`: the gateway predates `GET stats` - update `vortex/gateway`. A blank
618
642
  `gateway_path` is refused before anything is sent.
@@ -885,8 +909,9 @@ outright is always cloned. Groups are matched the way `app list --group` matches
885
909
  case-insensitive substring - except that an exact group name always wins, so cloning
886
910
  `BetTrackr` never drags in `BetTrackrLegacy`. If a partial name still spans several groups,
887
911
  vortex stops and lists them. A bare word that is genuinely both a TemplateName and a group
888
- is refused: use `--group NAME` or the ID. References may be qualified as `SERVER:REF`
889
- (`dev:BetTrackr`).
912
+ is refused: use `--group NAME` or the ID. A TemplateName or `group/name` must match in full but
913
+ ignores case; if two applications differ only in case, the one typed exactly wins. References
914
+ may be qualified as `SERVER:REF` (`dev:BetTrackr`).
890
915
 
891
916
  ### Working with Multiple Servers
892
917
 
@@ -62,6 +62,17 @@ While it is possible to use without it, this software has been purposefully desi
62
62
  java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
63
63
  ```
64
64
 
65
+ ## Upgrading to 8.4
66
+
67
+ - **`vortex stats` shows the server's disk space** after the statistics: each mounted local
68
+ filesystem's size, used and available space and Use%, as `df -h` shows them, with the
69
+ Puakma root's disk marked (see [Server statistics](#server-statistics)); `--json` adds them
70
+ as `disks`. It needs vortex/gateway 0.3.0, which adds them to `GET stats`; with an older
71
+ gateway the overview says so in one line.
72
+ - **8.4.1: `vortex clone` ignores case in a TemplateName or `group/name`.** `vortex clone
73
+ ui20complete/mastercustom` clones `ui20Complete/MasterCustom`; the name must still match in
74
+ full. If two applications differ only in case, the one typed exactly wins.
75
+
65
76
  ## Upgrading to 8.3
66
77
 
67
78
  - **`vortex weblog`** reads the server's HTTP access log (`HTTPTextLog`) through the gateway:
@@ -535,7 +546,8 @@ vortex weblog -k -n 0 only lines written from now on
535
546
 
536
547
  `vortex stats` is a health check from the terminal: the time series each loaded addin keeps
537
548
  in memory (the admin app's performance chart), through the gateway's `GET stats`
538
- (`GatewaySystem`). One request per run, one row per statistic:
549
+ (`GatewaySystem`), then the server's disk space. One request per run, one row per statistic
550
+ and per disk:
539
551
 
540
552
  ```
541
553
  $ vortex stats -s dev
@@ -549,6 +561,10 @@ http.bytesouttotal 83.1M
549
561
  http.hitsperminute 27 13 22.2 176 61m ▁▁▂▁▆▃▁▁▁▁▁▂▁▁█▁▁▅▅▅
550
562
  ...
551
563
 
564
+ Disk Size Used Avail Use% Type
565
+ --------------------- ------ ------ ------- ------ ------
566
+ /puakma (Puakma root) 24G 17G 7.3G 70% ext4
567
+
552
568
  vortex stats --addin HTTP one addin (a short name, or its class name)
553
569
  vortex stats --key stats.cpuusageperminute
554
570
  vortex stats -k poll every 5 seconds and reprint (^C stops)
@@ -562,13 +578,21 @@ vortex stats -k poll every 5 seconds and reprint (^C stops)
562
578
  - **In memory only.** The server keeps a limited window (about the last hour of a
563
579
  per-minute statistic) and starts again on a restart, so a short `Span` means a recent
564
580
  restart.
581
+ - **Disks** (gateway 0.3.0). Every mounted local filesystem the server's JVM sees, read when
582
+ the request is answered, as `df -h` shows them: `Used` is size minus free, `Avail` what a
583
+ non-root user can still write, `Use%` used / (used + avail). The disk holding the Puakma
584
+ root is marked. One disk seen through several mounts (a container's overlay root over its
585
+ host disk) is listed once; memory, kernel, read-only and network filesystems are left out.
586
+ No history - the gateway keeps none. `--addin` and `--key` narrow the request to statistics,
587
+ so they show no disks; an older gateway sends none, which the overview says once.
565
588
  - **`-k`** re-polls every `-d` seconds (default 5) and reprints, clearing the screen when the
566
589
  output is a terminal.
567
590
  - **`--json`**: `data` is the addins as the gateway sends them, every key present -
568
591
  `[{name, class, statistics: [{key, captureType, created, lastUpdated, entries: [{from, to,
569
592
  value}]}]}]` (`captureType`: `once`, `per-second`, `per-minute`, `per-hour`, `per-day`; a
570
- `once` entry has no `from`/`to`) - and `time` (the server's clock) beside it. With `-k`, one
571
- envelope per poll, one per line.
593
+ `once` entry has no `from`/`to`) - and `time` (the server's clock) beside it, and `disks`
594
+ when the gateway sent them (`[{mount, name, type, totalBytes, usableBytes, freeBytes,
595
+ usedPct, puakmaRoot}]`). With `-k`, one envelope per poll, one per line.
572
596
  - **Refusals.** `NOT_FOUND`: no addin of that name is loaded (`vortex stats` lists them).
573
597
  `NOT_EXPOSED`: the gateway predates `GET stats` - update `vortex/gateway`. A blank
574
598
  `gateway_path` is refused before anything is sent.
@@ -841,8 +865,9 @@ outright is always cloned. Groups are matched the way `app list --group` matches
841
865
  case-insensitive substring - except that an exact group name always wins, so cloning
842
866
  `BetTrackr` never drags in `BetTrackrLegacy`. If a partial name still spans several groups,
843
867
  vortex stops and lists them. A bare word that is genuinely both a TemplateName and a group
844
- is refused: use `--group NAME` or the ID. References may be qualified as `SERVER:REF`
845
- (`dev:BetTrackr`).
868
+ is refused: use `--group NAME` or the ID. A TemplateName or `group/name` must match in full but
869
+ ignores case; if two applications differ only in case, the one typed exactly wins. References
870
+ may be qualified as `SERVER:REF` (`dev:BetTrackr`).
846
871
 
847
872
  ### Working with Multiple Servers
848
873
 
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "vortex_cli"
8
- version = "8.3.0"
8
+ version = "8.4.1"
9
9
  description = "Vortex CLI"
10
10
  requires-python = ">=3.10"
11
11
  readme = { file = "README.md", content-type = "text/markdown" }
@@ -288,6 +288,46 @@ def _fetch_apps(
288
288
  )
289
289
 
290
290
 
291
+ def _fetch_exact_apps(
292
+ server: PuakmaServer,
293
+ *,
294
+ name: str | None = None,
295
+ group: str | None = None,
296
+ template: str | None = None,
297
+ ) -> list[PuakmaApplication]:
298
+ """
299
+ Applications whose name, group and TemplateName equal the given
300
+ values, ignoring case - 'ui20complete/mastercustom' finds
301
+ 'ui20Complete/MasterCustom'. Should the server have applications
302
+ differing only in case, the exact-case match wins. A named
303
+ application is always looked up in full, inherited ones included.
304
+ """
305
+
306
+ def equal(app: PuakmaApplication, fold: bool) -> bool:
307
+ def eq(actual: str | None, want: str | None) -> bool:
308
+ if want is None:
309
+ return True
310
+ actual = actual or ""
311
+ return actual.casefold() == want.casefold() if fold else actual == want
312
+
313
+ return (
314
+ eq(app.name, name)
315
+ and eq(app.group, group)
316
+ and eq(app.template_name, template)
317
+ )
318
+
319
+ def wanted(value: str | None) -> list[str]:
320
+ return [value] if value is not None else []
321
+
322
+ # The non-strict filter is a case-insensitive substring match, so it
323
+ # narrows the inventory without losing any case-insensitive equal
324
+ apps = _fetch_apps(server, wanted(name), wanted(group), wanted(template), False)
325
+ matches = [app for app in apps if equal(app, True)]
326
+ if len(matches) > 1:
327
+ return [app for app in matches if equal(app, False)] or matches
328
+ return matches
329
+
330
+
291
331
  def _resolve_one(
292
332
  server: PuakmaServer, matches: list[PuakmaApplication], desc: str
293
333
  ) -> list[int] | None:
@@ -378,7 +418,7 @@ def _resolve_bare_word(
378
418
  '--group' clones the group. A TemplateName names one application,
379
419
  so it is looked up in full; the group expansion honours include_all.
380
420
  """
381
- templates = _fetch_apps(server, [], [], [word], True)
421
+ templates = _fetch_exact_apps(server, template=word)
382
422
  group_apps = _fetch_group_apps(server, word, include_all)
383
423
  if templates and group_apps:
384
424
  logger.error(
@@ -414,7 +454,9 @@ def _resolve_refs_to_ids(
414
454
  elif ref.template is not None:
415
455
  resolved = _resolve_bare_word(server, ref.template, include_all)
416
456
  else:
417
- matches = _fetch_apps(server, [ref.name or ""], [ref.group or ""], [], True)
457
+ matches = _fetch_exact_apps(
458
+ server, name=ref.name or "", group=ref.group or ""
459
+ )
418
460
  resolved = _resolve_one(
419
461
  server, matches, f"application '{ref.group}/{ref.name}'"
420
462
  )
@@ -7,11 +7,15 @@ admin app's performance chart (CPU, memory, threads, errors, logins, HTTP
7
7
  hits and bytes, agenda actions, mail). One row per statistic: its value
8
8
  now (the period still filling), the min/avg/max over the periods that
9
9
  have ended, how far back the series goes, and a sparkline of its last
10
- points.
10
+ points. Then the server's disks: each mounted filesystem's size, used
11
+ and available space and Use% (as df shows them), the Puakma root's
12
+ marked - a gateway older than 0.3.0 sends none.
11
13
 
12
14
  --json: one envelope whose data is the addins - [{name, class,
13
15
  statistics: [{key, captureType, created, lastUpdated, entries: [{from,
14
- to, value}]}]}] - with the server's time beside it ("time"). With
16
+ to, value}]}]}] - with the server's time beside it ("time") and, when
17
+ the gateway sent them, the disks ("disks": [{mount, name, type,
18
+ totalBytes, usableBytes, freeBytes, usedPct, puakmaRoot}]). With
15
19
  --keep-alive it never ends, so it prints one envelope per poll, one per
16
20
  line, flushed; a failure ends it with an {"ok": false} line.
17
21
 
@@ -59,6 +63,8 @@ _SPARK = "▁▂▃▄▅▆▇█"
59
63
  # The points the sparkline shows (the newest)
60
64
  _SPARK_POINTS = 20
61
65
  _DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
66
+ # The gateway version that added disks to GET stats
67
+ _DISKS_GATEWAY = "0.3.0"
62
68
 
63
69
 
64
70
  def _command_error(e: WebDesignError | WebDesignUnavailable) -> CommandError:
@@ -91,7 +97,7 @@ def stats(
91
97
  return fail(_command_error(e))
92
98
  if keep_alive:
93
99
  return _poll(client, reply, addin, key, delay, json_output, fail)
94
- _show(s.name, reply, key, json_output)
100
+ _show(s.name, reply, addin, key, json_output)
95
101
  return 0
96
102
 
97
103
 
@@ -124,7 +130,7 @@ def _poll(
124
130
  elif not first and not json_output:
125
131
  print()
126
132
  first = False
127
- _show(name, reply, key, json_output)
133
+ _show(name, reply, addin, key, json_output)
128
134
  sys.stdout.flush()
129
135
  # the spinner only runs while waiting, never over the table
130
136
  with waiting:
@@ -138,29 +144,70 @@ def _poll(
138
144
 
139
145
 
140
146
  def _show(
141
- server_name: str, reply: dict[str, Any], key: str | None, json_output: bool
147
+ server_name: str,
148
+ reply: dict[str, Any],
149
+ addin: str | None,
150
+ key: str | None,
151
+ json_output: bool,
142
152
  ) -> None:
153
+ disks = reply.get("disks")
143
154
  if json_output:
144
- emit_json(envelope(server_name, reply["addins"], extra={"time": reply["time"]}))
155
+ extra: dict[str, Any] = {"time": reply["time"]}
156
+ if disks is not None:
157
+ extra["disks"] = disks
158
+ emit_json(envelope(server_name, reply["addins"], extra=extra))
145
159
  return
146
160
  addins = reply["addins"]
147
161
  names = ", ".join(a["name"] for a in addins)
148
162
  print(f"{server_name} at {reply['time'] or '?'} - addins: {names or 'none'}")
149
163
  now = _date(reply["time"])
150
164
  rows = [_row(stat, now) for a in addins for stat in a["statistics"]]
151
- if not rows:
165
+ if rows:
166
+ print(
167
+ tabulate.tabulate(
168
+ rows,
169
+ headers=("Statistic", "Now", "Min", "Avg", "Max", "Span", "Trend"),
170
+ colalign=("left", "right", "right", "right", "right", "right", "left"),
171
+ disable_numparse=True,
172
+ )
173
+ )
174
+ else:
152
175
  sys.stdout.flush()
153
176
  logger.info(
154
177
  f"No statistic '{key}' - 'vortex stats' lists them"
155
178
  if key
156
179
  else "The loaded addins keep no statistics"
157
180
  )
158
- return
181
+ if disks:
182
+ print()
183
+ _show_disks(disks)
184
+ elif disks is None and not addin and not key:
185
+ # the gateway leaves disks out of a narrowed request; a whole one
186
+ # without them came from a gateway that predates them
187
+ sys.stdout.flush()
188
+ logger.info(
189
+ f"No disk space: it needs vortex/gateway {_DISKS_GATEWAY} - update it"
190
+ )
191
+
192
+
193
+ def _show_disks(disks: list[dict[str, Any]]) -> None:
194
+ """One row per filesystem, df -h style; the Puakma root's marked."""
195
+ rows = [
196
+ (
197
+ d["mount"] + (" (Puakma root)" if d["puakmaRoot"] else ""),
198
+ _bytes(d["totalBytes"]),
199
+ _bytes(max(0, d["totalBytes"] - d["freeBytes"])),
200
+ _bytes(d["usableBytes"]),
201
+ f"{d['usedPct']:.0f}%",
202
+ d["type"],
203
+ )
204
+ for d in disks
205
+ ]
159
206
  print(
160
207
  tabulate.tabulate(
161
208
  rows,
162
- headers=("Statistic", "Now", "Min", "Avg", "Max", "Span", "Trend"),
163
- colalign=("left", "right", "right", "right", "right", "right", "left"),
209
+ headers=("Disk", "Size", "Used", "Avail", "Use%", "Type"),
210
+ colalign=("left", "right", "right", "right", "right", "left"),
164
211
  disable_numparse=True,
165
212
  )
166
213
  )
@@ -224,6 +271,19 @@ def _number(value: float) -> str:
224
271
  return text + suffix
225
272
 
226
273
 
274
+ def _bytes(size: int) -> str:
275
+ """Binary units as df -h prints them: 512B, 4.2G, 98G, 1.8T."""
276
+ if size < 1024:
277
+ return f"{size}B"
278
+ value = float(size)
279
+ for unit in ("K", "M", "G", "T"):
280
+ value /= 1024
281
+ # decided on the rounded figure: 1023.6M reads 1.0G, not 1024M
282
+ if round(value) < 1024 or unit == "T":
283
+ break
284
+ return f"{value:.1f}{unit}" if round(value, 1) < 10 else f"{value:.0f}{unit}"
285
+
286
+
227
287
  def _span(entries: list[dict[str, Any]]) -> str:
228
288
  """How far back the series goes: the first entry's start to the last one's end."""
229
289
  start, end = _date(entries[0]["from"]), _date(entries[-1]["to"])
@@ -791,6 +791,20 @@ class WhoAmI(NamedTuple):
791
791
  routes: list[dict[str, Any]] = [] # noqa: RUF012
792
792
 
793
793
 
794
+ def _disk(disk: dict[str, Any]) -> dict[str, Any]:
795
+ """One filesystem of a GET stats reply's disks, every key present."""
796
+ return {
797
+ "mount": str(disk["mount"]),
798
+ "name": str(disk.get("name") or ""),
799
+ "type": str(disk.get("type") or ""),
800
+ "totalBytes": int(disk["totalBytes"]),
801
+ "usableBytes": int(disk["usableBytes"]),
802
+ "freeBytes": int(disk["freeBytes"]),
803
+ "usedPct": float(disk["usedPct"]),
804
+ "puakmaRoot": bool(disk.get("puakmaRoot", False)),
805
+ }
806
+
807
+
794
808
  def _statistic(stat: dict[str, Any]) -> dict[str, Any]:
795
809
  """One statistic of a GET stats reply, every key present."""
796
810
 
@@ -1059,6 +1073,11 @@ class GatewayClient(WebDesignClient):
1059
1073
  addin (a short name like HTTP, or the class name) narrows it to one
1060
1074
  addin - an unknown one is NOT_FOUND; key to one statistic. A
1061
1075
  "once" statistic's single entry has no from/to (None here).
1076
+
1077
+ disks: the server's mounted filesystems now - [{mount, name, type,
1078
+ totalBytes, usableBytes, freeBytes, usedPct, puakmaRoot}] - which
1079
+ gateway 0.3.0 adds when neither addin nor key is given; None when
1080
+ the reply has none (an older gateway, or a narrowed request).
1062
1081
  """
1063
1082
  self._require_gateway("'vortex stats'")
1064
1083
  params: dict[str, Any] = {}
@@ -1078,6 +1097,11 @@ class GatewayClient(WebDesignClient):
1078
1097
  }
1079
1098
  for a in reply["addins"]
1080
1099
  ],
1100
+ "disks": (
1101
+ None
1102
+ if reply.get("disks") is None
1103
+ else [_disk(d) for d in reply["disks"]]
1104
+ ),
1081
1105
  }
1082
1106
  except (KeyError, TypeError, ValueError, AttributeError) as e:
1083
1107
  raise WebDesignUnavailable(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vortex_cli
3
- Version: 8.3.0
3
+ Version: 8.4.1
4
4
  Summary: Vortex CLI
5
5
  Author-email: Jordan Amos <jordan.amos@gmail.com>
6
6
  License: MIT License
@@ -106,6 +106,17 @@ While it is possible to use without it, this software has been purposefully desi
106
106
  java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
107
107
  ```
108
108
 
109
+ ## Upgrading to 8.4
110
+
111
+ - **`vortex stats` shows the server's disk space** after the statistics: each mounted local
112
+ filesystem's size, used and available space and Use%, as `df -h` shows them, with the
113
+ Puakma root's disk marked (see [Server statistics](#server-statistics)); `--json` adds them
114
+ as `disks`. It needs vortex/gateway 0.3.0, which adds them to `GET stats`; with an older
115
+ gateway the overview says so in one line.
116
+ - **8.4.1: `vortex clone` ignores case in a TemplateName or `group/name`.** `vortex clone
117
+ ui20complete/mastercustom` clones `ui20Complete/MasterCustom`; the name must still match in
118
+ full. If two applications differ only in case, the one typed exactly wins.
119
+
109
120
  ## Upgrading to 8.3
110
121
 
111
122
  - **`vortex weblog`** reads the server's HTTP access log (`HTTPTextLog`) through the gateway:
@@ -579,7 +590,8 @@ vortex weblog -k -n 0 only lines written from now on
579
590
 
580
591
  `vortex stats` is a health check from the terminal: the time series each loaded addin keeps
581
592
  in memory (the admin app's performance chart), through the gateway's `GET stats`
582
- (`GatewaySystem`). One request per run, one row per statistic:
593
+ (`GatewaySystem`), then the server's disk space. One request per run, one row per statistic
594
+ and per disk:
583
595
 
584
596
  ```
585
597
  $ vortex stats -s dev
@@ -593,6 +605,10 @@ http.bytesouttotal 83.1M
593
605
  http.hitsperminute 27 13 22.2 176 61m ▁▁▂▁▆▃▁▁▁▁▁▂▁▁█▁▁▅▅▅
594
606
  ...
595
607
 
608
+ Disk Size Used Avail Use% Type
609
+ --------------------- ------ ------ ------- ------ ------
610
+ /puakma (Puakma root) 24G 17G 7.3G 70% ext4
611
+
596
612
  vortex stats --addin HTTP one addin (a short name, or its class name)
597
613
  vortex stats --key stats.cpuusageperminute
598
614
  vortex stats -k poll every 5 seconds and reprint (^C stops)
@@ -606,13 +622,21 @@ vortex stats -k poll every 5 seconds and reprint (^C stops)
606
622
  - **In memory only.** The server keeps a limited window (about the last hour of a
607
623
  per-minute statistic) and starts again on a restart, so a short `Span` means a recent
608
624
  restart.
625
+ - **Disks** (gateway 0.3.0). Every mounted local filesystem the server's JVM sees, read when
626
+ the request is answered, as `df -h` shows them: `Used` is size minus free, `Avail` what a
627
+ non-root user can still write, `Use%` used / (used + avail). The disk holding the Puakma
628
+ root is marked. One disk seen through several mounts (a container's overlay root over its
629
+ host disk) is listed once; memory, kernel, read-only and network filesystems are left out.
630
+ No history - the gateway keeps none. `--addin` and `--key` narrow the request to statistics,
631
+ so they show no disks; an older gateway sends none, which the overview says once.
609
632
  - **`-k`** re-polls every `-d` seconds (default 5) and reprints, clearing the screen when the
610
633
  output is a terminal.
611
634
  - **`--json`**: `data` is the addins as the gateway sends them, every key present -
612
635
  `[{name, class, statistics: [{key, captureType, created, lastUpdated, entries: [{from, to,
613
636
  value}]}]}]` (`captureType`: `once`, `per-second`, `per-minute`, `per-hour`, `per-day`; a
614
- `once` entry has no `from`/`to`) - and `time` (the server's clock) beside it. With `-k`, one
615
- envelope per poll, one per line.
637
+ `once` entry has no `from`/`to`) - and `time` (the server's clock) beside it, and `disks`
638
+ when the gateway sent them (`[{mount, name, type, totalBytes, usableBytes, freeBytes,
639
+ usedPct, puakmaRoot}]`). With `-k`, one envelope per poll, one per line.
616
640
  - **Refusals.** `NOT_FOUND`: no addin of that name is loaded (`vortex stats` lists them).
617
641
  `NOT_EXPOSED`: the gateway predates `GET stats` - update `vortex/gateway`. A blank
618
642
  `gateway_path` is refused before anything is sent.
@@ -885,8 +909,9 @@ outright is always cloned. Groups are matched the way `app list --group` matches
885
909
  case-insensitive substring - except that an exact group name always wins, so cloning
886
910
  `BetTrackr` never drags in `BetTrackrLegacy`. If a partial name still spans several groups,
887
911
  vortex stops and lists them. A bare word that is genuinely both a TemplateName and a group
888
- is refused: use `--group NAME` or the ID. References may be qualified as `SERVER:REF`
889
- (`dev:BetTrackr`).
912
+ is refused: use `--group NAME` or the ID. A TemplateName or `group/name` must match in full but
913
+ ignores case; if two applications differ only in case, the one typed exactly wins. References
914
+ may be qualified as `SERVER:REF` (`dev:BetTrackr`).
890
915
 
891
916
  ### Working with Multiple Servers
892
917
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes