@ornncompute/cli 0.2.19 → 0.2.21
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 +1 -1
- package/src/api-client.mjs +2 -7
- package/src/catalog-dispatch.mjs +102 -4
- package/src/cli.mjs +124 -123
- package/vendor/capabilities/capabilities/listings.js +2 -2
- package/vendor/capabilities/capabilities/staff-gtm.d.ts +171 -0
- package/vendor/capabilities/capabilities/staff-gtm.js +616 -0
- package/vendor/capabilities/capabilities/tokens.js +4 -4
- package/vendor/capabilities/capability.d.ts +1 -1
- package/vendor/capabilities/capability.js +1 -0
- package/vendor/capabilities/catalog.js +2 -0
- package/vendor/capabilities/index.d.ts +2 -1
- package/vendor/capabilities/index.js +2 -1
package/src/cli.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import { pipeline } from "node:stream/promises";
|
|
|
11
11
|
import {
|
|
12
12
|
CliApiError,
|
|
13
13
|
cliRequest,
|
|
14
|
-
computeEndpoint,
|
|
15
14
|
loadRequiredSession,
|
|
15
|
+
normalizeComputePath,
|
|
16
16
|
operatorRequest,
|
|
17
17
|
raiseForFailedResponse,
|
|
18
18
|
resolveApiBaseUrl,
|
|
@@ -1727,6 +1727,41 @@ async function status(args, { env, fetchImpl, stdout }) {
|
|
|
1727
1727
|
return 0;
|
|
1728
1728
|
}
|
|
1729
1729
|
|
|
1730
|
+
function rewriteCustomerApiPath(path) {
|
|
1731
|
+
if (path.startsWith("/v1/")) {
|
|
1732
|
+
return path;
|
|
1733
|
+
}
|
|
1734
|
+
const queryIndex = path.indexOf("?");
|
|
1735
|
+
const pathname = queryIndex === -1 ? path : path.slice(0, queryIndex);
|
|
1736
|
+
const search = queryIndex === -1 ? "" : path.slice(queryIndex);
|
|
1737
|
+
if (pathname === "/storage-targets") {
|
|
1738
|
+
return `/v1/orchestrator/storage-targets${search}`;
|
|
1739
|
+
}
|
|
1740
|
+
if (pathname === "/tenants/me" || pathname.startsWith("/tenants/me/")) {
|
|
1741
|
+
const rest = pathname === "/tenants/me" ? "" : pathname.slice("/tenants/me".length);
|
|
1742
|
+
return `/v1/workflows/commerce${rest}${search}`;
|
|
1743
|
+
}
|
|
1744
|
+
if (pathname === "/organizations/me" || pathname.startsWith("/organizations/me/")) {
|
|
1745
|
+
return `/v1/workflows/compute/nodes${pathname}${search}`;
|
|
1746
|
+
}
|
|
1747
|
+
if (pathname === "/inventory") {
|
|
1748
|
+
return `/v1/workflows/commerce/inventory${search}`;
|
|
1749
|
+
}
|
|
1750
|
+
if (pathname === "/listings" || pathname.startsWith("/listings/") || pathname === "/marketplace" || pathname.startsWith("/marketplace/")) {
|
|
1751
|
+
return `/v1/workflows/commerce${pathname}${search}`;
|
|
1752
|
+
}
|
|
1753
|
+
if (pathname === "/networks" || pathname.startsWith("/networks/")) {
|
|
1754
|
+
return `/v1/orchestrator${pathname}${search}`;
|
|
1755
|
+
}
|
|
1756
|
+
if (pathname === "/nodes/storage-drives" || pathname.startsWith("/nodes/storage-drives/")) {
|
|
1757
|
+
return `/v1/orchestrator/drives${pathname.slice("/nodes/storage-drives".length)}${search}`;
|
|
1758
|
+
}
|
|
1759
|
+
if (pathname.startsWith("/nodes/")) {
|
|
1760
|
+
return `/v1/workflows/compute${pathname}${search}`;
|
|
1761
|
+
}
|
|
1762
|
+
return path;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1730
1765
|
async function api(args, { env, fetchImpl, stdout }) {
|
|
1731
1766
|
const [method, path, ...rest] = args;
|
|
1732
1767
|
if (!method || !path) {
|
|
@@ -1746,7 +1781,7 @@ async function api(args, { env, fetchImpl, stdout }) {
|
|
|
1746
1781
|
const body = await readJsonOption(options.data);
|
|
1747
1782
|
const response = await cliRequest({
|
|
1748
1783
|
body,
|
|
1749
|
-
endpoint:
|
|
1784
|
+
endpoint: rewriteCustomerApiPath(normalizeComputePath(path)),
|
|
1750
1785
|
env,
|
|
1751
1786
|
fetchImpl,
|
|
1752
1787
|
method: normalizedMethod,
|
|
@@ -1790,7 +1825,7 @@ async function availability(args, context) {
|
|
|
1790
1825
|
);
|
|
1791
1826
|
const { limit, cursor } = listPaginationOptions(options);
|
|
1792
1827
|
const forecast = await cliRequest({
|
|
1793
|
-
endpoint:
|
|
1828
|
+
endpoint: `/v1/workflows/commerce/listings/forecast${buildQuery({ limit, cursor })}`,
|
|
1794
1829
|
env: context.env,
|
|
1795
1830
|
fetchImpl: context.fetchImpl,
|
|
1796
1831
|
});
|
|
@@ -1866,7 +1901,7 @@ async function bid(args, context) {
|
|
|
1866
1901
|
);
|
|
1867
1902
|
const { limit, cursor } = listPaginationOptions(options);
|
|
1868
1903
|
const bids = await cliRequest({
|
|
1869
|
-
endpoint:
|
|
1904
|
+
endpoint: `/v1/workflows/commerce/bids${buildQuery({ limit, cursor })}`,
|
|
1870
1905
|
env: context.env,
|
|
1871
1906
|
fetchImpl: context.fetchImpl,
|
|
1872
1907
|
});
|
|
@@ -1953,7 +1988,7 @@ async function bid(args, context) {
|
|
|
1953
1988
|
}
|
|
1954
1989
|
const created = await cliRequest({
|
|
1955
1990
|
body: payload,
|
|
1956
|
-
endpoint:
|
|
1991
|
+
endpoint: "/v1/workflows/commerce/bids",
|
|
1957
1992
|
env: context.env,
|
|
1958
1993
|
fetchImpl: context.fetchImpl,
|
|
1959
1994
|
method: "POST",
|
|
@@ -2013,7 +2048,7 @@ async function bid(args, context) {
|
|
|
2013
2048
|
};
|
|
2014
2049
|
const updated = await cliRequest({
|
|
2015
2050
|
body: payload,
|
|
2016
|
-
endpoint:
|
|
2051
|
+
endpoint: `/v1/workflows/commerce/bids/${id}`,
|
|
2017
2052
|
env: context.env,
|
|
2018
2053
|
fetchImpl: context.fetchImpl,
|
|
2019
2054
|
method: "PATCH",
|
|
@@ -2034,7 +2069,7 @@ async function bid(args, context) {
|
|
|
2034
2069
|
`Usage: ornn ${commandName} withdraw <${idPlaceholder}> [--json]`
|
|
2035
2070
|
);
|
|
2036
2071
|
const response = await cliRequest({
|
|
2037
|
-
endpoint:
|
|
2072
|
+
endpoint: `/v1/workflows/commerce/bids/${id}`,
|
|
2038
2073
|
env: context.env,
|
|
2039
2074
|
fetchImpl: context.fetchImpl,
|
|
2040
2075
|
method: "DELETE",
|
|
@@ -2414,7 +2449,7 @@ async function guideClusterCreate(reservationId, originalOptions, context) {
|
|
|
2414
2449
|
if (!selectedReservationId) {
|
|
2415
2450
|
const reservations = requireArrayPayload(
|
|
2416
2451
|
await cliRequest({
|
|
2417
|
-
endpoint:
|
|
2452
|
+
endpoint: "/v1/workflows/compute/clusters/reservations",
|
|
2418
2453
|
env: context.env,
|
|
2419
2454
|
fetchImpl: context.fetchImpl,
|
|
2420
2455
|
}),
|
|
@@ -2572,7 +2607,7 @@ async function reservationOp(subcommand, id, rest, context) {
|
|
|
2572
2607
|
throw new Error("--listing must be a Commerce listing UUID.");
|
|
2573
2608
|
}
|
|
2574
2609
|
const result = await operatorRequest({
|
|
2575
|
-
endpoint: `/internal/commerce-reservations/deployable${buildQuery({ tenant_id: tenant.id, listing_id: listingId })}`,
|
|
2610
|
+
endpoint: `/v1/staff/internal/commerce-reservations/deployable${buildQuery({ tenant_id: tenant.id, listing_id: listingId })}`,
|
|
2576
2611
|
env: context.env,
|
|
2577
2612
|
fetchImpl: context.fetchImpl,
|
|
2578
2613
|
});
|
|
@@ -2650,7 +2685,7 @@ async function reservationOp(subcommand, id, rest, context) {
|
|
|
2650
2685
|
}
|
|
2651
2686
|
const result = await operatorRequest({
|
|
2652
2687
|
body,
|
|
2653
|
-
endpoint: "/internal/commerce-reservations",
|
|
2688
|
+
endpoint: "/v1/staff/internal/commerce-reservations",
|
|
2654
2689
|
env: context.env,
|
|
2655
2690
|
fetchImpl: context.fetchImpl,
|
|
2656
2691
|
method: "POST",
|
|
@@ -2702,7 +2737,7 @@ async function reservationOp(subcommand, id, rest, context) {
|
|
|
2702
2737
|
}
|
|
2703
2738
|
const result = await operatorRequest({
|
|
2704
2739
|
body,
|
|
2705
|
-
endpoint: `/internal/reservations/${encodeURIComponent(id)}/transfer`,
|
|
2740
|
+
endpoint: `/v1/staff/internal/reservations/${encodeURIComponent(id)}/transfer`,
|
|
2706
2741
|
env: context.env,
|
|
2707
2742
|
fetchImpl: context.fetchImpl,
|
|
2708
2743
|
method: "POST",
|
|
@@ -2759,7 +2794,7 @@ async function reservationOp(subcommand, id, rest, context) {
|
|
|
2759
2794
|
}
|
|
2760
2795
|
const result = await operatorRequest({
|
|
2761
2796
|
body,
|
|
2762
|
-
endpoint: `/internal/nodes/${encodeURIComponent(id)}/deploy`,
|
|
2797
|
+
endpoint: `/v1/staff/internal/nodes/${encodeURIComponent(id)}/deploy`,
|
|
2763
2798
|
env: context.env,
|
|
2764
2799
|
fetchImpl: context.fetchImpl,
|
|
2765
2800
|
method: "POST",
|
|
@@ -2798,7 +2833,7 @@ async function reservations(args, context) {
|
|
|
2798
2833
|
const { limit, cursor } = listPaginationOptions(options);
|
|
2799
2834
|
const query = buildQuery({ status: options.status, limit, cursor });
|
|
2800
2835
|
const rows = await cliRequest({
|
|
2801
|
-
endpoint:
|
|
2836
|
+
endpoint: `/v1/workflows/commerce/reservations${query}`,
|
|
2802
2837
|
env: context.env,
|
|
2803
2838
|
fetchImpl: context.fetchImpl,
|
|
2804
2839
|
});
|
|
@@ -2911,7 +2946,7 @@ async function nodeOps(args, context) {
|
|
|
2911
2946
|
if (subcommand === "health") {
|
|
2912
2947
|
const options = parseCommandOptions(rest, { boolean: ["json"] }, nodeOpUsage(subcommand));
|
|
2913
2948
|
const node = await operatorRequest({
|
|
2914
|
-
endpoint: `/internal/nodes/${encodeURIComponent(id)}`,
|
|
2949
|
+
endpoint: `/v1/orchestrator/internal/nodes/${encodeURIComponent(id)}`,
|
|
2915
2950
|
env: context.env,
|
|
2916
2951
|
fetchImpl: context.fetchImpl,
|
|
2917
2952
|
});
|
|
@@ -2928,7 +2963,7 @@ async function nodeOps(args, context) {
|
|
|
2928
2963
|
// source.mode tags the validation run as CLI-originated for compute audit.
|
|
2929
2964
|
const job = await operatorRequest({
|
|
2930
2965
|
body: { node_id: id, source: { mode: "cli" }, burn_time_minutes: 0 },
|
|
2931
|
-
endpoint: "/jobs",
|
|
2966
|
+
endpoint: "/v1/benchmark/jobs",
|
|
2932
2967
|
env: context.env,
|
|
2933
2968
|
fetchImpl: context.fetchImpl,
|
|
2934
2969
|
method: "POST",
|
|
@@ -2990,7 +3025,7 @@ async function nodeOpList(rest, context) {
|
|
|
2990
3025
|
}
|
|
2991
3026
|
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
2992
3027
|
const nodesList = await operatorRequest({
|
|
2993
|
-
endpoint: `/internal/nodes${suffix}`,
|
|
3028
|
+
endpoint: `/v1/orchestrator/internal/nodes${suffix}`,
|
|
2994
3029
|
env: context.env,
|
|
2995
3030
|
fetchImpl: context.fetchImpl,
|
|
2996
3031
|
});
|
|
@@ -3023,7 +3058,7 @@ async function nodeRebootOp(subcommand, id, rest, context) {
|
|
|
3023
3058
|
const instanceId = await resolveNodeInstanceId(id, context);
|
|
3024
3059
|
const result = await operatorRequest({
|
|
3025
3060
|
body: { mode: subcommand === "hard-reset" ? "hard_reset" : "reboot" },
|
|
3026
|
-
endpoint: `/nodes/${encodeURIComponent(instanceId)}/reboot`,
|
|
3061
|
+
endpoint: `/v1/orchestrator/nodes/${encodeURIComponent(instanceId)}/reboot`,
|
|
3027
3062
|
env: context.env,
|
|
3028
3063
|
fetchImpl: context.fetchImpl,
|
|
3029
3064
|
method: "POST",
|
|
@@ -3052,7 +3087,7 @@ async function nodeAdminKeyOp(id, rest, context) {
|
|
|
3052
3087
|
nodeOpUsage("admin-key")
|
|
3053
3088
|
);
|
|
3054
3089
|
const result = await operatorRequest({
|
|
3055
|
-
endpoint: `/enrollment/admin-ssh-key?node_id=${encodeURIComponent(id)}`,
|
|
3090
|
+
endpoint: `/v1/orchestrator/enrollment/admin-ssh-key?node_id=${encodeURIComponent(id)}`,
|
|
3056
3091
|
env: context.env,
|
|
3057
3092
|
fetchImpl: context.fetchImpl,
|
|
3058
3093
|
method: options.generate ? "POST" : "GET",
|
|
@@ -3083,7 +3118,7 @@ async function nodeAdminKeyOp(id, rest, context) {
|
|
|
3083
3118
|
// chain the internal dashboard uses.
|
|
3084
3119
|
async function resolveNodeInstanceId(nodeId, context) {
|
|
3085
3120
|
const node = await operatorRequest({
|
|
3086
|
-
|
|
3121
|
+
endpoint: `/v1/orchestrator/internal/nodes/${encodeURIComponent(nodeId)}`,
|
|
3087
3122
|
env: context.env,
|
|
3088
3123
|
fetchImpl: context.fetchImpl,
|
|
3089
3124
|
});
|
|
@@ -3098,7 +3133,7 @@ async function resolveNodeInstanceId(nodeId, context) {
|
|
|
3098
3133
|
throw new CliApiError(`Node ${nodeId} has no assigned reservation to reboot.`);
|
|
3099
3134
|
}
|
|
3100
3135
|
const machines = await operatorRequest({
|
|
3101
|
-
endpoint: `/nodes/reservations/${encodeURIComponent(reservationId)}/machines`,
|
|
3136
|
+
endpoint: `/v1/orchestrator/nodes/reservations/${encodeURIComponent(reservationId)}/machines`,
|
|
3102
3137
|
env: context.env,
|
|
3103
3138
|
fetchImpl: context.fetchImpl,
|
|
3104
3139
|
});
|
|
@@ -3136,7 +3171,7 @@ async function resolveOperatorId(operatorFilter, context) {
|
|
|
3136
3171
|
return operatorFilter;
|
|
3137
3172
|
}
|
|
3138
3173
|
const operators = await operatorRequest({
|
|
3139
|
-
endpoint: "/
|
|
3174
|
+
endpoint: "/internal/v1/operators",
|
|
3140
3175
|
env: context.env,
|
|
3141
3176
|
fetchImpl: context.fetchImpl,
|
|
3142
3177
|
});
|
|
@@ -3173,7 +3208,7 @@ async function operatorsList(args, context) {
|
|
|
3173
3208
|
}
|
|
3174
3209
|
const options = parseCommandOptions(rest, { boolean: ["json"] }, usage);
|
|
3175
3210
|
const operators = await operatorRequest({
|
|
3176
|
-
endpoint: "/
|
|
3211
|
+
endpoint: "/internal/v1/operators",
|
|
3177
3212
|
env: context.env,
|
|
3178
3213
|
fetchImpl: context.fetchImpl,
|
|
3179
3214
|
});
|
|
@@ -3201,7 +3236,7 @@ async function facilitiesList(args, context) {
|
|
|
3201
3236
|
}
|
|
3202
3237
|
const options = parseCommandOptions(rest, { boolean: ["json"], value: ["operator"] }, usage);
|
|
3203
3238
|
const facilities = await operatorRequest({
|
|
3204
|
-
endpoint: "/
|
|
3239
|
+
endpoint: "/internal/v1/facilities",
|
|
3205
3240
|
env: context.env,
|
|
3206
3241
|
fetchImpl: context.fetchImpl,
|
|
3207
3242
|
});
|
|
@@ -3288,7 +3323,7 @@ async function tokensCommand(args, context) {
|
|
|
3288
3323
|
}
|
|
3289
3324
|
const options = parseCommandOptions(revokeRest, { boolean: ["json"] }, revokeUsage);
|
|
3290
3325
|
const result = await operatorRequest({
|
|
3291
|
-
endpoint: `/enrollment
|
|
3326
|
+
endpoint: `/v1/orchestrator/enrollment-tokens/${encodeURIComponent(id)}/revoke`,
|
|
3292
3327
|
env: context.env,
|
|
3293
3328
|
fetchImpl: context.fetchImpl,
|
|
3294
3329
|
method: "POST",
|
|
@@ -3686,7 +3721,7 @@ async function clusters(args, context) {
|
|
|
3686
3721
|
"Usage: ornn clusters reservations [--json]"
|
|
3687
3722
|
);
|
|
3688
3723
|
const rows = await cliRequest({
|
|
3689
|
-
endpoint:
|
|
3724
|
+
endpoint: "/v1/workflows/compute/clusters/reservations",
|
|
3690
3725
|
env: context.env,
|
|
3691
3726
|
fetchImpl: context.fetchImpl,
|
|
3692
3727
|
});
|
|
@@ -4165,7 +4200,7 @@ async function networks(args, context) {
|
|
|
4165
4200
|
"Usage: ornn networks list [--json]"
|
|
4166
4201
|
);
|
|
4167
4202
|
const payload = await cliRequest({
|
|
4168
|
-
endpoint:
|
|
4203
|
+
endpoint: "/v1/orchestrator/networks",
|
|
4169
4204
|
env: context.env,
|
|
4170
4205
|
fetchImpl: context.fetchImpl,
|
|
4171
4206
|
});
|
|
@@ -4185,7 +4220,7 @@ async function networks(args, context) {
|
|
|
4185
4220
|
"Usage: ornn networks show <network-id> [--json]"
|
|
4186
4221
|
);
|
|
4187
4222
|
const network = await cliRequest({
|
|
4188
|
-
endpoint:
|
|
4223
|
+
endpoint: `/v1/orchestrator/networks/${encodeURIComponent(id)}`,
|
|
4189
4224
|
env: context.env,
|
|
4190
4225
|
fetchImpl: context.fetchImpl,
|
|
4191
4226
|
});
|
|
@@ -4210,7 +4245,7 @@ async function networks(args, context) {
|
|
|
4210
4245
|
};
|
|
4211
4246
|
const created = await cliRequest({
|
|
4212
4247
|
body: payload,
|
|
4213
|
-
endpoint:
|
|
4248
|
+
endpoint: "/v1/orchestrator/networks",
|
|
4214
4249
|
env: context.env,
|
|
4215
4250
|
fetchImpl: context.fetchImpl,
|
|
4216
4251
|
method: "POST",
|
|
@@ -4248,7 +4283,7 @@ async function networks(args, context) {
|
|
|
4248
4283
|
}
|
|
4249
4284
|
const updated = await cliRequest({
|
|
4250
4285
|
body: payload,
|
|
4251
|
-
endpoint:
|
|
4286
|
+
endpoint: `/v1/orchestrator/networks/${encodeURIComponent(id)}`,
|
|
4252
4287
|
env: context.env,
|
|
4253
4288
|
fetchImpl: context.fetchImpl,
|
|
4254
4289
|
method: "PATCH",
|
|
@@ -4277,7 +4312,7 @@ async function networks(args, context) {
|
|
|
4277
4312
|
);
|
|
4278
4313
|
if (!confirmed) return 1;
|
|
4279
4314
|
await cliRequest({
|
|
4280
|
-
endpoint:
|
|
4315
|
+
endpoint: `/v1/orchestrator/networks/${encodeURIComponent(id)}`,
|
|
4281
4316
|
env: context.env,
|
|
4282
4317
|
fetchImpl: context.fetchImpl,
|
|
4283
4318
|
method: "DELETE",
|
|
@@ -4298,7 +4333,7 @@ async function networks(args, context) {
|
|
|
4298
4333
|
"Usage: ornn networks reservation <reservation-id> [--json]"
|
|
4299
4334
|
);
|
|
4300
4335
|
const payload = await cliRequest({
|
|
4301
|
-
endpoint:
|
|
4336
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(id)}/network`,
|
|
4302
4337
|
env: context.env,
|
|
4303
4338
|
fetchImpl: context.fetchImpl,
|
|
4304
4339
|
});
|
|
@@ -4319,7 +4354,7 @@ async function networks(args, context) {
|
|
|
4319
4354
|
const networkId = requiredOption(options.network || options.networkId, "--network");
|
|
4320
4355
|
const payload = await cliRequest({
|
|
4321
4356
|
body: { network_id: networkId },
|
|
4322
|
-
endpoint:
|
|
4357
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(id)}/network`,
|
|
4323
4358
|
env: context.env,
|
|
4324
4359
|
fetchImpl: context.fetchImpl,
|
|
4325
4360
|
method: "POST",
|
|
@@ -4341,7 +4376,7 @@ async function networks(args, context) {
|
|
|
4341
4376
|
);
|
|
4342
4377
|
const payload = await cliRequest({
|
|
4343
4378
|
body: { network_id: null },
|
|
4344
|
-
endpoint:
|
|
4379
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(id)}/network`,
|
|
4345
4380
|
env: context.env,
|
|
4346
4381
|
fetchImpl: context.fetchImpl,
|
|
4347
4382
|
method: "POST",
|
|
@@ -4460,9 +4495,7 @@ async function putSignedStorageUpload({
|
|
|
4460
4495
|
async function cancelStorageUploadSession({ driveId, env, fetchImpl, uploadId }) {
|
|
4461
4496
|
try {
|
|
4462
4497
|
await cliRequest({
|
|
4463
|
-
endpoint:
|
|
4464
|
-
`/nodes/storage-drives/${encodeURIComponent(driveId)}/file-uploads/${encodeURIComponent(uploadId)}`
|
|
4465
|
-
),
|
|
4498
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(driveId)}/file-uploads/${encodeURIComponent(uploadId)}`,
|
|
4466
4499
|
env,
|
|
4467
4500
|
fetchImpl,
|
|
4468
4501
|
method: "DELETE",
|
|
@@ -4591,9 +4624,7 @@ async function storage(rawArgs, context) {
|
|
|
4591
4624
|
try {
|
|
4592
4625
|
session = await cliRequest({
|
|
4593
4626
|
body: { path: destination, content_type: contentType, size_bytes: fileInfo.size },
|
|
4594
|
-
endpoint:
|
|
4595
|
-
`/nodes/storage-drives/${encodeURIComponent(id)}/file-upload-url`
|
|
4596
|
-
),
|
|
4627
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}/file-upload-url`,
|
|
4597
4628
|
env: context.env,
|
|
4598
4629
|
fetchImpl: context.fetchImpl,
|
|
4599
4630
|
method: "POST",
|
|
@@ -4627,9 +4658,7 @@ async function storage(rawArgs, context) {
|
|
|
4627
4658
|
} finally {
|
|
4628
4659
|
progress?.finish();
|
|
4629
4660
|
}
|
|
4630
|
-
const completionEndpoint =
|
|
4631
|
-
`/nodes/storage-drives/${encodeURIComponent(id)}/file-uploads/${encodeURIComponent(session.upload_id)}/complete`
|
|
4632
|
-
);
|
|
4661
|
+
const completionEndpoint = `/v1/orchestrator/drives/${encodeURIComponent(id)}/file-uploads/${encodeURIComponent(session.upload_id)}/complete`;
|
|
4633
4662
|
try {
|
|
4634
4663
|
result = await cliRequest({
|
|
4635
4664
|
body: { uploaded_generation: uploadedGeneration },
|
|
@@ -4698,8 +4727,8 @@ async function storage(rawArgs, context) {
|
|
|
4698
4727
|
.map((segment) => encodeURIComponent(segment))
|
|
4699
4728
|
.join("/");
|
|
4700
4729
|
const url = new URL(
|
|
4701
|
-
|
|
4702
|
-
`${baseUrl}
|
|
4730
|
+
`/v1/orchestrator/drives/${encodeURIComponent(id)}/files/${remoteSegments}`,
|
|
4731
|
+
`${baseUrl}/`,
|
|
4703
4732
|
);
|
|
4704
4733
|
const response = await context.fetchImpl(url, {
|
|
4705
4734
|
headers: {
|
|
@@ -4763,9 +4792,7 @@ async function storage(rawArgs, context) {
|
|
|
4763
4792
|
"--reservation"
|
|
4764
4793
|
);
|
|
4765
4794
|
const payload = await cliRequest({
|
|
4766
|
-
endpoint:
|
|
4767
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`
|
|
4768
|
-
),
|
|
4795
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`,
|
|
4769
4796
|
env: context.env,
|
|
4770
4797
|
fetchImpl: context.fetchImpl,
|
|
4771
4798
|
method: "DELETE",
|
|
@@ -4804,9 +4831,7 @@ async function storage(rawArgs, context) {
|
|
|
4804
4831
|
? { capacity_gib: positiveIntegerOption(options.capacityGib, "--capacity-gib") }
|
|
4805
4832
|
: {}),
|
|
4806
4833
|
},
|
|
4807
|
-
endpoint:
|
|
4808
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/filesystem-deployment`
|
|
4809
|
-
),
|
|
4834
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/filesystem-deployment`,
|
|
4810
4835
|
env: context.env,
|
|
4811
4836
|
fetchImpl: context.fetchImpl,
|
|
4812
4837
|
method: "POST",
|
|
@@ -4833,9 +4858,7 @@ async function storage(rawArgs, context) {
|
|
|
4833
4858
|
"--reservation"
|
|
4834
4859
|
);
|
|
4835
4860
|
const payload = await cliRequest({
|
|
4836
|
-
endpoint:
|
|
4837
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`
|
|
4838
|
-
),
|
|
4861
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`,
|
|
4839
4862
|
env: context.env,
|
|
4840
4863
|
fetchImpl: context.fetchImpl,
|
|
4841
4864
|
timeoutMs: 30_000,
|
|
@@ -4869,9 +4892,7 @@ async function storage(rawArgs, context) {
|
|
|
4869
4892
|
);
|
|
4870
4893
|
if (!confirmed) return 1;
|
|
4871
4894
|
const payload = await cliRequest({
|
|
4872
|
-
endpoint:
|
|
4873
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/filesystem-deployment`
|
|
4874
|
-
),
|
|
4895
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/filesystem-deployment`,
|
|
4875
4896
|
env: context.env,
|
|
4876
4897
|
fetchImpl: context.fetchImpl,
|
|
4877
4898
|
method: "DELETE",
|
|
@@ -4908,9 +4929,7 @@ async function storage(rawArgs, context) {
|
|
|
4908
4929
|
}
|
|
4909
4930
|
const fetchAttachment = () =>
|
|
4910
4931
|
cliRequest({
|
|
4911
|
-
endpoint:
|
|
4912
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`
|
|
4913
|
-
),
|
|
4932
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`,
|
|
4914
4933
|
env: context.env,
|
|
4915
4934
|
fetchImpl: context.fetchImpl,
|
|
4916
4935
|
timeoutMs: 30_000,
|
|
@@ -5054,9 +5073,7 @@ async function storage(rawArgs, context) {
|
|
|
5054
5073
|
access_mode: options.readOnly ? "read-only" : "read-write",
|
|
5055
5074
|
...(options.allNodes ? { all_nodes: true } : {}),
|
|
5056
5075
|
},
|
|
5057
|
-
endpoint:
|
|
5058
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/storage-deployment`
|
|
5059
|
-
),
|
|
5076
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/storage-deployment`,
|
|
5060
5077
|
env: context.env,
|
|
5061
5078
|
fetchImpl: context.fetchImpl,
|
|
5062
5079
|
method: "POST",
|
|
@@ -5092,11 +5109,7 @@ async function storage(rawArgs, context) {
|
|
|
5092
5109
|
"Usage: ornn storage targets [--json]"
|
|
5093
5110
|
);
|
|
5094
5111
|
const [payload, drivesPayload] = await Promise.all([
|
|
5095
|
-
cliRequest({
|
|
5096
|
-
endpoint: "/v1/cli/storage-targets",
|
|
5097
|
-
env: context.env,
|
|
5098
|
-
fetchImpl: context.fetchImpl,
|
|
5099
|
-
}),
|
|
5112
|
+
cliRequest({ endpoint: "/v1/orchestrator/storage-targets", env: context.env, fetchImpl: context.fetchImpl }),
|
|
5100
5113
|
fetchStorageDrives(context),
|
|
5101
5114
|
]);
|
|
5102
5115
|
const targets = Array.isArray(payload?.targets) ? payload.targets : [];
|
|
@@ -5180,7 +5193,7 @@ async function storage(rawArgs, context) {
|
|
|
5180
5193
|
"Usage: ornn storage buckets verify <drive-id> [--json]"
|
|
5181
5194
|
);
|
|
5182
5195
|
const drive = await cliRequest({
|
|
5183
|
-
endpoint:
|
|
5196
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}/verify-source`,
|
|
5184
5197
|
env: context.env,
|
|
5185
5198
|
fetchImpl: context.fetchImpl,
|
|
5186
5199
|
method: "POST",
|
|
@@ -5219,9 +5232,7 @@ async function storage(rawArgs, context) {
|
|
|
5219
5232
|
external_access_key_id: requiredOption(options.accessKeyId, "--access-key-id"),
|
|
5220
5233
|
external_secret_access_key: secretAccessKey,
|
|
5221
5234
|
},
|
|
5222
|
-
endpoint:
|
|
5223
|
-
`/nodes/storage-drives/${encodeURIComponent(id)}/source-credentials`
|
|
5224
|
-
),
|
|
5235
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}/source-credentials`,
|
|
5225
5236
|
env: context.env,
|
|
5226
5237
|
fetchImpl: context.fetchImpl,
|
|
5227
5238
|
method: "PATCH",
|
|
@@ -5241,7 +5252,7 @@ async function storage(rawArgs, context) {
|
|
|
5241
5252
|
"Usage: ornn storage buckets disconnect <drive-id> [--json]"
|
|
5242
5253
|
);
|
|
5243
5254
|
await cliRequest({
|
|
5244
|
-
endpoint:
|
|
5255
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}`,
|
|
5245
5256
|
env: context.env,
|
|
5246
5257
|
fetchImpl: context.fetchImpl,
|
|
5247
5258
|
method: "DELETE",
|
|
@@ -5331,7 +5342,7 @@ async function storage(rawArgs, context) {
|
|
|
5331
5342
|
...(options.accessKeyId ? { external_access_key_id: options.accessKeyId } : {}),
|
|
5332
5343
|
...(secretAccessKey ? { external_secret_access_key: secretAccessKey } : {}),
|
|
5333
5344
|
},
|
|
5334
|
-
endpoint:
|
|
5345
|
+
endpoint: "/v1/orchestrator/drives",
|
|
5335
5346
|
env: context.env,
|
|
5336
5347
|
fetchImpl: context.fetchImpl,
|
|
5337
5348
|
method: "POST",
|
|
@@ -5418,7 +5429,7 @@ async function storage(rawArgs, context) {
|
|
|
5418
5429
|
name: requiredOption(options.name, "--name"),
|
|
5419
5430
|
source_drive_id: sourceDriveId,
|
|
5420
5431
|
},
|
|
5421
|
-
endpoint:
|
|
5432
|
+
endpoint: "/v1/orchestrator/drives",
|
|
5422
5433
|
env: context.env,
|
|
5423
5434
|
fetchImpl: context.fetchImpl,
|
|
5424
5435
|
method: "POST",
|
|
@@ -5439,7 +5450,7 @@ async function storage(rawArgs, context) {
|
|
|
5439
5450
|
"Usage: ornn storage volumes refresh <drive-id> [--json]"
|
|
5440
5451
|
);
|
|
5441
5452
|
const drive = await cliRequest({
|
|
5442
|
-
endpoint:
|
|
5453
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}/refresh`,
|
|
5443
5454
|
env: context.env,
|
|
5444
5455
|
fetchImpl: context.fetchImpl,
|
|
5445
5456
|
method: "POST",
|
|
@@ -5467,7 +5478,7 @@ async function storage(rawArgs, context) {
|
|
|
5467
5478
|
);
|
|
5468
5479
|
if (!confirmed) return 1;
|
|
5469
5480
|
await cliRequest({
|
|
5470
|
-
endpoint:
|
|
5481
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}/contents`,
|
|
5471
5482
|
env: context.env,
|
|
5472
5483
|
fetchImpl: context.fetchImpl,
|
|
5473
5484
|
method: "DELETE",
|
|
@@ -5495,7 +5506,7 @@ async function storage(rawArgs, context) {
|
|
|
5495
5506
|
);
|
|
5496
5507
|
if (!confirmed) return 1;
|
|
5497
5508
|
await cliRequest({
|
|
5498
|
-
endpoint:
|
|
5509
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(id)}`,
|
|
5499
5510
|
env: context.env,
|
|
5500
5511
|
fetchImpl: context.fetchImpl,
|
|
5501
5512
|
method: "DELETE",
|
|
@@ -5848,7 +5859,7 @@ async function billing(args, context) {
|
|
|
5848
5859
|
);
|
|
5849
5860
|
const { limit, cursor } = listPaginationOptions(options);
|
|
5850
5861
|
const invoices = await cliRequest({
|
|
5851
|
-
endpoint:
|
|
5862
|
+
endpoint: `/v1/workflows/commerce/invoices${buildQuery({ limit, cursor })}`,
|
|
5852
5863
|
env: context.env,
|
|
5853
5864
|
fetchImpl: context.fetchImpl,
|
|
5854
5865
|
});
|
|
@@ -5871,9 +5882,7 @@ async function billing(args, context) {
|
|
|
5871
5882
|
startDate: options.start,
|
|
5872
5883
|
});
|
|
5873
5884
|
const report = await cliRequest({
|
|
5874
|
-
endpoint:
|
|
5875
|
-
`/tenants/me/showback${buildQuery({ end: endDate, start: startDate })}`
|
|
5876
|
-
),
|
|
5885
|
+
endpoint: `/v1/workflows/commerce/showback${buildQuery({ end: endDate, start: startDate })}`,
|
|
5877
5886
|
env: context.env,
|
|
5878
5887
|
fetchImpl: context.fetchImpl,
|
|
5879
5888
|
});
|
|
@@ -5913,7 +5922,7 @@ async function sshKeys(args, context) {
|
|
|
5913
5922
|
"Usage: ornn ssh-keys list [--json]"
|
|
5914
5923
|
);
|
|
5915
5924
|
const keys = await cliRequest({
|
|
5916
|
-
endpoint:
|
|
5925
|
+
endpoint: "/v1/workflows/compute/nodes/organizations/me/ssh-keys",
|
|
5917
5926
|
env: context.env,
|
|
5918
5927
|
fetchImpl: context.fetchImpl,
|
|
5919
5928
|
});
|
|
@@ -5939,7 +5948,7 @@ async function sshKeys(args, context) {
|
|
|
5939
5948
|
label: requiredOption(options.label, "--label"),
|
|
5940
5949
|
public_key: publicKey,
|
|
5941
5950
|
},
|
|
5942
|
-
endpoint:
|
|
5951
|
+
endpoint: "/v1/workflows/compute/nodes/organizations/me/ssh-keys",
|
|
5943
5952
|
env: context.env,
|
|
5944
5953
|
fetchImpl: context.fetchImpl,
|
|
5945
5954
|
method: "POST",
|
|
@@ -5962,7 +5971,7 @@ async function sshKeys(args, context) {
|
|
|
5962
5971
|
"Usage: ornn ssh-keys delete <key-id> [--json]"
|
|
5963
5972
|
);
|
|
5964
5973
|
const response = await cliRequest({
|
|
5965
|
-
endpoint:
|
|
5974
|
+
endpoint: `/v1/workflows/compute/nodes/organizations/me/ssh-keys/${id}`,
|
|
5966
5975
|
env: context.env,
|
|
5967
5976
|
fetchImpl: context.fetchImpl,
|
|
5968
5977
|
method: "DELETE",
|
|
@@ -5988,7 +5997,7 @@ async function loadAvailabilityListings(context) {
|
|
|
5988
5997
|
|
|
5989
5998
|
async function fetchInventoryList(context) {
|
|
5990
5999
|
const payload = await cliRequest({
|
|
5991
|
-
endpoint:
|
|
6000
|
+
endpoint: "/v1/workflows/commerce/inventory",
|
|
5992
6001
|
env: context.env,
|
|
5993
6002
|
fetchImpl: context.fetchImpl,
|
|
5994
6003
|
});
|
|
@@ -5997,7 +6006,7 @@ async function fetchInventoryList(context) {
|
|
|
5997
6006
|
|
|
5998
6007
|
async function fetchInventory(id, context) {
|
|
5999
6008
|
return await cliRequest({
|
|
6000
|
-
endpoint:
|
|
6009
|
+
endpoint: `/v1/workflows/commerce/inventory/${encodeURIComponent(id)}`,
|
|
6001
6010
|
env: context.env,
|
|
6002
6011
|
fetchImpl: context.fetchImpl,
|
|
6003
6012
|
});
|
|
@@ -6530,7 +6539,7 @@ async function findBid(id, context) {
|
|
|
6530
6539
|
let found;
|
|
6531
6540
|
try {
|
|
6532
6541
|
found = await cliRequest({
|
|
6533
|
-
endpoint:
|
|
6542
|
+
endpoint: `/v1/workflows/commerce/bids/${encodeURIComponent(id)}`,
|
|
6534
6543
|
env: context.env,
|
|
6535
6544
|
fetchImpl: context.fetchImpl,
|
|
6536
6545
|
});
|
|
@@ -6602,7 +6611,7 @@ async function findReservation(id, context) {
|
|
|
6602
6611
|
let found;
|
|
6603
6612
|
try {
|
|
6604
6613
|
found = await cliRequest({
|
|
6605
|
-
endpoint:
|
|
6614
|
+
endpoint: `/v1/workflows/commerce/reservations/${encodeURIComponent(id)}`,
|
|
6606
6615
|
env: context.env,
|
|
6607
6616
|
fetchImpl: context.fetchImpl,
|
|
6608
6617
|
});
|
|
@@ -6625,7 +6634,7 @@ export async function fetchAllTenantReservations(context) {
|
|
|
6625
6634
|
let cursor;
|
|
6626
6635
|
for (let page = 0; page < 201; page += 1) {
|
|
6627
6636
|
const payload = await cliRequest({
|
|
6628
|
-
endpoint:
|
|
6637
|
+
endpoint: `/v1/workflows/commerce/reservations${buildQuery({ limit, cursor })}`,
|
|
6629
6638
|
env: context.env,
|
|
6630
6639
|
fetchImpl: context.fetchImpl,
|
|
6631
6640
|
});
|
|
@@ -6736,7 +6745,7 @@ async function resolveTenantByEmail(tenantInput, context) {
|
|
|
6736
6745
|
throw new Error("--tenant must be the tenant contact email address.");
|
|
6737
6746
|
}
|
|
6738
6747
|
const rows = await operatorRequest({
|
|
6739
|
-
endpoint: `/internal/users?q=${encodeURIComponent(input)}&approved=true&limit=1000`,
|
|
6748
|
+
endpoint: `/v1/staff/internal/users?q=${encodeURIComponent(input)}&approved=true&limit=1000`,
|
|
6740
6749
|
env: context.env,
|
|
6741
6750
|
fetchImpl: context.fetchImpl,
|
|
6742
6751
|
});
|
|
@@ -6848,7 +6857,7 @@ async function resolveStorageMountUsers(attachment, context) {
|
|
|
6848
6857
|
|
|
6849
6858
|
async function getReservationMachines(reservationId, context) {
|
|
6850
6859
|
const payload = await cliRequest({
|
|
6851
|
-
endpoint:
|
|
6860
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${reservationId}/machines`,
|
|
6852
6861
|
env: context.env,
|
|
6853
6862
|
fetchImpl: context.fetchImpl,
|
|
6854
6863
|
});
|
|
@@ -6857,7 +6866,7 @@ async function getReservationMachines(reservationId, context) {
|
|
|
6857
6866
|
|
|
6858
6867
|
async function fetchBillingInvoices(context) {
|
|
6859
6868
|
const payload = await cliRequest({
|
|
6860
|
-
endpoint:
|
|
6869
|
+
endpoint: "/v1/workflows/commerce/invoices",
|
|
6861
6870
|
env: context.env,
|
|
6862
6871
|
fetchImpl: context.fetchImpl,
|
|
6863
6872
|
});
|
|
@@ -6870,7 +6879,7 @@ async function fetchBillingInvoices(context) {
|
|
|
6870
6879
|
|
|
6871
6880
|
async function fetchStorageDrives(context) {
|
|
6872
6881
|
return await cliRequest({
|
|
6873
|
-
endpoint:
|
|
6882
|
+
endpoint: "/v1/orchestrator/drives",
|
|
6874
6883
|
env: context.env,
|
|
6875
6884
|
fetchImpl: context.fetchImpl,
|
|
6876
6885
|
});
|
|
@@ -6878,7 +6887,7 @@ async function fetchStorageDrives(context) {
|
|
|
6878
6887
|
|
|
6879
6888
|
async function verifyStorageBucketSource(driveId, context) {
|
|
6880
6889
|
return await cliRequest({
|
|
6881
|
-
endpoint:
|
|
6890
|
+
endpoint: `/v1/orchestrator/drives/${encodeURIComponent(driveId)}/verify-source`,
|
|
6882
6891
|
env: context.env,
|
|
6883
6892
|
fetchImpl: context.fetchImpl,
|
|
6884
6893
|
method: "POST",
|
|
@@ -6908,7 +6917,7 @@ async function findStorageBucket(driveId, context, { label = "bucket" } = {}) {
|
|
|
6908
6917
|
}
|
|
6909
6918
|
|
|
6910
6919
|
function reservationSshKeysEndpoint(reservationId) {
|
|
6911
|
-
return
|
|
6920
|
+
return `/v1/workflows/compute/nodes/reservations/${reservationId}/ssh-keys`;
|
|
6912
6921
|
}
|
|
6913
6922
|
|
|
6914
6923
|
async function fetchReservationSshKeys(reservationId, context) {
|
|
@@ -6960,14 +6969,14 @@ async function launchReservationAccess(
|
|
|
6960
6969
|
}
|
|
6961
6970
|
const access = await cliRequest({
|
|
6962
6971
|
body: { access_mode: mode, image_id: null },
|
|
6963
|
-
endpoint:
|
|
6972
|
+
endpoint: `/v1/workflows/commerce/reservations/${reservationId}/access-mode`,
|
|
6964
6973
|
env: context.env,
|
|
6965
6974
|
fetchImpl: context.fetchImpl,
|
|
6966
6975
|
method: "POST",
|
|
6967
6976
|
});
|
|
6968
6977
|
const launch = await cliRequest({
|
|
6969
6978
|
body: launchPayload,
|
|
6970
|
-
endpoint:
|
|
6979
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${reservationId}/launch`,
|
|
6971
6980
|
env: context.env,
|
|
6972
6981
|
fetchImpl: context.fetchImpl,
|
|
6973
6982
|
method: "POST",
|
|
@@ -7013,7 +7022,7 @@ async function switchReservationAccess(reservationId, options, context) {
|
|
|
7013
7022
|
};
|
|
7014
7023
|
const switched = await cliRequest({
|
|
7015
7024
|
body: switchPayload,
|
|
7016
|
-
endpoint:
|
|
7025
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${reservationId}/switch-access`,
|
|
7017
7026
|
env: context.env,
|
|
7018
7027
|
fetchImpl: context.fetchImpl,
|
|
7019
7028
|
method: "POST",
|
|
@@ -7045,7 +7054,7 @@ function accessActivateJsonResult(result) {
|
|
|
7045
7054
|
|
|
7046
7055
|
async function fetchTenantClusters(context) {
|
|
7047
7056
|
return await cliRequest({
|
|
7048
|
-
endpoint:
|
|
7057
|
+
endpoint: "/v1/workflows/compute/clusters",
|
|
7049
7058
|
env: context.env,
|
|
7050
7059
|
fetchImpl: context.fetchImpl,
|
|
7051
7060
|
});
|
|
@@ -7053,7 +7062,7 @@ async function fetchTenantClusters(context) {
|
|
|
7053
7062
|
|
|
7054
7063
|
async function fetchEligibleClusterNodes(reservationId, type, networkMode, context) {
|
|
7055
7064
|
const payload = await cliRequest({
|
|
7056
|
-
endpoint:
|
|
7065
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/machines`,
|
|
7057
7066
|
env: context.env,
|
|
7058
7067
|
fetchImpl: context.fetchImpl,
|
|
7059
7068
|
});
|
|
@@ -7078,7 +7087,7 @@ async function fetchEligibleClusterNodes(reservationId, type, networkMode, conte
|
|
|
7078
7087
|
|
|
7079
7088
|
async function fetchCluster(reservationId, type, context) {
|
|
7080
7089
|
return await cliRequest({
|
|
7081
|
-
endpoint:
|
|
7090
|
+
endpoint: clusterEndpoint(type, reservationId, "cluster"),
|
|
7082
7091
|
env: context.env,
|
|
7083
7092
|
fetchImpl: context.fetchImpl,
|
|
7084
7093
|
});
|
|
@@ -7086,7 +7095,7 @@ async function fetchCluster(reservationId, type, context) {
|
|
|
7086
7095
|
|
|
7087
7096
|
async function fetchClusterCredentials(reservationId, type, context) {
|
|
7088
7097
|
return await cliRequest({
|
|
7089
|
-
endpoint:
|
|
7098
|
+
endpoint: clusterEndpoint(type, reservationId, "credentials"),
|
|
7090
7099
|
env: context.env,
|
|
7091
7100
|
fetchImpl: context.fetchImpl,
|
|
7092
7101
|
});
|
|
@@ -7095,7 +7104,7 @@ async function fetchClusterCredentials(reservationId, type, context) {
|
|
|
7095
7104
|
async function launchCluster(reservationId, type, options, context) {
|
|
7096
7105
|
return await cliRequest({
|
|
7097
7106
|
body: clusterLaunchPayload(options),
|
|
7098
|
-
endpoint:
|
|
7107
|
+
endpoint: clusterEndpoint(type, reservationId, "cluster/launch"),
|
|
7099
7108
|
env: context.env,
|
|
7100
7109
|
fetchImpl: context.fetchImpl,
|
|
7101
7110
|
method: "POST",
|
|
@@ -7104,7 +7113,7 @@ async function launchCluster(reservationId, type, options, context) {
|
|
|
7104
7113
|
|
|
7105
7114
|
async function teardownCluster(reservationId, type, context) {
|
|
7106
7115
|
return await cliRequest({
|
|
7107
|
-
endpoint:
|
|
7116
|
+
endpoint: clusterEndpoint(type, reservationId, "cluster/teardown"),
|
|
7108
7117
|
env: context.env,
|
|
7109
7118
|
fetchImpl: context.fetchImpl,
|
|
7110
7119
|
method: "POST",
|
|
@@ -7114,9 +7123,7 @@ async function teardownCluster(reservationId, type, context) {
|
|
|
7114
7123
|
async function addClusterNode(reservationId, nodeId, context) {
|
|
7115
7124
|
return await cliRequest({
|
|
7116
7125
|
body: { node_id: nodeId },
|
|
7117
|
-
endpoint:
|
|
7118
|
-
`/clusters/reservations/${encodeURIComponent(reservationId)}/cluster/nodes`
|
|
7119
|
-
),
|
|
7126
|
+
endpoint: `/v1/workflows/compute/clusters/reservations/${encodeURIComponent(reservationId)}/cluster/nodes`,
|
|
7120
7127
|
env: context.env,
|
|
7121
7128
|
fetchImpl: context.fetchImpl,
|
|
7122
7129
|
method: "POST",
|
|
@@ -7125,9 +7132,7 @@ async function addClusterNode(reservationId, nodeId, context) {
|
|
|
7125
7132
|
|
|
7126
7133
|
async function removeClusterNode(reservationId, nodeId, context) {
|
|
7127
7134
|
return await cliRequest({
|
|
7128
|
-
endpoint:
|
|
7129
|
-
`/clusters/reservations/${encodeURIComponent(reservationId)}/cluster/nodes/${encodeURIComponent(nodeId)}`
|
|
7130
|
-
),
|
|
7135
|
+
endpoint: `/v1/workflows/compute/clusters/reservations/${encodeURIComponent(reservationId)}/cluster/nodes/${encodeURIComponent(nodeId)}`,
|
|
7131
7136
|
env: context.env,
|
|
7132
7137
|
fetchImpl: context.fetchImpl,
|
|
7133
7138
|
method: "DELETE",
|
|
@@ -7202,7 +7207,7 @@ async function waitForClusterActive(reservationId, type, options, context) {
|
|
|
7202
7207
|
}
|
|
7203
7208
|
|
|
7204
7209
|
function clusterEndpoint(type, reservationId, suffix) {
|
|
7205
|
-
return
|
|
7210
|
+
return `/v1/workflows/compute/${normalizeClusterType(type)}/reservations/${encodeURIComponent(reservationId)}/${suffix}`;
|
|
7206
7211
|
}
|
|
7207
7212
|
|
|
7208
7213
|
function clusterLaunchPayload(options) {
|
|
@@ -7259,7 +7264,7 @@ async function fetchTenantMachines(context, { requireComplete = false } = {}) {
|
|
|
7259
7264
|
|
|
7260
7265
|
async function fetchMachine(nodeId, context) {
|
|
7261
7266
|
return await cliRequest({
|
|
7262
|
-
endpoint:
|
|
7267
|
+
endpoint: `/v1/workflows/compute/nodes/${nodeId}`,
|
|
7263
7268
|
env: context.env,
|
|
7264
7269
|
fetchImpl: context.fetchImpl,
|
|
7265
7270
|
});
|
|
@@ -7373,9 +7378,7 @@ async function fetchMetricHistoryForNode(nodeId, options, context) {
|
|
|
7373
7378
|
start: options.start,
|
|
7374
7379
|
});
|
|
7375
7380
|
const series = await cliRequest({
|
|
7376
|
-
endpoint:
|
|
7377
|
-
`/nodes/reservations/${encodeURIComponent(machine.reservation_id)}/telemetry-history${query}`
|
|
7378
|
-
),
|
|
7381
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(machine.reservation_id)}/telemetry-history${query}`,
|
|
7379
7382
|
env: context.env,
|
|
7380
7383
|
fetchImpl: context.fetchImpl,
|
|
7381
7384
|
});
|
|
@@ -7392,9 +7395,7 @@ async function fetchMetricSnapshotForMachine(machine, context) {
|
|
|
7392
7395
|
return metricSnapshotFromMachine(machine, { error: "Reservation context unavailable." });
|
|
7393
7396
|
}
|
|
7394
7397
|
const payload = await cliRequest({
|
|
7395
|
-
endpoint:
|
|
7396
|
-
`/nodes/reservations/${encodeURIComponent(reservationId)}/live-metrics?machine_id=${encodeURIComponent(machineId(machine))}`
|
|
7397
|
-
),
|
|
7398
|
+
endpoint: `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservationId)}/live-metrics?machine_id=${encodeURIComponent(machineId(machine))}`,
|
|
7398
7399
|
env: context.env,
|
|
7399
7400
|
fetchImpl: context.fetchImpl,
|
|
7400
7401
|
});
|
|
@@ -7492,7 +7493,7 @@ async function runNodeAction(nodeId, action, options, context) {
|
|
|
7492
7493
|
const mode = action === "hard-reset" ? "hard_reset" : "reboot";
|
|
7493
7494
|
return await cliRequest({
|
|
7494
7495
|
body: { mode },
|
|
7495
|
-
endpoint:
|
|
7496
|
+
endpoint: `/v1/workflows/compute/nodes/${nodeId}/reboot`,
|
|
7496
7497
|
env: context.env,
|
|
7497
7498
|
fetchImpl: context.fetchImpl,
|
|
7498
7499
|
method: "POST",
|
|
@@ -7505,7 +7506,7 @@ async function pushNodeKeys(nodeId, sshKeyIds, requestId, context) {
|
|
|
7505
7506
|
request_id: requestId || `cli-node-push-keys:${nodeId}:${Date.now()}`,
|
|
7506
7507
|
ssh_key_ids: sshKeyIds,
|
|
7507
7508
|
},
|
|
7508
|
-
endpoint:
|
|
7509
|
+
endpoint: `/v1/workflows/compute/nodes/${nodeId}/push-keys`,
|
|
7509
7510
|
env: context.env,
|
|
7510
7511
|
fetchImpl: context.fetchImpl,
|
|
7511
7512
|
method: "POST",
|
|
@@ -7641,7 +7642,7 @@ async function ensureAccountSshKey(publicKey, label, context) {
|
|
|
7641
7642
|
label: savedLabel,
|
|
7642
7643
|
public_key: normalized,
|
|
7643
7644
|
},
|
|
7644
|
-
endpoint:
|
|
7645
|
+
endpoint: "/v1/workflows/compute/nodes/organizations/me/ssh-keys",
|
|
7645
7646
|
env: context.env,
|
|
7646
7647
|
fetchImpl: context.fetchImpl,
|
|
7647
7648
|
method: "POST",
|
|
@@ -7650,7 +7651,7 @@ async function ensureAccountSshKey(publicKey, label, context) {
|
|
|
7650
7651
|
|
|
7651
7652
|
async function fetchAccountSshKeys(context) {
|
|
7652
7653
|
return await cliRequest({
|
|
7653
|
-
endpoint:
|
|
7654
|
+
endpoint: "/v1/workflows/compute/nodes/organizations/me/ssh-keys",
|
|
7654
7655
|
env: context.env,
|
|
7655
7656
|
fetchImpl: context.fetchImpl,
|
|
7656
7657
|
});
|
|
@@ -7704,7 +7705,7 @@ async function pushReservationKeys(reservationId, sshKeyIds, requestId, context)
|
|
|
7704
7705
|
request_id: requestId || `cli-push-keys:${id}:${Date.now()}`,
|
|
7705
7706
|
ssh_key_ids: sshKeyIds,
|
|
7706
7707
|
},
|
|
7707
|
-
endpoint:
|
|
7708
|
+
endpoint: `/v1/workflows/compute/nodes/${id}/push-keys`,
|
|
7708
7709
|
env: context.env,
|
|
7709
7710
|
fetchImpl: context.fetchImpl,
|
|
7710
7711
|
method: "POST",
|