@cloudbeat/atlas-cli 0.4.0 → 0.4.1
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.
|
@@ -47,19 +47,24 @@ function registerCapacity(program) {
|
|
|
47
47
|
.option('--json', 'machine-readable output')
|
|
48
48
|
.action(async (opts) => {
|
|
49
49
|
const api = api_1.AtlasApi.fromConfig();
|
|
50
|
-
|
|
51
|
-
//
|
|
52
|
-
//
|
|
50
|
+
// Only servers are essential. Caps and quota are newer than the fleet
|
|
51
|
+
// endpoints, and listing clusters needs account-admin rights an operator
|
|
52
|
+
// does not have (403) — none of that should stop the command answering
|
|
53
|
+
// the main question, which is what this credential can run on.
|
|
53
54
|
const optional = async (call) => call.catch(() => null);
|
|
54
|
-
const [fleet, quota] = await Promise.all([
|
|
55
|
+
const [servers, clusterList, fleet, quota] = await Promise.all([
|
|
56
|
+
api.servers(),
|
|
57
|
+
optional(api.clusters()),
|
|
55
58
|
optional(api.fleet()),
|
|
56
59
|
optional(api.quota()),
|
|
57
60
|
]);
|
|
61
|
+
const clusters = clusterList ?? [];
|
|
58
62
|
const free = servers.filter(s => !s.jmeter_running);
|
|
59
63
|
if (opts.json) {
|
|
60
64
|
(0, ui_1.json)({
|
|
61
65
|
servers,
|
|
62
66
|
clusters,
|
|
67
|
+
clustersVisible: clusterList !== null,
|
|
63
68
|
fleet,
|
|
64
69
|
quota,
|
|
65
70
|
available: { servers: free.length, of: servers.length },
|