runcloud 0.2.169 → 0.2.170
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/dist/commands/run-cloud-fleet.js +10 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/runcloud-0.2.170.tgz +0 -0
- package/runcloud-0.2.169.tgz +0 -0
|
@@ -280,6 +280,10 @@ export async function readFleetLogs(client, hostId, source = 'service', limit =
|
|
|
280
280
|
lines: Array.isArray(result.data.lines) ? result.data.lines.map(safeFleetText) : [] };
|
|
281
281
|
}
|
|
282
282
|
function credentialsClient() { const credentials = requireCredentials(); return new ApiClient(credentials.apiUrl, credentials.token); }
|
|
283
|
+
function requireFleetReadAccess(reason) {
|
|
284
|
+
if (reason === 'HTTP 401' || reason === 'HTTP 403')
|
|
285
|
+
throw new Error(`Fleet access denied (${reason}); use an admin identity with read permission`);
|
|
286
|
+
}
|
|
283
287
|
function action(fn) {
|
|
284
288
|
return fn().catch(error => { console.error(safeFleetText(error instanceof Error ? error.message : 'Fleet read failed')); process.exitCode = 1; });
|
|
285
289
|
}
|
|
@@ -323,9 +327,14 @@ export function registerRunCloudFleet(program) {
|
|
|
323
327
|
.option('--event-pages <pages>', 'Maximum pages (1..10)', '1')
|
|
324
328
|
.action(opts => action(async () => {
|
|
325
329
|
const result = await readFleetEvents(credentialsClient(), { hostId: opts.host, range: opts.range, limit: Number(opts.limit), eventPages: Number(opts.eventPages) });
|
|
330
|
+
requireFleetReadAccess(result.coverage.reason);
|
|
326
331
|
console.log(JSON.stringify({ coverage: result.coverage, items: result.items.map(eventEvidence) }, null, 2));
|
|
327
332
|
}));
|
|
328
333
|
fleet.command('logs <hostId>').description('Read bounded retained host logs; no SSH or host changes')
|
|
329
334
|
.option('--source <source>', 'service, warm_pool, or event_log', 'service').option('--limit <rows>', 'Maximum lines (1..500)', '100')
|
|
330
|
-
.action((hostId, opts) => action(async () => {
|
|
335
|
+
.action((hostId, opts) => action(async () => {
|
|
336
|
+
const result = await readFleetLogs(credentialsClient(), hostId, opts.source, Number(opts.limit));
|
|
337
|
+
requireFleetReadAccess(result.reason);
|
|
338
|
+
console.log(JSON.stringify(result, null, 2));
|
|
339
|
+
}));
|
|
331
340
|
}
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.2.
|
|
1
|
+
export const CLI_VERSION = '0.2.170';
|
package/package.json
CHANGED
|
Binary file
|
package/runcloud-0.2.169.tgz
DELETED
|
Binary file
|