@ornncompute/cli 1.0.174 → 1.0.176
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/README.md +22 -0
- package/package.json +1 -1
- package/src/admin-command-handlers.mjs +2 -0
- package/src/admin-supplier-networking.mjs +37 -0
- package/src/catalog-shell.mjs +15 -4
- package/src/interaction-runtime.mjs +1 -0
- package/vendor/api-client/orchestrator.js +13 -0
- package/vendor/capabilities/cli.js +947 -753
package/README.md
CHANGED
|
@@ -190,6 +190,28 @@ ornn admin capacity-offers
|
|
|
190
190
|
ornn admin reservations
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
Supplier networking is available under the existing supplier root:
|
|
194
|
+
|
|
195
|
+
```text
|
|
196
|
+
ornn admin suppliers connections list | show | create
|
|
197
|
+
ornn admin suppliers gateways register | regions | create | show
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**gateways register** saves an existing Supplier Jump Host and its connection
|
|
201
|
+
config. It takes `--supplier`, `--name`, `--address`, optional `--ssh-port` (22)
|
|
202
|
+
and `--ssh-username` (`admin`); it provisions no VM. Use **connections list** with
|
|
203
|
+
`--gateway` to find the saved connection ID for enrollment. **connections create**
|
|
204
|
+
saves NetBird or reverse-SSH settings; **gateways create** explicitly provisions
|
|
205
|
+
its billable gateway in the chosen supported region. **gateways show** reports
|
|
206
|
+
creation status, and `--retry` on create explicitly retries a failed attempt.
|
|
207
|
+
These operations execute directly with the staff session on the native
|
|
208
|
+
`/v1/orchestrator/supplier-*` gateway routes; they add no owner API or staff alias.
|
|
209
|
+
Lists preserve the owner's `next_cursor` as `--cursor` and do not auto-paginate.
|
|
210
|
+
Examples and retry guidance live in the
|
|
211
|
+
[staff CLI reference](../../docs/cli.md#supplier-connections-and-jump-hosts).
|
|
212
|
+
Enrollment help links to these commands. Setup does not change the enrollment
|
|
213
|
+
API or automatically select a connection for another enrollment command.
|
|
214
|
+
|
|
193
215
|
Every `ornn admin` command, read or mutation, requires an admin session.
|
|
194
216
|
`ornn admin users list` and `ornn admin organizations list` search the
|
|
195
217
|
Authorization directory by person name, email, or company name, with bounded `--limit` and
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminSupplierNetworkingHandlers } from "./admin-supplier-networking.mjs";
|
|
1
2
|
import { adminSshHandlers } from "./admin-ssh.mjs";
|
|
2
3
|
import { adminCapacityReservationHandlers } from "./admin-capacity-reservations.mjs";
|
|
3
4
|
import { adminCreditHandlers } from "./admin-credits.mjs";
|
|
@@ -8,6 +9,7 @@ import { adminNodeSanitizeHandlers } from "./admin-node-sanitize.mjs";
|
|
|
8
9
|
import { ADMIN_MUTATION_SAFETY, assertAdminMutationContext } from "./admin-mutations.mjs";
|
|
9
10
|
|
|
10
11
|
const handlers = [
|
|
12
|
+
...adminSupplierNetworkingHandlers,
|
|
11
13
|
...adminSshHandlers,
|
|
12
14
|
...adminCapacityReservationHandlers,
|
|
13
15
|
...adminCreditHandlers,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ADMIN_MUTATION_SAFETY, AdminMutationError } from "./admin-mutations.mjs";
|
|
2
|
+
import { parseSemanticArguments } from "./interaction-runtime.mjs";
|
|
3
|
+
|
|
4
|
+
function parse(argv, capability) {
|
|
5
|
+
const { $positionals, ...options } = parseSemanticArguments(argv);
|
|
6
|
+
if ($positionals.length) throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}`);
|
|
7
|
+
const aliases = { supplier: "organization_id", gateway: "gateway_id", cursor: "after" };
|
|
8
|
+
const input = {};
|
|
9
|
+
for (const [option, value] of Object.entries(options)) {
|
|
10
|
+
const field =
|
|
11
|
+
aliases[option] ?? option.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
|
12
|
+
if (Object.hasOwn(input, field)) throw new AdminMutationError(`Supply ${field} only once.`);
|
|
13
|
+
input[field] = ["limit", "ssh_port"].includes(field) ? Number(value) : value;
|
|
14
|
+
}
|
|
15
|
+
const parsed = capability.input.safeParse(input);
|
|
16
|
+
if (!parsed.success)
|
|
17
|
+
throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}\n${parsed.error.message}`);
|
|
18
|
+
return { input: parsed.data };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function run({ execute, input }) {
|
|
22
|
+
return {
|
|
23
|
+
data: await execute(input),
|
|
24
|
+
exitCode: 0,
|
|
25
|
+
outcome: { class: "ready", phase: "complete" },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const adminSupplierNetworkingHandlers = [
|
|
30
|
+
"supplier-connection.list",
|
|
31
|
+
"supplier-connection.get",
|
|
32
|
+
"supplier-connection.create",
|
|
33
|
+
"supplier-gateway.register",
|
|
34
|
+
"supplier-gateway.regions",
|
|
35
|
+
"supplier-gateway.create",
|
|
36
|
+
"supplier-gateway.get",
|
|
37
|
+
].map((capabilityId) => ({ capabilityId, parse, run, safety: ADMIN_MUTATION_SAFETY.direct }));
|
package/src/catalog-shell.mjs
CHANGED
|
@@ -761,13 +761,24 @@ function parseCapabilityInput(capability, rawInput) {
|
|
|
761
761
|
}
|
|
762
762
|
|
|
763
763
|
// Native Commerce and Markets routes authenticate the caller at the gateway.
|
|
764
|
-
// Commerce's /internal/v1 routes additionally require staff.
|
|
765
|
-
|
|
764
|
+
// Commerce's /internal/v1 routes additionally require staff. Supplier networking
|
|
765
|
+
// retains its native supplier/staff policy after the CLI staff preflight.
|
|
766
|
+
const DIRECT_GATEWAY_PREFIXES = [
|
|
767
|
+
"/commerce",
|
|
768
|
+
"/internal/v1",
|
|
769
|
+
"/v1/markets",
|
|
770
|
+
"/v1/orchestrator/supplier-connection-configs",
|
|
771
|
+
"/v1/orchestrator/supplier-gateways",
|
|
772
|
+
];
|
|
773
|
+
const DIRECT_GATEWAY_PATHS = new Set(["/v1/orchestrator/supplier-gateway-regions"]);
|
|
766
774
|
|
|
767
775
|
function isDirectGatewayPath(path) {
|
|
768
776
|
const pathname = String(path).split("?")[0];
|
|
769
|
-
return
|
|
770
|
-
(
|
|
777
|
+
return (
|
|
778
|
+
DIRECT_GATEWAY_PATHS.has(pathname) ||
|
|
779
|
+
DIRECT_GATEWAY_PREFIXES.some(
|
|
780
|
+
(prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)
|
|
781
|
+
)
|
|
771
782
|
);
|
|
772
783
|
}
|
|
773
784
|
|
|
@@ -499,6 +499,18 @@ function getCustomerServicingProfile(request, organizationId, signal) {
|
|
|
499
499
|
function saveServicingRequirement(request, organizationId, id, body) {
|
|
500
500
|
return request(`/v1/orchestrator/customer-profiles/${encodeURIComponent(organizationId)}/requirements/${encodeURIComponent(id)}`, { method: "PUT", body });
|
|
501
501
|
}
|
|
502
|
+
function listServicingRequirements(request, query = {}, signal) {
|
|
503
|
+
const params = new URLSearchParams();
|
|
504
|
+
if (query.q)
|
|
505
|
+
params.set("q", query.q);
|
|
506
|
+
if (query.offset)
|
|
507
|
+
params.set("offset", String(query.offset));
|
|
508
|
+
const suffix = params.size ? `?${params}` : "";
|
|
509
|
+
return request(`/v1/orchestrator/customer-profiles${suffix}`, {
|
|
510
|
+
method: "GET",
|
|
511
|
+
signal
|
|
512
|
+
});
|
|
513
|
+
}
|
|
502
514
|
|
|
503
515
|
// ../../packages/api-client/dist/orchestrator/maintenance-history.js
|
|
504
516
|
function listMaintenanceHistory(request, filter = {}, signal) {
|
|
@@ -1105,6 +1117,7 @@ export {
|
|
|
1105
1117
|
listReservationNodeRollout,
|
|
1106
1118
|
listReservationSshKeys,
|
|
1107
1119
|
listReservationVirtualMachines,
|
|
1120
|
+
listServicingRequirements,
|
|
1108
1121
|
listSshBastions,
|
|
1109
1122
|
listStaffNodeVirtualMachines,
|
|
1110
1123
|
listStaffNodes,
|