@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
- const [servers, clusters] = await Promise.all([api.servers(), api.clusters()]);
51
- // Caps and quota are newer than the fleet endpoints; an Atlas that predates
52
- // them should still answer the main question rather than failing outright.
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 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbeat/atlas-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Atlas CLI — run JMeter load tests from CI and record scenarios",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {