@ornncompute/cli 1.0.194 → 1.0.195

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.194",
3
+ "version": "1.0.195",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -948,6 +948,32 @@ function listStaffNodeVirtualMachines(request, nodeId, signal) {
948
948
  ...signal ? { signal } : {}
949
949
  });
950
950
  }
951
+ async function listStaffVirtualMachines(request, input, signal) {
952
+ const virtual_machines = [];
953
+ let cursor = input.cursor;
954
+ const seen = new Set(cursor ? [cursor] : []);
955
+ for (; ; ) {
956
+ const query = new URLSearchParams({
957
+ node_ids: input.node_ids.join(","),
958
+ limit: String(input.limit ?? 500)
959
+ });
960
+ if (cursor)
961
+ query.set("cursor", cursor);
962
+ const page = await request(`/v1/staff/virtual-machines?${query}`, {
963
+ method: "GET",
964
+ ...signal ? { signal } : {}
965
+ });
966
+ if (!Array.isArray(page.virtual_machines) || page.next_cursor === void 0)
967
+ throw new Error("The virtual machine catalog did not return a complete page.");
968
+ virtual_machines.push(...page.virtual_machines);
969
+ if (!page.next_cursor)
970
+ return { ...page, virtual_machines };
971
+ if (seen.has(page.next_cursor))
972
+ throw new Error("Virtual machine pagination repeated a cursor.");
973
+ seen.add(page.next_cursor);
974
+ cursor = page.next_cursor;
975
+ }
976
+ }
951
977
  function listReservationVirtualMachines(request, reservationId, signal) {
952
978
  return request(`/v1/orchestrator/reservations/${encodeURIComponent(reservationId)}/virtual-machines`, { method: "GET", ...signal ? { signal } : {} });
953
979
  }
@@ -1131,6 +1157,7 @@ export {
1131
1157
  listSshBastions,
1132
1158
  listStaffNodeVirtualMachines,
1133
1159
  listStaffNodes,
1160
+ listStaffVirtualMachines,
1134
1161
  listStorageInventory,
1135
1162
  listStorageTargets,
1136
1163
  listSupplierConnectionConfigs,