hostctl 0.1.58 → 0.1.59
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/bin/hostctl.js +623 -539
- package/dist/bin/hostctl.js.map +1 -1
- package/dist/index.d.ts +48 -42
- package/dist/index.js +591 -507
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/app.ts
|
|
8
8
|
import process4 from "process";
|
|
9
|
-
import * as
|
|
9
|
+
import * as fs12 from "fs";
|
|
10
10
|
import { homedir as homedir3 } from "os";
|
|
11
11
|
|
|
12
12
|
// src/handlebars.ts
|
|
@@ -1831,8 +1831,12 @@ var TmpFileRegistry = class _TmpFileRegistry {
|
|
|
1831
1831
|
constructor(rootPath) {
|
|
1832
1832
|
this.rootPath = Path.new(rootPath);
|
|
1833
1833
|
this.tempFilePaths = [];
|
|
1834
|
+
this.ensureRootPathExists();
|
|
1834
1835
|
process2.on("exit", (code) => this.exitCallback());
|
|
1835
1836
|
}
|
|
1837
|
+
ensureRootPathExists() {
|
|
1838
|
+
fs.mkdirSync(this.rootPath.toString(), { recursive: true });
|
|
1839
|
+
}
|
|
1836
1840
|
randName() {
|
|
1837
1841
|
return Math.random().toString(36).slice(-5) + Math.random().toString(36).slice(-5);
|
|
1838
1842
|
}
|
|
@@ -1849,6 +1853,7 @@ var TmpFileRegistry = class _TmpFileRegistry {
|
|
|
1849
1853
|
}
|
|
1850
1854
|
// this file will be automatically cleaned up at program exit
|
|
1851
1855
|
writeTmpFile(fileContent) {
|
|
1856
|
+
this.ensureRootPathExists();
|
|
1852
1857
|
const path14 = this.tmpPath();
|
|
1853
1858
|
fs.writeFileSync(path14.toString(), fileContent);
|
|
1854
1859
|
this.registerTempFileOrDir(path14.toString());
|
|
@@ -1890,6 +1895,7 @@ var Host = class {
|
|
|
1890
1895
|
this.user = opts.user;
|
|
1891
1896
|
this.password = opts.password;
|
|
1892
1897
|
this.sshKey = opts.sshKey;
|
|
1898
|
+
this.sshKeyPassphrase = opts.sshKeyPassphrase;
|
|
1893
1899
|
this.tags = opts.tags ?? [];
|
|
1894
1900
|
this.tagSet = new Set(this.tags);
|
|
1895
1901
|
}
|
|
@@ -1901,6 +1907,7 @@ var Host = class {
|
|
|
1901
1907
|
user;
|
|
1902
1908
|
password;
|
|
1903
1909
|
sshKey;
|
|
1910
|
+
sshKeyPassphrase;
|
|
1904
1911
|
tags;
|
|
1905
1912
|
tagSet;
|
|
1906
1913
|
async decryptedPassword() {
|
|
@@ -1920,6 +1927,16 @@ var Host = class {
|
|
|
1920
1927
|
return await secret?.plaintext();
|
|
1921
1928
|
}
|
|
1922
1929
|
}
|
|
1930
|
+
async decryptedSshKeyPassphrase() {
|
|
1931
|
+
if (V(this.sshKeyPassphrase).isA(SecretRef)) {
|
|
1932
|
+
const secretRef = this.sshKeyPassphrase;
|
|
1933
|
+
const secret = this.config.getSecret(secretRef.name);
|
|
1934
|
+
return await secret?.plaintext();
|
|
1935
|
+
}
|
|
1936
|
+
if (typeof this.sshKeyPassphrase === "string") {
|
|
1937
|
+
return this.sshKeyPassphrase;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1923
1940
|
toYAML() {
|
|
1924
1941
|
let passwordForYaml = this.password;
|
|
1925
1942
|
if (this.password && V(this.password).isA(SecretRef)) {
|
|
@@ -1929,6 +1946,10 @@ var Host = class {
|
|
|
1929
1946
|
if (this.sshKey && V(this.sshKey).isA(SecretRef)) {
|
|
1930
1947
|
sshKeyForYaml = this.sshKey.toYAML();
|
|
1931
1948
|
}
|
|
1949
|
+
let sshKeyPassphraseForYaml = this.sshKeyPassphrase;
|
|
1950
|
+
if (this.sshKeyPassphrase && V(this.sshKeyPassphrase).isA(SecretRef)) {
|
|
1951
|
+
sshKeyPassphraseForYaml = this.sshKeyPassphrase.toYAML();
|
|
1952
|
+
}
|
|
1932
1953
|
return {
|
|
1933
1954
|
host: this.hostname,
|
|
1934
1955
|
// Always include the host field
|
|
@@ -1937,6 +1958,7 @@ var Host = class {
|
|
|
1937
1958
|
// Only include port if not default
|
|
1938
1959
|
password: passwordForYaml,
|
|
1939
1960
|
"ssh-key": sshKeyForYaml,
|
|
1961
|
+
"ssh-key-passphrase": sshKeyPassphraseForYaml,
|
|
1940
1962
|
tags: this.tags
|
|
1941
1963
|
};
|
|
1942
1964
|
}
|
|
@@ -2288,6 +2310,7 @@ var ConfigFile2 = class {
|
|
|
2288
2310
|
hostObj ||= {};
|
|
2289
2311
|
const password = this.parseSecretValue(hostObj.password);
|
|
2290
2312
|
const sshKey = this.parseSecretValue(hostObj["ssh-key"]);
|
|
2313
|
+
const sshKeyPassphrase = this.parseSecretValue(hostObj["ssh-key-passphrase"]);
|
|
2291
2314
|
const hostname = hostObj.host || alias;
|
|
2292
2315
|
hostMap.set(
|
|
2293
2316
|
alias,
|
|
@@ -2302,6 +2325,7 @@ var ConfigFile2 = class {
|
|
|
2302
2325
|
user: hostObj.user,
|
|
2303
2326
|
password,
|
|
2304
2327
|
sshKey,
|
|
2328
|
+
sshKeyPassphrase,
|
|
2305
2329
|
tags: hostObj.tags
|
|
2306
2330
|
})
|
|
2307
2331
|
);
|
|
@@ -2476,6 +2500,7 @@ var ProviderConfig = class _ProviderConfig {
|
|
|
2476
2500
|
user: input.user,
|
|
2477
2501
|
password: input.password,
|
|
2478
2502
|
sshKey: input.sshKey,
|
|
2503
|
+
sshKeyPassphrase: input.sshKeyPassphrase,
|
|
2479
2504
|
tags: input.tags
|
|
2480
2505
|
});
|
|
2481
2506
|
}
|
|
@@ -2519,6 +2544,7 @@ var FileConfigProvider = class {
|
|
|
2519
2544
|
port: h.port,
|
|
2520
2545
|
password: h.password,
|
|
2521
2546
|
sshKey: h.sshKey,
|
|
2547
|
+
sshKeyPassphrase: h.sshKeyPassphrase,
|
|
2522
2548
|
tags: h.tags
|
|
2523
2549
|
}));
|
|
2524
2550
|
}
|
|
@@ -2719,7 +2745,7 @@ var Verbosity = {
|
|
|
2719
2745
|
};
|
|
2720
2746
|
|
|
2721
2747
|
// src/version.ts
|
|
2722
|
-
var version = "0.1.
|
|
2748
|
+
var version = "0.1.59";
|
|
2723
2749
|
|
|
2724
2750
|
// src/commands/pkg/create.ts
|
|
2725
2751
|
import { promises as fs5 } from "fs";
|
|
@@ -4812,7 +4838,7 @@ var DirCreateOutputSchema = z.object({
|
|
|
4812
4838
|
})
|
|
4813
4839
|
);
|
|
4814
4840
|
async function runFn(context) {
|
|
4815
|
-
const { params, exec, run:
|
|
4841
|
+
const { params, exec, run: run249 } = context;
|
|
4816
4842
|
const sudoDefault = context.host ? !context.host.isLocal() : false;
|
|
4817
4843
|
const { path: path14, mode, owner, sudo = sudoDefault } = params;
|
|
4818
4844
|
if (!path14) {
|
|
@@ -4836,7 +4862,7 @@ async function runFn(context) {
|
|
|
4836
4862
|
}
|
|
4837
4863
|
}
|
|
4838
4864
|
if (mode) {
|
|
4839
|
-
const chmodResult = await
|
|
4865
|
+
const chmodResult = await run249(chmod_default({ path: path14, mode, sudo: true }));
|
|
4840
4866
|
if (!chmodResult?.success) {
|
|
4841
4867
|
return { success: false, error: chmodResult?.error ?? "Failed to set directory mode" };
|
|
4842
4868
|
}
|
|
@@ -5429,7 +5455,7 @@ async function ensureFile(context, file, sudo) {
|
|
|
5429
5455
|
await exec(["touch", file], { sudo });
|
|
5430
5456
|
}
|
|
5431
5457
|
async function runFn2(context) {
|
|
5432
|
-
const { params, exec, info, run:
|
|
5458
|
+
const { params, exec, info, run: run249, error } = context;
|
|
5433
5459
|
const {
|
|
5434
5460
|
file,
|
|
5435
5461
|
state = "present",
|
|
@@ -6116,7 +6142,7 @@ async function getOsReleaseInfo(exec) {
|
|
|
6116
6142
|
const cpeMatch = osRelease.match(/^CPE_NAME=(.*?)$/im);
|
|
6117
6143
|
if (idMatch) {
|
|
6118
6144
|
let id = idMatch[1].trim().replace(/"/g, "");
|
|
6119
|
-
|
|
6145
|
+
let idLike = idLikeMatch ? idLikeMatch[1].trim().replace(/"/g, "") : id;
|
|
6120
6146
|
const version2 = versionIdMatch && versionIdMatch[1].trim().replace(/"/g, "") || buildIdMatch && buildIdMatch[1].trim().replace(/"/g, "") || "unknown";
|
|
6121
6147
|
const nameValue = nameMatch ? nameMatch[1].trim().replace(/"/g, "") : "";
|
|
6122
6148
|
const prettyName = prettyNameMatch ? prettyNameMatch[1].trim().replace(/"/g, "") : "";
|
|
@@ -6125,6 +6151,10 @@ async function getOsReleaseInfo(exec) {
|
|
|
6125
6151
|
if (normalizedName.includes("rocky") || idLike.toLowerCase().includes("rocky")) {
|
|
6126
6152
|
id = "rocky";
|
|
6127
6153
|
}
|
|
6154
|
+
if (normalizedName.includes("xcp-ng") || id.toLowerCase() === "xenenterprise") {
|
|
6155
|
+
id = "xcp-ng";
|
|
6156
|
+
idLike = "xcp-ng";
|
|
6157
|
+
}
|
|
6128
6158
|
return {
|
|
6129
6159
|
idLike,
|
|
6130
6160
|
id,
|
|
@@ -6144,6 +6174,53 @@ async function getOsReleaseInfo(exec) {
|
|
|
6144
6174
|
};
|
|
6145
6175
|
}
|
|
6146
6176
|
}
|
|
6177
|
+
function parseKeyValueFile(contents) {
|
|
6178
|
+
return contents.split("\n").map((line) => line.trim()).filter(Boolean).reduce((acc, line) => {
|
|
6179
|
+
const match7 = line.match(/^([A-Za-z0-9_]+)=(.*)$/);
|
|
6180
|
+
if (!match7) {
|
|
6181
|
+
return acc;
|
|
6182
|
+
}
|
|
6183
|
+
const key = match7[1];
|
|
6184
|
+
const rawValue = match7[2];
|
|
6185
|
+
const value = rawValue.replace(/^"(.*)"$/, "$1");
|
|
6186
|
+
acc[key] = value;
|
|
6187
|
+
return acc;
|
|
6188
|
+
}, {});
|
|
6189
|
+
}
|
|
6190
|
+
async function detectSynologyInfo(exec) {
|
|
6191
|
+
try {
|
|
6192
|
+
const { stdout } = await exec(["cat", "/etc.defaults/VERSION"]);
|
|
6193
|
+
const values3 = parseKeyValueFile(stdout);
|
|
6194
|
+
const version2 = values3.productversion || values3.version || `${values3.major || ""}.${values3.minor || ""}`.trim();
|
|
6195
|
+
if (!version2 || version2 === ".") {
|
|
6196
|
+
return null;
|
|
6197
|
+
}
|
|
6198
|
+
return {
|
|
6199
|
+
idLike: "synology",
|
|
6200
|
+
id: "synology",
|
|
6201
|
+
version: version2
|
|
6202
|
+
};
|
|
6203
|
+
} catch {
|
|
6204
|
+
return null;
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
async function detectXcpNgInfo(exec) {
|
|
6208
|
+
try {
|
|
6209
|
+
const { stdout } = await exec(["cat", "/etc/redhat-release"]);
|
|
6210
|
+
if (!stdout.toLowerCase().includes("xcp-ng")) {
|
|
6211
|
+
return null;
|
|
6212
|
+
}
|
|
6213
|
+
const versionMatch = stdout.match(/([0-9]+(?:\.[0-9]+)+)/);
|
|
6214
|
+
const version2 = versionMatch ? versionMatch[1] : "unknown";
|
|
6215
|
+
return {
|
|
6216
|
+
idLike: "xcp-ng",
|
|
6217
|
+
id: "xcp-ng",
|
|
6218
|
+
version: version2
|
|
6219
|
+
};
|
|
6220
|
+
} catch {
|
|
6221
|
+
return null;
|
|
6222
|
+
}
|
|
6223
|
+
}
|
|
6147
6224
|
async function detectRockyLinux(exec) {
|
|
6148
6225
|
try {
|
|
6149
6226
|
const { stdout } = await exec([
|
|
@@ -6183,7 +6260,17 @@ var os_default = task(
|
|
|
6183
6260
|
const { stdout: swVersOutput } = await exec(["sw_vers", "-productVersion"]);
|
|
6184
6261
|
return [family, family, swVersOutput.trim()];
|
|
6185
6262
|
}).with("linux", async () => {
|
|
6186
|
-
|
|
6263
|
+
let { idLike, id, version: version2 } = await getOsReleaseInfo(exec);
|
|
6264
|
+
if (id === "unknown") {
|
|
6265
|
+
const synologyInfo = await detectSynologyInfo(exec);
|
|
6266
|
+
if (synologyInfo) {
|
|
6267
|
+
return [synologyInfo.idLike, synologyInfo.id, synologyInfo.version];
|
|
6268
|
+
}
|
|
6269
|
+
const xcpNgInfo = await detectXcpNgInfo(exec);
|
|
6270
|
+
if (xcpNgInfo) {
|
|
6271
|
+
return [xcpNgInfo.idLike, xcpNgInfo.id, xcpNgInfo.version];
|
|
6272
|
+
}
|
|
6273
|
+
}
|
|
6187
6274
|
return [idLike, id, version2];
|
|
6188
6275
|
}).with("solaris", async () => {
|
|
6189
6276
|
const { stdout: unameROutput } = await exec(["uname", "-r"]);
|
|
@@ -6266,15 +6353,29 @@ async function run27(context) {
|
|
|
6266
6353
|
const hostnameResult = await runTask(hostname_default({}));
|
|
6267
6354
|
const name = hostnameResult.hostname;
|
|
6268
6355
|
const os6 = await runTask(os_default({}));
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6356
|
+
let lsb_release = {
|
|
6357
|
+
"Distributor ID": "",
|
|
6358
|
+
Description: "",
|
|
6359
|
+
Release: "",
|
|
6360
|
+
Codename: ""
|
|
6361
|
+
};
|
|
6362
|
+
try {
|
|
6363
|
+
const { stdout: lsbOutput } = await exec(["lsb_release", "-a"]);
|
|
6364
|
+
lsb_release = lsbOutput.split("\n").filter(Boolean).reduce((acc, line) => {
|
|
6365
|
+
const [key, ...valueParts] = line.split(":");
|
|
6366
|
+
const value = valueParts.join(":").trim();
|
|
6367
|
+
acc[key.trim()] = value;
|
|
6368
|
+
return acc;
|
|
6369
|
+
}, {});
|
|
6370
|
+
} catch {
|
|
6371
|
+
}
|
|
6372
|
+
let lscpu = [];
|
|
6373
|
+
try {
|
|
6374
|
+
const { stdout: lscpuOutput } = await exec(["lscpu", "-J"]);
|
|
6375
|
+
const parsed = JSON.parse(lscpuOutput);
|
|
6376
|
+
lscpu = Array.isArray(parsed?.lscpu) ? parsed.lscpu : [];
|
|
6377
|
+
} catch {
|
|
6378
|
+
}
|
|
6278
6379
|
return {
|
|
6279
6380
|
host: {
|
|
6280
6381
|
name,
|
|
@@ -7657,10 +7758,6 @@ var uninstall_default2 = task(run41, {
|
|
|
7657
7758
|
// src/core/pkg/dnf/update.ts
|
|
7658
7759
|
async function run42(context) {
|
|
7659
7760
|
const { sudo = true, updateMetadata = true } = context.params;
|
|
7660
|
-
const isProtectedPackageError = (output) => {
|
|
7661
|
-
const normalized = output.toLowerCase();
|
|
7662
|
-
return normalized.includes("protected packages") || normalized.includes("protected package") || normalized.includes("the following protected") || normalized.includes("systemd-udev");
|
|
7663
|
-
};
|
|
7664
7761
|
try {
|
|
7665
7762
|
if (!updateMetadata) {
|
|
7666
7763
|
return {
|
|
@@ -7671,55 +7768,25 @@ async function run42(context) {
|
|
|
7671
7768
|
updatedPackages: []
|
|
7672
7769
|
};
|
|
7673
7770
|
}
|
|
7674
|
-
const command = ["dnf", "
|
|
7771
|
+
const command = ["dnf", "makecache", "--refresh", "--quiet"];
|
|
7675
7772
|
const result = await context.exec(command, { sudo });
|
|
7676
|
-
const combinedOutput = `${result.stdout}
|
|
7677
|
-
${result.stderr}`;
|
|
7678
7773
|
if (result.exitCode === 0) {
|
|
7679
|
-
const updatedPackages = [];
|
|
7680
|
-
let packagesUpdated = 0;
|
|
7681
|
-
const lines = result.stdout.split("\n");
|
|
7682
|
-
for (const line of lines) {
|
|
7683
|
-
if (line.includes("packages upgraded")) {
|
|
7684
|
-
const match7 = line.match(/(\d+)\s+packages? upgraded/);
|
|
7685
|
-
if (match7) {
|
|
7686
|
-
packagesUpdated = parseInt(match7[1], 10);
|
|
7687
|
-
}
|
|
7688
|
-
} else if (line.includes("Installing") || line.includes("Upgrading")) {
|
|
7689
|
-
const match7 = line.match(/(?:Installing|Upgrading)\s+(\S+)/);
|
|
7690
|
-
if (match7) {
|
|
7691
|
-
updatedPackages.push(match7[1]);
|
|
7692
|
-
}
|
|
7693
|
-
}
|
|
7694
|
-
}
|
|
7695
7774
|
return {
|
|
7696
7775
|
success: true,
|
|
7697
7776
|
packageManager: "dnf",
|
|
7698
7777
|
output: result.stdout,
|
|
7699
|
-
packagesUpdated,
|
|
7700
|
-
updatedPackages
|
|
7701
|
-
};
|
|
7702
|
-
} else {
|
|
7703
|
-
if (isProtectedPackageError(combinedOutput)) {
|
|
7704
|
-
context.warn("DNF skipped updates because the transaction would remove protected packages.");
|
|
7705
|
-
return {
|
|
7706
|
-
success: true,
|
|
7707
|
-
packageManager: "dnf",
|
|
7708
|
-
output: combinedOutput,
|
|
7709
|
-
packagesUpdated: 0,
|
|
7710
|
-
updatedPackages: [],
|
|
7711
|
-
warning: "DNF skipped updates due to protected packages; leaving system unchanged."
|
|
7712
|
-
};
|
|
7713
|
-
}
|
|
7714
|
-
return {
|
|
7715
|
-
success: false,
|
|
7716
|
-
error: result.stderr || "Update failed",
|
|
7717
|
-
packageManager: "dnf",
|
|
7718
|
-
output: result.stdout,
|
|
7719
7778
|
packagesUpdated: 0,
|
|
7720
7779
|
updatedPackages: []
|
|
7721
7780
|
};
|
|
7722
7781
|
}
|
|
7782
|
+
return {
|
|
7783
|
+
success: false,
|
|
7784
|
+
error: result.stderr || "Update failed",
|
|
7785
|
+
packageManager: "dnf",
|
|
7786
|
+
output: result.stdout,
|
|
7787
|
+
packagesUpdated: 0,
|
|
7788
|
+
updatedPackages: []
|
|
7789
|
+
};
|
|
7723
7790
|
} catch (error) {
|
|
7724
7791
|
context.error("Error updating packages:", error);
|
|
7725
7792
|
return {
|
|
@@ -7733,7 +7800,7 @@ ${result.stderr}`;
|
|
|
7733
7800
|
}
|
|
7734
7801
|
var update_default2 = task(run42, {
|
|
7735
7802
|
name: "update",
|
|
7736
|
-
description: "Update
|
|
7803
|
+
description: "Update package metadata using dnf package manager",
|
|
7737
7804
|
inputSchema: DnfUpdateParamsSchema,
|
|
7738
7805
|
outputSchema: DnfUpdateResultSchema
|
|
7739
7806
|
});
|
|
@@ -10378,6 +10445,44 @@ async function packageManagerSpecificInstall(pkgManager, context) {
|
|
|
10378
10445
|
return abstractInstallFallback(context, pkgManager);
|
|
10379
10446
|
}
|
|
10380
10447
|
}
|
|
10448
|
+
async function packageManagerSpecificUpdate(pkgManager, context) {
|
|
10449
|
+
const mapAptParams = () => ({
|
|
10450
|
+
...context.params,
|
|
10451
|
+
packageManager: "apt",
|
|
10452
|
+
updateLists: true,
|
|
10453
|
+
upgrade: false
|
|
10454
|
+
});
|
|
10455
|
+
const mapDnfParams = () => ({
|
|
10456
|
+
...context.params,
|
|
10457
|
+
packageManager: "dnf",
|
|
10458
|
+
updateMetadata: true,
|
|
10459
|
+
upgrade: false
|
|
10460
|
+
});
|
|
10461
|
+
const mapPacmanParams = () => ({
|
|
10462
|
+
...context.params,
|
|
10463
|
+
packageManager: "pacman",
|
|
10464
|
+
updateMetadata: true,
|
|
10465
|
+
upgrade: false
|
|
10466
|
+
});
|
|
10467
|
+
const mapYumParams = () => ({
|
|
10468
|
+
...context.params,
|
|
10469
|
+
packageManager: "yum",
|
|
10470
|
+
updateMetadata: true,
|
|
10471
|
+
upgrade: false
|
|
10472
|
+
});
|
|
10473
|
+
switch (pkgManager.name) {
|
|
10474
|
+
case "apt":
|
|
10475
|
+
return await context.run(update_default(mapAptParams()));
|
|
10476
|
+
case "dnf":
|
|
10477
|
+
return await context.run(update_default2(mapDnfParams()));
|
|
10478
|
+
case "pacman":
|
|
10479
|
+
return await context.run(update_default3(mapPacmanParams()));
|
|
10480
|
+
case "yum":
|
|
10481
|
+
return await context.run(update_default4(mapYumParams()));
|
|
10482
|
+
default:
|
|
10483
|
+
return await abstractUpdateFallback(context, pkgManager);
|
|
10484
|
+
}
|
|
10485
|
+
}
|
|
10381
10486
|
function buildCommandArray(pkgManager, operation, packages, extraArgs) {
|
|
10382
10487
|
const baseCommand = pkgManager[operation];
|
|
10383
10488
|
if (!baseCommand) {
|
|
@@ -10667,8 +10772,8 @@ async function abstractUninstallFallback(context) {
|
|
|
10667
10772
|
}
|
|
10668
10773
|
}
|
|
10669
10774
|
async function abstractUpdate(context) {
|
|
10670
|
-
const { params,
|
|
10671
|
-
const {
|
|
10775
|
+
const { params, warn } = context;
|
|
10776
|
+
const { packageManager: forcedManager } = params;
|
|
10672
10777
|
try {
|
|
10673
10778
|
const pkgManager = forcedManager ? PACKAGE_MANAGERS[forcedManager] : await detectPackageManager(context);
|
|
10674
10779
|
if (!pkgManager) {
|
|
@@ -10678,14 +10783,26 @@ async function abstractUpdate(context) {
|
|
|
10678
10783
|
};
|
|
10679
10784
|
}
|
|
10680
10785
|
warn(`Using package manager: ${pkgManager.name}`);
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10786
|
+
return await packageManagerSpecificUpdate(pkgManager, context);
|
|
10787
|
+
} catch (error) {
|
|
10788
|
+
return {
|
|
10789
|
+
success: false,
|
|
10790
|
+
error: error instanceof Error ? error.message : String(error)
|
|
10791
|
+
};
|
|
10792
|
+
}
|
|
10793
|
+
}
|
|
10794
|
+
async function abstractUpdateFallback(context, detectedManager) {
|
|
10795
|
+
const { params, exec, warn, info } = context;
|
|
10796
|
+
const { sudo = true, packageManager: forcedManager, extraArgs, input: userInput } = params;
|
|
10797
|
+
try {
|
|
10798
|
+
const pkgManager = detectedManager || (forcedManager ? PACKAGE_MANAGERS[forcedManager] : await detectPackageManager(context));
|
|
10799
|
+
if (!pkgManager) {
|
|
10800
|
+
return {
|
|
10801
|
+
success: false,
|
|
10802
|
+
error: "No supported package manager detected. Please specify one explicitly."
|
|
10803
|
+
};
|
|
10688
10804
|
}
|
|
10805
|
+
warn(`Using fallback implementation for package manager: ${pkgManager.name}`);
|
|
10689
10806
|
const mergedInput = getInteractiveInput(pkgManager.name, userInput);
|
|
10690
10807
|
const commandArray = buildCommandArray(pkgManager, "updateCommand", [], extraArgs);
|
|
10691
10808
|
info(`Executing: ${commandArray.join(" ")}`);
|
|
@@ -11220,7 +11337,8 @@ async function abstractClean(context) {
|
|
|
11220
11337
|
var AbstractPkgUpdateParamsSchema = AbstractPkgParamsSchema.pick({
|
|
11221
11338
|
sudo: true,
|
|
11222
11339
|
packageManager: true,
|
|
11223
|
-
extraArgs: true
|
|
11340
|
+
extraArgs: true,
|
|
11341
|
+
input: true
|
|
11224
11342
|
});
|
|
11225
11343
|
var AbstractPkgUpdateResultSchema = AbstractPkgResultSchema;
|
|
11226
11344
|
async function run68(context) {
|
|
@@ -11601,7 +11719,6 @@ async function run75(context) {
|
|
|
11601
11719
|
const { params, run: runTask, exec, log, info, error } = context;
|
|
11602
11720
|
let { public_key, user, sudo } = params;
|
|
11603
11721
|
const publicKeyTrimmed = public_key.trim();
|
|
11604
|
-
const sudoPrefix = sudo ? ["sudo"] : [];
|
|
11605
11722
|
if (!user) {
|
|
11606
11723
|
const usernameResult = await runTask(get_username_default());
|
|
11607
11724
|
if (usernameResult instanceof Error) {
|
|
@@ -11655,9 +11772,7 @@ async function run75(context) {
|
|
|
11655
11772
|
);
|
|
11656
11773
|
return { success: false, changed: false };
|
|
11657
11774
|
}
|
|
11658
|
-
const
|
|
11659
|
-
checkKeyCommandParts.push("sudo", "-u", user, "grep", "-xqF", publicKeyTrimmed, authorizedKeysFile);
|
|
11660
|
-
const checkKeyCmdResult = await exec(checkKeyCommandParts);
|
|
11775
|
+
const checkKeyCmdResult = await exec(["grep", "-xqF", publicKeyTrimmed, authorizedKeysFile], { sudo });
|
|
11661
11776
|
if (checkKeyCmdResult.exitCode === 0) {
|
|
11662
11777
|
info(`SSH key already exists in ${authorizedKeysFile} for user ${user}.`);
|
|
11663
11778
|
return { success: true, changed: false };
|
|
@@ -11667,7 +11782,7 @@ async function run75(context) {
|
|
|
11667
11782
|
}
|
|
11668
11783
|
const escapedPublicKey = publicKeyTrimmed.replace(/"/g, '\\"').replace(/\$/g, "\\$").replace(/`/g, "\\`");
|
|
11669
11784
|
const command = `echo "${escapedPublicKey}" >> "${authorizedKeysFile}"`;
|
|
11670
|
-
const addKeyResult = await exec([
|
|
11785
|
+
const addKeyResult = await exec(["sh", "-c", command], { sudo });
|
|
11671
11786
|
if (!addKeyResult.success) {
|
|
11672
11787
|
error(`Failed to append public key to ${authorizedKeysFile}: ${addKeyResult.stderr}`);
|
|
11673
11788
|
return { success: false, changed: false };
|
|
@@ -11965,7 +12080,7 @@ async function bootstrapServiceAccount(context) {
|
|
|
11965
12080
|
create_home = true,
|
|
11966
12081
|
create_group = true,
|
|
11967
12082
|
system = false,
|
|
11968
|
-
skip_packages =
|
|
12083
|
+
skip_packages = true
|
|
11969
12084
|
} = params;
|
|
11970
12085
|
const skipPackages = typeof skip_packages === "string" ? skip_packages === "true" : Boolean(skip_packages);
|
|
11971
12086
|
if (!username || !password || !public_key) {
|
|
@@ -12218,7 +12333,6 @@ __export(pkg_exports, {
|
|
|
12218
12333
|
removeCp: () => remove_cp_default,
|
|
12219
12334
|
search: () => search_default5,
|
|
12220
12335
|
update: () => update_default5,
|
|
12221
|
-
updateCp: () => update_cp_default,
|
|
12222
12336
|
upgrade: () => upgrade_default5,
|
|
12223
12337
|
yum: () => yum_exports
|
|
12224
12338
|
});
|
|
@@ -12729,94 +12843,6 @@ var remove_default = task(run89, {
|
|
|
12729
12843
|
// src/core/pkg/remove-cp.ts
|
|
12730
12844
|
var remove_cp_default = remove_default;
|
|
12731
12845
|
|
|
12732
|
-
// src/core/pkg/update/arch.ts
|
|
12733
|
-
async function run90(context) {
|
|
12734
|
-
const {
|
|
12735
|
-
params: { package: pkg, sudo = true },
|
|
12736
|
-
exec
|
|
12737
|
-
} = context;
|
|
12738
|
-
const commandParts = [sudo ? "sudo" : "", "pacman", "-Syu", "--noconfirm"];
|
|
12739
|
-
if (pkg && Array.isArray(pkg) && pkg.length) {
|
|
12740
|
-
commandParts.push(...pkg);
|
|
12741
|
-
}
|
|
12742
|
-
const { success } = await exec(commandParts.filter(Boolean).join(" "), { sudo });
|
|
12743
|
-
return { success };
|
|
12744
|
-
}
|
|
12745
|
-
var update = task(run90);
|
|
12746
|
-
|
|
12747
|
-
// src/core/pkg/update/debian.ts
|
|
12748
|
-
async function run91(context) {
|
|
12749
|
-
const {
|
|
12750
|
-
params: { package: pkg, sudo = true, fullUpgrade = false },
|
|
12751
|
-
exec
|
|
12752
|
-
} = context;
|
|
12753
|
-
const prefix = sudo ? "sudo " : "";
|
|
12754
|
-
if (!pkg || Array.isArray(pkg) && pkg.length === 0) {
|
|
12755
|
-
const upgradeCmd = fullUpgrade ? "apt-get dist-upgrade -y" : "apt-get upgrade -y";
|
|
12756
|
-
const { success: u1 } = await exec(`${prefix}apt-get update`, { sudo });
|
|
12757
|
-
if (!u1) return { success: false };
|
|
12758
|
-
const { success: success2 } = await exec(prefix + upgradeCmd, { sudo });
|
|
12759
|
-
return { success: success2 };
|
|
12760
|
-
}
|
|
12761
|
-
const packages = Array.isArray(pkg) ? pkg : [pkg];
|
|
12762
|
-
const { success } = await exec(`${prefix}apt-get install -y --only-upgrade ${packages.join(" ")}`, { sudo });
|
|
12763
|
-
return { success };
|
|
12764
|
-
}
|
|
12765
|
-
var update2 = task(run91);
|
|
12766
|
-
|
|
12767
|
-
// src/core/pkg/update/fedora.ts
|
|
12768
|
-
async function run92(context) {
|
|
12769
|
-
const {
|
|
12770
|
-
params: { package: pkg, sudo = true },
|
|
12771
|
-
exec
|
|
12772
|
-
} = context;
|
|
12773
|
-
const prefix = sudo ? "sudo " : "";
|
|
12774
|
-
if (!pkg || Array.isArray(pkg) && pkg.length === 0) {
|
|
12775
|
-
const { success: success2 } = await exec(`${prefix}dnf upgrade -y`, { sudo });
|
|
12776
|
-
return { success: success2 };
|
|
12777
|
-
}
|
|
12778
|
-
const packages = Array.isArray(pkg) ? pkg : [pkg];
|
|
12779
|
-
const { success } = await exec(`${prefix}dnf upgrade -y ${packages.join(" ")}`, { sudo });
|
|
12780
|
-
return { success };
|
|
12781
|
-
}
|
|
12782
|
-
var update3 = task(run92);
|
|
12783
|
-
|
|
12784
|
-
// src/core/pkg/update/index.ts
|
|
12785
|
-
async function run93(context) {
|
|
12786
|
-
const { params: taskParams, run: runTask, error } = context;
|
|
12787
|
-
const osDetails = await runTask(os_default());
|
|
12788
|
-
if (osDetails instanceof Error) {
|
|
12789
|
-
error(`Failed to determine OS details: ${osDetails.message}`);
|
|
12790
|
-
return { success: false };
|
|
12791
|
-
}
|
|
12792
|
-
const baseOs = String(osDetails?.os ?? "");
|
|
12793
|
-
let result;
|
|
12794
|
-
if (/arch/.test(baseOs)) {
|
|
12795
|
-
result = await runTask(update(taskParams));
|
|
12796
|
-
} else if (/debian|ubuntu/.test(baseOs)) {
|
|
12797
|
-
result = await runTask(update2(taskParams));
|
|
12798
|
-
} else if (baseOs === "fedora") {
|
|
12799
|
-
result = await runTask(update3(taskParams));
|
|
12800
|
-
} else {
|
|
12801
|
-
error(`Unsupported OS (${baseOs}) for pkg.update`);
|
|
12802
|
-
return { success: false };
|
|
12803
|
-
}
|
|
12804
|
-
if (result instanceof Error) {
|
|
12805
|
-
error(`pkg.update failed: ${result.message}`);
|
|
12806
|
-
return { success: false };
|
|
12807
|
-
}
|
|
12808
|
-
return result;
|
|
12809
|
-
}
|
|
12810
|
-
var update_default6 = task(run93, {
|
|
12811
|
-
name: "update",
|
|
12812
|
-
description: "Updates packages using the appropriate OS package manager.",
|
|
12813
|
-
inputSchema: PkgUpdateParamsSchema,
|
|
12814
|
-
outputSchema: PkgUpdateResultSchema
|
|
12815
|
-
});
|
|
12816
|
-
|
|
12817
|
-
// src/core/pkg/update-cp.ts
|
|
12818
|
-
var update_cp_default = update_default6;
|
|
12819
|
-
|
|
12820
12846
|
// src/core/pkg/search.ts
|
|
12821
12847
|
var AbstractPkgSearchParamsSchema = z.object({
|
|
12822
12848
|
/** Search query */
|
|
@@ -12825,13 +12851,13 @@ var AbstractPkgSearchParamsSchema = z.object({
|
|
|
12825
12851
|
packageManager: z.string().optional()
|
|
12826
12852
|
});
|
|
12827
12853
|
var AbstractPkgSearchResultSchema = AbstractPkgResultSchema;
|
|
12828
|
-
async function
|
|
12854
|
+
async function run90(context) {
|
|
12829
12855
|
const result = await abstractSearch(context);
|
|
12830
12856
|
return {
|
|
12831
12857
|
...result
|
|
12832
12858
|
};
|
|
12833
12859
|
}
|
|
12834
|
-
var search_default5 = task(
|
|
12860
|
+
var search_default5 = task(run90, {
|
|
12835
12861
|
description: "Search for packages using auto-detected or specified package manager",
|
|
12836
12862
|
inputSchema: AbstractPkgSearchParamsSchema,
|
|
12837
12863
|
outputSchema: AbstractPkgSearchResultSchema
|
|
@@ -12843,10 +12869,10 @@ var AbstractPkgListParamsSchema = z.object({
|
|
|
12843
12869
|
packageManager: z.string().optional()
|
|
12844
12870
|
});
|
|
12845
12871
|
var AbstractPkgListResultSchema = AbstractPkgResultSchema;
|
|
12846
|
-
async function
|
|
12872
|
+
async function run91(context) {
|
|
12847
12873
|
return await abstractList(context);
|
|
12848
12874
|
}
|
|
12849
|
-
var list_default7 = task(
|
|
12875
|
+
var list_default7 = task(run91, {
|
|
12850
12876
|
description: "List installed packages using auto-detected or specified package manager",
|
|
12851
12877
|
inputSchema: AbstractPkgListParamsSchema,
|
|
12852
12878
|
outputSchema: AbstractPkgListResultSchema
|
|
@@ -12858,10 +12884,10 @@ var AbstractPkgCleanParamsSchema = AbstractPkgParamsSchema.pick({
|
|
|
12858
12884
|
sudo: true
|
|
12859
12885
|
});
|
|
12860
12886
|
var AbstractPkgCleanResultSchema = AbstractPkgResultSchema;
|
|
12861
|
-
async function
|
|
12887
|
+
async function run92(context) {
|
|
12862
12888
|
return await abstractClean(context);
|
|
12863
12889
|
}
|
|
12864
|
-
var clean_default5 = task(
|
|
12890
|
+
var clean_default5 = task(run92, {
|
|
12865
12891
|
description: "Clean package cache using auto-detected or specified package manager",
|
|
12866
12892
|
inputSchema: AbstractPkgCleanParamsSchema,
|
|
12867
12893
|
outputSchema: AbstractPkgCleanResultSchema
|
|
@@ -12915,7 +12941,7 @@ var K3supInstallOutputSchema = z.object({
|
|
|
12915
12941
|
/** The command that would be run if --print-command was used */
|
|
12916
12942
|
executedCommand: z.string().optional()
|
|
12917
12943
|
});
|
|
12918
|
-
async function
|
|
12944
|
+
async function run93(context) {
|
|
12919
12945
|
const { params, exec, log, error, debug } = context;
|
|
12920
12946
|
const k3supCmd = ["k3sup", "install"];
|
|
12921
12947
|
const addFlag = (flag, condition) => {
|
|
@@ -12973,7 +12999,7 @@ async function run97(context) {
|
|
|
12973
12999
|
throw e;
|
|
12974
13000
|
}
|
|
12975
13001
|
}
|
|
12976
|
-
var k3sup_install_default = task(
|
|
13002
|
+
var k3sup_install_default = task(run93, {
|
|
12977
13003
|
name: "k3sup-install",
|
|
12978
13004
|
description: "K3s k3sup-install.",
|
|
12979
13005
|
inputSchema: K3supInstallInputSchema,
|
|
@@ -13737,7 +13763,7 @@ var AddUsersOutputSchema = z.object({
|
|
|
13737
13763
|
error: z.string().optional()
|
|
13738
13764
|
})
|
|
13739
13765
|
);
|
|
13740
|
-
async function
|
|
13766
|
+
async function run94(context) {
|
|
13741
13767
|
const { params, info, warn, error, run: runTask } = context;
|
|
13742
13768
|
const { users } = params;
|
|
13743
13769
|
if (!users || users.length === 0) {
|
|
@@ -13770,7 +13796,7 @@ async function run98(context) {
|
|
|
13770
13796
|
return { success: false, error: message };
|
|
13771
13797
|
}
|
|
13772
13798
|
}
|
|
13773
|
-
var add_users_default = task(
|
|
13799
|
+
var add_users_default = task(run94, {
|
|
13774
13800
|
description: "Adds one or more users to the docker group.",
|
|
13775
13801
|
inputSchema: AddUsersInputSchema,
|
|
13776
13802
|
outputSchema: AddUsersOutputSchema
|
|
@@ -13790,7 +13816,7 @@ var InstallComposeOutputSchema = z.object({
|
|
|
13790
13816
|
error: z.string().optional()
|
|
13791
13817
|
})
|
|
13792
13818
|
);
|
|
13793
|
-
async function
|
|
13819
|
+
async function run95(context) {
|
|
13794
13820
|
const { params, info, error, run: runTask } = context;
|
|
13795
13821
|
const version2 = params.version ?? "v2.24.5";
|
|
13796
13822
|
const composePath = params.path ?? "/usr/local/bin/docker-compose";
|
|
@@ -13828,7 +13854,7 @@ async function run99(context) {
|
|
|
13828
13854
|
return { success: false, error: message };
|
|
13829
13855
|
}
|
|
13830
13856
|
}
|
|
13831
|
-
var install_compose_default = task(
|
|
13857
|
+
var install_compose_default = task(run95, {
|
|
13832
13858
|
description: "Installs the Docker Compose standalone binary.",
|
|
13833
13859
|
inputSchema: InstallComposeInputSchema,
|
|
13834
13860
|
outputSchema: InstallComposeOutputSchema
|
|
@@ -13851,7 +13877,7 @@ var DockerInstallOutputSchema = z.object({
|
|
|
13851
13877
|
error: z.string().optional()
|
|
13852
13878
|
})
|
|
13853
13879
|
);
|
|
13854
|
-
async function
|
|
13880
|
+
async function run96(context) {
|
|
13855
13881
|
const { info, run: runTask, params, error: logError2 } = context;
|
|
13856
13882
|
const installComposePlugin = params.install_compose_plugin !== false;
|
|
13857
13883
|
const installComposeStandalone = params.install_compose_standalone === true;
|
|
@@ -14090,7 +14116,7 @@ function sanitizeSystemctlState(value) {
|
|
|
14090
14116
|
}
|
|
14091
14117
|
return value.replace(/\u001b\][^\u001b]*\u001b\\/g, "").replace(/\u001b\[[0-9;?]*[ -/]*[@-~]/g, "").trim().toLowerCase();
|
|
14092
14118
|
}
|
|
14093
|
-
var install_default6 = task(
|
|
14119
|
+
var install_default6 = task(run96, {
|
|
14094
14120
|
name: "install",
|
|
14095
14121
|
description: "Installs and configures Docker, Docker Compose, and group membership.",
|
|
14096
14122
|
inputSchema: DockerInstallInputSchema,
|
|
@@ -14239,7 +14265,7 @@ var DockerRunContainerOutputSchema = z.object({
|
|
|
14239
14265
|
containerName: z.string().optional(),
|
|
14240
14266
|
error: z.string().optional()
|
|
14241
14267
|
});
|
|
14242
|
-
async function
|
|
14268
|
+
async function run97(context) {
|
|
14243
14269
|
const { params, exec, info, error: logError2 } = context;
|
|
14244
14270
|
if (!params.image) {
|
|
14245
14271
|
const message = "Docker image is required.";
|
|
@@ -14280,7 +14306,7 @@ async function run101(context) {
|
|
|
14280
14306
|
containerName: params.name
|
|
14281
14307
|
};
|
|
14282
14308
|
}
|
|
14283
|
-
var run_container_default = task(
|
|
14309
|
+
var run_container_default = task(run97, {
|
|
14284
14310
|
description: "Runs a Docker container and returns its output (attached).",
|
|
14285
14311
|
inputSchema: DockerRunContainerInputSchema,
|
|
14286
14312
|
outputSchema: DockerRunContainerOutputSchema
|
|
@@ -14297,7 +14323,7 @@ var DockerRunDetachedOutputSchema = z.object({
|
|
|
14297
14323
|
containerName: z.string().optional(),
|
|
14298
14324
|
error: z.string().optional()
|
|
14299
14325
|
});
|
|
14300
|
-
async function
|
|
14326
|
+
async function run98(context) {
|
|
14301
14327
|
const { params, exec, info, error: logError2 } = context;
|
|
14302
14328
|
if (!params.image) {
|
|
14303
14329
|
const message = "Docker image is required.";
|
|
@@ -14337,7 +14363,7 @@ async function run102(context) {
|
|
|
14337
14363
|
containerName: params.name
|
|
14338
14364
|
};
|
|
14339
14365
|
}
|
|
14340
|
-
var run_container_detached_default = task(
|
|
14366
|
+
var run_container_detached_default = task(run98, {
|
|
14341
14367
|
description: "Runs a Docker container in detached mode and returns its metadata.",
|
|
14342
14368
|
inputSchema: DockerRunDetachedInputSchema,
|
|
14343
14369
|
outputSchema: DockerRunDetachedOutputSchema
|
|
@@ -14396,7 +14422,7 @@ var ProcessListOutputSchema = z.object({
|
|
|
14396
14422
|
error: z.string().optional()
|
|
14397
14423
|
})
|
|
14398
14424
|
);
|
|
14399
|
-
async function
|
|
14425
|
+
async function run99(context) {
|
|
14400
14426
|
const { params, exec, debug, error } = context;
|
|
14401
14427
|
const { user, command, limit, sort, reverse } = params;
|
|
14402
14428
|
try {
|
|
@@ -14482,7 +14508,7 @@ async function run103(context) {
|
|
|
14482
14508
|
return { success: false, error: errorMsg };
|
|
14483
14509
|
}
|
|
14484
14510
|
}
|
|
14485
|
-
var list_default8 = task(
|
|
14511
|
+
var list_default8 = task(run99, {
|
|
14486
14512
|
name: "list",
|
|
14487
14513
|
description: "Lists processes on the system.",
|
|
14488
14514
|
inputSchema: ProcessListInputSchema,
|
|
@@ -14528,7 +14554,7 @@ var ProcessSearchOutputSchema = z.object({
|
|
|
14528
14554
|
error: z.string().optional()
|
|
14529
14555
|
})
|
|
14530
14556
|
);
|
|
14531
|
-
async function
|
|
14557
|
+
async function run100(context) {
|
|
14532
14558
|
const { params, exec, debug, error } = context;
|
|
14533
14559
|
const { name, user, pid, ppid, args, state, regex = false, ignoreCase = false, limit } = params;
|
|
14534
14560
|
debug(`Searching processes with params: ${JSON.stringify(params)}`);
|
|
@@ -14642,7 +14668,7 @@ function filterProcesses(processes, filters) {
|
|
|
14642
14668
|
return true;
|
|
14643
14669
|
});
|
|
14644
14670
|
}
|
|
14645
|
-
var search_default6 = task(
|
|
14671
|
+
var search_default6 = task(run100, {
|
|
14646
14672
|
name: "search",
|
|
14647
14673
|
description: "Search for processes matching specified criteria.",
|
|
14648
14674
|
inputSchema: ProcessSearchInputSchema,
|
|
@@ -14670,7 +14696,7 @@ var ProcessKillOutputSchema = z.object({
|
|
|
14670
14696
|
error: z.string().optional()
|
|
14671
14697
|
})
|
|
14672
14698
|
);
|
|
14673
|
-
async function
|
|
14699
|
+
async function run101(context) {
|
|
14674
14700
|
const { params, exec, debug, error } = context;
|
|
14675
14701
|
const { pid, user, command, signal = "TERM", force = false, sudo = false } = params;
|
|
14676
14702
|
try {
|
|
@@ -14758,7 +14784,7 @@ async function run105(context) {
|
|
|
14758
14784
|
return { success: false, error: errorMsg };
|
|
14759
14785
|
}
|
|
14760
14786
|
}
|
|
14761
|
-
var kill_default = task(
|
|
14787
|
+
var kill_default = task(run101, {
|
|
14762
14788
|
name: "kill",
|
|
14763
14789
|
description: "Kills processes matching specified criteria. Requires at least one filtering parameter (pid, user, or command) to prevent accidental killing of all processes.",
|
|
14764
14790
|
inputSchema: ProcessKillInputSchema,
|
|
@@ -14779,7 +14805,7 @@ var ProcessSignalOutputSchema = z.object({
|
|
|
14779
14805
|
error: z.string().optional()
|
|
14780
14806
|
})
|
|
14781
14807
|
);
|
|
14782
|
-
async function
|
|
14808
|
+
async function run102(context) {
|
|
14783
14809
|
const { params, exec, debug, error } = context;
|
|
14784
14810
|
const { pid, signal = "TERM", sudo = false } = params;
|
|
14785
14811
|
if (!pid || pid <= 0) {
|
|
@@ -14802,7 +14828,7 @@ async function run106(context) {
|
|
|
14802
14828
|
return { success: false, error: errorMsg };
|
|
14803
14829
|
}
|
|
14804
14830
|
}
|
|
14805
|
-
var signal_default = task(
|
|
14831
|
+
var signal_default = task(run102, {
|
|
14806
14832
|
name: "signal",
|
|
14807
14833
|
description: "Sends a signal to a process.",
|
|
14808
14834
|
inputSchema: ProcessSignalInputSchema,
|
|
@@ -14838,7 +14864,7 @@ var ProcessInfoOutputSchema = z.object({
|
|
|
14838
14864
|
error: z.string().optional()
|
|
14839
14865
|
})
|
|
14840
14866
|
);
|
|
14841
|
-
async function
|
|
14867
|
+
async function run103(context) {
|
|
14842
14868
|
const { params, exec, debug, error } = context;
|
|
14843
14869
|
const { pid } = params;
|
|
14844
14870
|
if (!pid || pid <= 0) {
|
|
@@ -14914,7 +14940,7 @@ async function run107(context) {
|
|
|
14914
14940
|
return { success: false, error: errorMsg };
|
|
14915
14941
|
}
|
|
14916
14942
|
}
|
|
14917
|
-
var info_default7 = task(
|
|
14943
|
+
var info_default7 = task(run103, {
|
|
14918
14944
|
name: "info",
|
|
14919
14945
|
description: "Gets detailed information about a specific process.",
|
|
14920
14946
|
inputSchema: ProcessInfoInputSchema,
|
|
@@ -14978,7 +15004,7 @@ var ProcessTopOutputSchema = z.object({
|
|
|
14978
15004
|
timestamp: z.string()
|
|
14979
15005
|
})
|
|
14980
15006
|
);
|
|
14981
|
-
async function
|
|
15007
|
+
async function run104(context) {
|
|
14982
15008
|
const { params, exec, debug, error } = context;
|
|
14983
15009
|
const {
|
|
14984
15010
|
limit = 10,
|
|
@@ -15140,7 +15166,7 @@ function sortProcesses(processes, sort) {
|
|
|
15140
15166
|
}
|
|
15141
15167
|
});
|
|
15142
15168
|
}
|
|
15143
|
-
var top_default = task(
|
|
15169
|
+
var top_default = task(run104, {
|
|
15144
15170
|
name: "top",
|
|
15145
15171
|
description: "Get top processes with system information.",
|
|
15146
15172
|
inputSchema: ProcessTopInputSchema,
|
|
@@ -15204,7 +15230,7 @@ var ProcessStatsOutputSchema = z.object({
|
|
|
15204
15230
|
timestamp: z.string()
|
|
15205
15231
|
})
|
|
15206
15232
|
);
|
|
15207
|
-
async function
|
|
15233
|
+
async function run105(context) {
|
|
15208
15234
|
const { params, exec, debug, error } = context;
|
|
15209
15235
|
const { includeUsers = true, includeStates = true, includeCommands = false, commandLimit = 10 } = params;
|
|
15210
15236
|
debug(`Getting process statistics with params: ${JSON.stringify(params)}`);
|
|
@@ -15382,7 +15408,7 @@ function calculateCommandStats(processes, limit) {
|
|
|
15382
15408
|
}
|
|
15383
15409
|
return Array.from(commandMap.values()).sort((a, b) => b.cpu - a.cpu).slice(0, limit);
|
|
15384
15410
|
}
|
|
15385
|
-
var stats_default = task(
|
|
15411
|
+
var stats_default = task(run105, {
|
|
15386
15412
|
name: "stats",
|
|
15387
15413
|
description: "Get system-wide process statistics.",
|
|
15388
15414
|
inputSchema: ProcessStatsInputSchema,
|
|
@@ -15417,7 +15443,7 @@ var ProcessChildrenOutputSchema = z.object({
|
|
|
15417
15443
|
error: z.string().optional()
|
|
15418
15444
|
})
|
|
15419
15445
|
);
|
|
15420
|
-
async function
|
|
15446
|
+
async function run106(context) {
|
|
15421
15447
|
const { params, exec, debug, error } = context;
|
|
15422
15448
|
const { pid, recursive = false, maxDepth } = params;
|
|
15423
15449
|
debug(`Getting children for process ${pid} with params: ${JSON.stringify(params)}`);
|
|
@@ -15502,7 +15528,7 @@ async function getDescendants(exec, parentPid, currentDepth, maxDepth) {
|
|
|
15502
15528
|
}
|
|
15503
15529
|
return allDescendants;
|
|
15504
15530
|
}
|
|
15505
|
-
var children_default = task(
|
|
15531
|
+
var children_default = task(run106, {
|
|
15506
15532
|
name: "children",
|
|
15507
15533
|
description: "Get child processes of a given PID.",
|
|
15508
15534
|
inputSchema: ProcessChildrenInputSchema,
|
|
@@ -15535,7 +15561,7 @@ var RebootOutputSchema = z.object({
|
|
|
15535
15561
|
error: z.string().optional(),
|
|
15536
15562
|
status: z.string()
|
|
15537
15563
|
});
|
|
15538
|
-
async function
|
|
15564
|
+
async function run107(context) {
|
|
15539
15565
|
const { params, info, warn, exec } = context;
|
|
15540
15566
|
const time = params.time || "now";
|
|
15541
15567
|
const sudo = params.sudo ?? true;
|
|
@@ -15568,7 +15594,7 @@ stderr: ${stderr}`
|
|
|
15568
15594
|
};
|
|
15569
15595
|
}
|
|
15570
15596
|
}
|
|
15571
|
-
var reboot_default = task(
|
|
15597
|
+
var reboot_default = task(run107, {
|
|
15572
15598
|
description: "Reboots a system",
|
|
15573
15599
|
inputSchema: RebootInputSchema,
|
|
15574
15600
|
outputSchema: RebootOutputSchema
|
|
@@ -15588,7 +15614,7 @@ var ShutdownOutputSchema = z.object({
|
|
|
15588
15614
|
error: z.string().optional(),
|
|
15589
15615
|
status: z.string()
|
|
15590
15616
|
});
|
|
15591
|
-
async function
|
|
15617
|
+
async function run108(context) {
|
|
15592
15618
|
const { params, info, warn, exec } = context;
|
|
15593
15619
|
const time = params.time || "now";
|
|
15594
15620
|
const sudo = params.sudo ?? true;
|
|
@@ -15620,7 +15646,7 @@ stderr: ${stderr}`
|
|
|
15620
15646
|
};
|
|
15621
15647
|
}
|
|
15622
15648
|
}
|
|
15623
|
-
var shutdown_default = task(
|
|
15649
|
+
var shutdown_default = task(run108, {
|
|
15624
15650
|
description: "Shuts down a system",
|
|
15625
15651
|
inputSchema: ShutdownInputSchema,
|
|
15626
15652
|
outputSchema: ShutdownOutputSchema
|
|
@@ -15641,7 +15667,7 @@ var RebootIfNeededOutputSchema = z.object({
|
|
|
15641
15667
|
error: z.string().optional()
|
|
15642
15668
|
})
|
|
15643
15669
|
);
|
|
15644
|
-
async function
|
|
15670
|
+
async function run109(context) {
|
|
15645
15671
|
const { params, run: runTask, exec, error, info, warn } = context;
|
|
15646
15672
|
const delayInSeconds = Math.max(1, params.delay ?? 1);
|
|
15647
15673
|
const message = params.message ?? "Reboot is required. Initiating reboot sequence.";
|
|
@@ -15671,7 +15697,7 @@ ${stderr}`;
|
|
|
15671
15697
|
}
|
|
15672
15698
|
return { rebooting: true, success: true };
|
|
15673
15699
|
}
|
|
15674
|
-
var reboot_if_needed_default = task(
|
|
15700
|
+
var reboot_if_needed_default = task(run109, {
|
|
15675
15701
|
name: "reboot_if_needed",
|
|
15676
15702
|
description: "Reboot if needed.",
|
|
15677
15703
|
inputSchema: RebootIfNeededInputSchema,
|
|
@@ -15688,7 +15714,7 @@ var SystemUptimeOutputSchema = z.object({
|
|
|
15688
15714
|
days: z.number().optional(),
|
|
15689
15715
|
error: z.string().optional()
|
|
15690
15716
|
});
|
|
15691
|
-
async function
|
|
15717
|
+
async function run110(context) {
|
|
15692
15718
|
const { params, exec, error } = context;
|
|
15693
15719
|
const sudo = params.sudo ?? false;
|
|
15694
15720
|
const { success, stdout, stderr } = await exec(["cat", "/proc/uptime"], { sudo });
|
|
@@ -15707,7 +15733,7 @@ async function run114(context) {
|
|
|
15707
15733
|
days: Math.floor(uptimeSeconds / 86400)
|
|
15708
15734
|
};
|
|
15709
15735
|
}
|
|
15710
|
-
var uptime_default = task(
|
|
15736
|
+
var uptime_default = task(run110, {
|
|
15711
15737
|
name: "uptime",
|
|
15712
15738
|
description: "Report system uptime.",
|
|
15713
15739
|
inputSchema: SystemUptimeInputSchema,
|
|
@@ -15732,7 +15758,7 @@ var SystemDatetimeOutputSchema = z.object({
|
|
|
15732
15758
|
error: z.string().optional()
|
|
15733
15759
|
})
|
|
15734
15760
|
);
|
|
15735
|
-
async function
|
|
15761
|
+
async function run111(context) {
|
|
15736
15762
|
const { params, exec } = context;
|
|
15737
15763
|
const sudo = params.sudo ?? false;
|
|
15738
15764
|
const isoResult = await exec(["date", "--iso-8601=seconds"], { sudo }).catch((error) => error);
|
|
@@ -15753,7 +15779,7 @@ async function run115(context) {
|
|
|
15753
15779
|
timezone
|
|
15754
15780
|
};
|
|
15755
15781
|
}
|
|
15756
|
-
var datetime_default = task(
|
|
15782
|
+
var datetime_default = task(run111, {
|
|
15757
15783
|
name: "datetime",
|
|
15758
15784
|
description: "Report system time and timezone.",
|
|
15759
15785
|
inputSchema: SystemDatetimeInputSchema,
|
|
@@ -15780,7 +15806,7 @@ var SystemHardwareOutputSchema = z.object({
|
|
|
15780
15806
|
error: z.string().optional()
|
|
15781
15807
|
})
|
|
15782
15808
|
);
|
|
15783
|
-
async function
|
|
15809
|
+
async function run112(context) {
|
|
15784
15810
|
const { params, exec } = context;
|
|
15785
15811
|
const sudo = params.sudo ?? false;
|
|
15786
15812
|
const archResult = await exec(["uname", "-m"], { sudo }).catch((error) => error);
|
|
@@ -15807,7 +15833,7 @@ async function run116(context) {
|
|
|
15807
15833
|
memTotalKb: Number.isFinite(memTotalKb ?? NaN) ? memTotalKb : void 0
|
|
15808
15834
|
};
|
|
15809
15835
|
}
|
|
15810
|
-
var hardware_default = task(
|
|
15836
|
+
var hardware_default = task(run112, {
|
|
15811
15837
|
name: "hardware",
|
|
15812
15838
|
description: "Report CPU and memory details.",
|
|
15813
15839
|
inputSchema: SystemHardwareInputSchema,
|
|
@@ -15839,7 +15865,7 @@ var SystemdDisableOutputSchema = z.object({
|
|
|
15839
15865
|
error: z.string().optional()
|
|
15840
15866
|
})
|
|
15841
15867
|
);
|
|
15842
|
-
async function
|
|
15868
|
+
async function run113(context) {
|
|
15843
15869
|
const { params, exec, error } = context;
|
|
15844
15870
|
const { service, sudo = false } = params;
|
|
15845
15871
|
if (!service) {
|
|
@@ -15862,7 +15888,7 @@ async function run117(context) {
|
|
|
15862
15888
|
};
|
|
15863
15889
|
}
|
|
15864
15890
|
}
|
|
15865
|
-
var disable_default = task(
|
|
15891
|
+
var disable_default = task(run113, {
|
|
15866
15892
|
name: "disable",
|
|
15867
15893
|
description: "Systemd disable.",
|
|
15868
15894
|
inputSchema: SystemdDisableInputSchema,
|
|
@@ -15882,7 +15908,7 @@ var SystemdEnableOutputSchema = z.object({
|
|
|
15882
15908
|
error: z.string().optional()
|
|
15883
15909
|
})
|
|
15884
15910
|
);
|
|
15885
|
-
async function
|
|
15911
|
+
async function run114(context) {
|
|
15886
15912
|
const { params, exec, error } = context;
|
|
15887
15913
|
const { service, sudo = false } = params;
|
|
15888
15914
|
if (!service) {
|
|
@@ -15905,7 +15931,7 @@ async function run118(context) {
|
|
|
15905
15931
|
};
|
|
15906
15932
|
}
|
|
15907
15933
|
}
|
|
15908
|
-
var enable_default = task(
|
|
15934
|
+
var enable_default = task(run114, {
|
|
15909
15935
|
name: "enable",
|
|
15910
15936
|
description: "Systemd enable.",
|
|
15911
15937
|
inputSchema: SystemdEnableInputSchema,
|
|
@@ -15925,7 +15951,7 @@ var SystemdRestartOutputSchema = z.object({
|
|
|
15925
15951
|
error: z.string().optional()
|
|
15926
15952
|
})
|
|
15927
15953
|
);
|
|
15928
|
-
async function
|
|
15954
|
+
async function run115(context) {
|
|
15929
15955
|
const { params, exec, error } = context;
|
|
15930
15956
|
const { service, sudo = false } = params;
|
|
15931
15957
|
if (!service) {
|
|
@@ -15952,7 +15978,7 @@ async function run119(context) {
|
|
|
15952
15978
|
};
|
|
15953
15979
|
}
|
|
15954
15980
|
}
|
|
15955
|
-
var restart_default = task(
|
|
15981
|
+
var restart_default = task(run115, {
|
|
15956
15982
|
name: "restart",
|
|
15957
15983
|
description: "Systemd restart.",
|
|
15958
15984
|
inputSchema: SystemdRestartInputSchema,
|
|
@@ -15972,7 +15998,7 @@ var SystemdStartOutputSchema = z.object({
|
|
|
15972
15998
|
error: z.string().optional()
|
|
15973
15999
|
})
|
|
15974
16000
|
);
|
|
15975
|
-
async function
|
|
16001
|
+
async function run116(context) {
|
|
15976
16002
|
const { params, exec, error } = context;
|
|
15977
16003
|
const { service, sudo = false } = params;
|
|
15978
16004
|
if (!service) {
|
|
@@ -15995,7 +16021,7 @@ async function run120(context) {
|
|
|
15995
16021
|
};
|
|
15996
16022
|
}
|
|
15997
16023
|
}
|
|
15998
|
-
var start_default = task(
|
|
16024
|
+
var start_default = task(run116, {
|
|
15999
16025
|
name: "start",
|
|
16000
16026
|
description: "Systemd start.",
|
|
16001
16027
|
inputSchema: SystemdStartInputSchema,
|
|
@@ -16015,7 +16041,7 @@ var SystemdStopOutputSchema = z.object({
|
|
|
16015
16041
|
error: z.string().optional()
|
|
16016
16042
|
})
|
|
16017
16043
|
);
|
|
16018
|
-
async function
|
|
16044
|
+
async function run117(context) {
|
|
16019
16045
|
const { params, exec, error } = context;
|
|
16020
16046
|
const { service, sudo = false } = params;
|
|
16021
16047
|
if (!service) {
|
|
@@ -16042,7 +16068,7 @@ async function run121(context) {
|
|
|
16042
16068
|
};
|
|
16043
16069
|
}
|
|
16044
16070
|
}
|
|
16045
|
-
var stop_default = task(
|
|
16071
|
+
var stop_default = task(run117, {
|
|
16046
16072
|
name: "stop",
|
|
16047
16073
|
description: "Systemd stop.",
|
|
16048
16074
|
inputSchema: SystemdStopInputSchema,
|
|
@@ -16062,7 +16088,7 @@ var SystemdReloadOutputSchema = z.object({
|
|
|
16062
16088
|
error: z.string().optional()
|
|
16063
16089
|
})
|
|
16064
16090
|
);
|
|
16065
|
-
async function
|
|
16091
|
+
async function run118(context) {
|
|
16066
16092
|
const { params, exec, error } = context;
|
|
16067
16093
|
const { service, sudo = false } = params;
|
|
16068
16094
|
if (!service) {
|
|
@@ -16083,7 +16109,7 @@ async function run122(context) {
|
|
|
16083
16109
|
};
|
|
16084
16110
|
}
|
|
16085
16111
|
}
|
|
16086
|
-
var reload_default = task(
|
|
16112
|
+
var reload_default = task(run118, {
|
|
16087
16113
|
name: "reload",
|
|
16088
16114
|
description: "Reloads a systemd service (e.g., re-reads configuration without full restart).",
|
|
16089
16115
|
inputSchema: SystemdReloadInputSchema,
|
|
@@ -16105,7 +16131,7 @@ var SystemdStatusOutputSchema = z.object({
|
|
|
16105
16131
|
error: z.string().optional()
|
|
16106
16132
|
})
|
|
16107
16133
|
);
|
|
16108
|
-
async function
|
|
16134
|
+
async function run119(context) {
|
|
16109
16135
|
const { params, exec, error } = context;
|
|
16110
16136
|
const { service, sudo = false } = params;
|
|
16111
16137
|
if (!service) {
|
|
@@ -16128,7 +16154,7 @@ async function run123(context) {
|
|
|
16128
16154
|
};
|
|
16129
16155
|
}
|
|
16130
16156
|
}
|
|
16131
|
-
var status_default = task(
|
|
16157
|
+
var status_default = task(run119, {
|
|
16132
16158
|
name: "status",
|
|
16133
16159
|
description: "Checks systemd service status.",
|
|
16134
16160
|
inputSchema: SystemdStatusInputSchema,
|
|
@@ -16158,7 +16184,7 @@ var TemplateWriteOutputSchema = z.object({
|
|
|
16158
16184
|
path: z.string()
|
|
16159
16185
|
});
|
|
16160
16186
|
async function runFn3(context) {
|
|
16161
|
-
const { params, warn, error, debug, run:
|
|
16187
|
+
const { params, warn, error, debug, run: run249, file, exec } = context;
|
|
16162
16188
|
const { template, template_file, variables, to, mode, owner, group, sudo } = params;
|
|
16163
16189
|
let templateContent = template;
|
|
16164
16190
|
if (template && template_file) {
|
|
@@ -16213,7 +16239,7 @@ EOF`;
|
|
|
16213
16239
|
debug(`Setting mode ${mode} for ${outputPath}`);
|
|
16214
16240
|
try {
|
|
16215
16241
|
const chmodParams = { path: outputPath, mode, sudo };
|
|
16216
|
-
const chmodResult = await
|
|
16242
|
+
const chmodResult = await run249(chmod_default(chmodParams));
|
|
16217
16243
|
if (chmodResult instanceof Error) {
|
|
16218
16244
|
error(`Error setting mode for ${outputPath}: ${chmodResult.message}`);
|
|
16219
16245
|
overallSuccess = false;
|
|
@@ -16239,7 +16265,7 @@ EOF`;
|
|
|
16239
16265
|
if (group) {
|
|
16240
16266
|
chownTaskParams.group = group;
|
|
16241
16267
|
}
|
|
16242
|
-
const chownResult = await
|
|
16268
|
+
const chownResult = await run249(chown_default(chownTaskParams));
|
|
16243
16269
|
if (chownResult instanceof Error) {
|
|
16244
16270
|
error(`Error setting owner/group for ${outputPath}: ${chownResult.message}`);
|
|
16245
16271
|
overallSuccess = false;
|
|
@@ -16299,7 +16325,7 @@ var UfwAllowOutputSchema = z.object({
|
|
|
16299
16325
|
error: z.string().optional()
|
|
16300
16326
|
})
|
|
16301
16327
|
);
|
|
16302
|
-
async function
|
|
16328
|
+
async function run120(context) {
|
|
16303
16329
|
const { params, exec, info } = context;
|
|
16304
16330
|
const { port, proto = "tcp", from } = params;
|
|
16305
16331
|
if (!port) {
|
|
@@ -16330,7 +16356,7 @@ async function run124(context) {
|
|
|
16330
16356
|
return { success: false, error };
|
|
16331
16357
|
}
|
|
16332
16358
|
}
|
|
16333
|
-
var allow_default = task(
|
|
16359
|
+
var allow_default = task(run120, {
|
|
16334
16360
|
description: "Allows a port through UFW firewall.",
|
|
16335
16361
|
inputSchema: UfwAllowInputSchema,
|
|
16336
16362
|
outputSchema: UfwAllowOutputSchema
|
|
@@ -16351,7 +16377,7 @@ var UfwDenyOutputSchema = z.object({
|
|
|
16351
16377
|
error: z.string().optional()
|
|
16352
16378
|
})
|
|
16353
16379
|
);
|
|
16354
|
-
async function
|
|
16380
|
+
async function run121(context) {
|
|
16355
16381
|
const { params, exec, error, info } = context;
|
|
16356
16382
|
const { port, proto = "tcp", from } = params;
|
|
16357
16383
|
if (!port) {
|
|
@@ -16382,7 +16408,7 @@ async function run125(context) {
|
|
|
16382
16408
|
};
|
|
16383
16409
|
}
|
|
16384
16410
|
}
|
|
16385
|
-
var deny_default = task(
|
|
16411
|
+
var deny_default = task(run121, {
|
|
16386
16412
|
name: "deny",
|
|
16387
16413
|
description: "Ufw deny.",
|
|
16388
16414
|
inputSchema: UfwDenyInputSchema,
|
|
@@ -16401,7 +16427,7 @@ var UfwDeleteOutputSchema = z.object({
|
|
|
16401
16427
|
error: z.string().optional()
|
|
16402
16428
|
})
|
|
16403
16429
|
);
|
|
16404
|
-
async function
|
|
16430
|
+
async function run122(context) {
|
|
16405
16431
|
const { params, exec, error } = context;
|
|
16406
16432
|
const { rule_number } = params;
|
|
16407
16433
|
if (!rule_number || rule_number <= 0) {
|
|
@@ -16423,7 +16449,7 @@ async function run126(context) {
|
|
|
16423
16449
|
};
|
|
16424
16450
|
}
|
|
16425
16451
|
}
|
|
16426
|
-
var delete_default4 = task(
|
|
16452
|
+
var delete_default4 = task(run122, {
|
|
16427
16453
|
name: "delete",
|
|
16428
16454
|
description: "Ufw delete.",
|
|
16429
16455
|
inputSchema: UfwDeleteInputSchema,
|
|
@@ -16436,7 +16462,7 @@ var UfwDisableOutputSchema = z.object({
|
|
|
16436
16462
|
success: z.boolean(),
|
|
16437
16463
|
error: z.string().optional()
|
|
16438
16464
|
});
|
|
16439
|
-
async function
|
|
16465
|
+
async function run123(context) {
|
|
16440
16466
|
const { exec, error } = context;
|
|
16441
16467
|
try {
|
|
16442
16468
|
const result = await exec(["ufw", "disable"], { sudo: true });
|
|
@@ -16452,7 +16478,7 @@ async function run127(context) {
|
|
|
16452
16478
|
return { success: false, error: errorMsg };
|
|
16453
16479
|
}
|
|
16454
16480
|
}
|
|
16455
|
-
var disable_default2 = task(
|
|
16481
|
+
var disable_default2 = task(run123, {
|
|
16456
16482
|
description: "Disables UFW firewall.",
|
|
16457
16483
|
inputSchema: UfwDisableInputSchema,
|
|
16458
16484
|
outputSchema: UfwDisableOutputSchema
|
|
@@ -16464,7 +16490,7 @@ var UfwEnableOutputSchema = z.object({
|
|
|
16464
16490
|
success: z.boolean(),
|
|
16465
16491
|
error: z.string().optional()
|
|
16466
16492
|
});
|
|
16467
|
-
async function
|
|
16493
|
+
async function run124(context) {
|
|
16468
16494
|
const { exec, error } = context;
|
|
16469
16495
|
try {
|
|
16470
16496
|
const result = await exec(["ufw", "--force", "enable"], { sudo: true });
|
|
@@ -16480,7 +16506,7 @@ async function run128(context) {
|
|
|
16480
16506
|
return { success: false, error: errorMsg };
|
|
16481
16507
|
}
|
|
16482
16508
|
}
|
|
16483
|
-
var enable_default2 = task(
|
|
16509
|
+
var enable_default2 = task(run124, {
|
|
16484
16510
|
description: "Enables UFW firewall.",
|
|
16485
16511
|
inputSchema: UfwEnableInputSchema,
|
|
16486
16512
|
outputSchema: UfwEnableOutputSchema
|
|
@@ -16496,7 +16522,7 @@ var UfwInstallOutputSchema = z.object({
|
|
|
16496
16522
|
error: z.string().optional()
|
|
16497
16523
|
})
|
|
16498
16524
|
);
|
|
16499
|
-
async function
|
|
16525
|
+
async function run125(context) {
|
|
16500
16526
|
const { run: runTask, error } = context;
|
|
16501
16527
|
try {
|
|
16502
16528
|
const installResult = await runTask(install_default5({ package: "ufw", sudo: true }));
|
|
@@ -16515,7 +16541,7 @@ async function run129(context) {
|
|
|
16515
16541
|
};
|
|
16516
16542
|
}
|
|
16517
16543
|
}
|
|
16518
|
-
var install_default7 = task(
|
|
16544
|
+
var install_default7 = task(run125, {
|
|
16519
16545
|
name: "install",
|
|
16520
16546
|
description: "Ufw install.",
|
|
16521
16547
|
inputSchema: UfwInstallInputSchema,
|
|
@@ -16535,7 +16561,7 @@ var UfwLoggingOutputSchema = z.object({
|
|
|
16535
16561
|
error: z.string().optional()
|
|
16536
16562
|
})
|
|
16537
16563
|
);
|
|
16538
|
-
async function
|
|
16564
|
+
async function run126(context) {
|
|
16539
16565
|
const { params, exec, log } = context;
|
|
16540
16566
|
const level = params.level || "on";
|
|
16541
16567
|
try {
|
|
@@ -16552,7 +16578,7 @@ async function run130(context) {
|
|
|
16552
16578
|
return { success: false, error };
|
|
16553
16579
|
}
|
|
16554
16580
|
}
|
|
16555
|
-
var logging_default = task(
|
|
16581
|
+
var logging_default = task(run126, {
|
|
16556
16582
|
description: "Configures UFW logging",
|
|
16557
16583
|
inputSchema: UfwLoggingInputSchema,
|
|
16558
16584
|
outputSchema: UfwLoggingOutputSchema
|
|
@@ -16568,7 +16594,7 @@ var UfwReloadOutputSchema = z.object({
|
|
|
16568
16594
|
error: z.string().optional()
|
|
16569
16595
|
})
|
|
16570
16596
|
);
|
|
16571
|
-
async function
|
|
16597
|
+
async function run127(context) {
|
|
16572
16598
|
const { exec, error } = context;
|
|
16573
16599
|
try {
|
|
16574
16600
|
const { success } = await exec(["sudo", "ufw", "reload"], { sudo: true });
|
|
@@ -16580,7 +16606,7 @@ async function run131(context) {
|
|
|
16580
16606
|
};
|
|
16581
16607
|
}
|
|
16582
16608
|
}
|
|
16583
|
-
var reload_default2 = task(
|
|
16609
|
+
var reload_default2 = task(run127, {
|
|
16584
16610
|
name: "reload",
|
|
16585
16611
|
description: "Ufw reload.",
|
|
16586
16612
|
inputSchema: UfwReloadInputSchema,
|
|
@@ -16598,7 +16624,7 @@ var UfwResetOutputSchema = z.object({
|
|
|
16598
16624
|
error: z.string().optional()
|
|
16599
16625
|
})
|
|
16600
16626
|
);
|
|
16601
|
-
async function
|
|
16627
|
+
async function run128(context) {
|
|
16602
16628
|
const { exec, error, info } = context;
|
|
16603
16629
|
try {
|
|
16604
16630
|
const command = ["ufw", "--force", "reset"];
|
|
@@ -16619,7 +16645,7 @@ async function run132(context) {
|
|
|
16619
16645
|
return { success: false, error: errorMsg };
|
|
16620
16646
|
}
|
|
16621
16647
|
}
|
|
16622
|
-
var reset_default = task(
|
|
16648
|
+
var reset_default = task(run128, {
|
|
16623
16649
|
name: "reset",
|
|
16624
16650
|
description: "Resets UFW firewall to default state.",
|
|
16625
16651
|
inputSchema: UfwResetInputSchema,
|
|
@@ -16642,7 +16668,7 @@ var UfwStatusOutputSchema = z.object({
|
|
|
16642
16668
|
rules: z.array(UfwRuleSchema).optional(),
|
|
16643
16669
|
error: z.string().optional()
|
|
16644
16670
|
});
|
|
16645
|
-
async function
|
|
16671
|
+
async function run129(context) {
|
|
16646
16672
|
const { exec, error } = context;
|
|
16647
16673
|
try {
|
|
16648
16674
|
const result = await exec(["ufw", "status", "numbered"], { sudo: true });
|
|
@@ -16697,7 +16723,7 @@ async function run133(context) {
|
|
|
16697
16723
|
return { success: false, error: errorMsg };
|
|
16698
16724
|
}
|
|
16699
16725
|
}
|
|
16700
|
-
var status_default2 = task(
|
|
16726
|
+
var status_default2 = task(run129, {
|
|
16701
16727
|
description: "Gets UFW firewall status with numbered rules.",
|
|
16702
16728
|
inputSchema: UfwStatusInputSchema,
|
|
16703
16729
|
outputSchema: UfwStatusOutputSchema
|
|
@@ -16736,7 +16762,7 @@ var AddGroupsOutputSchema = z.object({
|
|
|
16736
16762
|
error: z.string().optional()
|
|
16737
16763
|
})
|
|
16738
16764
|
);
|
|
16739
|
-
async function
|
|
16765
|
+
async function run130(context) {
|
|
16740
16766
|
const { params, exec } = context;
|
|
16741
16767
|
const { user, groups, sudo = true } = params;
|
|
16742
16768
|
const normalizedGroups = Array.isArray(groups) ? groups : typeof groups === "string" ? groups.split(",").map((group) => group.trim()).filter(Boolean) : [];
|
|
@@ -16751,7 +16777,7 @@ async function run134(context) {
|
|
|
16751
16777
|
error: success ? void 0 : stderr || stdout
|
|
16752
16778
|
};
|
|
16753
16779
|
}
|
|
16754
|
-
var add_groups_default = task(
|
|
16780
|
+
var add_groups_default = task(run130, {
|
|
16755
16781
|
name: "add_groups",
|
|
16756
16782
|
description: "User add groups.",
|
|
16757
16783
|
inputSchema: AddGroupsInputSchema,
|
|
@@ -16771,7 +16797,7 @@ var GetGidOutputSchema = z.object({
|
|
|
16771
16797
|
gid: z.string().optional()
|
|
16772
16798
|
})
|
|
16773
16799
|
);
|
|
16774
|
-
async function
|
|
16800
|
+
async function run131(context) {
|
|
16775
16801
|
const { params, exec } = context;
|
|
16776
16802
|
const { user } = params;
|
|
16777
16803
|
const command = ["id", "-g", user].filter(Boolean).join(" ");
|
|
@@ -16781,7 +16807,7 @@ async function run135(context) {
|
|
|
16781
16807
|
gid: gid.trim()
|
|
16782
16808
|
};
|
|
16783
16809
|
}
|
|
16784
|
-
var get_gid_default = task(
|
|
16810
|
+
var get_gid_default = task(run131, {
|
|
16785
16811
|
name: "get_gid",
|
|
16786
16812
|
description: "User get gid.",
|
|
16787
16813
|
inputSchema: GetGidInputSchema,
|
|
@@ -16801,7 +16827,7 @@ var GetGroupsOutputSchema = z.object({
|
|
|
16801
16827
|
groups: z.array(z.string()).optional()
|
|
16802
16828
|
})
|
|
16803
16829
|
);
|
|
16804
|
-
async function
|
|
16830
|
+
async function run132(context) {
|
|
16805
16831
|
const { params, exec } = context;
|
|
16806
16832
|
const { user } = params;
|
|
16807
16833
|
const command = ["groups", user].filter(Boolean).join(" ");
|
|
@@ -16818,7 +16844,7 @@ async function run136(context) {
|
|
|
16818
16844
|
groups
|
|
16819
16845
|
};
|
|
16820
16846
|
}
|
|
16821
|
-
var get_groups_default = task(
|
|
16847
|
+
var get_groups_default = task(run132, {
|
|
16822
16848
|
name: "get_groups",
|
|
16823
16849
|
description: "User get groups.",
|
|
16824
16850
|
inputSchema: GetGroupsInputSchema,
|
|
@@ -16838,7 +16864,7 @@ var GetUidOutputSchema = z.object({
|
|
|
16838
16864
|
uid: z.string().optional()
|
|
16839
16865
|
})
|
|
16840
16866
|
);
|
|
16841
|
-
async function
|
|
16867
|
+
async function run133(context) {
|
|
16842
16868
|
const { params, exec } = context;
|
|
16843
16869
|
const { user } = params;
|
|
16844
16870
|
const command = ["id", "-u", user].filter(Boolean).join(" ");
|
|
@@ -16848,7 +16874,7 @@ async function run137(context) {
|
|
|
16848
16874
|
uid: uid.trim()
|
|
16849
16875
|
};
|
|
16850
16876
|
}
|
|
16851
|
-
var get_uid_default = task(
|
|
16877
|
+
var get_uid_default = task(run133, {
|
|
16852
16878
|
name: "get_uid",
|
|
16853
16879
|
description: "User get uid.",
|
|
16854
16880
|
inputSchema: GetUidInputSchema,
|
|
@@ -16869,7 +16895,7 @@ var SetUserGroupsOutputSchema = z.object({
|
|
|
16869
16895
|
error: z.string().optional()
|
|
16870
16896
|
})
|
|
16871
16897
|
);
|
|
16872
|
-
async function
|
|
16898
|
+
async function run134(context) {
|
|
16873
16899
|
const { params, exec } = context;
|
|
16874
16900
|
const { user, groups, sudo = true } = params;
|
|
16875
16901
|
const normalizedGroups = Array.isArray(groups) ? groups : typeof groups === "string" ? groups.split(",").map((group) => group.trim()).filter(Boolean) : [];
|
|
@@ -16884,7 +16910,7 @@ async function run138(context) {
|
|
|
16884
16910
|
error: success ? void 0 : stderr || stdout
|
|
16885
16911
|
};
|
|
16886
16912
|
}
|
|
16887
|
-
var set_groups_default = task(
|
|
16913
|
+
var set_groups_default = task(run134, {
|
|
16888
16914
|
name: "set_groups",
|
|
16889
16915
|
description: "User set groups.",
|
|
16890
16916
|
inputSchema: SetUserGroupsInputSchema,
|
|
@@ -16905,7 +16931,7 @@ var SetUserShellOutputSchema = z.object({
|
|
|
16905
16931
|
error: z.string().optional()
|
|
16906
16932
|
})
|
|
16907
16933
|
);
|
|
16908
|
-
async function
|
|
16934
|
+
async function run135(context) {
|
|
16909
16935
|
const { params, exec } = context;
|
|
16910
16936
|
const { user, shell, sudo = true } = params;
|
|
16911
16937
|
const command = [sudo ? "sudo" : "", "usermod", "-s", shell, user].filter(Boolean).join(" ");
|
|
@@ -16915,7 +16941,7 @@ async function run139(context) {
|
|
|
16915
16941
|
error: success ? void 0 : stderr || stdout
|
|
16916
16942
|
};
|
|
16917
16943
|
}
|
|
16918
|
-
var set_shell_default = task(
|
|
16944
|
+
var set_shell_default = task(run135, {
|
|
16919
16945
|
name: "set_shell",
|
|
16920
16946
|
description: "User set shell.",
|
|
16921
16947
|
inputSchema: SetUserShellInputSchema,
|
|
@@ -16934,8 +16960,8 @@ var UserDeleteOutputSchema = z.object({
|
|
|
16934
16960
|
success: z.boolean(),
|
|
16935
16961
|
error: z.string().optional()
|
|
16936
16962
|
});
|
|
16937
|
-
async function
|
|
16938
|
-
const { params, debug, exec, run:
|
|
16963
|
+
async function run136(context) {
|
|
16964
|
+
const { params, debug, exec, run: run249, error } = context;
|
|
16939
16965
|
const { user, remove: remove4 = false, sudo = true } = params;
|
|
16940
16966
|
if (!user) {
|
|
16941
16967
|
error('Required parameter "user" is missing');
|
|
@@ -16945,7 +16971,7 @@ async function run140(context) {
|
|
|
16945
16971
|
};
|
|
16946
16972
|
}
|
|
16947
16973
|
try {
|
|
16948
|
-
const { exists: userExists } = await
|
|
16974
|
+
const { exists: userExists } = await run249(exists_default4({ user }));
|
|
16949
16975
|
if (!userExists) {
|
|
16950
16976
|
debug(`User '${user}' does not exist, considering task successful (idempotent).`);
|
|
16951
16977
|
return { success: true };
|
|
@@ -16973,7 +16999,7 @@ async function run140(context) {
|
|
|
16973
16999
|
};
|
|
16974
17000
|
}
|
|
16975
17001
|
}
|
|
16976
|
-
var delete_default5 = task(
|
|
17002
|
+
var delete_default5 = task(run136, {
|
|
16977
17003
|
description: "Deletes a user from the system idempotently",
|
|
16978
17004
|
inputSchema: UserDeleteInputSchema,
|
|
16979
17005
|
outputSchema: UserDeleteOutputSchema
|
|
@@ -17003,7 +17029,7 @@ var ModifyUserOutputSchema = z.object({
|
|
|
17003
17029
|
error: z.string().optional()
|
|
17004
17030
|
})
|
|
17005
17031
|
);
|
|
17006
|
-
async function
|
|
17032
|
+
async function run137(context) {
|
|
17007
17033
|
const { params, exec, run: runTask, error } = context;
|
|
17008
17034
|
const {
|
|
17009
17035
|
user,
|
|
@@ -17062,7 +17088,7 @@ async function run141(context) {
|
|
|
17062
17088
|
};
|
|
17063
17089
|
}
|
|
17064
17090
|
}
|
|
17065
|
-
var modify_default2 = task(
|
|
17091
|
+
var modify_default2 = task(run137, {
|
|
17066
17092
|
name: "modify",
|
|
17067
17093
|
description: "Modify an existing user account.",
|
|
17068
17094
|
inputSchema: ModifyUserInputSchema,
|
|
@@ -17347,7 +17373,7 @@ var XcpngAttachVdiResultSchema = z.object({
|
|
|
17347
17373
|
plugged: z.boolean().optional(),
|
|
17348
17374
|
error: z.string().optional()
|
|
17349
17375
|
});
|
|
17350
|
-
async function
|
|
17376
|
+
async function run138(context) {
|
|
17351
17377
|
const { params, error, debug } = context;
|
|
17352
17378
|
const { vm_uuid, vdi_uuid, device = "0", mode = "RW", bootable: rawBootable = false } = params;
|
|
17353
17379
|
if (!vm_uuid) {
|
|
@@ -17406,7 +17432,7 @@ async function run142(context) {
|
|
|
17406
17432
|
plugged: true
|
|
17407
17433
|
};
|
|
17408
17434
|
}
|
|
17409
|
-
var attach_vdi_default = task(
|
|
17435
|
+
var attach_vdi_default = task(run138, {
|
|
17410
17436
|
inputSchema: XcpngAttachVdiParamsSchema,
|
|
17411
17437
|
outputSchema: XcpngAttachVdiResultSchema,
|
|
17412
17438
|
description: "Attaches an existing virtual disk image to a VM and plugs it into the guest."
|
|
@@ -17470,7 +17496,7 @@ var XcpngCreateVdiResultSchema = z.object({
|
|
|
17470
17496
|
command: z.string().optional(),
|
|
17471
17497
|
error: z.string().optional()
|
|
17472
17498
|
});
|
|
17473
|
-
async function
|
|
17499
|
+
async function run139(context) {
|
|
17474
17500
|
const { params, error } = context;
|
|
17475
17501
|
const { name_label, sr_uuid, size_bytes, size_mb, size_gb, description, type = "user", shareable = false } = params;
|
|
17476
17502
|
if (!name_label) {
|
|
@@ -17523,7 +17549,7 @@ async function run143(context) {
|
|
|
17523
17549
|
command: result.command
|
|
17524
17550
|
};
|
|
17525
17551
|
}
|
|
17526
|
-
var create_vdi_default = task(
|
|
17552
|
+
var create_vdi_default = task(run139, {
|
|
17527
17553
|
inputSchema: XcpngCreateVdiParamsSchema,
|
|
17528
17554
|
outputSchema: XcpngCreateVdiResultSchema,
|
|
17529
17555
|
description: "Creates a new virtual disk image on the specified XCP-ng storage repository."
|
|
@@ -17538,7 +17564,7 @@ var XcpngListSrParamsResultSchema = z.object({
|
|
|
17538
17564
|
items: z.any().optional(),
|
|
17539
17565
|
error: z.string().optional()
|
|
17540
17566
|
});
|
|
17541
|
-
async function
|
|
17567
|
+
async function run140(context) {
|
|
17542
17568
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
17543
17569
|
const result = await runXeCommand(context, "sr-param-list", filters);
|
|
17544
17570
|
if (!result.success) {
|
|
@@ -17552,7 +17578,7 @@ async function run144(context) {
|
|
|
17552
17578
|
items: parseKeyValueOutput(result.stdout)
|
|
17553
17579
|
};
|
|
17554
17580
|
}
|
|
17555
|
-
var list_sr_params_default = task(
|
|
17581
|
+
var list_sr_params_default = task(run140, {
|
|
17556
17582
|
inputSchema: XcpngListSrParamsParamsSchema,
|
|
17557
17583
|
outputSchema: XcpngListSrParamsResultSchema,
|
|
17558
17584
|
description: "Lists parameters for storage repositories (SRs) on an XCP-ng host."
|
|
@@ -17567,7 +17593,7 @@ var XcpngListStorageRepositoriesResultSchema = z.object({
|
|
|
17567
17593
|
items: z.array(z.any()).optional(),
|
|
17568
17594
|
error: z.string().optional()
|
|
17569
17595
|
});
|
|
17570
|
-
async function
|
|
17596
|
+
async function run141(context) {
|
|
17571
17597
|
const { params } = context;
|
|
17572
17598
|
const filters = normalizeFilterArgs(params?.filters);
|
|
17573
17599
|
const result = await runXeCommand(context, "sr-list", filters);
|
|
@@ -17616,7 +17642,7 @@ async function run145(context) {
|
|
|
17616
17642
|
items: enrichedItems
|
|
17617
17643
|
};
|
|
17618
17644
|
}
|
|
17619
|
-
var list_storage_repositories_default = task(
|
|
17645
|
+
var list_storage_repositories_default = task(run141, {
|
|
17620
17646
|
inputSchema: XcpngListStorageRepositoriesParamsSchema,
|
|
17621
17647
|
outputSchema: XcpngListStorageRepositoriesResultSchema,
|
|
17622
17648
|
description: "Lists storage repositories on an XCP-ng host."
|
|
@@ -17639,7 +17665,7 @@ var XcpngFindStorageRepositoryResultSchema = z.object({
|
|
|
17639
17665
|
multiple: z.boolean().optional(),
|
|
17640
17666
|
error: z.string().optional()
|
|
17641
17667
|
});
|
|
17642
|
-
async function
|
|
17668
|
+
async function run142(context) {
|
|
17643
17669
|
const params = context.params ?? {};
|
|
17644
17670
|
const {
|
|
17645
17671
|
name_label: nameLabel,
|
|
@@ -17759,7 +17785,7 @@ async function runListStorageRepositories(context, params) {
|
|
|
17759
17785
|
})
|
|
17760
17786
|
);
|
|
17761
17787
|
}
|
|
17762
|
-
var find_storage_repository_default = task(
|
|
17788
|
+
var find_storage_repository_default = task(run142, {
|
|
17763
17789
|
inputSchema: XcpngFindStorageRepositoryParamsSchema,
|
|
17764
17790
|
outputSchema: XcpngFindStorageRepositoryResultSchema,
|
|
17765
17791
|
description: "Finds a single storage repository on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -17792,7 +17818,7 @@ var XcpngAddDiskResultSchema = z.object({
|
|
|
17792
17818
|
plugged: z.boolean().optional(),
|
|
17793
17819
|
error: z.string().optional()
|
|
17794
17820
|
});
|
|
17795
|
-
async function
|
|
17821
|
+
async function run143(context) {
|
|
17796
17822
|
const { params, error } = context;
|
|
17797
17823
|
const {
|
|
17798
17824
|
vm_uuid: vmUuid,
|
|
@@ -17925,7 +17951,7 @@ async function destroyVdi(context, vdiUuid, appliedCommands) {
|
|
|
17925
17951
|
context.warn(`Failed to clean up VDI ${vdiUuid}: ${xeErrorMessage(result, "unknown error")}`);
|
|
17926
17952
|
}
|
|
17927
17953
|
}
|
|
17928
|
-
var add_disk_default = task(
|
|
17954
|
+
var add_disk_default = task(run143, {
|
|
17929
17955
|
inputSchema: XcpngAddDiskParamsSchema,
|
|
17930
17956
|
outputSchema: XcpngAddDiskResultSchema,
|
|
17931
17957
|
description: "Creates a VDI and attaches it to a VM on XCP-ng."
|
|
@@ -17944,7 +17970,7 @@ var XcpngAttachIsoResultSchema = z.object({
|
|
|
17944
17970
|
plugged: z.boolean().optional(),
|
|
17945
17971
|
error: z.string().optional()
|
|
17946
17972
|
});
|
|
17947
|
-
async function
|
|
17973
|
+
async function run144(context) {
|
|
17948
17974
|
const { params, error, debug } = context;
|
|
17949
17975
|
const { vm_uuid, iso_vdi_uuid, device, eject_before_insert = true } = params;
|
|
17950
17976
|
if (!vm_uuid) {
|
|
@@ -18037,7 +18063,7 @@ async function run148(context) {
|
|
|
18037
18063
|
plugged
|
|
18038
18064
|
};
|
|
18039
18065
|
}
|
|
18040
|
-
var attach_iso_default = task(
|
|
18066
|
+
var attach_iso_default = task(run144, {
|
|
18041
18067
|
inputSchema: XcpngAttachIsoParamsSchema,
|
|
18042
18068
|
outputSchema: XcpngAttachIsoResultSchema,
|
|
18043
18069
|
description: "Attaches an ISO image to a VM by invoking xe vm-cd-insert, ejecting existing media if requested."
|
|
@@ -18058,7 +18084,7 @@ var XcpngAttachNetworkInterfaceResultSchema = z.object({
|
|
|
18058
18084
|
plugged: z.boolean().optional(),
|
|
18059
18085
|
error: z.string().optional()
|
|
18060
18086
|
});
|
|
18061
|
-
async function
|
|
18087
|
+
async function run145(context) {
|
|
18062
18088
|
const { params, error, debug } = context;
|
|
18063
18089
|
const { vm_uuid, network_uuid, device = "0", mac_address, mtu } = params;
|
|
18064
18090
|
if (!vm_uuid) {
|
|
@@ -18123,7 +18149,7 @@ async function run149(context) {
|
|
|
18123
18149
|
plugged: true
|
|
18124
18150
|
};
|
|
18125
18151
|
}
|
|
18126
|
-
var attach_network_interface_default = task(
|
|
18152
|
+
var attach_network_interface_default = task(run145, {
|
|
18127
18153
|
inputSchema: XcpngAttachNetworkInterfaceParamsSchema,
|
|
18128
18154
|
outputSchema: XcpngAttachNetworkInterfaceResultSchema,
|
|
18129
18155
|
description: "Creates and plugs a virtual network interface for a VM on XCP-ng."
|
|
@@ -18138,7 +18164,7 @@ var XcpngListTemplateParamsResultSchema = z.object({
|
|
|
18138
18164
|
items: z.any().optional(),
|
|
18139
18165
|
error: z.string().optional()
|
|
18140
18166
|
});
|
|
18141
|
-
async function
|
|
18167
|
+
async function run146(context) {
|
|
18142
18168
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18143
18169
|
const result = await runXeCommand(context, "template-param-list", filters);
|
|
18144
18170
|
if (!result.success) {
|
|
@@ -18152,7 +18178,7 @@ async function run150(context) {
|
|
|
18152
18178
|
items: parseKeyValueOutput(result.stdout)
|
|
18153
18179
|
};
|
|
18154
18180
|
}
|
|
18155
|
-
var list_template_params_default = task(
|
|
18181
|
+
var list_template_params_default = task(run146, {
|
|
18156
18182
|
inputSchema: XcpngListTemplateParamsParamsSchema,
|
|
18157
18183
|
outputSchema: XcpngListTemplateParamsResultSchema,
|
|
18158
18184
|
description: "Lists parameters for templates on an XCP-ng host."
|
|
@@ -18167,7 +18193,7 @@ var XcpngListTemplatesResultSchema = z.object({
|
|
|
18167
18193
|
items: z.array(z.any()).optional(),
|
|
18168
18194
|
error: z.string().optional()
|
|
18169
18195
|
});
|
|
18170
|
-
async function
|
|
18196
|
+
async function run147(context) {
|
|
18171
18197
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18172
18198
|
const result = await runXeCommand(context, "template-list", filters);
|
|
18173
18199
|
if (!result.success) {
|
|
@@ -18217,7 +18243,7 @@ async function run151(context) {
|
|
|
18217
18243
|
items: enriched
|
|
18218
18244
|
};
|
|
18219
18245
|
}
|
|
18220
|
-
var list_templates_default = task(
|
|
18246
|
+
var list_templates_default = task(run147, {
|
|
18221
18247
|
inputSchema: XcpngListTemplatesParamsSchema,
|
|
18222
18248
|
outputSchema: XcpngListTemplatesResultSchema,
|
|
18223
18249
|
description: "Lists VM templates available on the XCP-ng host."
|
|
@@ -18238,7 +18264,7 @@ var XcpngFindTemplateResultSchema = z.object({
|
|
|
18238
18264
|
multiple: z.boolean().optional(),
|
|
18239
18265
|
error: z.string().optional()
|
|
18240
18266
|
});
|
|
18241
|
-
async function
|
|
18267
|
+
async function run148(context) {
|
|
18242
18268
|
const params = context.params ?? {};
|
|
18243
18269
|
const {
|
|
18244
18270
|
name_label: nameLabel,
|
|
@@ -18336,7 +18362,7 @@ async function runListTemplates(context, params) {
|
|
|
18336
18362
|
})
|
|
18337
18363
|
);
|
|
18338
18364
|
}
|
|
18339
|
-
var find_template_default = task(
|
|
18365
|
+
var find_template_default = task(run148, {
|
|
18340
18366
|
inputSchema: XcpngFindTemplateParamsSchema,
|
|
18341
18367
|
outputSchema: XcpngFindTemplateResultSchema,
|
|
18342
18368
|
description: "Finds a single template on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -18361,7 +18387,7 @@ var XcpngCloneTemplateResultSchema = z.object({
|
|
|
18361
18387
|
alreadyExists: z.boolean().optional(),
|
|
18362
18388
|
error: z.string().optional()
|
|
18363
18389
|
});
|
|
18364
|
-
async function
|
|
18390
|
+
async function run149(context) {
|
|
18365
18391
|
const { params, error } = context;
|
|
18366
18392
|
const {
|
|
18367
18393
|
source_template_uuid: sourceTemplateUuidParam,
|
|
@@ -18481,7 +18507,7 @@ async function run153(context) {
|
|
|
18481
18507
|
appliedCommands
|
|
18482
18508
|
};
|
|
18483
18509
|
}
|
|
18484
|
-
var clone_template_default = task(
|
|
18510
|
+
var clone_template_default = task(run149, {
|
|
18485
18511
|
inputSchema: XcpngCloneTemplateParamsSchema,
|
|
18486
18512
|
outputSchema: XcpngCloneTemplateResultSchema,
|
|
18487
18513
|
description: "Clones an existing XCP-ng template to a new template name."
|
|
@@ -18496,7 +18522,7 @@ var XcpngListHostsResultSchema = z.object({
|
|
|
18496
18522
|
items: z.any().optional(),
|
|
18497
18523
|
error: z.string().optional()
|
|
18498
18524
|
});
|
|
18499
|
-
async function
|
|
18525
|
+
async function run150(context) {
|
|
18500
18526
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18501
18527
|
const result = await runXeCommand(context, "host-list", filters);
|
|
18502
18528
|
if (!result.success) {
|
|
@@ -18510,7 +18536,7 @@ async function run154(context) {
|
|
|
18510
18536
|
items: parseKeyValueOutput(result.stdout)
|
|
18511
18537
|
};
|
|
18512
18538
|
}
|
|
18513
|
-
var list_hosts_default = task(
|
|
18539
|
+
var list_hosts_default = task(run150, {
|
|
18514
18540
|
inputSchema: XcpngListHostsParamsSchema,
|
|
18515
18541
|
outputSchema: XcpngListHostsResultSchema,
|
|
18516
18542
|
description: "Lists hosts in an XCP-ng pool, returning parsed xe host-list output."
|
|
@@ -18531,7 +18557,7 @@ var XcpngFindHostResultSchema = z.object({
|
|
|
18531
18557
|
multiple: z.boolean().optional(),
|
|
18532
18558
|
error: z.string().optional()
|
|
18533
18559
|
});
|
|
18534
|
-
async function
|
|
18560
|
+
async function run151(context) {
|
|
18535
18561
|
const params = context.params ?? {};
|
|
18536
18562
|
const {
|
|
18537
18563
|
name_label: nameLabel,
|
|
@@ -18631,7 +18657,7 @@ async function runListHosts(context, params) {
|
|
|
18631
18657
|
})
|
|
18632
18658
|
);
|
|
18633
18659
|
}
|
|
18634
|
-
var find_host_default = task(
|
|
18660
|
+
var find_host_default = task(run151, {
|
|
18635
18661
|
inputSchema: XcpngFindHostParamsSchema,
|
|
18636
18662
|
outputSchema: XcpngFindHostResultSchema,
|
|
18637
18663
|
description: "Finds a single host on an XCP-ng pool, optionally allowing multiple matches."
|
|
@@ -18646,7 +18672,7 @@ var XcpngListNetworkParamsResultSchema = z.object({
|
|
|
18646
18672
|
items: z.any().optional(),
|
|
18647
18673
|
error: z.string().optional()
|
|
18648
18674
|
});
|
|
18649
|
-
async function
|
|
18675
|
+
async function run152(context) {
|
|
18650
18676
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18651
18677
|
const result = await runXeCommand(context, "network-param-list", filters);
|
|
18652
18678
|
if (!result.success) {
|
|
@@ -18660,7 +18686,7 @@ async function run156(context) {
|
|
|
18660
18686
|
items: parseKeyValueOutput(result.stdout)
|
|
18661
18687
|
};
|
|
18662
18688
|
}
|
|
18663
|
-
var list_network_params_default = task(
|
|
18689
|
+
var list_network_params_default = task(run152, {
|
|
18664
18690
|
inputSchema: XcpngListNetworkParamsParamsSchema,
|
|
18665
18691
|
outputSchema: XcpngListNetworkParamsResultSchema,
|
|
18666
18692
|
description: "Lists parameters for networks on an XCP-ng host."
|
|
@@ -18675,7 +18701,7 @@ var XcpngListNetworksResultSchema = z.object({
|
|
|
18675
18701
|
items: z.array(z.any()).optional(),
|
|
18676
18702
|
error: z.string().optional()
|
|
18677
18703
|
});
|
|
18678
|
-
async function
|
|
18704
|
+
async function run153(context) {
|
|
18679
18705
|
const { params } = context;
|
|
18680
18706
|
const filters = normalizeFilterArgs(params?.filters);
|
|
18681
18707
|
const result = await runXeCommand(context, "network-list", filters);
|
|
@@ -18724,7 +18750,7 @@ async function run157(context) {
|
|
|
18724
18750
|
items: enrichedItems
|
|
18725
18751
|
};
|
|
18726
18752
|
}
|
|
18727
|
-
var list_networks_default = task(
|
|
18753
|
+
var list_networks_default = task(run153, {
|
|
18728
18754
|
inputSchema: XcpngListNetworksParamsSchema,
|
|
18729
18755
|
outputSchema: XcpngListNetworksResultSchema,
|
|
18730
18756
|
description: "Lists networks on an XCP-ng host."
|
|
@@ -18745,7 +18771,7 @@ var XcpngFindNetworkResultSchema = z.object({
|
|
|
18745
18771
|
multiple: z.boolean().optional(),
|
|
18746
18772
|
error: z.string().optional()
|
|
18747
18773
|
});
|
|
18748
|
-
async function
|
|
18774
|
+
async function run154(context) {
|
|
18749
18775
|
const params = context.params ?? {};
|
|
18750
18776
|
const {
|
|
18751
18777
|
name_label: nameLabel,
|
|
@@ -18836,7 +18862,7 @@ function buildMultipleMessage4(nameLabel, uuid, count) {
|
|
|
18836
18862
|
const detail = identifiers.length > 0 ? identifiers.join(", ") : "specified criteria";
|
|
18837
18863
|
return `Multiple networks (${count}) matched ${detail}; refine filters or set allow_multiple:true.`;
|
|
18838
18864
|
}
|
|
18839
|
-
var find_network_default = task(
|
|
18865
|
+
var find_network_default = task(run154, {
|
|
18840
18866
|
inputSchema: XcpngFindNetworkParamsSchema,
|
|
18841
18867
|
outputSchema: XcpngFindNetworkResultSchema,
|
|
18842
18868
|
description: "Finds a single network on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -18863,7 +18889,7 @@ var XcpngCreateBondResultSchema = z.object({
|
|
|
18863
18889
|
appliedCommands: z.array(z.string()),
|
|
18864
18890
|
error: z.string().optional()
|
|
18865
18891
|
});
|
|
18866
|
-
async function
|
|
18892
|
+
async function run155(context) {
|
|
18867
18893
|
const { params, error } = context;
|
|
18868
18894
|
const {
|
|
18869
18895
|
host_uuid: hostUuidParam,
|
|
@@ -18985,7 +19011,7 @@ async function run159(context) {
|
|
|
18985
19011
|
appliedCommands
|
|
18986
19012
|
};
|
|
18987
19013
|
}
|
|
18988
|
-
var create_bond_default = task(
|
|
19014
|
+
var create_bond_default = task(run155, {
|
|
18989
19015
|
inputSchema: XcpngCreateBondParamsSchema,
|
|
18990
19016
|
outputSchema: XcpngCreateBondResultSchema,
|
|
18991
19017
|
description: "Creates a bonded interface on a host, wrapping xe bond-create."
|
|
@@ -19000,7 +19026,7 @@ var XcpngListPbdParamsResultSchema = z.object({
|
|
|
19000
19026
|
items: z.any().optional(),
|
|
19001
19027
|
error: z.string().optional()
|
|
19002
19028
|
});
|
|
19003
|
-
async function
|
|
19029
|
+
async function run156(context) {
|
|
19004
19030
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19005
19031
|
const result = await runXeCommand(context, "pbd-param-list", filters);
|
|
19006
19032
|
if (!result.success) {
|
|
@@ -19014,7 +19040,7 @@ async function run160(context) {
|
|
|
19014
19040
|
items: parseKeyValueOutput(result.stdout)
|
|
19015
19041
|
};
|
|
19016
19042
|
}
|
|
19017
|
-
var list_pbd_params_default = task(
|
|
19043
|
+
var list_pbd_params_default = task(run156, {
|
|
19018
19044
|
inputSchema: XcpngListPbdParamsParamsSchema,
|
|
19019
19045
|
outputSchema: XcpngListPbdParamsResultSchema,
|
|
19020
19046
|
description: "Lists parameters for PBDs on an XCP-ng host."
|
|
@@ -19029,7 +19055,7 @@ var XcpngListPbdsResultSchema = z.object({
|
|
|
19029
19055
|
items: z.array(z.any()).optional(),
|
|
19030
19056
|
error: z.string().optional()
|
|
19031
19057
|
});
|
|
19032
|
-
async function
|
|
19058
|
+
async function run157(context) {
|
|
19033
19059
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19034
19060
|
const result = await runXeCommand(context, "pbd-list", filters);
|
|
19035
19061
|
if (!result.success) {
|
|
@@ -19077,7 +19103,7 @@ async function run161(context) {
|
|
|
19077
19103
|
items: enrichedItems
|
|
19078
19104
|
};
|
|
19079
19105
|
}
|
|
19080
|
-
var list_pbds_default = task(
|
|
19106
|
+
var list_pbds_default = task(run157, {
|
|
19081
19107
|
inputSchema: XcpngListPbdsParamsSchema,
|
|
19082
19108
|
outputSchema: XcpngListPbdsResultSchema,
|
|
19083
19109
|
description: "Lists storage bindings (PBDs) between hosts and storage repositories."
|
|
@@ -19099,7 +19125,7 @@ var XcpngFindPbdResultSchema = z.object({
|
|
|
19099
19125
|
multiple: z.boolean().optional(),
|
|
19100
19126
|
error: z.string().optional()
|
|
19101
19127
|
});
|
|
19102
|
-
async function
|
|
19128
|
+
async function run158(context) {
|
|
19103
19129
|
const params = context.params ?? {};
|
|
19104
19130
|
const {
|
|
19105
19131
|
uuid,
|
|
@@ -19212,7 +19238,7 @@ async function runListPbds(context, params) {
|
|
|
19212
19238
|
})
|
|
19213
19239
|
);
|
|
19214
19240
|
}
|
|
19215
|
-
var find_pbd_default = task(
|
|
19241
|
+
var find_pbd_default = task(run158, {
|
|
19216
19242
|
inputSchema: XcpngFindPbdParamsSchema,
|
|
19217
19243
|
outputSchema: XcpngFindPbdResultSchema,
|
|
19218
19244
|
description: "Finds a single PBD (host \u2194 SR binding), optionally allowing multiple matches."
|
|
@@ -19237,7 +19263,7 @@ var XcpngCreatePbdResultSchema = z.object({
|
|
|
19237
19263
|
skipped: z.boolean().optional(),
|
|
19238
19264
|
error: z.string().optional()
|
|
19239
19265
|
});
|
|
19240
|
-
async function
|
|
19266
|
+
async function run159(context) {
|
|
19241
19267
|
const { params, error } = context;
|
|
19242
19268
|
const {
|
|
19243
19269
|
host_uuid: hostUuidParam,
|
|
@@ -19354,7 +19380,7 @@ async function run163(context) {
|
|
|
19354
19380
|
appliedCommands
|
|
19355
19381
|
};
|
|
19356
19382
|
}
|
|
19357
|
-
var create_pbd_default = task(
|
|
19383
|
+
var create_pbd_default = task(run159, {
|
|
19358
19384
|
inputSchema: XcpngCreatePbdParamsSchema,
|
|
19359
19385
|
outputSchema: XcpngCreatePbdResultSchema,
|
|
19360
19386
|
description: "Creates a host \u2194 storage repository binding (PBD)."
|
|
@@ -19369,7 +19395,7 @@ var XcpngListVmParamsResultSchema = z.object({
|
|
|
19369
19395
|
items: z.any().optional(),
|
|
19370
19396
|
error: z.string().optional()
|
|
19371
19397
|
});
|
|
19372
|
-
async function
|
|
19398
|
+
async function run160(context) {
|
|
19373
19399
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19374
19400
|
const result = await runXeCommand(context, "vm-param-list", filters);
|
|
19375
19401
|
if (!result.success) {
|
|
@@ -19383,7 +19409,7 @@ async function run164(context) {
|
|
|
19383
19409
|
items: parseKeyValueOutput(result.stdout)
|
|
19384
19410
|
};
|
|
19385
19411
|
}
|
|
19386
|
-
var list_vm_params_default = task(
|
|
19412
|
+
var list_vm_params_default = task(run160, {
|
|
19387
19413
|
inputSchema: XcpngListVmParamsParamsSchema,
|
|
19388
19414
|
outputSchema: XcpngListVmParamsResultSchema,
|
|
19389
19415
|
description: "Lists virtual machines (VMs) on an XCP-ng host."
|
|
@@ -19399,7 +19425,7 @@ var XcpngListVmsResultSchema = z.object({
|
|
|
19399
19425
|
items: z.array(z.any()).optional(),
|
|
19400
19426
|
error: z.string().optional()
|
|
19401
19427
|
});
|
|
19402
|
-
async function
|
|
19428
|
+
async function run161(context) {
|
|
19403
19429
|
const { params } = context;
|
|
19404
19430
|
const filters = normalizeFilterArgs(params?.filters);
|
|
19405
19431
|
const paramsArg = buildParamsArg(params?.params);
|
|
@@ -19452,7 +19478,7 @@ async function run165(context) {
|
|
|
19452
19478
|
items: enrichedItems
|
|
19453
19479
|
};
|
|
19454
19480
|
}
|
|
19455
|
-
var list_vms_default = task(
|
|
19481
|
+
var list_vms_default = task(run161, {
|
|
19456
19482
|
inputSchema: XcpngListVmsParamsSchema,
|
|
19457
19483
|
outputSchema: XcpngListVmsResultSchema,
|
|
19458
19484
|
description: "Lists VMs on an XCP-ng host and returns structured metadata."
|
|
@@ -19503,7 +19529,7 @@ var XcpngFindVmResultSchema = z.object({
|
|
|
19503
19529
|
multiple: z.boolean().optional(),
|
|
19504
19530
|
error: z.string().optional()
|
|
19505
19531
|
});
|
|
19506
|
-
async function
|
|
19532
|
+
async function run162(context) {
|
|
19507
19533
|
const params = context.params ?? {};
|
|
19508
19534
|
const {
|
|
19509
19535
|
name_label: nameLabel,
|
|
@@ -19631,7 +19657,7 @@ async function runListVms(context, params) {
|
|
|
19631
19657
|
})
|
|
19632
19658
|
);
|
|
19633
19659
|
}
|
|
19634
|
-
var find_vm_default = task(
|
|
19660
|
+
var find_vm_default = task(run162, {
|
|
19635
19661
|
inputSchema: XcpngFindVmParamsSchema,
|
|
19636
19662
|
outputSchema: XcpngFindVmResultSchema,
|
|
19637
19663
|
description: "Finds a single VM on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -19736,7 +19762,7 @@ var XcpngCreateTemplateResultSchema = z.object({
|
|
|
19736
19762
|
powerState: z.string().optional(),
|
|
19737
19763
|
waitAttempts: z.number().optional()
|
|
19738
19764
|
});
|
|
19739
|
-
async function
|
|
19765
|
+
async function run163(context) {
|
|
19740
19766
|
const { params, error } = context;
|
|
19741
19767
|
const {
|
|
19742
19768
|
source_vm_uuid: sourceVmUuidParam,
|
|
@@ -19844,7 +19870,7 @@ async function run167(context) {
|
|
|
19844
19870
|
waitAttempts: ensureHalted.attempts
|
|
19845
19871
|
};
|
|
19846
19872
|
}
|
|
19847
|
-
var create_template_default = task(
|
|
19873
|
+
var create_template_default = task(run163, {
|
|
19848
19874
|
inputSchema: XcpngCreateTemplateParamsSchema,
|
|
19849
19875
|
outputSchema: XcpngCreateTemplateResultSchema,
|
|
19850
19876
|
description: "Clones a VM and converts it into an XCP-ng template."
|
|
@@ -19871,7 +19897,7 @@ var XcpngCreateVmResultSchema = z.object({
|
|
|
19871
19897
|
appliedCommands: z.array(z.string()),
|
|
19872
19898
|
error: z.string().optional()
|
|
19873
19899
|
});
|
|
19874
|
-
async function
|
|
19900
|
+
async function run164(context) {
|
|
19875
19901
|
const { params, error } = context;
|
|
19876
19902
|
const {
|
|
19877
19903
|
name_label,
|
|
@@ -19997,7 +20023,7 @@ async function run168(context) {
|
|
|
19997
20023
|
appliedCommands
|
|
19998
20024
|
};
|
|
19999
20025
|
}
|
|
20000
|
-
var create_vm_default = task(
|
|
20026
|
+
var create_vm_default = task(run164, {
|
|
20001
20027
|
inputSchema: XcpngCreateVmParamsSchema,
|
|
20002
20028
|
outputSchema: XcpngCreateVmResultSchema,
|
|
20003
20029
|
description: "Creates a new VM on XCP-ng and optionally applies memory and CPU sizing."
|
|
@@ -20012,7 +20038,7 @@ var XcpngListVdiParamsResultSchema = z.object({
|
|
|
20012
20038
|
items: z.any().optional(),
|
|
20013
20039
|
error: z.string().optional()
|
|
20014
20040
|
});
|
|
20015
|
-
async function
|
|
20041
|
+
async function run165(context) {
|
|
20016
20042
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
20017
20043
|
const result = await runXeCommand(context, "vdi-param-list", filters);
|
|
20018
20044
|
if (!result.success) {
|
|
@@ -20026,7 +20052,7 @@ async function run169(context) {
|
|
|
20026
20052
|
items: parseKeyValueOutput(result.stdout)
|
|
20027
20053
|
};
|
|
20028
20054
|
}
|
|
20029
|
-
var list_vdi_params_default = task(
|
|
20055
|
+
var list_vdi_params_default = task(run165, {
|
|
20030
20056
|
inputSchema: XcpngListVdiParamsParamsSchema,
|
|
20031
20057
|
outputSchema: XcpngListVdiParamsResultSchema,
|
|
20032
20058
|
description: "Lists virtual disk image parameters (VDI params) on an XCP-ng host."
|
|
@@ -20041,7 +20067,7 @@ var XcpngListVdisResultSchema = z.object({
|
|
|
20041
20067
|
items: z.array(z.any()).optional(),
|
|
20042
20068
|
error: z.string().optional()
|
|
20043
20069
|
});
|
|
20044
|
-
async function
|
|
20070
|
+
async function run166(context) {
|
|
20045
20071
|
const { params } = context;
|
|
20046
20072
|
const filters = normalizeFilterArgs(params?.filters);
|
|
20047
20073
|
const result = await runXeCommand(context, "vdi-list", filters);
|
|
@@ -20092,7 +20118,7 @@ async function run170(context) {
|
|
|
20092
20118
|
items: enrichedItems
|
|
20093
20119
|
};
|
|
20094
20120
|
}
|
|
20095
|
-
var list_vdis_default = task(
|
|
20121
|
+
var list_vdis_default = task(run166, {
|
|
20096
20122
|
inputSchema: XcpngListVdisParamsSchema,
|
|
20097
20123
|
outputSchema: XcpngListVdisResultSchema,
|
|
20098
20124
|
description: "Lists VDIs on an XCP-ng host with optional filtering."
|
|
@@ -20114,7 +20140,7 @@ var XcpngFindVdiResultSchema = z.object({
|
|
|
20114
20140
|
multiple: z.boolean().optional(),
|
|
20115
20141
|
error: z.string().optional()
|
|
20116
20142
|
});
|
|
20117
|
-
async function
|
|
20143
|
+
async function run167(context) {
|
|
20118
20144
|
const params = context.params ?? {};
|
|
20119
20145
|
const {
|
|
20120
20146
|
name_label: nameLabel,
|
|
@@ -20220,7 +20246,7 @@ function buildMultipleMessage7(nameLabel, uuid, srUuid, count) {
|
|
|
20220
20246
|
const detail = identifiers.length > 0 ? identifiers.join(", ") : "specified criteria";
|
|
20221
20247
|
return `Multiple VDIs (${count}) matched ${detail}; refine filters or set allow_multiple:true.`;
|
|
20222
20248
|
}
|
|
20223
|
-
var find_vdi_default = task(
|
|
20249
|
+
var find_vdi_default = task(run167, {
|
|
20224
20250
|
inputSchema: XcpngFindVdiParamsSchema,
|
|
20225
20251
|
outputSchema: XcpngFindVdiResultSchema,
|
|
20226
20252
|
description: "Finds a single VDI on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -20235,7 +20261,7 @@ var XcpngListVbdParamsResultSchema = z.object({
|
|
|
20235
20261
|
items: z.any().optional(),
|
|
20236
20262
|
error: z.string().optional()
|
|
20237
20263
|
});
|
|
20238
|
-
async function
|
|
20264
|
+
async function run168(context) {
|
|
20239
20265
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
20240
20266
|
const result = await runXeCommand(context, "vbd-param-list", filters);
|
|
20241
20267
|
if (!result.success) {
|
|
@@ -20249,7 +20275,7 @@ async function run172(context) {
|
|
|
20249
20275
|
items: parseKeyValueOutput(result.stdout)
|
|
20250
20276
|
};
|
|
20251
20277
|
}
|
|
20252
|
-
var list_vbd_params_default = task(
|
|
20278
|
+
var list_vbd_params_default = task(run168, {
|
|
20253
20279
|
inputSchema: XcpngListVbdParamsParamsSchema,
|
|
20254
20280
|
outputSchema: XcpngListVbdParamsResultSchema,
|
|
20255
20281
|
description: "Lists virtual block devices (VBDs) on an XCP-ng host."
|
|
@@ -20264,7 +20290,7 @@ var XcpngListVbdsResultSchema = z.object({
|
|
|
20264
20290
|
items: z.array(z.any()).optional(),
|
|
20265
20291
|
error: z.string().optional()
|
|
20266
20292
|
});
|
|
20267
|
-
async function
|
|
20293
|
+
async function run169(context) {
|
|
20268
20294
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
20269
20295
|
const result = await runXeCommand(context, "vbd-list", filters);
|
|
20270
20296
|
if (!result.success) {
|
|
@@ -20314,7 +20340,7 @@ async function run173(context) {
|
|
|
20314
20340
|
items: enrichedItems
|
|
20315
20341
|
};
|
|
20316
20342
|
}
|
|
20317
|
-
var list_vbds_default = task(
|
|
20343
|
+
var list_vbds_default = task(run169, {
|
|
20318
20344
|
inputSchema: XcpngListVbdsParamsSchema,
|
|
20319
20345
|
outputSchema: XcpngListVbdsResultSchema,
|
|
20320
20346
|
description: "Lists virtual block devices (VBDs) on an XCP-ng host."
|
|
@@ -20331,7 +20357,7 @@ var XcpngListAttachedDisksResultSchema = z.object({
|
|
|
20331
20357
|
disks: z.array(z.any()).optional(),
|
|
20332
20358
|
error: z.string().optional()
|
|
20333
20359
|
});
|
|
20334
|
-
async function
|
|
20360
|
+
async function run170(context) {
|
|
20335
20361
|
const { params, error } = context;
|
|
20336
20362
|
const { vm_uuid: vmUuid, include_readonly: rawIncludeReadonly } = params ?? {};
|
|
20337
20363
|
if (!vmUuid) {
|
|
@@ -20425,7 +20451,7 @@ async function run174(context) {
|
|
|
20425
20451
|
disks
|
|
20426
20452
|
};
|
|
20427
20453
|
}
|
|
20428
|
-
var list_attached_disks_default = task(
|
|
20454
|
+
var list_attached_disks_default = task(run170, {
|
|
20429
20455
|
inputSchema: XcpngListAttachedDisksParamsSchema,
|
|
20430
20456
|
outputSchema: XcpngListAttachedDisksResultSchema,
|
|
20431
20457
|
description: "Lists VBDs attached to a VM and enriches them with VDI metadata so disks vs CD drives can be distinguished."
|
|
@@ -20452,7 +20478,7 @@ var XcpngRemoveDiskResultSchema = z.object({
|
|
|
20452
20478
|
appliedCommands: z.array(z.string()),
|
|
20453
20479
|
error: z.string().optional()
|
|
20454
20480
|
});
|
|
20455
|
-
async function
|
|
20481
|
+
async function run171(context) {
|
|
20456
20482
|
const { params, error } = context;
|
|
20457
20483
|
const {
|
|
20458
20484
|
vbd_uuid: vbdUuidParam,
|
|
@@ -20640,7 +20666,7 @@ async function waitForVdiRemoval(context, vdiUuid, timeoutMs) {
|
|
|
20640
20666
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
20641
20667
|
}
|
|
20642
20668
|
}
|
|
20643
|
-
var remove_disk_default = task(
|
|
20669
|
+
var remove_disk_default = task(run171, {
|
|
20644
20670
|
inputSchema: XcpngRemoveDiskParamsSchema,
|
|
20645
20671
|
outputSchema: XcpngRemoveDiskResultSchema,
|
|
20646
20672
|
description: "Detaches a VDI from a VM and optionally destroys the backing disk on XCP-ng."
|
|
@@ -20657,7 +20683,7 @@ var XcpngSetBootOrderResultSchema = z.object({
|
|
|
20657
20683
|
appliedCommands: z.array(z.string()),
|
|
20658
20684
|
error: z.string().optional()
|
|
20659
20685
|
});
|
|
20660
|
-
async function
|
|
20686
|
+
async function run172(context) {
|
|
20661
20687
|
const { params, error } = context;
|
|
20662
20688
|
const { vm_uuid, boot_order, firmware } = params;
|
|
20663
20689
|
if (!vm_uuid) {
|
|
@@ -20721,7 +20747,7 @@ async function run176(context) {
|
|
|
20721
20747
|
appliedCommands
|
|
20722
20748
|
};
|
|
20723
20749
|
}
|
|
20724
|
-
var set_boot_order_default = task(
|
|
20750
|
+
var set_boot_order_default = task(run172, {
|
|
20725
20751
|
inputSchema: XcpngSetBootOrderParamsSchema,
|
|
20726
20752
|
outputSchema: XcpngSetBootOrderResultSchema,
|
|
20727
20753
|
description: "Configures VM boot order and optional firmware mode via xe vm-param-set."
|
|
@@ -20774,7 +20800,7 @@ var OTHER_CONFIG_KEYS_TO_REMOVE = [
|
|
|
20774
20800
|
"cloud-init-hostname",
|
|
20775
20801
|
"cloud-init-instance-id"
|
|
20776
20802
|
];
|
|
20777
|
-
async function
|
|
20803
|
+
async function run173(context) {
|
|
20778
20804
|
if (!context.host) {
|
|
20779
20805
|
const message = "core.xcpng.create-template-from-vdi must run against a remote XCP-ng host.";
|
|
20780
20806
|
return {
|
|
@@ -21307,7 +21333,7 @@ async function run177(context) {
|
|
|
21307
21333
|
steps
|
|
21308
21334
|
};
|
|
21309
21335
|
}
|
|
21310
|
-
var create_template_from_vdi_default = task(
|
|
21336
|
+
var create_template_from_vdi_default = task(run173, {
|
|
21311
21337
|
inputSchema: XcpngCreateTemplateFromVdiParamsSchema,
|
|
21312
21338
|
outputSchema: XcpngCreateTemplateFromVdiResultSchema,
|
|
21313
21339
|
description: "Creates an XCP-ng template from an existing VDI by staging a VM and converting it."
|
|
@@ -21424,7 +21450,7 @@ var XcpngCreateNetworkResultSchema = z.object({
|
|
|
21424
21450
|
skipped: z.boolean().optional(),
|
|
21425
21451
|
error: z.string().optional()
|
|
21426
21452
|
});
|
|
21427
|
-
async function
|
|
21453
|
+
async function run174(context) {
|
|
21428
21454
|
const { params, error } = context;
|
|
21429
21455
|
const { name_label: nameLabel, description, bridge, mtu, tags, allow_existing: rawAllowExisting } = params ?? {};
|
|
21430
21456
|
if (!nameLabel) {
|
|
@@ -21489,7 +21515,7 @@ async function run178(context) {
|
|
|
21489
21515
|
appliedCommands
|
|
21490
21516
|
};
|
|
21491
21517
|
}
|
|
21492
|
-
var create_network_default = task(
|
|
21518
|
+
var create_network_default = task(run174, {
|
|
21493
21519
|
inputSchema: XcpngCreateNetworkParamsSchema,
|
|
21494
21520
|
outputSchema: XcpngCreateNetworkResultSchema,
|
|
21495
21521
|
description: "Creates a new network on an XCP-ng host (bridge, MTU, and tags optional)."
|
|
@@ -21521,7 +21547,7 @@ var XcpngFindOrCreateIsoSrResultSchema = z.object({
|
|
|
21521
21547
|
commands: z.array(z.string()),
|
|
21522
21548
|
error: z.string().optional()
|
|
21523
21549
|
});
|
|
21524
|
-
async function
|
|
21550
|
+
async function run175(context) {
|
|
21525
21551
|
const { params, debug, error: logError2 } = context;
|
|
21526
21552
|
const {
|
|
21527
21553
|
name_label: nameLabel,
|
|
@@ -21673,7 +21699,7 @@ async function runDirCreate(context, params) {
|
|
|
21673
21699
|
})
|
|
21674
21700
|
);
|
|
21675
21701
|
}
|
|
21676
|
-
var find_or_create_iso_sr_default = task(
|
|
21702
|
+
var find_or_create_iso_sr_default = task(run175, {
|
|
21677
21703
|
inputSchema: XcpngFindOrCreateIsoSrParamsSchema,
|
|
21678
21704
|
outputSchema: XcpngFindOrCreateIsoSrResultSchema,
|
|
21679
21705
|
description: "Finds an ISO storage repository by name, creating it if missing using xe sr-create."
|
|
@@ -21716,7 +21742,7 @@ var XcpngCreateConfigDriveResultSchema = z.object({
|
|
|
21716
21742
|
steps: z.array(z.any()),
|
|
21717
21743
|
error: z.string().optional()
|
|
21718
21744
|
});
|
|
21719
|
-
async function
|
|
21745
|
+
async function run176(context) {
|
|
21720
21746
|
if (!context.host) {
|
|
21721
21747
|
return {
|
|
21722
21748
|
success: false,
|
|
@@ -22235,7 +22261,7 @@ function decodeBase64Field(field, value) {
|
|
|
22235
22261
|
};
|
|
22236
22262
|
}
|
|
22237
22263
|
}
|
|
22238
|
-
var create_config_drive_default = task(
|
|
22264
|
+
var create_config_drive_default = task(run176, {
|
|
22239
22265
|
inputSchema: XcpngCreateConfigDriveParamsSchema,
|
|
22240
22266
|
outputSchema: XcpngCreateConfigDriveResultSchema,
|
|
22241
22267
|
description: "Generates a NoCloud config-drive ISO, stores it in an ISO SR, and returns the associated VDI."
|
|
@@ -22259,7 +22285,7 @@ var XcpngConvertTemplateToVmResultSchema = z.object({
|
|
|
22259
22285
|
alreadyVm: z.boolean().optional(),
|
|
22260
22286
|
error: z.string().optional()
|
|
22261
22287
|
});
|
|
22262
|
-
async function
|
|
22288
|
+
async function run177(context) {
|
|
22263
22289
|
const { params, error } = context;
|
|
22264
22290
|
const {
|
|
22265
22291
|
template_uuid: templateUuidParam,
|
|
@@ -22358,7 +22384,7 @@ async function run181(context) {
|
|
|
22358
22384
|
alreadyVm
|
|
22359
22385
|
};
|
|
22360
22386
|
}
|
|
22361
|
-
var convert_template_to_vm_default = task(
|
|
22387
|
+
var convert_template_to_vm_default = task(run177, {
|
|
22362
22388
|
inputSchema: XcpngConvertTemplateToVmParamsSchema,
|
|
22363
22389
|
outputSchema: XcpngConvertTemplateToVmResultSchema,
|
|
22364
22390
|
description: "Converts an XCP-ng template into a VM by clearing the template flag and optionally renaming it."
|
|
@@ -22379,7 +22405,7 @@ var XcpngDestroyIsoSrResultSchema = z.object({
|
|
|
22379
22405
|
skipped: z.boolean().optional(),
|
|
22380
22406
|
error: z.string().optional()
|
|
22381
22407
|
});
|
|
22382
|
-
async function
|
|
22408
|
+
async function run178(context) {
|
|
22383
22409
|
const { params, error } = context;
|
|
22384
22410
|
const { sr_uuid: srUuidParam, sr_name_label: srName, location, allow_missing: rawAllowMissing } = params ?? {};
|
|
22385
22411
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -22545,7 +22571,7 @@ async function detachSrPbds(context, srUuid, allowMissing) {
|
|
|
22545
22571
|
}
|
|
22546
22572
|
return { commands };
|
|
22547
22573
|
}
|
|
22548
|
-
var destroy_iso_sr_default = task(
|
|
22574
|
+
var destroy_iso_sr_default = task(run178, {
|
|
22549
22575
|
inputSchema: XcpngDestroyIsoSrParamsSchema,
|
|
22550
22576
|
outputSchema: XcpngDestroyIsoSrResultSchema,
|
|
22551
22577
|
description: "Destroys an ISO storage repository and optionally removes its backing directory."
|
|
@@ -22564,7 +22590,7 @@ var XcpngDestroyBondResultSchema = z.object({
|
|
|
22564
22590
|
skipped: z.boolean().optional(),
|
|
22565
22591
|
error: z.string().optional()
|
|
22566
22592
|
});
|
|
22567
|
-
async function
|
|
22593
|
+
async function run179(context) {
|
|
22568
22594
|
const { params, error } = context;
|
|
22569
22595
|
const { bond_uuid: bondUuidParam, pif_uuid: pifUuidParam, allow_missing: rawAllowMissing } = params ?? {};
|
|
22570
22596
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -22601,7 +22627,7 @@ async function run183(context) {
|
|
|
22601
22627
|
appliedCommands
|
|
22602
22628
|
};
|
|
22603
22629
|
}
|
|
22604
|
-
var destroy_bond_default = task(
|
|
22630
|
+
var destroy_bond_default = task(run179, {
|
|
22605
22631
|
inputSchema: XcpngDestroyBondParamsSchema,
|
|
22606
22632
|
outputSchema: XcpngDestroyBondResultSchema,
|
|
22607
22633
|
description: "Destroys a bonded interface, wrapping xe bond-destroy."
|
|
@@ -22623,7 +22649,7 @@ var XcpngCreateSrResultSchema = z.object({
|
|
|
22623
22649
|
skipped: z.boolean().optional(),
|
|
22624
22650
|
error: z.string().optional()
|
|
22625
22651
|
});
|
|
22626
|
-
async function
|
|
22652
|
+
async function run180(context) {
|
|
22627
22653
|
const { params, error } = context;
|
|
22628
22654
|
const {
|
|
22629
22655
|
name_label: nameLabel,
|
|
@@ -22698,7 +22724,7 @@ async function run184(context) {
|
|
|
22698
22724
|
appliedCommands
|
|
22699
22725
|
};
|
|
22700
22726
|
}
|
|
22701
|
-
var create_sr_default = task(
|
|
22727
|
+
var create_sr_default = task(run180, {
|
|
22702
22728
|
inputSchema: XcpngCreateSrParamsSchema,
|
|
22703
22729
|
outputSchema: XcpngCreateSrResultSchema,
|
|
22704
22730
|
description: "Creates a new storage repository (SR) with the specified device configuration."
|
|
@@ -22718,7 +22744,7 @@ var XcpngDestroySrResultSchema = z.object({
|
|
|
22718
22744
|
skipped: z.boolean().optional(),
|
|
22719
22745
|
error: z.string().optional()
|
|
22720
22746
|
});
|
|
22721
|
-
async function
|
|
22747
|
+
async function run181(context) {
|
|
22722
22748
|
const { params, error } = context;
|
|
22723
22749
|
const {
|
|
22724
22750
|
sr_uuid: srUuidParam,
|
|
@@ -22792,7 +22818,7 @@ async function run185(context) {
|
|
|
22792
22818
|
appliedCommands
|
|
22793
22819
|
};
|
|
22794
22820
|
}
|
|
22795
|
-
var destroy_sr_default = task(
|
|
22821
|
+
var destroy_sr_default = task(run181, {
|
|
22796
22822
|
inputSchema: XcpngDestroySrParamsSchema,
|
|
22797
22823
|
outputSchema: XcpngDestroySrResultSchema,
|
|
22798
22824
|
description: "Destroys a storage repository by UUID or name-label (optionally forcing)."
|
|
@@ -22811,7 +22837,7 @@ var XcpngDestroyNetworkResultSchema = z.object({
|
|
|
22811
22837
|
skipped: z.boolean().optional(),
|
|
22812
22838
|
error: z.string().optional()
|
|
22813
22839
|
});
|
|
22814
|
-
async function
|
|
22840
|
+
async function run182(context) {
|
|
22815
22841
|
const { params, error } = context;
|
|
22816
22842
|
const {
|
|
22817
22843
|
network_uuid: networkUuidParam,
|
|
@@ -22878,7 +22904,7 @@ async function run186(context) {
|
|
|
22878
22904
|
appliedCommands
|
|
22879
22905
|
};
|
|
22880
22906
|
}
|
|
22881
|
-
var destroy_network_default = task(
|
|
22907
|
+
var destroy_network_default = task(run182, {
|
|
22882
22908
|
inputSchema: XcpngDestroyNetworkParamsSchema,
|
|
22883
22909
|
outputSchema: XcpngDestroyNetworkResultSchema,
|
|
22884
22910
|
description: "Destroys an XCP-ng network by UUID or name-label."
|
|
@@ -22900,7 +22926,7 @@ var XcpngDestroyPbdResultSchema = z.object({
|
|
|
22900
22926
|
skipped: z.boolean().optional(),
|
|
22901
22927
|
error: z.string().optional()
|
|
22902
22928
|
});
|
|
22903
|
-
async function
|
|
22929
|
+
async function run183(context) {
|
|
22904
22930
|
const { params, error } = context;
|
|
22905
22931
|
const {
|
|
22906
22932
|
pbd_uuid: pbdUuidParam,
|
|
@@ -23009,7 +23035,7 @@ async function run187(context) {
|
|
|
23009
23035
|
appliedCommands
|
|
23010
23036
|
};
|
|
23011
23037
|
}
|
|
23012
|
-
var destroy_pbd_default = task(
|
|
23038
|
+
var destroy_pbd_default = task(run183, {
|
|
23013
23039
|
inputSchema: XcpngDestroyPbdParamsSchema,
|
|
23014
23040
|
outputSchema: XcpngDestroyPbdResultSchema,
|
|
23015
23041
|
description: "Destroys a host \u2194 storage repository binding (PBD)."
|
|
@@ -23025,7 +23051,7 @@ var XcpngDestroySnapshotResultSchema = z.object({
|
|
|
23025
23051
|
command: z.string().optional(),
|
|
23026
23052
|
error: z.string().optional()
|
|
23027
23053
|
});
|
|
23028
|
-
async function
|
|
23054
|
+
async function run184(context) {
|
|
23029
23055
|
const { params, error } = context;
|
|
23030
23056
|
const { snapshot_uuid: snapshotUuid } = params ?? {};
|
|
23031
23057
|
if (!snapshotUuid) {
|
|
@@ -23048,7 +23074,7 @@ async function run188(context) {
|
|
|
23048
23074
|
command: result.command
|
|
23049
23075
|
};
|
|
23050
23076
|
}
|
|
23051
|
-
var destroy_snapshot_default = task(
|
|
23077
|
+
var destroy_snapshot_default = task(run184, {
|
|
23052
23078
|
inputSchema: XcpngDestroySnapshotParamsSchema,
|
|
23053
23079
|
outputSchema: XcpngDestroySnapshotResultSchema,
|
|
23054
23080
|
description: "Destroys an XCP-ng VM snapshot."
|
|
@@ -23068,7 +23094,7 @@ var XcpngIntroduceSrResultSchema = z.object({
|
|
|
23068
23094
|
appliedCommands: z.array(z.string()),
|
|
23069
23095
|
error: z.string().optional()
|
|
23070
23096
|
});
|
|
23071
|
-
async function
|
|
23097
|
+
async function run185(context) {
|
|
23072
23098
|
const { params, error } = context;
|
|
23073
23099
|
const { sr_uuid: srUuid, name_label: nameLabel, type, content_type: contentType, shared } = params ?? {};
|
|
23074
23100
|
if (!srUuid) {
|
|
@@ -23109,7 +23135,7 @@ async function run189(context) {
|
|
|
23109
23135
|
appliedCommands
|
|
23110
23136
|
};
|
|
23111
23137
|
}
|
|
23112
|
-
var introduce_sr_default = task(
|
|
23138
|
+
var introduce_sr_default = task(run185, {
|
|
23113
23139
|
inputSchema: XcpngIntroduceSrParamsSchema,
|
|
23114
23140
|
outputSchema: XcpngIntroduceSrResultSchema,
|
|
23115
23141
|
description: "Introduces an existing storage repository into the pool."
|
|
@@ -23128,7 +23154,7 @@ var XcpngForgetSrResultSchema = z.object({
|
|
|
23128
23154
|
skipped: z.boolean().optional(),
|
|
23129
23155
|
error: z.string().optional()
|
|
23130
23156
|
});
|
|
23131
|
-
async function
|
|
23157
|
+
async function run186(context) {
|
|
23132
23158
|
const { params, error } = context;
|
|
23133
23159
|
const { sr_uuid: srUuidParam, sr_name_label: srNameLabel, allow_missing: rawAllowMissing } = params ?? {};
|
|
23134
23160
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -23191,7 +23217,7 @@ async function run190(context) {
|
|
|
23191
23217
|
appliedCommands
|
|
23192
23218
|
};
|
|
23193
23219
|
}
|
|
23194
|
-
var forget_sr_default = task(
|
|
23220
|
+
var forget_sr_default = task(run186, {
|
|
23195
23221
|
inputSchema: XcpngForgetSrParamsSchema,
|
|
23196
23222
|
outputSchema: XcpngForgetSrResultSchema,
|
|
23197
23223
|
description: "Forgets an SR from the pool metadata without destroying the underlying storage."
|
|
@@ -23206,7 +23232,7 @@ var XcpngListSnapshotsResultSchema = z.object({
|
|
|
23206
23232
|
items: z.any().optional(),
|
|
23207
23233
|
error: z.string().optional()
|
|
23208
23234
|
});
|
|
23209
|
-
async function
|
|
23235
|
+
async function run187(context) {
|
|
23210
23236
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
23211
23237
|
const result = await runXeCommand(context, "snapshot-list", filters);
|
|
23212
23238
|
if (!result.success) {
|
|
@@ -23220,7 +23246,7 @@ async function run191(context) {
|
|
|
23220
23246
|
items: parseKeyValueOutput(result.stdout)
|
|
23221
23247
|
};
|
|
23222
23248
|
}
|
|
23223
|
-
var list_snapshots_default = task(
|
|
23249
|
+
var list_snapshots_default = task(run187, {
|
|
23224
23250
|
inputSchema: XcpngListSnapshotsParamsSchema,
|
|
23225
23251
|
outputSchema: XcpngListSnapshotsResultSchema,
|
|
23226
23252
|
description: "Lists VM snapshots available on the host."
|
|
@@ -23235,7 +23261,7 @@ var XcpngListMessagesResultSchema = z.object({
|
|
|
23235
23261
|
items: z.any().optional(),
|
|
23236
23262
|
error: z.string().optional()
|
|
23237
23263
|
});
|
|
23238
|
-
async function
|
|
23264
|
+
async function run188(context) {
|
|
23239
23265
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
23240
23266
|
const result = await runXeCommand(context, "message-list", filters);
|
|
23241
23267
|
if (!result.success) {
|
|
@@ -23249,7 +23275,7 @@ async function run192(context) {
|
|
|
23249
23275
|
items: parseKeyValueOutput(result.stdout)
|
|
23250
23276
|
};
|
|
23251
23277
|
}
|
|
23252
|
-
var list_messages_default = task(
|
|
23278
|
+
var list_messages_default = task(run188, {
|
|
23253
23279
|
inputSchema: XcpngListMessagesParamsSchema,
|
|
23254
23280
|
outputSchema: XcpngListMessagesResultSchema,
|
|
23255
23281
|
description: "Lists messages emitted by the XCP-ng pool."
|
|
@@ -23268,7 +23294,7 @@ var XcpngClearMessagesResultSchema = z.object({
|
|
|
23268
23294
|
commands: z.any().optional(),
|
|
23269
23295
|
error: z.string().optional()
|
|
23270
23296
|
});
|
|
23271
|
-
async function
|
|
23297
|
+
async function run189(context) {
|
|
23272
23298
|
const { params, error } = context;
|
|
23273
23299
|
const { uuid, uuid_prefix: uuidPrefix, all: rawAll, filters } = params ?? {};
|
|
23274
23300
|
const all = coerceBoolean(rawAll, false);
|
|
@@ -23326,7 +23352,7 @@ async function run193(context) {
|
|
|
23326
23352
|
commands
|
|
23327
23353
|
};
|
|
23328
23354
|
}
|
|
23329
|
-
var clear_messages_default = task(
|
|
23355
|
+
var clear_messages_default = task(run189, {
|
|
23330
23356
|
inputSchema: XcpngClearMessagesParamsSchema,
|
|
23331
23357
|
outputSchema: XcpngClearMessagesResultSchema,
|
|
23332
23358
|
description: "Clears messages (all, by UUID, or UUID prefix)."
|
|
@@ -23347,7 +23373,7 @@ var XcpngDestroyTemplateResultSchema = z.object({
|
|
|
23347
23373
|
skipped: z.boolean().optional(),
|
|
23348
23374
|
error: z.string().optional()
|
|
23349
23375
|
});
|
|
23350
|
-
async function
|
|
23376
|
+
async function run190(context) {
|
|
23351
23377
|
const { params, error } = context;
|
|
23352
23378
|
const {
|
|
23353
23379
|
template_uuid: templateUuidParam,
|
|
@@ -23422,7 +23448,7 @@ async function run194(context) {
|
|
|
23422
23448
|
command: commandResult.command
|
|
23423
23449
|
};
|
|
23424
23450
|
}
|
|
23425
|
-
var destroy_template_default = task(
|
|
23451
|
+
var destroy_template_default = task(run190, {
|
|
23426
23452
|
inputSchema: XcpngDestroyTemplateParamsSchema,
|
|
23427
23453
|
outputSchema: XcpngDestroyTemplateResultSchema,
|
|
23428
23454
|
description: "Destroys an XCP-ng template by UUID or name-label."
|
|
@@ -23442,7 +23468,7 @@ var XcpngDestroyVdiResultSchema = z.object({
|
|
|
23442
23468
|
skipped: z.boolean().optional(),
|
|
23443
23469
|
error: z.string().optional()
|
|
23444
23470
|
});
|
|
23445
|
-
async function
|
|
23471
|
+
async function run191(context) {
|
|
23446
23472
|
const { params, error } = context;
|
|
23447
23473
|
const {
|
|
23448
23474
|
vdi_uuid: vdiUuidParam,
|
|
@@ -23507,7 +23533,7 @@ async function run195(context) {
|
|
|
23507
23533
|
command: result.command
|
|
23508
23534
|
};
|
|
23509
23535
|
}
|
|
23510
|
-
var destroy_vdi_default = task(
|
|
23536
|
+
var destroy_vdi_default = task(run191, {
|
|
23511
23537
|
inputSchema: XcpngDestroyVdiParamsSchema,
|
|
23512
23538
|
outputSchema: XcpngDestroyVdiResultSchema,
|
|
23513
23539
|
description: "Destroys an XCP-ng VDI by UUID (optionally resolving by name-label)."
|
|
@@ -23532,7 +23558,7 @@ var XcpngDestroyVmResultSchema = z.object({
|
|
|
23532
23558
|
skipped: z.boolean().optional(),
|
|
23533
23559
|
error: z.string().optional()
|
|
23534
23560
|
});
|
|
23535
|
-
async function
|
|
23561
|
+
async function run192(context) {
|
|
23536
23562
|
const { params, error } = context;
|
|
23537
23563
|
const {
|
|
23538
23564
|
vm_uuid: vmUuidParam,
|
|
@@ -23695,7 +23721,7 @@ async function run196(context) {
|
|
|
23695
23721
|
destroyedVdiUuids
|
|
23696
23722
|
};
|
|
23697
23723
|
}
|
|
23698
|
-
var destroy_vm_default = task(
|
|
23724
|
+
var destroy_vm_default = task(run192, {
|
|
23699
23725
|
inputSchema: XcpngDestroyVmParamsSchema,
|
|
23700
23726
|
outputSchema: XcpngDestroyVmResultSchema,
|
|
23701
23727
|
description: "Destroys an XCP-ng VM, optionally forcing and pruning snapshots."
|
|
@@ -23724,7 +23750,7 @@ var XcpngCopyVdiResultSchema = z.object({
|
|
|
23724
23750
|
skipped: z.boolean().optional(),
|
|
23725
23751
|
error: z.string().optional()
|
|
23726
23752
|
});
|
|
23727
|
-
async function
|
|
23753
|
+
async function run193(context) {
|
|
23728
23754
|
const { params, error } = context;
|
|
23729
23755
|
const {
|
|
23730
23756
|
source_vdi_uuid: sourceVdiUuidParam,
|
|
@@ -23869,7 +23895,7 @@ async function run197(context) {
|
|
|
23869
23895
|
appliedCommands
|
|
23870
23896
|
};
|
|
23871
23897
|
}
|
|
23872
|
-
var copy_vdi_default = task(
|
|
23898
|
+
var copy_vdi_default = task(run193, {
|
|
23873
23899
|
inputSchema: XcpngCopyVdiParamsSchema,
|
|
23874
23900
|
outputSchema: XcpngCopyVdiResultSchema,
|
|
23875
23901
|
description: "Copies an XCP-ng VDI to a destination storage repository and optionally updates its metadata."
|
|
@@ -23887,7 +23913,7 @@ var XcpngDetachIsoResultSchema = z.object({
|
|
|
23887
23913
|
alreadyEmpty: z.boolean().optional(),
|
|
23888
23914
|
error: z.string().optional()
|
|
23889
23915
|
});
|
|
23890
|
-
async function
|
|
23916
|
+
async function run194(context) {
|
|
23891
23917
|
const { params, error } = context;
|
|
23892
23918
|
const { vm_uuid: vmUuid, allow_missing: rawAllowMissing } = params;
|
|
23893
23919
|
if (!vmUuid) {
|
|
@@ -23919,7 +23945,7 @@ async function run198(context) {
|
|
|
23919
23945
|
error: message
|
|
23920
23946
|
};
|
|
23921
23947
|
}
|
|
23922
|
-
var detach_iso_default = task(
|
|
23948
|
+
var detach_iso_default = task(run194, {
|
|
23923
23949
|
inputSchema: XcpngDetachIsoParamsSchema,
|
|
23924
23950
|
outputSchema: XcpngDetachIsoResultSchema,
|
|
23925
23951
|
description: "Ejects ISO media from a VM, tolerating empty drives when allow_missing:true."
|
|
@@ -23945,7 +23971,7 @@ var XcpngDetachVdiResultSchema = z.object({
|
|
|
23945
23971
|
appliedCommands: z.array(z.string()),
|
|
23946
23972
|
error: z.string().optional()
|
|
23947
23973
|
});
|
|
23948
|
-
async function
|
|
23974
|
+
async function run195(context) {
|
|
23949
23975
|
const { params } = context;
|
|
23950
23976
|
const {
|
|
23951
23977
|
vbd_uuid,
|
|
@@ -23982,7 +24008,7 @@ async function run199(context) {
|
|
|
23982
24008
|
error: result.error
|
|
23983
24009
|
};
|
|
23984
24010
|
}
|
|
23985
|
-
var detach_vdi_default = task(
|
|
24011
|
+
var detach_vdi_default = task(run195, {
|
|
23986
24012
|
inputSchema: XcpngDetachVdiParamsSchema,
|
|
23987
24013
|
outputSchema: XcpngDetachVdiResultSchema,
|
|
23988
24014
|
description: "Detaches a VDI from a VM by unplugging and optionally destroying the VBD, leaving the VDI intact by default."
|
|
@@ -24004,7 +24030,7 @@ var XcpngDetachNetworkInterfaceResultSchema = z.object({
|
|
|
24004
24030
|
appliedCommands: z.array(z.string()),
|
|
24005
24031
|
error: z.string().optional()
|
|
24006
24032
|
});
|
|
24007
|
-
async function
|
|
24033
|
+
async function run196(context) {
|
|
24008
24034
|
const { params, error } = context;
|
|
24009
24035
|
const {
|
|
24010
24036
|
vif_uuid: vifUuidParam,
|
|
@@ -24098,7 +24124,7 @@ async function run200(context) {
|
|
|
24098
24124
|
appliedCommands
|
|
24099
24125
|
};
|
|
24100
24126
|
}
|
|
24101
|
-
var detach_network_interface_default = task(
|
|
24127
|
+
var detach_network_interface_default = task(run196, {
|
|
24102
24128
|
inputSchema: XcpngDetachNetworkInterfaceParamsSchema,
|
|
24103
24129
|
outputSchema: XcpngDetachNetworkInterfaceResultSchema,
|
|
24104
24130
|
description: "Unplugs (and optionally destroys) a virtual network interface from an XCP-ng VM."
|
|
@@ -24118,7 +24144,7 @@ var XcpngEnableHostResultSchema = z.object({
|
|
|
24118
24144
|
skipped: z.boolean().optional(),
|
|
24119
24145
|
error: z.string().optional()
|
|
24120
24146
|
});
|
|
24121
|
-
async function
|
|
24147
|
+
async function run197(context) {
|
|
24122
24148
|
const { params, error } = context;
|
|
24123
24149
|
const {
|
|
24124
24150
|
host_uuid: hostUuidParam,
|
|
@@ -24186,7 +24212,7 @@ async function run201(context) {
|
|
|
24186
24212
|
appliedCommands
|
|
24187
24213
|
};
|
|
24188
24214
|
}
|
|
24189
|
-
var enable_host_default = task(
|
|
24215
|
+
var enable_host_default = task(run197, {
|
|
24190
24216
|
inputSchema: XcpngEnableHostParamsSchema,
|
|
24191
24217
|
outputSchema: XcpngEnableHostResultSchema,
|
|
24192
24218
|
description: "Enables maintenance-disabled hosts so they rejoin scheduling."
|
|
@@ -24208,7 +24234,7 @@ var XcpngDisableHostResultSchema = z.object({
|
|
|
24208
24234
|
evacuated: z.boolean().optional(),
|
|
24209
24235
|
error: z.string().optional()
|
|
24210
24236
|
});
|
|
24211
|
-
async function
|
|
24237
|
+
async function run198(context) {
|
|
24212
24238
|
const { params, error } = context;
|
|
24213
24239
|
const {
|
|
24214
24240
|
host_uuid: hostUuidParam,
|
|
@@ -24293,7 +24319,7 @@ async function run202(context) {
|
|
|
24293
24319
|
evacuated: evacuate
|
|
24294
24320
|
};
|
|
24295
24321
|
}
|
|
24296
|
-
var disable_host_default = task(
|
|
24322
|
+
var disable_host_default = task(run198, {
|
|
24297
24323
|
inputSchema: XcpngDisableHostParamsSchema,
|
|
24298
24324
|
outputSchema: XcpngDisableHostResultSchema,
|
|
24299
24325
|
description: "Disables a host (optionally evacuating resident VMs first)."
|
|
@@ -24313,7 +24339,7 @@ var XcpngPlugPbdResultSchema = z.object({
|
|
|
24313
24339
|
skipped: z.boolean().optional(),
|
|
24314
24340
|
error: z.string().optional()
|
|
24315
24341
|
});
|
|
24316
|
-
async function
|
|
24342
|
+
async function run199(context) {
|
|
24317
24343
|
const { params, error } = context;
|
|
24318
24344
|
const { pbd_uuid: pbdUuidParam, sr_uuid: srUuid, host_uuid: hostUuid, allow_missing: rawAllowMissing } = params ?? {};
|
|
24319
24345
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -24377,7 +24403,7 @@ async function run203(context) {
|
|
|
24377
24403
|
appliedCommands
|
|
24378
24404
|
};
|
|
24379
24405
|
}
|
|
24380
|
-
var plug_pbd_default = task(
|
|
24406
|
+
var plug_pbd_default = task(run199, {
|
|
24381
24407
|
inputSchema: XcpngPlugPbdParamsSchema,
|
|
24382
24408
|
outputSchema: XcpngPlugPbdResultSchema,
|
|
24383
24409
|
description: "Plugs a PBD so the host reattaches the storage repository."
|
|
@@ -24397,7 +24423,7 @@ var XcpngUnplugPbdResultSchema = z.object({
|
|
|
24397
24423
|
skipped: z.boolean().optional(),
|
|
24398
24424
|
error: z.string().optional()
|
|
24399
24425
|
});
|
|
24400
|
-
async function
|
|
24426
|
+
async function run200(context) {
|
|
24401
24427
|
const { params, error } = context;
|
|
24402
24428
|
const { pbd_uuid: pbdUuidParam, sr_uuid: srUuid, host_uuid: hostUuid, allow_missing: rawAllowMissing } = params ?? {};
|
|
24403
24429
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -24461,7 +24487,7 @@ async function run204(context) {
|
|
|
24461
24487
|
appliedCommands
|
|
24462
24488
|
};
|
|
24463
24489
|
}
|
|
24464
|
-
var unplug_pbd_default = task(
|
|
24490
|
+
var unplug_pbd_default = task(run200, {
|
|
24465
24491
|
inputSchema: XcpngUnplugPbdParamsSchema,
|
|
24466
24492
|
outputSchema: XcpngUnplugPbdResultSchema,
|
|
24467
24493
|
description: "Unplugs a PBD so the host detaches the storage repository."
|
|
@@ -24476,7 +24502,7 @@ var XcpngListPoolsResultSchema = z.object({
|
|
|
24476
24502
|
items: z.any().optional(),
|
|
24477
24503
|
error: z.string().optional()
|
|
24478
24504
|
});
|
|
24479
|
-
async function
|
|
24505
|
+
async function run201(context) {
|
|
24480
24506
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
24481
24507
|
const result = await runXeCommand(context, "pool-list", filters);
|
|
24482
24508
|
if (!result.success) {
|
|
@@ -24490,7 +24516,7 @@ async function run205(context) {
|
|
|
24490
24516
|
items: parseKeyValueOutput(result.stdout)
|
|
24491
24517
|
};
|
|
24492
24518
|
}
|
|
24493
|
-
var list_pools_default = task(
|
|
24519
|
+
var list_pools_default = task(run201, {
|
|
24494
24520
|
inputSchema: XcpngListPoolsParamsSchema,
|
|
24495
24521
|
outputSchema: XcpngListPoolsResultSchema,
|
|
24496
24522
|
description: "Lists pools available to the current host."
|
|
@@ -24511,7 +24537,7 @@ var XcpngFindPoolResultSchema = z.object({
|
|
|
24511
24537
|
multiple: z.boolean().optional(),
|
|
24512
24538
|
error: z.string().optional()
|
|
24513
24539
|
});
|
|
24514
|
-
async function
|
|
24540
|
+
async function run202(context) {
|
|
24515
24541
|
const params = context.params ?? {};
|
|
24516
24542
|
const {
|
|
24517
24543
|
uuid,
|
|
@@ -24611,7 +24637,7 @@ async function runListPools(context, params) {
|
|
|
24611
24637
|
})
|
|
24612
24638
|
);
|
|
24613
24639
|
}
|
|
24614
|
-
var find_pool_default = task(
|
|
24640
|
+
var find_pool_default = task(run202, {
|
|
24615
24641
|
inputSchema: XcpngFindPoolParamsSchema,
|
|
24616
24642
|
outputSchema: XcpngFindPoolResultSchema,
|
|
24617
24643
|
description: "Finds a single pool by UUID or name-label, optionally allowing multiple matches."
|
|
@@ -24630,7 +24656,7 @@ var XcpngSetPoolParamResultSchema = z.object({
|
|
|
24630
24656
|
appliedCommands: z.array(z.string()),
|
|
24631
24657
|
error: z.string().optional()
|
|
24632
24658
|
});
|
|
24633
|
-
async function
|
|
24659
|
+
async function run203(context) {
|
|
24634
24660
|
const { params, error } = context;
|
|
24635
24661
|
const { pool_uuid: poolUuidParam, pool_name_label: poolNameLabel, key, value } = params ?? {};
|
|
24636
24662
|
if (!key) {
|
|
@@ -24691,7 +24717,7 @@ async function run207(context) {
|
|
|
24691
24717
|
appliedCommands
|
|
24692
24718
|
};
|
|
24693
24719
|
}
|
|
24694
|
-
var set_pool_param_default = task(
|
|
24720
|
+
var set_pool_param_default = task(run203, {
|
|
24695
24721
|
inputSchema: XcpngSetPoolParamParamsSchema,
|
|
24696
24722
|
outputSchema: XcpngSetPoolParamResultSchema,
|
|
24697
24723
|
description: "Updates a pool parameter (wraps xe pool-param-set)."
|
|
@@ -24711,7 +24737,7 @@ var XcpngRebootHostResultSchema = z.object({
|
|
|
24711
24737
|
skipped: z.boolean().optional(),
|
|
24712
24738
|
error: z.string().optional()
|
|
24713
24739
|
});
|
|
24714
|
-
async function
|
|
24740
|
+
async function run204(context) {
|
|
24715
24741
|
const { params, error } = context;
|
|
24716
24742
|
const {
|
|
24717
24743
|
host_uuid: hostUuidParam,
|
|
@@ -24777,7 +24803,7 @@ async function run208(context) {
|
|
|
24777
24803
|
command: commandResult.command
|
|
24778
24804
|
};
|
|
24779
24805
|
}
|
|
24780
|
-
var reboot_host_default = task(
|
|
24806
|
+
var reboot_host_default = task(run204, {
|
|
24781
24807
|
inputSchema: XcpngRebootHostParamsSchema,
|
|
24782
24808
|
outputSchema: XcpngRebootHostResultSchema,
|
|
24783
24809
|
description: "Reboots an XCP-ng host (optionally forcing)."
|
|
@@ -24797,7 +24823,7 @@ var XcpngShutdownHostResultSchema = z.object({
|
|
|
24797
24823
|
skipped: z.boolean().optional(),
|
|
24798
24824
|
error: z.string().optional()
|
|
24799
24825
|
});
|
|
24800
|
-
async function
|
|
24826
|
+
async function run205(context) {
|
|
24801
24827
|
const { params, error } = context;
|
|
24802
24828
|
const {
|
|
24803
24829
|
host_uuid: hostUuidParam,
|
|
@@ -24861,7 +24887,7 @@ async function run209(context) {
|
|
|
24861
24887
|
command: commandResult.command
|
|
24862
24888
|
};
|
|
24863
24889
|
}
|
|
24864
|
-
var shutdown_host_default = task(
|
|
24890
|
+
var shutdown_host_default = task(run205, {
|
|
24865
24891
|
inputSchema: XcpngShutdownHostParamsSchema,
|
|
24866
24892
|
outputSchema: XcpngShutdownHostResultSchema,
|
|
24867
24893
|
description: "Shuts down an XCP-ng host (optionally forcing)."
|
|
@@ -24880,7 +24906,7 @@ var XcpngEvacuateHostResultSchema = z.object({
|
|
|
24880
24906
|
skipped: z.boolean().optional(),
|
|
24881
24907
|
error: z.string().optional()
|
|
24882
24908
|
});
|
|
24883
|
-
async function
|
|
24909
|
+
async function run206(context) {
|
|
24884
24910
|
const { params, error } = context;
|
|
24885
24911
|
const { host_uuid: hostUuidParam, host_name_label: hostNameLabel, allow_missing: rawAllowMissing } = params ?? {};
|
|
24886
24912
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -24933,7 +24959,7 @@ async function run210(context) {
|
|
|
24933
24959
|
command: commandResult.command
|
|
24934
24960
|
};
|
|
24935
24961
|
}
|
|
24936
|
-
var evacuate_host_default = task(
|
|
24962
|
+
var evacuate_host_default = task(run206, {
|
|
24937
24963
|
inputSchema: XcpngEvacuateHostParamsSchema,
|
|
24938
24964
|
outputSchema: XcpngEvacuateHostResultSchema,
|
|
24939
24965
|
description: "Evacuates all VMs from a host."
|
|
@@ -24954,7 +24980,7 @@ var XcpngPlugPifResultSchema = z.object({
|
|
|
24954
24980
|
skipped: z.boolean().optional(),
|
|
24955
24981
|
error: z.string().optional()
|
|
24956
24982
|
});
|
|
24957
|
-
async function
|
|
24983
|
+
async function run207(context) {
|
|
24958
24984
|
const { params, error } = context;
|
|
24959
24985
|
const {
|
|
24960
24986
|
pif_uuid: pifUuidParam,
|
|
@@ -25051,7 +25077,7 @@ async function run211(context) {
|
|
|
25051
25077
|
appliedCommands
|
|
25052
25078
|
};
|
|
25053
25079
|
}
|
|
25054
|
-
var plug_pif_default = task(
|
|
25080
|
+
var plug_pif_default = task(run207, {
|
|
25055
25081
|
inputSchema: XcpngPlugPifParamsSchema,
|
|
25056
25082
|
outputSchema: XcpngPlugPifResultSchema,
|
|
25057
25083
|
description: "Plugs a physical interface (PIF) on the specified host."
|
|
@@ -25070,7 +25096,7 @@ var XcpngPifScanResultSchema = z.object({
|
|
|
25070
25096
|
skipped: z.boolean().optional(),
|
|
25071
25097
|
error: z.string().optional()
|
|
25072
25098
|
});
|
|
25073
|
-
async function
|
|
25099
|
+
async function run208(context) {
|
|
25074
25100
|
const { params, error } = context;
|
|
25075
25101
|
const { host_uuid: hostUuidParam, host_name_label: hostNameLabel, allow_missing: rawAllowMissing } = params ?? {};
|
|
25076
25102
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -25135,7 +25161,7 @@ async function run212(context) {
|
|
|
25135
25161
|
appliedCommands
|
|
25136
25162
|
};
|
|
25137
25163
|
}
|
|
25138
|
-
var pif_scan_default = task(
|
|
25164
|
+
var pif_scan_default = task(run208, {
|
|
25139
25165
|
inputSchema: XcpngPifScanParamsSchema,
|
|
25140
25166
|
outputSchema: XcpngPifScanResultSchema,
|
|
25141
25167
|
description: "Rescans physical interfaces (PIFs) on a host to discover changes."
|
|
@@ -25156,7 +25182,7 @@ var XcpngUnplugPifResultSchema = z.object({
|
|
|
25156
25182
|
skipped: z.boolean().optional(),
|
|
25157
25183
|
error: z.string().optional()
|
|
25158
25184
|
});
|
|
25159
|
-
async function
|
|
25185
|
+
async function run209(context) {
|
|
25160
25186
|
const { params, error } = context;
|
|
25161
25187
|
const {
|
|
25162
25188
|
pif_uuid: pifUuidParam,
|
|
@@ -25253,7 +25279,7 @@ async function run213(context) {
|
|
|
25253
25279
|
appliedCommands
|
|
25254
25280
|
};
|
|
25255
25281
|
}
|
|
25256
|
-
var unplug_pif_default = task(
|
|
25282
|
+
var unplug_pif_default = task(run209, {
|
|
25257
25283
|
inputSchema: XcpngUnplugPifParamsSchema,
|
|
25258
25284
|
outputSchema: XcpngUnplugPifResultSchema,
|
|
25259
25285
|
description: "Unplugs a physical interface (PIF) on the specified host."
|
|
@@ -25271,7 +25297,7 @@ var XcpngSetPifParamResultSchema = z.object({
|
|
|
25271
25297
|
command: z.string().optional(),
|
|
25272
25298
|
error: z.string().optional()
|
|
25273
25299
|
});
|
|
25274
|
-
async function
|
|
25300
|
+
async function run210(context) {
|
|
25275
25301
|
const { params, error } = context;
|
|
25276
25302
|
const { pif_uuid: pifUuid, key, value } = params ?? {};
|
|
25277
25303
|
if (!pifUuid) {
|
|
@@ -25309,7 +25335,7 @@ async function run214(context) {
|
|
|
25309
25335
|
command: commandResult.command
|
|
25310
25336
|
};
|
|
25311
25337
|
}
|
|
25312
|
-
var set_pif_param_default = task(
|
|
25338
|
+
var set_pif_param_default = task(run210, {
|
|
25313
25339
|
inputSchema: XcpngSetPifParamParamsSchema,
|
|
25314
25340
|
outputSchema: XcpngSetPifParamResultSchema,
|
|
25315
25341
|
description: "Updates a PIF parameter (wraps `xe pif-param-set`)."
|
|
@@ -25326,7 +25352,7 @@ var XcpngUnplugVbdResultSchema = z.object({
|
|
|
25326
25352
|
alreadyDetached: z.boolean().optional(),
|
|
25327
25353
|
error: z.string().optional()
|
|
25328
25354
|
});
|
|
25329
|
-
async function
|
|
25355
|
+
async function run211(context) {
|
|
25330
25356
|
const { params, error } = context;
|
|
25331
25357
|
const { vbd_uuid: vbdUuid, allow_missing: rawAllowMissing } = params;
|
|
25332
25358
|
if (!vbdUuid) {
|
|
@@ -25356,7 +25382,7 @@ async function run215(context) {
|
|
|
25356
25382
|
error: message
|
|
25357
25383
|
};
|
|
25358
25384
|
}
|
|
25359
|
-
var unplug_vbd_default = task(
|
|
25385
|
+
var unplug_vbd_default = task(run211, {
|
|
25360
25386
|
inputSchema: XcpngUnplugVbdParamsSchema,
|
|
25361
25387
|
outputSchema: XcpngUnplugVbdResultSchema,
|
|
25362
25388
|
description: "Unplugs a VBD from an XCP-ng VM, tolerating already-detached devices when allow_missing:true."
|
|
@@ -25376,7 +25402,7 @@ var XcpngSuspendVmResultSchema = z.object({
|
|
|
25376
25402
|
waitAttempts: z.number().optional(),
|
|
25377
25403
|
error: z.string().optional()
|
|
25378
25404
|
});
|
|
25379
|
-
async function
|
|
25405
|
+
async function run212(context) {
|
|
25380
25406
|
const { params, error } = context;
|
|
25381
25407
|
const { vm_uuid: vmUuid, allow_running: rawAllowRunning } = params;
|
|
25382
25408
|
if (!vmUuid) {
|
|
@@ -25437,7 +25463,7 @@ async function run216(context) {
|
|
|
25437
25463
|
waitAttempts: waitResult.attempts
|
|
25438
25464
|
};
|
|
25439
25465
|
}
|
|
25440
|
-
var suspend_vm_default = task(
|
|
25466
|
+
var suspend_vm_default = task(run212, {
|
|
25441
25467
|
inputSchema: XcpngSuspendVmParamsSchema,
|
|
25442
25468
|
outputSchema: XcpngSuspendVmResultSchema,
|
|
25443
25469
|
description: "Suspends an XCP-ng VM, waiting until the VM reports the suspended power state."
|
|
@@ -25458,7 +25484,7 @@ var XcpngResumeVmResultSchema = z.object({
|
|
|
25458
25484
|
waitAttempts: z.number().optional(),
|
|
25459
25485
|
error: z.string().optional()
|
|
25460
25486
|
});
|
|
25461
|
-
async function
|
|
25487
|
+
async function run213(context) {
|
|
25462
25488
|
const { params, error } = context;
|
|
25463
25489
|
const { vm_uuid: vmUuid, start_paused: rawStartPaused, host_uuid: hostUuid } = params;
|
|
25464
25490
|
if (!vmUuid) {
|
|
@@ -25523,7 +25549,7 @@ async function run217(context) {
|
|
|
25523
25549
|
waitAttempts: waitResult.attempts
|
|
25524
25550
|
};
|
|
25525
25551
|
}
|
|
25526
|
-
var resume_vm_default = task(
|
|
25552
|
+
var resume_vm_default = task(run213, {
|
|
25527
25553
|
inputSchema: XcpngResumeVmParamsSchema,
|
|
25528
25554
|
outputSchema: XcpngResumeVmResultSchema,
|
|
25529
25555
|
description: "Resumes a suspended XCP-ng VM, optionally starting it in a paused state or on a specific host."
|
|
@@ -25538,7 +25564,7 @@ var XcpngListVifParamsResultSchema = z.object({
|
|
|
25538
25564
|
items: z.any().optional(),
|
|
25539
25565
|
error: z.string().optional()
|
|
25540
25566
|
});
|
|
25541
|
-
async function
|
|
25567
|
+
async function run214(context) {
|
|
25542
25568
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
25543
25569
|
const result = await runXeCommand(context, "vif-param-list", filters);
|
|
25544
25570
|
if (!result.success) {
|
|
@@ -25552,7 +25578,7 @@ async function run218(context) {
|
|
|
25552
25578
|
items: parseKeyValueOutput(result.stdout)
|
|
25553
25579
|
};
|
|
25554
25580
|
}
|
|
25555
|
-
var list_vif_params_default = task(
|
|
25581
|
+
var list_vif_params_default = task(run214, {
|
|
25556
25582
|
inputSchema: XcpngListVifParamsParamsSchema,
|
|
25557
25583
|
outputSchema: XcpngListVifParamsResultSchema,
|
|
25558
25584
|
description: "Lists parameters for virtual interfaces (VIFs) on an XCP-ng host."
|
|
@@ -25567,7 +25593,7 @@ var XcpngListVifsResultSchema = z.object({
|
|
|
25567
25593
|
items: z.array(z.any()).optional(),
|
|
25568
25594
|
error: z.string().optional()
|
|
25569
25595
|
});
|
|
25570
|
-
async function
|
|
25596
|
+
async function run215(context) {
|
|
25571
25597
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
25572
25598
|
const result = await runXeCommand(context, "vif-list", filters);
|
|
25573
25599
|
if (!result.success) {
|
|
@@ -25615,7 +25641,7 @@ async function run219(context) {
|
|
|
25615
25641
|
items: enrichedItems
|
|
25616
25642
|
};
|
|
25617
25643
|
}
|
|
25618
|
-
var list_vifs_default = task(
|
|
25644
|
+
var list_vifs_default = task(run215, {
|
|
25619
25645
|
inputSchema: XcpngListVifsParamsSchema,
|
|
25620
25646
|
outputSchema: XcpngListVifsResultSchema,
|
|
25621
25647
|
description: "Lists VIFs (virtual interfaces) attached to VMs."
|
|
@@ -25630,7 +25656,7 @@ var XcpngListPifParamsResultSchema = z.object({
|
|
|
25630
25656
|
items: z.any().optional(),
|
|
25631
25657
|
error: z.string().optional()
|
|
25632
25658
|
});
|
|
25633
|
-
async function
|
|
25659
|
+
async function run216(context) {
|
|
25634
25660
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
25635
25661
|
const result = await runXeCommand(context, "pif-param-list", filters);
|
|
25636
25662
|
if (!result.success) {
|
|
@@ -25644,7 +25670,7 @@ async function run220(context) {
|
|
|
25644
25670
|
items: parseKeyValueOutput(result.stdout)
|
|
25645
25671
|
};
|
|
25646
25672
|
}
|
|
25647
|
-
var list_pif_params_default = task(
|
|
25673
|
+
var list_pif_params_default = task(run216, {
|
|
25648
25674
|
inputSchema: XcpngListPifParamsParamsSchema,
|
|
25649
25675
|
outputSchema: XcpngListPifParamsResultSchema,
|
|
25650
25676
|
description: "Lists parameters for PIFs on an XCP-ng host."
|
|
@@ -25659,7 +25685,7 @@ var XcpngListPifsResultSchema = z.object({
|
|
|
25659
25685
|
items: z.array(z.any()).optional(),
|
|
25660
25686
|
error: z.string().optional()
|
|
25661
25687
|
});
|
|
25662
|
-
async function
|
|
25688
|
+
async function run217(context) {
|
|
25663
25689
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
25664
25690
|
const result = await runXeCommand(context, "pif-list", filters);
|
|
25665
25691
|
if (!result.success) {
|
|
@@ -25707,7 +25733,7 @@ async function run221(context) {
|
|
|
25707
25733
|
items: enrichedItems
|
|
25708
25734
|
};
|
|
25709
25735
|
}
|
|
25710
|
-
var list_pifs_default = task(
|
|
25736
|
+
var list_pifs_default = task(run217, {
|
|
25711
25737
|
inputSchema: XcpngListPifsParamsSchema,
|
|
25712
25738
|
outputSchema: XcpngListPifsResultSchema,
|
|
25713
25739
|
description: "Lists PIFs (physical interfaces) available on the XCP-ng host."
|
|
@@ -25727,7 +25753,7 @@ var XcpngRebootVmResultSchema = z.object({
|
|
|
25727
25753
|
powerState: z.string().optional(),
|
|
25728
25754
|
waitAttempts: z.number().optional()
|
|
25729
25755
|
});
|
|
25730
|
-
async function
|
|
25756
|
+
async function run218(context) {
|
|
25731
25757
|
const { params, error } = context;
|
|
25732
25758
|
const { vm_uuid: vmUuidParam, vm_name_label: vmNameLabel, force: rawForce } = params ?? {};
|
|
25733
25759
|
const force = coerceBoolean(rawForce, false);
|
|
@@ -25788,7 +25814,7 @@ async function run222(context) {
|
|
|
25788
25814
|
waitAttempts: waitResult.attempts
|
|
25789
25815
|
};
|
|
25790
25816
|
}
|
|
25791
|
-
var reboot_vm_default = task(
|
|
25817
|
+
var reboot_vm_default = task(run218, {
|
|
25792
25818
|
inputSchema: XcpngRebootVmParamsSchema,
|
|
25793
25819
|
outputSchema: XcpngRebootVmResultSchema,
|
|
25794
25820
|
description: "Reboots an XCP-ng VM using `xe vm-reboot`."
|
|
@@ -25807,7 +25833,7 @@ var XcpngSetNetworkParamResultSchema = z.object({
|
|
|
25807
25833
|
appliedCommands: z.array(z.string()),
|
|
25808
25834
|
error: z.string().optional()
|
|
25809
25835
|
});
|
|
25810
|
-
async function
|
|
25836
|
+
async function run219(context) {
|
|
25811
25837
|
const { params, error } = context;
|
|
25812
25838
|
const { network_uuid: networkUuidParam, network_name_label: networkNameLabel, key, value } = params ?? {};
|
|
25813
25839
|
if (!key) {
|
|
@@ -25868,7 +25894,7 @@ async function run223(context) {
|
|
|
25868
25894
|
appliedCommands
|
|
25869
25895
|
};
|
|
25870
25896
|
}
|
|
25871
|
-
var set_network_param_default = task(
|
|
25897
|
+
var set_network_param_default = task(run219, {
|
|
25872
25898
|
inputSchema: XcpngSetNetworkParamParamsSchema,
|
|
25873
25899
|
outputSchema: XcpngSetNetworkParamResultSchema,
|
|
25874
25900
|
description: "Updates a network parameter (wraps xe network-param-set)."
|
|
@@ -25892,7 +25918,7 @@ var XcpngResizeVdiResultSchema = z.object({
|
|
|
25892
25918
|
newSizeBytes: z.number().optional(),
|
|
25893
25919
|
error: z.string().optional()
|
|
25894
25920
|
});
|
|
25895
|
-
async function
|
|
25921
|
+
async function run220(context) {
|
|
25896
25922
|
const { params, error } = context;
|
|
25897
25923
|
const {
|
|
25898
25924
|
vdi_uuid: vdiUuidParam,
|
|
@@ -25966,7 +25992,7 @@ async function run224(context) {
|
|
|
25966
25992
|
newSizeBytes: sizeBytes
|
|
25967
25993
|
};
|
|
25968
25994
|
}
|
|
25969
|
-
var resize_vdi_default = task(
|
|
25995
|
+
var resize_vdi_default = task(run220, {
|
|
25970
25996
|
inputSchema: XcpngResizeVdiParamsSchema,
|
|
25971
25997
|
outputSchema: XcpngResizeVdiResultSchema,
|
|
25972
25998
|
description: "Resizes an existing VDI on XCP-ng using `xe vdi-resize`/`vdi-resize-online`."
|
|
@@ -25998,7 +26024,7 @@ var XcpngSetVmResourcesResultSchema = z.object({
|
|
|
25998
26024
|
powerState: z.string().optional(),
|
|
25999
26025
|
waitAttempts: z.number().optional()
|
|
26000
26026
|
});
|
|
26001
|
-
async function
|
|
26027
|
+
async function run221(context) {
|
|
26002
26028
|
const { params, error } = context;
|
|
26003
26029
|
const {
|
|
26004
26030
|
vm_uuid: vmUuidParam,
|
|
@@ -26246,14 +26272,14 @@ async function run225(context) {
|
|
|
26246
26272
|
cpuUpdates.push({ field, value });
|
|
26247
26273
|
}
|
|
26248
26274
|
}
|
|
26249
|
-
for (const
|
|
26275
|
+
for (const update of cpuUpdates) {
|
|
26250
26276
|
const result = await runXeCommand(context, "vm-param-set", {
|
|
26251
26277
|
uuid: vmUuid,
|
|
26252
|
-
[
|
|
26278
|
+
[update.field]: update.value
|
|
26253
26279
|
});
|
|
26254
26280
|
appliedCommands.push(result.command);
|
|
26255
26281
|
if (!result.success) {
|
|
26256
|
-
const message = xeErrorMessage(result, `xe vm-param-set (${
|
|
26282
|
+
const message = xeErrorMessage(result, `xe vm-param-set (${update.field}) failed`);
|
|
26257
26283
|
error(message);
|
|
26258
26284
|
return {
|
|
26259
26285
|
success: false,
|
|
@@ -26301,7 +26327,7 @@ function ensurePositiveMib(value, fieldName) {
|
|
|
26301
26327
|
bytes: mibToBytes2(value)
|
|
26302
26328
|
};
|
|
26303
26329
|
}
|
|
26304
|
-
var set_vm_resources_default = task(
|
|
26330
|
+
var set_vm_resources_default = task(run221, {
|
|
26305
26331
|
inputSchema: XcpngSetVmResourcesParamsSchema,
|
|
26306
26332
|
outputSchema: XcpngSetVmResourcesResultSchema,
|
|
26307
26333
|
description: "Updates VM memory and vCPU settings on an XCP-ng host."
|
|
@@ -26326,7 +26352,7 @@ var XcpngResizeVmCpusResultSchema = z.object({
|
|
|
26326
26352
|
powerState: z.string().optional(),
|
|
26327
26353
|
waitAttempts: z.number().optional()
|
|
26328
26354
|
});
|
|
26329
|
-
async function
|
|
26355
|
+
async function run222(context) {
|
|
26330
26356
|
const { params, error } = context;
|
|
26331
26357
|
const {
|
|
26332
26358
|
vm_uuid: vmUuid,
|
|
@@ -26375,7 +26401,7 @@ async function run226(context) {
|
|
|
26375
26401
|
waitAttempts: result.waitAttempts
|
|
26376
26402
|
};
|
|
26377
26403
|
}
|
|
26378
|
-
var resize_vm_cpus_default = task(
|
|
26404
|
+
var resize_vm_cpus_default = task(run222, {
|
|
26379
26405
|
inputSchema: XcpngResizeVmCpusParamsSchema,
|
|
26380
26406
|
outputSchema: XcpngResizeVmCpusResultSchema,
|
|
26381
26407
|
description: "Resizes an XCP-ng VM\u2019s vCPU configuration."
|
|
@@ -26396,7 +26422,7 @@ var XcpngResizeVmMemoryResultSchema = z.object({
|
|
|
26396
26422
|
powerState: z.string().optional(),
|
|
26397
26423
|
waitAttempts: z.number().optional()
|
|
26398
26424
|
});
|
|
26399
|
-
async function
|
|
26425
|
+
async function run223(context) {
|
|
26400
26426
|
const { params, error } = context;
|
|
26401
26427
|
const { vm_uuid: vmUuid, vm_name_label: vmNameLabel, memory_mib: memoryMib } = params ?? {};
|
|
26402
26428
|
if (!memoryMib || !Number.isFinite(memoryMib) || memoryMib <= 0) {
|
|
@@ -26435,7 +26461,7 @@ async function run227(context) {
|
|
|
26435
26461
|
waitAttempts: result.waitAttempts
|
|
26436
26462
|
};
|
|
26437
26463
|
}
|
|
26438
|
-
var resize_vm_memory_default = task(
|
|
26464
|
+
var resize_vm_memory_default = task(run223, {
|
|
26439
26465
|
inputSchema: XcpngResizeVmMemoryParamsSchema,
|
|
26440
26466
|
outputSchema: XcpngResizeVmMemoryResultSchema,
|
|
26441
26467
|
description: "Resizes an XCP-ng VM\u2019s memory allocation (static/dynamic bounds)."
|
|
@@ -26454,7 +26480,7 @@ var XcpngRevertSnapshotResultSchema = z.object({
|
|
|
26454
26480
|
powerState: z.string().optional(),
|
|
26455
26481
|
waitAttempts: z.number().optional()
|
|
26456
26482
|
});
|
|
26457
|
-
async function
|
|
26483
|
+
async function run224(context) {
|
|
26458
26484
|
const { params, error } = context;
|
|
26459
26485
|
const { snapshot_uuid: snapshotUuid } = params ?? {};
|
|
26460
26486
|
if (!snapshotUuid) {
|
|
@@ -26543,7 +26569,7 @@ async function run228(context) {
|
|
|
26543
26569
|
waitAttempts
|
|
26544
26570
|
};
|
|
26545
26571
|
}
|
|
26546
|
-
var revert_snapshot_default = task(
|
|
26572
|
+
var revert_snapshot_default = task(run224, {
|
|
26547
26573
|
inputSchema: XcpngRevertSnapshotParamsSchema,
|
|
26548
26574
|
outputSchema: XcpngRevertSnapshotResultSchema,
|
|
26549
26575
|
description: "Reverts an XCP-ng VM to a specified snapshot."
|
|
@@ -26561,7 +26587,7 @@ var XcpngSetSnapshotParamResultSchema = z.object({
|
|
|
26561
26587
|
command: z.string().optional(),
|
|
26562
26588
|
error: z.string().optional()
|
|
26563
26589
|
});
|
|
26564
|
-
async function
|
|
26590
|
+
async function run225(context) {
|
|
26565
26591
|
const { params, error } = context;
|
|
26566
26592
|
const { snapshot_uuid: snapshotUuid, key, value } = params ?? {};
|
|
26567
26593
|
if (!snapshotUuid) {
|
|
@@ -26599,7 +26625,7 @@ async function run229(context) {
|
|
|
26599
26625
|
command: commandResult.command
|
|
26600
26626
|
};
|
|
26601
26627
|
}
|
|
26602
|
-
var set_snapshot_param_default = task(
|
|
26628
|
+
var set_snapshot_param_default = task(run225, {
|
|
26603
26629
|
inputSchema: XcpngSetSnapshotParamParamsSchema,
|
|
26604
26630
|
outputSchema: XcpngSetSnapshotParamResultSchema,
|
|
26605
26631
|
description: "Updates a snapshot parameter (wraps xe snapshot-param-set)."
|
|
@@ -26618,7 +26644,7 @@ var XcpngSetSrParamResultSchema = z.object({
|
|
|
26618
26644
|
appliedCommands: z.array(z.string()),
|
|
26619
26645
|
error: z.string().optional()
|
|
26620
26646
|
});
|
|
26621
|
-
async function
|
|
26647
|
+
async function run226(context) {
|
|
26622
26648
|
const { params, error } = context;
|
|
26623
26649
|
const { sr_uuid: srUuidParam, sr_name_label: srNameLabel, key, value } = params ?? {};
|
|
26624
26650
|
if (!key) {
|
|
@@ -26679,7 +26705,7 @@ async function run230(context) {
|
|
|
26679
26705
|
appliedCommands
|
|
26680
26706
|
};
|
|
26681
26707
|
}
|
|
26682
|
-
var set_sr_param_default = task(
|
|
26708
|
+
var set_sr_param_default = task(run226, {
|
|
26683
26709
|
inputSchema: XcpngSetSrParamParamsSchema,
|
|
26684
26710
|
outputSchema: XcpngSetSrParamResultSchema,
|
|
26685
26711
|
description: "Updates a storage repository parameter (wraps xe sr-param-set)."
|
|
@@ -26700,7 +26726,7 @@ var XcpngStartVmResultSchema = z.object({
|
|
|
26700
26726
|
finalPowerState: z.string().optional(),
|
|
26701
26727
|
waitAttempts: z.number().optional()
|
|
26702
26728
|
});
|
|
26703
|
-
async function
|
|
26729
|
+
async function run227(context) {
|
|
26704
26730
|
const { params, error } = context;
|
|
26705
26731
|
const { vm_uuid, start_paused: rawStartPaused, force: rawForce } = params;
|
|
26706
26732
|
const startPaused = coerceBoolean(rawStartPaused, false);
|
|
@@ -26767,7 +26793,7 @@ async function run231(context) {
|
|
|
26767
26793
|
waitAttempts: waitResult.attempts
|
|
26768
26794
|
};
|
|
26769
26795
|
}
|
|
26770
|
-
var start_vm_default = task(
|
|
26796
|
+
var start_vm_default = task(run227, {
|
|
26771
26797
|
inputSchema: XcpngStartVmParamsSchema,
|
|
26772
26798
|
outputSchema: XcpngStartVmResultSchema,
|
|
26773
26799
|
description: "Starts an XCP-ng virtual machine with optional paused or forced modes."
|
|
@@ -26788,7 +26814,7 @@ var XcpngStopVmResultSchema = z.object({
|
|
|
26788
26814
|
finalPowerState: z.string().optional(),
|
|
26789
26815
|
waitAttempts: z.number().optional()
|
|
26790
26816
|
});
|
|
26791
|
-
async function
|
|
26817
|
+
async function run228(context) {
|
|
26792
26818
|
const { params, error } = context;
|
|
26793
26819
|
const { vm_uuid, force: rawForce, timeout_seconds: rawTimeout } = params;
|
|
26794
26820
|
const force = coerceBoolean(rawForce, false);
|
|
@@ -26863,7 +26889,7 @@ async function run232(context) {
|
|
|
26863
26889
|
waitAttempts: waitResult.attempts
|
|
26864
26890
|
};
|
|
26865
26891
|
}
|
|
26866
|
-
var stop_vm_default = task(
|
|
26892
|
+
var stop_vm_default = task(run228, {
|
|
26867
26893
|
inputSchema: XcpngStopVmParamsSchema,
|
|
26868
26894
|
outputSchema: XcpngStopVmResultSchema,
|
|
26869
26895
|
description: "Stops an XCP-ng virtual machine gracefully or forcefully."
|
|
@@ -26892,7 +26918,7 @@ var XcpngImportIsoResultSchema = z.object({
|
|
|
26892
26918
|
commands: z.array(z.string()),
|
|
26893
26919
|
error: z.string().optional()
|
|
26894
26920
|
});
|
|
26895
|
-
async function
|
|
26921
|
+
async function run229(context) {
|
|
26896
26922
|
if (!context.host) {
|
|
26897
26923
|
return {
|
|
26898
26924
|
success: false,
|
|
@@ -27098,7 +27124,7 @@ async function findIsoVdi2(context, srUuid, isoFileName) {
|
|
|
27098
27124
|
}
|
|
27099
27125
|
return { vdi };
|
|
27100
27126
|
}
|
|
27101
|
-
var import_iso_default = task(
|
|
27127
|
+
var import_iso_default = task(run229, {
|
|
27102
27128
|
inputSchema: XcpngImportIsoParamsSchema,
|
|
27103
27129
|
outputSchema: XcpngImportIsoResultSchema,
|
|
27104
27130
|
description: "Ensures an ISO file is represented as a VDI in an ISO SR by rescanning and importing when necessary."
|
|
@@ -27127,7 +27153,7 @@ var XcpngUploadIsoHostResultSchema = z.object({
|
|
|
27127
27153
|
remotePath: z.string().optional(),
|
|
27128
27154
|
error: z.string().optional()
|
|
27129
27155
|
});
|
|
27130
|
-
async function
|
|
27156
|
+
async function run230(context) {
|
|
27131
27157
|
if (context.host) {
|
|
27132
27158
|
return {
|
|
27133
27159
|
success: false,
|
|
@@ -27182,10 +27208,10 @@ async function run234(context) {
|
|
|
27182
27208
|
const uploads = await context.ssh(
|
|
27183
27209
|
[],
|
|
27184
27210
|
async (remoteContext) => {
|
|
27185
|
-
const { run:
|
|
27211
|
+
const { run: run249 } = remoteContext;
|
|
27186
27212
|
const remotePath = pathPosix3.join(resolvedLocation, remoteFileName);
|
|
27187
27213
|
try {
|
|
27188
|
-
const srResult = await
|
|
27214
|
+
const srResult = await run249(
|
|
27189
27215
|
find_or_create_iso_sr_default({
|
|
27190
27216
|
name_label: isoSrName,
|
|
27191
27217
|
location: resolvedLocation,
|
|
@@ -27202,7 +27228,7 @@ async function run234(context) {
|
|
|
27202
27228
|
error: srResult.error ?? "Failed to ensure ISO SR exists."
|
|
27203
27229
|
};
|
|
27204
27230
|
}
|
|
27205
|
-
const fileExistsResult = await
|
|
27231
|
+
const fileExistsResult = await run249(exists_default2({ path: remotePath }));
|
|
27206
27232
|
if (fileExistsResult.exists) {
|
|
27207
27233
|
return {
|
|
27208
27234
|
success: true,
|
|
@@ -27269,7 +27295,7 @@ function resolveChunkSizeBytes(chunkSizeMb) {
|
|
|
27269
27295
|
const bounded = Math.min(Math.max(safeSize, MIN_CHUNK_SIZE_MB), MAX_CHUNK_SIZE_MB);
|
|
27270
27296
|
return bounded * 1024 * 1024;
|
|
27271
27297
|
}
|
|
27272
|
-
var upload_iso_default = task(
|
|
27298
|
+
var upload_iso_default = task(run230, {
|
|
27273
27299
|
inputSchema: XcpngUploadIsoParamsSchema,
|
|
27274
27300
|
outputSchema: XcpngUploadIsoHostResultSchema,
|
|
27275
27301
|
description: "Uploads a local ISO to the remote XCP-ng hypervisor, ensuring the target ISO SR exists beforehand."
|
|
@@ -27306,7 +27332,7 @@ function parseMapValue(raw) {
|
|
|
27306
27332
|
return acc;
|
|
27307
27333
|
}, {});
|
|
27308
27334
|
}
|
|
27309
|
-
async function
|
|
27335
|
+
async function run231(context) {
|
|
27310
27336
|
const { params, error } = context;
|
|
27311
27337
|
const {
|
|
27312
27338
|
vm_uuid: vmUuidParam,
|
|
@@ -27444,7 +27470,7 @@ async function run235(context) {
|
|
|
27444
27470
|
}
|
|
27445
27471
|
return result;
|
|
27446
27472
|
}
|
|
27447
|
-
var get_vm_info_default = task(
|
|
27473
|
+
var get_vm_info_default = task(run231, {
|
|
27448
27474
|
inputSchema: XcpngGetVmInfoParamsSchema,
|
|
27449
27475
|
outputSchema: XcpngGetVmInfoResultSchema,
|
|
27450
27476
|
description: "Returns structured VM details (platform, boot configuration, memory/CPU sizing, and optional VBD/VIF inventory)."
|
|
@@ -27468,7 +27494,7 @@ var XcpngExportVdiResultSchema = z.object({
|
|
|
27468
27494
|
skipped: z.boolean().optional(),
|
|
27469
27495
|
error: z.string().optional()
|
|
27470
27496
|
});
|
|
27471
|
-
async function
|
|
27497
|
+
async function run232(context) {
|
|
27472
27498
|
const { params, error } = context;
|
|
27473
27499
|
const {
|
|
27474
27500
|
vdi_uuid: vdiUuidParam,
|
|
@@ -27548,7 +27574,7 @@ async function run236(context) {
|
|
|
27548
27574
|
appliedCommands
|
|
27549
27575
|
};
|
|
27550
27576
|
}
|
|
27551
|
-
var export_vdi_default = task(
|
|
27577
|
+
var export_vdi_default = task(run232, {
|
|
27552
27578
|
inputSchema: XcpngExportVdiParamsSchema,
|
|
27553
27579
|
outputSchema: XcpngExportVdiResultSchema,
|
|
27554
27580
|
description: "Exports a VDI to the hypervisor filesystem via xe vdi-export."
|
|
@@ -27602,7 +27628,7 @@ var XcpngProvisionVmFromIsoResultSchema = z.object({
|
|
|
27602
27628
|
steps: z.array(z.any()),
|
|
27603
27629
|
error: z.string().optional()
|
|
27604
27630
|
});
|
|
27605
|
-
async function
|
|
27631
|
+
async function run233(context) {
|
|
27606
27632
|
if (!context.host) {
|
|
27607
27633
|
return {
|
|
27608
27634
|
success: false,
|
|
@@ -27929,7 +27955,7 @@ async function run237(context) {
|
|
|
27929
27955
|
steps
|
|
27930
27956
|
};
|
|
27931
27957
|
}
|
|
27932
|
-
var provision_vm_from_iso_default = task(
|
|
27958
|
+
var provision_vm_from_iso_default = task(run233, {
|
|
27933
27959
|
inputSchema: XcpngProvisionVmFromIsoParamsSchema,
|
|
27934
27960
|
outputSchema: XcpngProvisionVmFromIsoResultSchema,
|
|
27935
27961
|
description: "Creates a VM from a template, attaches storage, network, and ISO media, and optionally boots it for installation."
|
|
@@ -28959,7 +28985,7 @@ function resolveMemoryMib(input) {
|
|
|
28959
28985
|
}
|
|
28960
28986
|
return { value: Math.floor(value) };
|
|
28961
28987
|
}
|
|
28962
|
-
async function
|
|
28988
|
+
async function run234(context) {
|
|
28963
28989
|
if (!context.host) {
|
|
28964
28990
|
return runLocal(context);
|
|
28965
28991
|
}
|
|
@@ -29172,7 +29198,7 @@ function buildLocalFailure(step, message) {
|
|
|
29172
29198
|
error: message
|
|
29173
29199
|
};
|
|
29174
29200
|
}
|
|
29175
|
-
var provision_vm_default = task(
|
|
29201
|
+
var provision_vm_default = task(run234, {
|
|
29176
29202
|
inputSchema: XcpngProvisionVmParamsSchema,
|
|
29177
29203
|
outputSchema: XcpngProvisionVmResultSchema,
|
|
29178
29204
|
description: "Provisions a VM from an XCP-ng template by cloning its root disk, configuring cloud-init metadata, and attaching network resources."
|
|
@@ -29238,7 +29264,7 @@ var XcpngSnapshotVmResultSchema = z.object({
|
|
|
29238
29264
|
command: z.string().optional(),
|
|
29239
29265
|
error: z.string().optional()
|
|
29240
29266
|
});
|
|
29241
|
-
async function
|
|
29267
|
+
async function run235(context) {
|
|
29242
29268
|
const { params, error } = context;
|
|
29243
29269
|
const {
|
|
29244
29270
|
vm_uuid: vmUuidParam,
|
|
@@ -29308,7 +29334,7 @@ async function run239(context) {
|
|
|
29308
29334
|
command: snapshotResult.command
|
|
29309
29335
|
};
|
|
29310
29336
|
}
|
|
29311
|
-
var snapshot_vm_default = task(
|
|
29337
|
+
var snapshot_vm_default = task(run235, {
|
|
29312
29338
|
inputSchema: XcpngSnapshotVmParamsSchema,
|
|
29313
29339
|
outputSchema: XcpngSnapshotVmResultSchema,
|
|
29314
29340
|
description: "Creates a snapshot of an XCP-ng VM (optionally with quiesce)."
|
|
@@ -29335,7 +29361,7 @@ var XcpngImportVdiResultSchema = z.object({
|
|
|
29335
29361
|
appliedCommands: z.array(z.string()),
|
|
29336
29362
|
error: z.string().optional()
|
|
29337
29363
|
});
|
|
29338
|
-
async function
|
|
29364
|
+
async function run236(context) {
|
|
29339
29365
|
const { params, error } = context;
|
|
29340
29366
|
const {
|
|
29341
29367
|
sr_uuid: srUuidParam,
|
|
@@ -29457,7 +29483,7 @@ async function run240(context) {
|
|
|
29457
29483
|
appliedCommands
|
|
29458
29484
|
};
|
|
29459
29485
|
}
|
|
29460
|
-
var import_vdi_default = task(
|
|
29486
|
+
var import_vdi_default = task(run236, {
|
|
29461
29487
|
inputSchema: XcpngImportVdiParamsSchema,
|
|
29462
29488
|
outputSchema: XcpngImportVdiResultSchema,
|
|
29463
29489
|
description: "Imports a VDI file into a storage repository via xe vdi-import."
|
|
@@ -29559,7 +29585,7 @@ var XcpngVmMigrateResultSchema = z.object({
|
|
|
29559
29585
|
skipped: z.boolean().optional(),
|
|
29560
29586
|
error: z.string().optional()
|
|
29561
29587
|
});
|
|
29562
|
-
async function
|
|
29588
|
+
async function run237(context) {
|
|
29563
29589
|
const { params, error } = context;
|
|
29564
29590
|
const {
|
|
29565
29591
|
vm_uuid: vmUuidParam,
|
|
@@ -29683,7 +29709,7 @@ async function run241(context) {
|
|
|
29683
29709
|
appliedCommands
|
|
29684
29710
|
};
|
|
29685
29711
|
}
|
|
29686
|
-
var vm_migrate_default = task(
|
|
29712
|
+
var vm_migrate_default = task(run237, {
|
|
29687
29713
|
inputSchema: XcpngVmMigrateParamsSchema,
|
|
29688
29714
|
outputSchema: XcpngVmMigrateResultSchema,
|
|
29689
29715
|
description: "Migrates a VM to another host (and optionally storage repository) via xe vm-migrate."
|
|
@@ -29708,7 +29734,7 @@ var XcpngVmExportResultSchema = z.object({
|
|
|
29708
29734
|
skipped: z.boolean().optional(),
|
|
29709
29735
|
error: z.string().optional()
|
|
29710
29736
|
});
|
|
29711
|
-
async function
|
|
29737
|
+
async function run238(context) {
|
|
29712
29738
|
const { params, error } = context;
|
|
29713
29739
|
const {
|
|
29714
29740
|
vm_uuid: vmUuidParam,
|
|
@@ -29797,7 +29823,7 @@ async function run242(context) {
|
|
|
29797
29823
|
appliedCommands
|
|
29798
29824
|
};
|
|
29799
29825
|
}
|
|
29800
|
-
var vm_export_default = task(
|
|
29826
|
+
var vm_export_default = task(run238, {
|
|
29801
29827
|
inputSchema: XcpngVmExportParamsSchema,
|
|
29802
29828
|
outputSchema: XcpngVmExportResultSchema,
|
|
29803
29829
|
description: "Exports a VM to an XVA file via xe vm-export."
|
|
@@ -29819,7 +29845,7 @@ var XcpngVmImportResultSchema = z.object({
|
|
|
29819
29845
|
appliedCommands: z.array(z.string()),
|
|
29820
29846
|
error: z.string().optional()
|
|
29821
29847
|
});
|
|
29822
|
-
async function
|
|
29848
|
+
async function run239(context) {
|
|
29823
29849
|
const { params, error } = context;
|
|
29824
29850
|
const {
|
|
29825
29851
|
filename,
|
|
@@ -29888,7 +29914,7 @@ async function run243(context) {
|
|
|
29888
29914
|
appliedCommands
|
|
29889
29915
|
};
|
|
29890
29916
|
}
|
|
29891
|
-
var vm_import_default = task(
|
|
29917
|
+
var vm_import_default = task(run239, {
|
|
29892
29918
|
inputSchema: XcpngVmImportParamsSchema,
|
|
29893
29919
|
outputSchema: XcpngVmImportResultSchema,
|
|
29894
29920
|
description: "Imports a VM image from an XVA file via xe vm-import."
|
|
@@ -29915,7 +29941,7 @@ var XcpngVmCopyResultSchema = z.object({
|
|
|
29915
29941
|
skipped: z.boolean().optional(),
|
|
29916
29942
|
error: z.string().optional()
|
|
29917
29943
|
});
|
|
29918
|
-
async function
|
|
29944
|
+
async function run240(context) {
|
|
29919
29945
|
const { params, error } = context;
|
|
29920
29946
|
const {
|
|
29921
29947
|
vm_uuid: vmUuidParam,
|
|
@@ -30042,7 +30068,7 @@ async function run244(context) {
|
|
|
30042
30068
|
appliedCommands
|
|
30043
30069
|
};
|
|
30044
30070
|
}
|
|
30045
|
-
var vm_copy_default = task(
|
|
30071
|
+
var vm_copy_default = task(run240, {
|
|
30046
30072
|
inputSchema: XcpngVmCopyParamsSchema,
|
|
30047
30073
|
outputSchema: XcpngVmCopyResultSchema,
|
|
30048
30074
|
description: "Creates a full copy of a VM, optionally targeting a different SR."
|
|
@@ -30062,7 +30088,7 @@ var XcpngDetachCdMediaResultSchema = z.object({
|
|
|
30062
30088
|
error: z.string().optional(),
|
|
30063
30089
|
skipped: z.boolean().optional()
|
|
30064
30090
|
});
|
|
30065
|
-
async function
|
|
30091
|
+
async function run241(context) {
|
|
30066
30092
|
if (!context.host) {
|
|
30067
30093
|
return {
|
|
30068
30094
|
success: false,
|
|
@@ -30199,7 +30225,7 @@ function filterCdDisks(disks) {
|
|
|
30199
30225
|
}
|
|
30200
30226
|
return results;
|
|
30201
30227
|
}
|
|
30202
|
-
var detach_cd_media_default = task(
|
|
30228
|
+
var detach_cd_media_default = task(run241, {
|
|
30203
30229
|
inputSchema: XcpngDetachCdMediaParamsSchema,
|
|
30204
30230
|
outputSchema: XcpngDetachCdMediaResultSchema,
|
|
30205
30231
|
description: "Detaches CD/DVD virtual media from a VM by unplugging and destroying associated VBDs."
|
|
@@ -30222,7 +30248,7 @@ var XcpngCleanupConfigDriveResultSchema = z.object({
|
|
|
30222
30248
|
error: z.string().optional(),
|
|
30223
30249
|
skipped: z.boolean().optional()
|
|
30224
30250
|
});
|
|
30225
|
-
async function
|
|
30251
|
+
async function run242(context) {
|
|
30226
30252
|
if (!context.host) {
|
|
30227
30253
|
return {
|
|
30228
30254
|
success: false,
|
|
@@ -30422,7 +30448,7 @@ async function run246(context) {
|
|
|
30422
30448
|
steps
|
|
30423
30449
|
};
|
|
30424
30450
|
}
|
|
30425
|
-
var cleanup_config_drive_default = task(
|
|
30451
|
+
var cleanup_config_drive_default = task(run242, {
|
|
30426
30452
|
inputSchema: XcpngCleanupConfigDriveParamsSchema,
|
|
30427
30453
|
outputSchema: XcpngCleanupConfigDriveResultSchema,
|
|
30428
30454
|
description: "Detaches an attached config-drive ISO from a VM and removes the associated VDI once the guest is halted."
|
|
@@ -30561,7 +30587,7 @@ var YumAddRepositoryResultSchema = z.object({
|
|
|
30561
30587
|
error: z.string().optional()
|
|
30562
30588
|
})
|
|
30563
30589
|
);
|
|
30564
|
-
async function
|
|
30590
|
+
async function run243(context) {
|
|
30565
30591
|
const { params, exec, info, error } = context;
|
|
30566
30592
|
const { content, name, sudo = true } = params;
|
|
30567
30593
|
if (!content) {
|
|
@@ -30593,7 +30619,7 @@ EOF`;
|
|
|
30593
30619
|
return { success: false, error: errorMsg };
|
|
30594
30620
|
}
|
|
30595
30621
|
}
|
|
30596
|
-
var add_repository_default2 = task(
|
|
30622
|
+
var add_repository_default2 = task(run243, {
|
|
30597
30623
|
description: "Adds a YUM repository.",
|
|
30598
30624
|
inputSchema: YumAddRepositoryParamsSchema,
|
|
30599
30625
|
outputSchema: YumAddRepositoryResultSchema
|
|
@@ -30619,7 +30645,7 @@ var DownloadOutputSchema = z.object({
|
|
|
30619
30645
|
path: z.string().optional(),
|
|
30620
30646
|
error: z.string().optional()
|
|
30621
30647
|
});
|
|
30622
|
-
async function
|
|
30648
|
+
async function run244(context) {
|
|
30623
30649
|
const { params, info, error, exec } = context;
|
|
30624
30650
|
const { url, dest, mode, sudo = false } = params;
|
|
30625
30651
|
if (!url || !dest) {
|
|
@@ -30664,7 +30690,7 @@ async function run248(context) {
|
|
|
30664
30690
|
return { success: false, error: errorMsg };
|
|
30665
30691
|
}
|
|
30666
30692
|
}
|
|
30667
|
-
var download_default = task(
|
|
30693
|
+
var download_default = task(run244, {
|
|
30668
30694
|
description: "Downloads a file from a URL using curl or wget.",
|
|
30669
30695
|
inputSchema: DownloadInputSchema,
|
|
30670
30696
|
outputSchema: DownloadOutputSchema
|
|
@@ -30695,7 +30721,7 @@ var InterfacesOutputSchema = z.object({
|
|
|
30695
30721
|
error: z.string()
|
|
30696
30722
|
})
|
|
30697
30723
|
);
|
|
30698
|
-
async function
|
|
30724
|
+
async function run245(context) {
|
|
30699
30725
|
const { params, info, error, exec } = context;
|
|
30700
30726
|
const { sudo = false } = params;
|
|
30701
30727
|
try {
|
|
@@ -30787,7 +30813,7 @@ async function run249(context) {
|
|
|
30787
30813
|
return { success: false, error: errorMsg };
|
|
30788
30814
|
}
|
|
30789
30815
|
}
|
|
30790
|
-
var interfaces_default = task(
|
|
30816
|
+
var interfaces_default = task(run245, {
|
|
30791
30817
|
name: "interfaces",
|
|
30792
30818
|
description: "Lists network interfaces with their properties.",
|
|
30793
30819
|
inputSchema: InterfacesInputSchema,
|
|
@@ -30813,7 +30839,7 @@ var NftablesApplyOutputSchema = z.object({
|
|
|
30813
30839
|
error: z.string().optional()
|
|
30814
30840
|
})
|
|
30815
30841
|
);
|
|
30816
|
-
async function
|
|
30842
|
+
async function run246(context) {
|
|
30817
30843
|
const { params, exec, info } = context;
|
|
30818
30844
|
const { config } = params;
|
|
30819
30845
|
if (!config) {
|
|
@@ -30837,7 +30863,7 @@ async function run250(context) {
|
|
|
30837
30863
|
return { success: false, error };
|
|
30838
30864
|
}
|
|
30839
30865
|
}
|
|
30840
|
-
var apply_default = task(
|
|
30866
|
+
var apply_default = task(run246, {
|
|
30841
30867
|
description: "Applies an nftables configuration.",
|
|
30842
30868
|
inputSchema: NftablesApplyInputSchema,
|
|
30843
30869
|
outputSchema: NftablesApplyOutputSchema
|
|
@@ -30860,7 +30886,7 @@ var FirewalldDisableResultSchema = z.object({
|
|
|
30860
30886
|
success: z.boolean(),
|
|
30861
30887
|
error: z.string().optional()
|
|
30862
30888
|
});
|
|
30863
|
-
async function
|
|
30889
|
+
async function run247(context) {
|
|
30864
30890
|
const { run: runTask, debug, error, info } = context;
|
|
30865
30891
|
const statusResult = await runTask(status_default({ service: "firewalld", sudo: true }));
|
|
30866
30892
|
if (!statusResult.success && (statusResult.error?.includes("Could not find") || statusResult.error?.includes("not-found"))) {
|
|
@@ -30884,7 +30910,7 @@ async function run251(context) {
|
|
|
30884
30910
|
info("firewalld service disabled successfully.");
|
|
30885
30911
|
return { success: true };
|
|
30886
30912
|
}
|
|
30887
|
-
var disable_default3 = task(
|
|
30913
|
+
var disable_default3 = task(run247, {
|
|
30888
30914
|
description: "Disables and stops the firewalld service.",
|
|
30889
30915
|
inputSchema: FirewalldDisableInputSchema,
|
|
30890
30916
|
outputSchema: FirewalldDisableResultSchema
|
|
@@ -32179,6 +32205,7 @@ import Handlebars3 from "handlebars";
|
|
|
32179
32205
|
// src/remote-runtime.ts
|
|
32180
32206
|
import Handlebars2 from "handlebars";
|
|
32181
32207
|
import "path";
|
|
32208
|
+
import * as fs10 from "fs";
|
|
32182
32209
|
|
|
32183
32210
|
// src/ssh-session.ts
|
|
32184
32211
|
import { signalsByName } from "human-signals";
|
|
@@ -32326,6 +32353,15 @@ import "chalk";
|
|
|
32326
32353
|
import "util";
|
|
32327
32354
|
import "typescript-string-operations";
|
|
32328
32355
|
import { match as match4, P as P3 } from "ts-pattern";
|
|
32356
|
+
function normalizePrivateKey(value) {
|
|
32357
|
+
if (!value.includes("\n") && value.includes("\\n")) {
|
|
32358
|
+
return value.replace(/\\n/g, "\n");
|
|
32359
|
+
}
|
|
32360
|
+
return value;
|
|
32361
|
+
}
|
|
32362
|
+
function looksLikePrivateKey(value) {
|
|
32363
|
+
return /-----BEGIN [A-Z0-9 ]+PRIVATE KEY-----/.test(value);
|
|
32364
|
+
}
|
|
32329
32365
|
function normalizeWriteMode(mode) {
|
|
32330
32366
|
if (mode === void 0) {
|
|
32331
32367
|
return void 0;
|
|
@@ -32565,9 +32601,28 @@ var RemoteRuntime = class {
|
|
|
32565
32601
|
// Assuming defaultSshUser on App
|
|
32566
32602
|
port: this.host.port,
|
|
32567
32603
|
// node-ssh parses port from host string if present
|
|
32568
|
-
privateKey: await this.host.plaintextSshKeyPath(),
|
|
32569
32604
|
password: await this.host.decryptedPassword()
|
|
32570
32605
|
};
|
|
32606
|
+
const sshKeyPassphrase = await this.host.decryptedSshKeyPassphrase();
|
|
32607
|
+
if (sshKeyPassphrase) {
|
|
32608
|
+
sshConnectOpts.passphrase = sshKeyPassphrase;
|
|
32609
|
+
}
|
|
32610
|
+
const decryptedKey = await this.host.decryptedSshKey();
|
|
32611
|
+
if (decryptedKey) {
|
|
32612
|
+
const normalizedKey = normalizePrivateKey(decryptedKey).trim();
|
|
32613
|
+
if (looksLikePrivateKey(normalizedKey)) {
|
|
32614
|
+
sshConnectOpts.privateKey = normalizedKey;
|
|
32615
|
+
} else if (fs10.existsSync(normalizedKey)) {
|
|
32616
|
+
sshConnectOpts.privateKeyPath = normalizedKey;
|
|
32617
|
+
} else {
|
|
32618
|
+
sshConnectOpts.privateKey = normalizedKey;
|
|
32619
|
+
}
|
|
32620
|
+
} else {
|
|
32621
|
+
const keyPath = await this.host.plaintextSshKeyPath();
|
|
32622
|
+
if (keyPath) {
|
|
32623
|
+
sshConnectOpts.privateKeyPath = keyPath;
|
|
32624
|
+
}
|
|
32625
|
+
}
|
|
32571
32626
|
try {
|
|
32572
32627
|
if (!this.sshSession.isConnected()) {
|
|
32573
32628
|
await this.sshSession.connect(sshConnectOpts);
|
|
@@ -32658,7 +32713,7 @@ var RemoteRuntime = class {
|
|
|
32658
32713
|
};
|
|
32659
32714
|
|
|
32660
32715
|
// src/local-runtime.ts
|
|
32661
|
-
import * as
|
|
32716
|
+
import * as fs11 from "fs";
|
|
32662
32717
|
import chalk4 from "chalk";
|
|
32663
32718
|
function normalizeMode(mode) {
|
|
32664
32719
|
if (mode === void 0) {
|
|
@@ -32681,7 +32736,7 @@ var LocalInvocation = class _LocalInvocation extends Invocation {
|
|
|
32681
32736
|
)(params);
|
|
32682
32737
|
this.config = this.runtime.app.config;
|
|
32683
32738
|
this.file = {
|
|
32684
|
-
read: async (path14) =>
|
|
32739
|
+
read: async (path14) => fs11.promises.readFile(path14, "utf-8"),
|
|
32685
32740
|
write: async (path14, content, options) => {
|
|
32686
32741
|
const mode = normalizeMode(options?.mode);
|
|
32687
32742
|
const writeOptions = {
|
|
@@ -32690,20 +32745,20 @@ var LocalInvocation = class _LocalInvocation extends Invocation {
|
|
|
32690
32745
|
if (mode !== void 0) {
|
|
32691
32746
|
writeOptions.mode = mode;
|
|
32692
32747
|
}
|
|
32693
|
-
await
|
|
32748
|
+
await fs11.promises.writeFile(path14, content, writeOptions);
|
|
32694
32749
|
},
|
|
32695
32750
|
exists: async (path14) => {
|
|
32696
32751
|
try {
|
|
32697
|
-
await
|
|
32752
|
+
await fs11.promises.access(path14);
|
|
32698
32753
|
return true;
|
|
32699
32754
|
} catch {
|
|
32700
32755
|
return false;
|
|
32701
32756
|
}
|
|
32702
32757
|
},
|
|
32703
32758
|
mkdir: async (path14, options) => {
|
|
32704
|
-
await
|
|
32759
|
+
await fs11.promises.mkdir(path14, options);
|
|
32705
32760
|
},
|
|
32706
|
-
rm: async (path14, options) =>
|
|
32761
|
+
rm: async (path14, options) => fs11.promises.rm(path14, options)
|
|
32707
32762
|
};
|
|
32708
32763
|
}
|
|
32709
32764
|
config;
|
|
@@ -33053,7 +33108,7 @@ function serializeError(value) {
|
|
|
33053
33108
|
}
|
|
33054
33109
|
return { error: String(value) };
|
|
33055
33110
|
}
|
|
33056
|
-
async function
|
|
33111
|
+
async function run248(context) {
|
|
33057
33112
|
const { params, ssh } = context;
|
|
33058
33113
|
const { taskFn, params: taskParams } = params;
|
|
33059
33114
|
const remoteResults = await ssh([], async (remoteContext) => {
|
|
@@ -33082,7 +33137,7 @@ async function run252(context) {
|
|
|
33082
33137
|
});
|
|
33083
33138
|
return Object.fromEntries(normalizedEntries);
|
|
33084
33139
|
}
|
|
33085
|
-
var runAllRemote_default = task(
|
|
33140
|
+
var runAllRemote_default = task(run248, {
|
|
33086
33141
|
description: "run a task on all selected hosts",
|
|
33087
33142
|
inputSchema: RunParamsSchema,
|
|
33088
33143
|
outputSchema: RunResultSchema
|
|
@@ -33237,6 +33292,15 @@ var TaskCacheStore = class {
|
|
|
33237
33292
|
};
|
|
33238
33293
|
|
|
33239
33294
|
// src/app.ts
|
|
33295
|
+
function normalizePrivateKey2(value) {
|
|
33296
|
+
if (!value.includes("\n") && value.includes("\\n")) {
|
|
33297
|
+
return value.replace(/\\n/g, "\n");
|
|
33298
|
+
}
|
|
33299
|
+
return value;
|
|
33300
|
+
}
|
|
33301
|
+
function looksLikePrivateKey2(value) {
|
|
33302
|
+
return /-----BEGIN [A-Z0-9 ]+PRIVATE KEY-----/.test(value);
|
|
33303
|
+
}
|
|
33240
33304
|
var TaskTree = class {
|
|
33241
33305
|
// private taskEventBus: Emittery<{ newTask: NewTaskEvent; taskComplete: TaskCompleteEvent }>;
|
|
33242
33306
|
listr;
|
|
@@ -33357,8 +33421,8 @@ var App6 = class _App {
|
|
|
33357
33421
|
}
|
|
33358
33422
|
get tmpDir() {
|
|
33359
33423
|
if (!this._tmpDir) {
|
|
33360
|
-
if (!
|
|
33361
|
-
|
|
33424
|
+
if (!fs12.existsSync(this.hostctlDir().toString())) {
|
|
33425
|
+
fs12.mkdirSync(this.hostctlDir().toString(), { recursive: true });
|
|
33362
33426
|
}
|
|
33363
33427
|
this._tmpDir = this.createNamedTmpDir(version);
|
|
33364
33428
|
}
|
|
@@ -33372,10 +33436,11 @@ var App6 = class _App {
|
|
|
33372
33436
|
this.configProvider = provider;
|
|
33373
33437
|
if (provider instanceof FileConfigProvider) {
|
|
33374
33438
|
this.configRef = provider.path;
|
|
33439
|
+
this._config = await provider.getConfigFile();
|
|
33375
33440
|
} else {
|
|
33376
33441
|
this.configRef = "provider";
|
|
33442
|
+
this._config = await ProviderConfig.load(provider);
|
|
33377
33443
|
}
|
|
33378
|
-
this._config = await ProviderConfig.load(provider);
|
|
33379
33444
|
}
|
|
33380
33445
|
isValidUrl(url) {
|
|
33381
33446
|
try {
|
|
@@ -33579,9 +33644,28 @@ ${cmdRes.stderr.trim()}`));
|
|
|
33579
33644
|
host: host.hostname,
|
|
33580
33645
|
port: host.port,
|
|
33581
33646
|
username: host.user,
|
|
33582
|
-
password: hostPassword
|
|
33583
|
-
privateKeyPath: await host.plaintextSshKeyPath()
|
|
33647
|
+
password: hostPassword
|
|
33584
33648
|
};
|
|
33649
|
+
const sshKeyPassphrase = await host.decryptedSshKeyPassphrase();
|
|
33650
|
+
if (sshKeyPassphrase) {
|
|
33651
|
+
sshConnection.passphrase = sshKeyPassphrase;
|
|
33652
|
+
}
|
|
33653
|
+
const decryptedKey = await host.decryptedSshKey();
|
|
33654
|
+
if (decryptedKey) {
|
|
33655
|
+
const normalizedKey = normalizePrivateKey2(decryptedKey).trim();
|
|
33656
|
+
if (looksLikePrivateKey2(normalizedKey)) {
|
|
33657
|
+
sshConnection.privateKey = normalizedKey;
|
|
33658
|
+
} else if (fs12.existsSync(normalizedKey)) {
|
|
33659
|
+
sshConnection.privateKeyPath = normalizedKey;
|
|
33660
|
+
} else {
|
|
33661
|
+
sshConnection.privateKey = normalizedKey;
|
|
33662
|
+
}
|
|
33663
|
+
} else {
|
|
33664
|
+
const keyPath = await host.plaintextSshKeyPath();
|
|
33665
|
+
if (keyPath) {
|
|
33666
|
+
sshConnection.privateKeyPath = keyPath;
|
|
33667
|
+
}
|
|
33668
|
+
}
|
|
33585
33669
|
const interactionHandler = InteractionHandler.with(withSudo(hostPassword));
|
|
33586
33670
|
const session = new SSHSession();
|
|
33587
33671
|
await session.connect(sshConnection);
|
|
@@ -33991,7 +34075,7 @@ ${cmdRes.stderr.trim()}`));
|
|
|
33991
34075
|
await configFile.decryptAllIfPossible();
|
|
33992
34076
|
const successfullyUsedIdentityPaths = configFile.loadPrivateKeys().filter((identity2) => {
|
|
33993
34077
|
try {
|
|
33994
|
-
return
|
|
34078
|
+
return fs12.existsSync(identity2.identityFilePath);
|
|
33995
34079
|
} catch (e) {
|
|
33996
34080
|
return false;
|
|
33997
34081
|
}
|