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/bin/hostctl.js
CHANGED
|
@@ -14,7 +14,7 @@ import "zod";
|
|
|
14
14
|
|
|
15
15
|
// src/app.ts
|
|
16
16
|
import process3 from "process";
|
|
17
|
-
import * as
|
|
17
|
+
import * as fs10 from "fs";
|
|
18
18
|
import { homedir as homedir3 } from "os";
|
|
19
19
|
|
|
20
20
|
// src/handlebars.ts
|
|
@@ -1839,8 +1839,12 @@ var TmpFileRegistry = class _TmpFileRegistry {
|
|
|
1839
1839
|
constructor(rootPath) {
|
|
1840
1840
|
this.rootPath = Path.new(rootPath);
|
|
1841
1841
|
this.tempFilePaths = [];
|
|
1842
|
+
this.ensureRootPathExists();
|
|
1842
1843
|
process2.on("exit", (code) => this.exitCallback());
|
|
1843
1844
|
}
|
|
1845
|
+
ensureRootPathExists() {
|
|
1846
|
+
fs.mkdirSync(this.rootPath.toString(), { recursive: true });
|
|
1847
|
+
}
|
|
1844
1848
|
randName() {
|
|
1845
1849
|
return Math.random().toString(36).slice(-5) + Math.random().toString(36).slice(-5);
|
|
1846
1850
|
}
|
|
@@ -1857,6 +1861,7 @@ var TmpFileRegistry = class _TmpFileRegistry {
|
|
|
1857
1861
|
}
|
|
1858
1862
|
// this file will be automatically cleaned up at program exit
|
|
1859
1863
|
writeTmpFile(fileContent) {
|
|
1864
|
+
this.ensureRootPathExists();
|
|
1860
1865
|
const path14 = this.tmpPath();
|
|
1861
1866
|
fs.writeFileSync(path14.toString(), fileContent);
|
|
1862
1867
|
this.registerTempFileOrDir(path14.toString());
|
|
@@ -1898,6 +1903,7 @@ var Host = class {
|
|
|
1898
1903
|
this.user = opts.user;
|
|
1899
1904
|
this.password = opts.password;
|
|
1900
1905
|
this.sshKey = opts.sshKey;
|
|
1906
|
+
this.sshKeyPassphrase = opts.sshKeyPassphrase;
|
|
1901
1907
|
this.tags = opts.tags ?? [];
|
|
1902
1908
|
this.tagSet = new Set(this.tags);
|
|
1903
1909
|
}
|
|
@@ -1909,6 +1915,7 @@ var Host = class {
|
|
|
1909
1915
|
user;
|
|
1910
1916
|
password;
|
|
1911
1917
|
sshKey;
|
|
1918
|
+
sshKeyPassphrase;
|
|
1912
1919
|
tags;
|
|
1913
1920
|
tagSet;
|
|
1914
1921
|
async decryptedPassword() {
|
|
@@ -1928,6 +1935,16 @@ var Host = class {
|
|
|
1928
1935
|
return await secret?.plaintext();
|
|
1929
1936
|
}
|
|
1930
1937
|
}
|
|
1938
|
+
async decryptedSshKeyPassphrase() {
|
|
1939
|
+
if (V(this.sshKeyPassphrase).isA(SecretRef)) {
|
|
1940
|
+
const secretRef = this.sshKeyPassphrase;
|
|
1941
|
+
const secret = this.config.getSecret(secretRef.name);
|
|
1942
|
+
return await secret?.plaintext();
|
|
1943
|
+
}
|
|
1944
|
+
if (typeof this.sshKeyPassphrase === "string") {
|
|
1945
|
+
return this.sshKeyPassphrase;
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1931
1948
|
toYAML() {
|
|
1932
1949
|
let passwordForYaml = this.password;
|
|
1933
1950
|
if (this.password && V(this.password).isA(SecretRef)) {
|
|
@@ -1937,6 +1954,10 @@ var Host = class {
|
|
|
1937
1954
|
if (this.sshKey && V(this.sshKey).isA(SecretRef)) {
|
|
1938
1955
|
sshKeyForYaml = this.sshKey.toYAML();
|
|
1939
1956
|
}
|
|
1957
|
+
let sshKeyPassphraseForYaml = this.sshKeyPassphrase;
|
|
1958
|
+
if (this.sshKeyPassphrase && V(this.sshKeyPassphrase).isA(SecretRef)) {
|
|
1959
|
+
sshKeyPassphraseForYaml = this.sshKeyPassphrase.toYAML();
|
|
1960
|
+
}
|
|
1940
1961
|
return {
|
|
1941
1962
|
host: this.hostname,
|
|
1942
1963
|
// Always include the host field
|
|
@@ -1945,6 +1966,7 @@ var Host = class {
|
|
|
1945
1966
|
// Only include port if not default
|
|
1946
1967
|
password: passwordForYaml,
|
|
1947
1968
|
"ssh-key": sshKeyForYaml,
|
|
1969
|
+
"ssh-key-passphrase": sshKeyPassphraseForYaml,
|
|
1948
1970
|
tags: this.tags
|
|
1949
1971
|
};
|
|
1950
1972
|
}
|
|
@@ -2296,6 +2318,7 @@ var ConfigFile2 = class {
|
|
|
2296
2318
|
hostObj ||= {};
|
|
2297
2319
|
const password = this.parseSecretValue(hostObj.password);
|
|
2298
2320
|
const sshKey = this.parseSecretValue(hostObj["ssh-key"]);
|
|
2321
|
+
const sshKeyPassphrase = this.parseSecretValue(hostObj["ssh-key-passphrase"]);
|
|
2299
2322
|
const hostname = hostObj.host || alias;
|
|
2300
2323
|
hostMap.set(
|
|
2301
2324
|
alias,
|
|
@@ -2310,6 +2333,7 @@ var ConfigFile2 = class {
|
|
|
2310
2333
|
user: hostObj.user,
|
|
2311
2334
|
password,
|
|
2312
2335
|
sshKey,
|
|
2336
|
+
sshKeyPassphrase,
|
|
2313
2337
|
tags: hostObj.tags
|
|
2314
2338
|
})
|
|
2315
2339
|
);
|
|
@@ -2484,6 +2508,7 @@ var ProviderConfig = class _ProviderConfig {
|
|
|
2484
2508
|
user: input.user,
|
|
2485
2509
|
password: input.password,
|
|
2486
2510
|
sshKey: input.sshKey,
|
|
2511
|
+
sshKeyPassphrase: input.sshKeyPassphrase,
|
|
2487
2512
|
tags: input.tags
|
|
2488
2513
|
});
|
|
2489
2514
|
}
|
|
@@ -2527,6 +2552,7 @@ var FileConfigProvider = class {
|
|
|
2527
2552
|
port: h.port,
|
|
2528
2553
|
password: h.password,
|
|
2529
2554
|
sshKey: h.sshKey,
|
|
2555
|
+
sshKeyPassphrase: h.sshKeyPassphrase,
|
|
2530
2556
|
tags: h.tags
|
|
2531
2557
|
}));
|
|
2532
2558
|
}
|
|
@@ -3045,6 +3071,7 @@ var Invocation = class {
|
|
|
3045
3071
|
// src/remote-runtime.ts
|
|
3046
3072
|
import Handlebars2 from "handlebars";
|
|
3047
3073
|
import "path";
|
|
3074
|
+
import * as fs5 from "fs";
|
|
3048
3075
|
|
|
3049
3076
|
// src/ssh-session.ts
|
|
3050
3077
|
import { signalsByName } from "human-signals";
|
|
@@ -3228,6 +3255,15 @@ function withSudo(password, existingInputMap = {}) {
|
|
|
3228
3255
|
}
|
|
3229
3256
|
|
|
3230
3257
|
// src/remote-runtime.ts
|
|
3258
|
+
function normalizePrivateKey(value) {
|
|
3259
|
+
if (!value.includes("\n") && value.includes("\\n")) {
|
|
3260
|
+
return value.replace(/\\n/g, "\n");
|
|
3261
|
+
}
|
|
3262
|
+
return value;
|
|
3263
|
+
}
|
|
3264
|
+
function looksLikePrivateKey(value) {
|
|
3265
|
+
return /-----BEGIN [A-Z0-9 ]+PRIVATE KEY-----/.test(value);
|
|
3266
|
+
}
|
|
3231
3267
|
function normalizeWriteMode(mode) {
|
|
3232
3268
|
if (mode === void 0) {
|
|
3233
3269
|
return void 0;
|
|
@@ -3467,9 +3503,28 @@ var RemoteRuntime = class {
|
|
|
3467
3503
|
// Assuming defaultSshUser on App
|
|
3468
3504
|
port: this.host.port,
|
|
3469
3505
|
// node-ssh parses port from host string if present
|
|
3470
|
-
privateKey: await this.host.plaintextSshKeyPath(),
|
|
3471
3506
|
password: await this.host.decryptedPassword()
|
|
3472
3507
|
};
|
|
3508
|
+
const sshKeyPassphrase = await this.host.decryptedSshKeyPassphrase();
|
|
3509
|
+
if (sshKeyPassphrase) {
|
|
3510
|
+
sshConnectOpts.passphrase = sshKeyPassphrase;
|
|
3511
|
+
}
|
|
3512
|
+
const decryptedKey = await this.host.decryptedSshKey();
|
|
3513
|
+
if (decryptedKey) {
|
|
3514
|
+
const normalizedKey = normalizePrivateKey(decryptedKey).trim();
|
|
3515
|
+
if (looksLikePrivateKey(normalizedKey)) {
|
|
3516
|
+
sshConnectOpts.privateKey = normalizedKey;
|
|
3517
|
+
} else if (fs5.existsSync(normalizedKey)) {
|
|
3518
|
+
sshConnectOpts.privateKeyPath = normalizedKey;
|
|
3519
|
+
} else {
|
|
3520
|
+
sshConnectOpts.privateKey = normalizedKey;
|
|
3521
|
+
}
|
|
3522
|
+
} else {
|
|
3523
|
+
const keyPath = await this.host.plaintextSshKeyPath();
|
|
3524
|
+
if (keyPath) {
|
|
3525
|
+
sshConnectOpts.privateKeyPath = keyPath;
|
|
3526
|
+
}
|
|
3527
|
+
}
|
|
3473
3528
|
try {
|
|
3474
3529
|
if (!this.sshSession.isConnected()) {
|
|
3475
3530
|
await this.sshSession.connect(sshConnectOpts);
|
|
@@ -3560,7 +3615,7 @@ var RemoteRuntime = class {
|
|
|
3560
3615
|
};
|
|
3561
3616
|
|
|
3562
3617
|
// src/local-runtime.ts
|
|
3563
|
-
import * as
|
|
3618
|
+
import * as fs6 from "fs";
|
|
3564
3619
|
|
|
3565
3620
|
// src/ruspty-command.ts
|
|
3566
3621
|
import { Pty } from "@replit/ruspty";
|
|
@@ -3640,7 +3695,7 @@ var LocalInvocation = class _LocalInvocation extends Invocation {
|
|
|
3640
3695
|
)(params);
|
|
3641
3696
|
this.config = this.runtime.app.config;
|
|
3642
3697
|
this.file = {
|
|
3643
|
-
read: async (path14) =>
|
|
3698
|
+
read: async (path14) => fs6.promises.readFile(path14, "utf-8"),
|
|
3644
3699
|
write: async (path14, content, options) => {
|
|
3645
3700
|
const mode = normalizeMode(options?.mode);
|
|
3646
3701
|
const writeOptions = {
|
|
@@ -3649,20 +3704,20 @@ var LocalInvocation = class _LocalInvocation extends Invocation {
|
|
|
3649
3704
|
if (mode !== void 0) {
|
|
3650
3705
|
writeOptions.mode = mode;
|
|
3651
3706
|
}
|
|
3652
|
-
await
|
|
3707
|
+
await fs6.promises.writeFile(path14, content, writeOptions);
|
|
3653
3708
|
},
|
|
3654
3709
|
exists: async (path14) => {
|
|
3655
3710
|
try {
|
|
3656
|
-
await
|
|
3711
|
+
await fs6.promises.access(path14);
|
|
3657
3712
|
return true;
|
|
3658
3713
|
} catch {
|
|
3659
3714
|
return false;
|
|
3660
3715
|
}
|
|
3661
3716
|
},
|
|
3662
3717
|
mkdir: async (path14, options) => {
|
|
3663
|
-
await
|
|
3718
|
+
await fs6.promises.mkdir(path14, options);
|
|
3664
3719
|
},
|
|
3665
|
-
rm: async (path14, options) =>
|
|
3720
|
+
rm: async (path14, options) => fs6.promises.rm(path14, options)
|
|
3666
3721
|
};
|
|
3667
3722
|
}
|
|
3668
3723
|
config;
|
|
@@ -3988,7 +4043,7 @@ var ParamMap = class _ParamMap {
|
|
|
3988
4043
|
import * as z from "zod";
|
|
3989
4044
|
|
|
3990
4045
|
// src/version.ts
|
|
3991
|
-
var version = "0.1.
|
|
4046
|
+
var version = "0.1.59";
|
|
3992
4047
|
|
|
3993
4048
|
// src/app.ts
|
|
3994
4049
|
import { retryUntilDefined } from "ts-retry";
|
|
@@ -4054,7 +4109,7 @@ var runAllRemote_default = task(run, {
|
|
|
4054
4109
|
});
|
|
4055
4110
|
|
|
4056
4111
|
// src/commands/pkg/package-manager.ts
|
|
4057
|
-
import { promises as
|
|
4112
|
+
import { promises as fs7 } from "fs";
|
|
4058
4113
|
|
|
4059
4114
|
// src/node-runtime.ts
|
|
4060
4115
|
import os3 from "os";
|
|
@@ -4305,7 +4360,7 @@ var PackageManager = class {
|
|
|
4305
4360
|
async loadManifest() {
|
|
4306
4361
|
try {
|
|
4307
4362
|
if (await this.manifestPath.exists()) {
|
|
4308
|
-
const manifestContent = await
|
|
4363
|
+
const manifestContent = await fs7.readFile(this.manifestPath.toString(), "utf-8");
|
|
4309
4364
|
this.manifest = JSON.parse(manifestContent);
|
|
4310
4365
|
} else {
|
|
4311
4366
|
this.manifest = { packages: [], version: "1.0" };
|
|
@@ -4318,7 +4373,7 @@ var PackageManager = class {
|
|
|
4318
4373
|
}
|
|
4319
4374
|
}
|
|
4320
4375
|
async saveManifest() {
|
|
4321
|
-
await
|
|
4376
|
+
await fs7.writeFile(this.manifestPath.toString(), JSON.stringify(this.manifest, null, 2));
|
|
4322
4377
|
}
|
|
4323
4378
|
isLocalPath(source) {
|
|
4324
4379
|
if (source.startsWith("file:")) {
|
|
@@ -4353,7 +4408,7 @@ var PackageManager = class {
|
|
|
4353
4408
|
async discoverTasks(packagePath) {
|
|
4354
4409
|
const tasks = [];
|
|
4355
4410
|
try {
|
|
4356
|
-
const entries = await
|
|
4411
|
+
const entries = await fs7.readdir(packagePath.toString(), { withFileTypes: true });
|
|
4357
4412
|
for (const entry of entries) {
|
|
4358
4413
|
if (entry.isFile() && (entry.name.endsWith(".ts") || entry.name.endsWith(".js"))) {
|
|
4359
4414
|
if (entry.name === "index.ts" || entry.name === "index.js") {
|
|
@@ -4371,7 +4426,7 @@ var PackageManager = class {
|
|
|
4371
4426
|
for (const subdir of subdirs) {
|
|
4372
4427
|
const subdirPath = packagePath.join(subdir);
|
|
4373
4428
|
if (await subdirPath.exists()) {
|
|
4374
|
-
const subEntries = await
|
|
4429
|
+
const subEntries = await fs7.readdir(subdirPath.toString(), { withFileTypes: true });
|
|
4375
4430
|
for (const entry of subEntries) {
|
|
4376
4431
|
if (entry.isFile() && (entry.name.endsWith(".ts") || entry.name.endsWith(".js"))) {
|
|
4377
4432
|
const taskPath = subdirPath.join(entry.name);
|
|
@@ -4561,7 +4616,7 @@ var PackageManager = class {
|
|
|
4561
4616
|
}
|
|
4562
4617
|
const normalizedSource = this.normalizeSource(source);
|
|
4563
4618
|
const packagesDir = this.app.packagesDir();
|
|
4564
|
-
await
|
|
4619
|
+
await fs7.mkdir(packagesDir.toString(), { recursive: true });
|
|
4565
4620
|
const filenamifiedSource = filenamify(normalizedSource, { replacement: "_" });
|
|
4566
4621
|
const installDir = packagesDir.join(filenamifiedSource);
|
|
4567
4622
|
const existingPackage = this.findPackageBySource(normalizedSource);
|
|
@@ -4653,7 +4708,7 @@ var PackageManager = class {
|
|
|
4653
4708
|
const overrideValue = hostctlOverride ? hostctlOverride.startsWith("file:") ? hostctlOverride : `file:${Path.new(hostctlOverride).absolute().toString()}` : void 0;
|
|
4654
4709
|
let packageJson;
|
|
4655
4710
|
if (await packageJsonPath.exists()) {
|
|
4656
|
-
const raw = await
|
|
4711
|
+
const raw = await fs7.readFile(packageJsonPath.toString(), "utf-8");
|
|
4657
4712
|
packageJson = JSON.parse(raw);
|
|
4658
4713
|
} else {
|
|
4659
4714
|
packageJson = {
|
|
@@ -4666,7 +4721,7 @@ var PackageManager = class {
|
|
|
4666
4721
|
if (overrideValue) {
|
|
4667
4722
|
packageJson.overrides = { ...packageJson.overrides ?? {}, hostctl: overrideValue };
|
|
4668
4723
|
}
|
|
4669
|
-
await
|
|
4724
|
+
await fs7.writeFile(packageJsonPath.toString(), JSON.stringify(packageJson, null, 2));
|
|
4670
4725
|
}
|
|
4671
4726
|
// Scan node_modules for the real installed package (by name or repo match)
|
|
4672
4727
|
async findRealInstalledNpmPackagePath(packagesDir, source) {
|
|
@@ -4677,14 +4732,14 @@ var PackageManager = class {
|
|
|
4677
4732
|
}
|
|
4678
4733
|
return { path: null, name: null };
|
|
4679
4734
|
}
|
|
4680
|
-
const entries = await
|
|
4735
|
+
const entries = await fs7.readdir(nodeModulesPath.toString());
|
|
4681
4736
|
for (const entry of entries) {
|
|
4682
4737
|
const potentialPackagePath = nodeModulesPath.join(entry);
|
|
4683
4738
|
if (await potentialPackagePath.isDirectory()) {
|
|
4684
4739
|
const packageJsonPath = potentialPackagePath.join("package.json");
|
|
4685
4740
|
if (await packageJsonPath.exists()) {
|
|
4686
4741
|
try {
|
|
4687
|
-
const packageJsonContent = await
|
|
4742
|
+
const packageJsonContent = await fs7.readFile(packageJsonPath.toString(), "utf-8");
|
|
4688
4743
|
const packageJson = JSON.parse(packageJsonContent);
|
|
4689
4744
|
if (packageJson.repository && typeof packageJson.repository.url === "string" && packageJson.repository.url.includes(source.replace(/^https?:\/\//, "").replace(/\.git$/, "")) || packageJson.homepage && packageJson.homepage.includes(source.replace(/^https?:\/\//, "").replace(/\.git$/, ""))) {
|
|
4690
4745
|
return { path: potentialPackagePath, name: packageJson.name };
|
|
@@ -4703,7 +4758,7 @@ var PackageManager = class {
|
|
|
4703
4758
|
const packageJsonPath = potentialPackagePath.join("package.json");
|
|
4704
4759
|
if (await packageJsonPath.exists()) {
|
|
4705
4760
|
try {
|
|
4706
|
-
const packageJsonContent = await
|
|
4761
|
+
const packageJsonContent = await fs7.readFile(packageJsonPath.toString(), "utf-8");
|
|
4707
4762
|
const packageJson = JSON.parse(packageJsonContent);
|
|
4708
4763
|
return { path: potentialPackagePath, name: packageJson.name };
|
|
4709
4764
|
} catch {
|
|
@@ -4743,7 +4798,7 @@ var PackageManager = class {
|
|
|
4743
4798
|
try {
|
|
4744
4799
|
const packageJsonPath = packagePath.join("package.json");
|
|
4745
4800
|
if (await packageJsonPath.exists()) {
|
|
4746
|
-
const packageJsonContent = await
|
|
4801
|
+
const packageJsonContent = await fs7.readFile(packageJsonPath.toString(), "utf-8");
|
|
4747
4802
|
const packageJson = JSON.parse(packageJsonContent);
|
|
4748
4803
|
return {
|
|
4749
4804
|
name: packageJson.name || fallbackName || packagePath.basename().toString(),
|
|
@@ -4760,7 +4815,7 @@ var PackageManager = class {
|
|
|
4760
4815
|
};
|
|
4761
4816
|
|
|
4762
4817
|
// src/task-registry-loader.ts
|
|
4763
|
-
import { promises as
|
|
4818
|
+
import { promises as fs8 } from "fs";
|
|
4764
4819
|
import path4 from "path";
|
|
4765
4820
|
import { pathToFileURL } from "url";
|
|
4766
4821
|
function resolveExportsEntry(exportsField) {
|
|
@@ -4778,7 +4833,7 @@ function resolveExportsEntry(exportsField) {
|
|
|
4778
4833
|
async function readPackageJson(packagePath) {
|
|
4779
4834
|
const packageJsonPath = path4.join(packagePath, "package.json");
|
|
4780
4835
|
try {
|
|
4781
|
-
const raw = await
|
|
4836
|
+
const raw = await fs8.readFile(packageJsonPath, "utf8");
|
|
4782
4837
|
return JSON.parse(raw);
|
|
4783
4838
|
} catch {
|
|
4784
4839
|
return null;
|
|
@@ -4786,7 +4841,7 @@ async function readPackageJson(packagePath) {
|
|
|
4786
4841
|
}
|
|
4787
4842
|
async function fileExists(filePath) {
|
|
4788
4843
|
try {
|
|
4789
|
-
const stat = await
|
|
4844
|
+
const stat = await fs8.stat(filePath);
|
|
4790
4845
|
return stat.isFile();
|
|
4791
4846
|
} catch {
|
|
4792
4847
|
return false;
|
|
@@ -5392,7 +5447,7 @@ var DirCreateOutputSchema = z.object({
|
|
|
5392
5447
|
})
|
|
5393
5448
|
);
|
|
5394
5449
|
async function runFn(context) {
|
|
5395
|
-
const { params, exec, run:
|
|
5450
|
+
const { params, exec, run: run249 } = context;
|
|
5396
5451
|
const sudoDefault = context.host ? !context.host.isLocal() : false;
|
|
5397
5452
|
const { path: path14, mode, owner, sudo = sudoDefault } = params;
|
|
5398
5453
|
if (!path14) {
|
|
@@ -5416,7 +5471,7 @@ async function runFn(context) {
|
|
|
5416
5471
|
}
|
|
5417
5472
|
}
|
|
5418
5473
|
if (mode) {
|
|
5419
|
-
const chmodResult = await
|
|
5474
|
+
const chmodResult = await run249(chmod_default({ path: path14, mode, sudo: true }));
|
|
5420
5475
|
if (!chmodResult?.success) {
|
|
5421
5476
|
return { success: false, error: chmodResult?.error ?? "Failed to set directory mode" };
|
|
5422
5477
|
}
|
|
@@ -6009,7 +6064,7 @@ async function ensureFile(context, file, sudo) {
|
|
|
6009
6064
|
await exec(["touch", file], { sudo });
|
|
6010
6065
|
}
|
|
6011
6066
|
async function runFn2(context) {
|
|
6012
|
-
const { params, exec, info, run:
|
|
6067
|
+
const { params, exec, info, run: run249, error } = context;
|
|
6013
6068
|
const {
|
|
6014
6069
|
file,
|
|
6015
6070
|
state = "present",
|
|
@@ -6696,7 +6751,7 @@ async function getOsReleaseInfo(exec) {
|
|
|
6696
6751
|
const cpeMatch = osRelease.match(/^CPE_NAME=(.*?)$/im);
|
|
6697
6752
|
if (idMatch) {
|
|
6698
6753
|
let id = idMatch[1].trim().replace(/"/g, "");
|
|
6699
|
-
|
|
6754
|
+
let idLike = idLikeMatch ? idLikeMatch[1].trim().replace(/"/g, "") : id;
|
|
6700
6755
|
const version2 = versionIdMatch && versionIdMatch[1].trim().replace(/"/g, "") || buildIdMatch && buildIdMatch[1].trim().replace(/"/g, "") || "unknown";
|
|
6701
6756
|
const nameValue = nameMatch ? nameMatch[1].trim().replace(/"/g, "") : "";
|
|
6702
6757
|
const prettyName = prettyNameMatch ? prettyNameMatch[1].trim().replace(/"/g, "") : "";
|
|
@@ -6705,6 +6760,10 @@ async function getOsReleaseInfo(exec) {
|
|
|
6705
6760
|
if (normalizedName.includes("rocky") || idLike.toLowerCase().includes("rocky")) {
|
|
6706
6761
|
id = "rocky";
|
|
6707
6762
|
}
|
|
6763
|
+
if (normalizedName.includes("xcp-ng") || id.toLowerCase() === "xenenterprise") {
|
|
6764
|
+
id = "xcp-ng";
|
|
6765
|
+
idLike = "xcp-ng";
|
|
6766
|
+
}
|
|
6708
6767
|
return {
|
|
6709
6768
|
idLike,
|
|
6710
6769
|
id,
|
|
@@ -6724,6 +6783,53 @@ async function getOsReleaseInfo(exec) {
|
|
|
6724
6783
|
};
|
|
6725
6784
|
}
|
|
6726
6785
|
}
|
|
6786
|
+
function parseKeyValueFile(contents) {
|
|
6787
|
+
return contents.split("\n").map((line) => line.trim()).filter(Boolean).reduce((acc, line) => {
|
|
6788
|
+
const match7 = line.match(/^([A-Za-z0-9_]+)=(.*)$/);
|
|
6789
|
+
if (!match7) {
|
|
6790
|
+
return acc;
|
|
6791
|
+
}
|
|
6792
|
+
const key = match7[1];
|
|
6793
|
+
const rawValue = match7[2];
|
|
6794
|
+
const value = rawValue.replace(/^"(.*)"$/, "$1");
|
|
6795
|
+
acc[key] = value;
|
|
6796
|
+
return acc;
|
|
6797
|
+
}, {});
|
|
6798
|
+
}
|
|
6799
|
+
async function detectSynologyInfo(exec) {
|
|
6800
|
+
try {
|
|
6801
|
+
const { stdout } = await exec(["cat", "/etc.defaults/VERSION"]);
|
|
6802
|
+
const values3 = parseKeyValueFile(stdout);
|
|
6803
|
+
const version2 = values3.productversion || values3.version || `${values3.major || ""}.${values3.minor || ""}`.trim();
|
|
6804
|
+
if (!version2 || version2 === ".") {
|
|
6805
|
+
return null;
|
|
6806
|
+
}
|
|
6807
|
+
return {
|
|
6808
|
+
idLike: "synology",
|
|
6809
|
+
id: "synology",
|
|
6810
|
+
version: version2
|
|
6811
|
+
};
|
|
6812
|
+
} catch {
|
|
6813
|
+
return null;
|
|
6814
|
+
}
|
|
6815
|
+
}
|
|
6816
|
+
async function detectXcpNgInfo(exec) {
|
|
6817
|
+
try {
|
|
6818
|
+
const { stdout } = await exec(["cat", "/etc/redhat-release"]);
|
|
6819
|
+
if (!stdout.toLowerCase().includes("xcp-ng")) {
|
|
6820
|
+
return null;
|
|
6821
|
+
}
|
|
6822
|
+
const versionMatch = stdout.match(/([0-9]+(?:\.[0-9]+)+)/);
|
|
6823
|
+
const version2 = versionMatch ? versionMatch[1] : "unknown";
|
|
6824
|
+
return {
|
|
6825
|
+
idLike: "xcp-ng",
|
|
6826
|
+
id: "xcp-ng",
|
|
6827
|
+
version: version2
|
|
6828
|
+
};
|
|
6829
|
+
} catch {
|
|
6830
|
+
return null;
|
|
6831
|
+
}
|
|
6832
|
+
}
|
|
6727
6833
|
async function detectRockyLinux(exec) {
|
|
6728
6834
|
try {
|
|
6729
6835
|
const { stdout } = await exec([
|
|
@@ -6763,7 +6869,17 @@ var os_default = task(
|
|
|
6763
6869
|
const { stdout: swVersOutput } = await exec(["sw_vers", "-productVersion"]);
|
|
6764
6870
|
return [family, family, swVersOutput.trim()];
|
|
6765
6871
|
}).with("linux", async () => {
|
|
6766
|
-
|
|
6872
|
+
let { idLike, id, version: version2 } = await getOsReleaseInfo(exec);
|
|
6873
|
+
if (id === "unknown") {
|
|
6874
|
+
const synologyInfo = await detectSynologyInfo(exec);
|
|
6875
|
+
if (synologyInfo) {
|
|
6876
|
+
return [synologyInfo.idLike, synologyInfo.id, synologyInfo.version];
|
|
6877
|
+
}
|
|
6878
|
+
const xcpNgInfo = await detectXcpNgInfo(exec);
|
|
6879
|
+
if (xcpNgInfo) {
|
|
6880
|
+
return [xcpNgInfo.idLike, xcpNgInfo.id, xcpNgInfo.version];
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6767
6883
|
return [idLike, id, version2];
|
|
6768
6884
|
}).with("solaris", async () => {
|
|
6769
6885
|
const { stdout: unameROutput } = await exec(["uname", "-r"]);
|
|
@@ -6846,15 +6962,29 @@ async function run28(context) {
|
|
|
6846
6962
|
const hostnameResult = await runTask(hostname_default({}));
|
|
6847
6963
|
const name = hostnameResult.hostname;
|
|
6848
6964
|
const os6 = await runTask(os_default({}));
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6965
|
+
let lsb_release = {
|
|
6966
|
+
"Distributor ID": "",
|
|
6967
|
+
Description: "",
|
|
6968
|
+
Release: "",
|
|
6969
|
+
Codename: ""
|
|
6970
|
+
};
|
|
6971
|
+
try {
|
|
6972
|
+
const { stdout: lsbOutput } = await exec(["lsb_release", "-a"]);
|
|
6973
|
+
lsb_release = lsbOutput.split("\n").filter(Boolean).reduce((acc, line) => {
|
|
6974
|
+
const [key, ...valueParts] = line.split(":");
|
|
6975
|
+
const value = valueParts.join(":").trim();
|
|
6976
|
+
acc[key.trim()] = value;
|
|
6977
|
+
return acc;
|
|
6978
|
+
}, {});
|
|
6979
|
+
} catch {
|
|
6980
|
+
}
|
|
6981
|
+
let lscpu = [];
|
|
6982
|
+
try {
|
|
6983
|
+
const { stdout: lscpuOutput } = await exec(["lscpu", "-J"]);
|
|
6984
|
+
const parsed = JSON.parse(lscpuOutput);
|
|
6985
|
+
lscpu = Array.isArray(parsed?.lscpu) ? parsed.lscpu : [];
|
|
6986
|
+
} catch {
|
|
6987
|
+
}
|
|
6858
6988
|
return {
|
|
6859
6989
|
host: {
|
|
6860
6990
|
name,
|
|
@@ -8203,10 +8333,6 @@ var uninstall_default2 = task(run42, {
|
|
|
8203
8333
|
// src/core/pkg/dnf/update.ts
|
|
8204
8334
|
async function run43(context) {
|
|
8205
8335
|
const { sudo = true, updateMetadata = true } = context.params;
|
|
8206
|
-
const isProtectedPackageError = (output) => {
|
|
8207
|
-
const normalized = output.toLowerCase();
|
|
8208
|
-
return normalized.includes("protected packages") || normalized.includes("protected package") || normalized.includes("the following protected") || normalized.includes("systemd-udev");
|
|
8209
|
-
};
|
|
8210
8336
|
try {
|
|
8211
8337
|
if (!updateMetadata) {
|
|
8212
8338
|
return {
|
|
@@ -8217,55 +8343,25 @@ async function run43(context) {
|
|
|
8217
8343
|
updatedPackages: []
|
|
8218
8344
|
};
|
|
8219
8345
|
}
|
|
8220
|
-
const command = ["dnf", "
|
|
8346
|
+
const command = ["dnf", "makecache", "--refresh", "--quiet"];
|
|
8221
8347
|
const result = await context.exec(command, { sudo });
|
|
8222
|
-
const combinedOutput = `${result.stdout}
|
|
8223
|
-
${result.stderr}`;
|
|
8224
8348
|
if (result.exitCode === 0) {
|
|
8225
|
-
const updatedPackages = [];
|
|
8226
|
-
let packagesUpdated = 0;
|
|
8227
|
-
const lines = result.stdout.split("\n");
|
|
8228
|
-
for (const line of lines) {
|
|
8229
|
-
if (line.includes("packages upgraded")) {
|
|
8230
|
-
const match7 = line.match(/(\d+)\s+packages? upgraded/);
|
|
8231
|
-
if (match7) {
|
|
8232
|
-
packagesUpdated = parseInt(match7[1], 10);
|
|
8233
|
-
}
|
|
8234
|
-
} else if (line.includes("Installing") || line.includes("Upgrading")) {
|
|
8235
|
-
const match7 = line.match(/(?:Installing|Upgrading)\s+(\S+)/);
|
|
8236
|
-
if (match7) {
|
|
8237
|
-
updatedPackages.push(match7[1]);
|
|
8238
|
-
}
|
|
8239
|
-
}
|
|
8240
|
-
}
|
|
8241
8349
|
return {
|
|
8242
8350
|
success: true,
|
|
8243
8351
|
packageManager: "dnf",
|
|
8244
8352
|
output: result.stdout,
|
|
8245
|
-
packagesUpdated,
|
|
8246
|
-
updatedPackages
|
|
8247
|
-
};
|
|
8248
|
-
} else {
|
|
8249
|
-
if (isProtectedPackageError(combinedOutput)) {
|
|
8250
|
-
context.warn("DNF skipped updates because the transaction would remove protected packages.");
|
|
8251
|
-
return {
|
|
8252
|
-
success: true,
|
|
8253
|
-
packageManager: "dnf",
|
|
8254
|
-
output: combinedOutput,
|
|
8255
|
-
packagesUpdated: 0,
|
|
8256
|
-
updatedPackages: [],
|
|
8257
|
-
warning: "DNF skipped updates due to protected packages; leaving system unchanged."
|
|
8258
|
-
};
|
|
8259
|
-
}
|
|
8260
|
-
return {
|
|
8261
|
-
success: false,
|
|
8262
|
-
error: result.stderr || "Update failed",
|
|
8263
|
-
packageManager: "dnf",
|
|
8264
|
-
output: result.stdout,
|
|
8265
8353
|
packagesUpdated: 0,
|
|
8266
8354
|
updatedPackages: []
|
|
8267
8355
|
};
|
|
8268
8356
|
}
|
|
8357
|
+
return {
|
|
8358
|
+
success: false,
|
|
8359
|
+
error: result.stderr || "Update failed",
|
|
8360
|
+
packageManager: "dnf",
|
|
8361
|
+
output: result.stdout,
|
|
8362
|
+
packagesUpdated: 0,
|
|
8363
|
+
updatedPackages: []
|
|
8364
|
+
};
|
|
8269
8365
|
} catch (error) {
|
|
8270
8366
|
context.error("Error updating packages:", error);
|
|
8271
8367
|
return {
|
|
@@ -8279,7 +8375,7 @@ ${result.stderr}`;
|
|
|
8279
8375
|
}
|
|
8280
8376
|
var update_default2 = task(run43, {
|
|
8281
8377
|
name: "update",
|
|
8282
|
-
description: "Update
|
|
8378
|
+
description: "Update package metadata using dnf package manager",
|
|
8283
8379
|
inputSchema: DnfUpdateParamsSchema,
|
|
8284
8380
|
outputSchema: DnfUpdateResultSchema
|
|
8285
8381
|
});
|
|
@@ -10924,6 +11020,44 @@ async function packageManagerSpecificInstall(pkgManager, context) {
|
|
|
10924
11020
|
return abstractInstallFallback(context, pkgManager);
|
|
10925
11021
|
}
|
|
10926
11022
|
}
|
|
11023
|
+
async function packageManagerSpecificUpdate(pkgManager, context) {
|
|
11024
|
+
const mapAptParams = () => ({
|
|
11025
|
+
...context.params,
|
|
11026
|
+
packageManager: "apt",
|
|
11027
|
+
updateLists: true,
|
|
11028
|
+
upgrade: false
|
|
11029
|
+
});
|
|
11030
|
+
const mapDnfParams = () => ({
|
|
11031
|
+
...context.params,
|
|
11032
|
+
packageManager: "dnf",
|
|
11033
|
+
updateMetadata: true,
|
|
11034
|
+
upgrade: false
|
|
11035
|
+
});
|
|
11036
|
+
const mapPacmanParams = () => ({
|
|
11037
|
+
...context.params,
|
|
11038
|
+
packageManager: "pacman",
|
|
11039
|
+
updateMetadata: true,
|
|
11040
|
+
upgrade: false
|
|
11041
|
+
});
|
|
11042
|
+
const mapYumParams = () => ({
|
|
11043
|
+
...context.params,
|
|
11044
|
+
packageManager: "yum",
|
|
11045
|
+
updateMetadata: true,
|
|
11046
|
+
upgrade: false
|
|
11047
|
+
});
|
|
11048
|
+
switch (pkgManager.name) {
|
|
11049
|
+
case "apt":
|
|
11050
|
+
return await context.run(update_default(mapAptParams()));
|
|
11051
|
+
case "dnf":
|
|
11052
|
+
return await context.run(update_default2(mapDnfParams()));
|
|
11053
|
+
case "pacman":
|
|
11054
|
+
return await context.run(update_default3(mapPacmanParams()));
|
|
11055
|
+
case "yum":
|
|
11056
|
+
return await context.run(update_default4(mapYumParams()));
|
|
11057
|
+
default:
|
|
11058
|
+
return await abstractUpdateFallback(context, pkgManager);
|
|
11059
|
+
}
|
|
11060
|
+
}
|
|
10927
11061
|
function buildCommandArray(pkgManager, operation, packages, extraArgs) {
|
|
10928
11062
|
const baseCommand = pkgManager[operation];
|
|
10929
11063
|
if (!baseCommand) {
|
|
@@ -11213,8 +11347,8 @@ async function abstractUninstallFallback(context) {
|
|
|
11213
11347
|
}
|
|
11214
11348
|
}
|
|
11215
11349
|
async function abstractUpdate(context) {
|
|
11216
|
-
const { params,
|
|
11217
|
-
const {
|
|
11350
|
+
const { params, warn } = context;
|
|
11351
|
+
const { packageManager: forcedManager } = params;
|
|
11218
11352
|
try {
|
|
11219
11353
|
const pkgManager = forcedManager ? PACKAGE_MANAGERS[forcedManager] : await detectPackageManager(context);
|
|
11220
11354
|
if (!pkgManager) {
|
|
@@ -11224,14 +11358,26 @@ async function abstractUpdate(context) {
|
|
|
11224
11358
|
};
|
|
11225
11359
|
}
|
|
11226
11360
|
warn(`Using package manager: ${pkgManager.name}`);
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11361
|
+
return await packageManagerSpecificUpdate(pkgManager, context);
|
|
11362
|
+
} catch (error) {
|
|
11363
|
+
return {
|
|
11364
|
+
success: false,
|
|
11365
|
+
error: error instanceof Error ? error.message : String(error)
|
|
11366
|
+
};
|
|
11367
|
+
}
|
|
11368
|
+
}
|
|
11369
|
+
async function abstractUpdateFallback(context, detectedManager) {
|
|
11370
|
+
const { params, exec, warn, info } = context;
|
|
11371
|
+
const { sudo = true, packageManager: forcedManager, extraArgs, input: userInput } = params;
|
|
11372
|
+
try {
|
|
11373
|
+
const pkgManager = detectedManager || (forcedManager ? PACKAGE_MANAGERS[forcedManager] : await detectPackageManager(context));
|
|
11374
|
+
if (!pkgManager) {
|
|
11375
|
+
return {
|
|
11376
|
+
success: false,
|
|
11377
|
+
error: "No supported package manager detected. Please specify one explicitly."
|
|
11378
|
+
};
|
|
11234
11379
|
}
|
|
11380
|
+
warn(`Using fallback implementation for package manager: ${pkgManager.name}`);
|
|
11235
11381
|
const mergedInput = getInteractiveInput(pkgManager.name, userInput);
|
|
11236
11382
|
const commandArray = buildCommandArray(pkgManager, "updateCommand", [], extraArgs);
|
|
11237
11383
|
info(`Executing: ${commandArray.join(" ")}`);
|
|
@@ -11766,7 +11912,8 @@ async function abstractClean(context) {
|
|
|
11766
11912
|
var AbstractPkgUpdateParamsSchema = AbstractPkgParamsSchema.pick({
|
|
11767
11913
|
sudo: true,
|
|
11768
11914
|
packageManager: true,
|
|
11769
|
-
extraArgs: true
|
|
11915
|
+
extraArgs: true,
|
|
11916
|
+
input: true
|
|
11770
11917
|
});
|
|
11771
11918
|
var AbstractPkgUpdateResultSchema = AbstractPkgResultSchema;
|
|
11772
11919
|
async function run69(context) {
|
|
@@ -12147,7 +12294,6 @@ async function run76(context) {
|
|
|
12147
12294
|
const { params, run: runTask, exec, log, info, error } = context;
|
|
12148
12295
|
let { public_key, user, sudo } = params;
|
|
12149
12296
|
const publicKeyTrimmed = public_key.trim();
|
|
12150
|
-
const sudoPrefix = sudo ? ["sudo"] : [];
|
|
12151
12297
|
if (!user) {
|
|
12152
12298
|
const usernameResult = await runTask(get_username_default());
|
|
12153
12299
|
if (usernameResult instanceof Error) {
|
|
@@ -12201,9 +12347,7 @@ async function run76(context) {
|
|
|
12201
12347
|
);
|
|
12202
12348
|
return { success: false, changed: false };
|
|
12203
12349
|
}
|
|
12204
|
-
const
|
|
12205
|
-
checkKeyCommandParts.push("sudo", "-u", user, "grep", "-xqF", publicKeyTrimmed, authorizedKeysFile);
|
|
12206
|
-
const checkKeyCmdResult = await exec(checkKeyCommandParts);
|
|
12350
|
+
const checkKeyCmdResult = await exec(["grep", "-xqF", publicKeyTrimmed, authorizedKeysFile], { sudo });
|
|
12207
12351
|
if (checkKeyCmdResult.exitCode === 0) {
|
|
12208
12352
|
info(`SSH key already exists in ${authorizedKeysFile} for user ${user}.`);
|
|
12209
12353
|
return { success: true, changed: false };
|
|
@@ -12213,7 +12357,7 @@ async function run76(context) {
|
|
|
12213
12357
|
}
|
|
12214
12358
|
const escapedPublicKey = publicKeyTrimmed.replace(/"/g, '\\"').replace(/\$/g, "\\$").replace(/`/g, "\\`");
|
|
12215
12359
|
const command = `echo "${escapedPublicKey}" >> "${authorizedKeysFile}"`;
|
|
12216
|
-
const addKeyResult = await exec([
|
|
12360
|
+
const addKeyResult = await exec(["sh", "-c", command], { sudo });
|
|
12217
12361
|
if (!addKeyResult.success) {
|
|
12218
12362
|
error(`Failed to append public key to ${authorizedKeysFile}: ${addKeyResult.stderr}`);
|
|
12219
12363
|
return { success: false, changed: false };
|
|
@@ -12511,7 +12655,7 @@ async function bootstrapServiceAccount(context) {
|
|
|
12511
12655
|
create_home = true,
|
|
12512
12656
|
create_group = true,
|
|
12513
12657
|
system = false,
|
|
12514
|
-
skip_packages =
|
|
12658
|
+
skip_packages = true
|
|
12515
12659
|
} = params;
|
|
12516
12660
|
const skipPackages = typeof skip_packages === "string" ? skip_packages === "true" : Boolean(skip_packages);
|
|
12517
12661
|
if (!username || !password || !public_key) {
|
|
@@ -12764,7 +12908,6 @@ __export(pkg_exports, {
|
|
|
12764
12908
|
removeCp: () => remove_cp_default,
|
|
12765
12909
|
search: () => search_default5,
|
|
12766
12910
|
update: () => update_default5,
|
|
12767
|
-
updateCp: () => update_cp_default,
|
|
12768
12911
|
upgrade: () => upgrade_default5,
|
|
12769
12912
|
yum: () => yum_exports
|
|
12770
12913
|
});
|
|
@@ -13275,94 +13418,6 @@ var remove_default = task(run90, {
|
|
|
13275
13418
|
// src/core/pkg/remove-cp.ts
|
|
13276
13419
|
var remove_cp_default = remove_default;
|
|
13277
13420
|
|
|
13278
|
-
// src/core/pkg/update/arch.ts
|
|
13279
|
-
async function run91(context) {
|
|
13280
|
-
const {
|
|
13281
|
-
params: { package: pkg, sudo = true },
|
|
13282
|
-
exec
|
|
13283
|
-
} = context;
|
|
13284
|
-
const commandParts = [sudo ? "sudo" : "", "pacman", "-Syu", "--noconfirm"];
|
|
13285
|
-
if (pkg && Array.isArray(pkg) && pkg.length) {
|
|
13286
|
-
commandParts.push(...pkg);
|
|
13287
|
-
}
|
|
13288
|
-
const { success } = await exec(commandParts.filter(Boolean).join(" "), { sudo });
|
|
13289
|
-
return { success };
|
|
13290
|
-
}
|
|
13291
|
-
var update = task(run91);
|
|
13292
|
-
|
|
13293
|
-
// src/core/pkg/update/debian.ts
|
|
13294
|
-
async function run92(context) {
|
|
13295
|
-
const {
|
|
13296
|
-
params: { package: pkg, sudo = true, fullUpgrade = false },
|
|
13297
|
-
exec
|
|
13298
|
-
} = context;
|
|
13299
|
-
const prefix = sudo ? "sudo " : "";
|
|
13300
|
-
if (!pkg || Array.isArray(pkg) && pkg.length === 0) {
|
|
13301
|
-
const upgradeCmd = fullUpgrade ? "apt-get dist-upgrade -y" : "apt-get upgrade -y";
|
|
13302
|
-
const { success: u1 } = await exec(`${prefix}apt-get update`, { sudo });
|
|
13303
|
-
if (!u1) return { success: false };
|
|
13304
|
-
const { success: success2 } = await exec(prefix + upgradeCmd, { sudo });
|
|
13305
|
-
return { success: success2 };
|
|
13306
|
-
}
|
|
13307
|
-
const packages = Array.isArray(pkg) ? pkg : [pkg];
|
|
13308
|
-
const { success } = await exec(`${prefix}apt-get install -y --only-upgrade ${packages.join(" ")}`, { sudo });
|
|
13309
|
-
return { success };
|
|
13310
|
-
}
|
|
13311
|
-
var update2 = task(run92);
|
|
13312
|
-
|
|
13313
|
-
// src/core/pkg/update/fedora.ts
|
|
13314
|
-
async function run93(context) {
|
|
13315
|
-
const {
|
|
13316
|
-
params: { package: pkg, sudo = true },
|
|
13317
|
-
exec
|
|
13318
|
-
} = context;
|
|
13319
|
-
const prefix = sudo ? "sudo " : "";
|
|
13320
|
-
if (!pkg || Array.isArray(pkg) && pkg.length === 0) {
|
|
13321
|
-
const { success: success2 } = await exec(`${prefix}dnf upgrade -y`, { sudo });
|
|
13322
|
-
return { success: success2 };
|
|
13323
|
-
}
|
|
13324
|
-
const packages = Array.isArray(pkg) ? pkg : [pkg];
|
|
13325
|
-
const { success } = await exec(`${prefix}dnf upgrade -y ${packages.join(" ")}`, { sudo });
|
|
13326
|
-
return { success };
|
|
13327
|
-
}
|
|
13328
|
-
var update3 = task(run93);
|
|
13329
|
-
|
|
13330
|
-
// src/core/pkg/update/index.ts
|
|
13331
|
-
async function run94(context) {
|
|
13332
|
-
const { params: taskParams, run: runTask, error } = context;
|
|
13333
|
-
const osDetails = await runTask(os_default());
|
|
13334
|
-
if (osDetails instanceof Error) {
|
|
13335
|
-
error(`Failed to determine OS details: ${osDetails.message}`);
|
|
13336
|
-
return { success: false };
|
|
13337
|
-
}
|
|
13338
|
-
const baseOs = String(osDetails?.os ?? "");
|
|
13339
|
-
let result;
|
|
13340
|
-
if (/arch/.test(baseOs)) {
|
|
13341
|
-
result = await runTask(update(taskParams));
|
|
13342
|
-
} else if (/debian|ubuntu/.test(baseOs)) {
|
|
13343
|
-
result = await runTask(update2(taskParams));
|
|
13344
|
-
} else if (baseOs === "fedora") {
|
|
13345
|
-
result = await runTask(update3(taskParams));
|
|
13346
|
-
} else {
|
|
13347
|
-
error(`Unsupported OS (${baseOs}) for pkg.update`);
|
|
13348
|
-
return { success: false };
|
|
13349
|
-
}
|
|
13350
|
-
if (result instanceof Error) {
|
|
13351
|
-
error(`pkg.update failed: ${result.message}`);
|
|
13352
|
-
return { success: false };
|
|
13353
|
-
}
|
|
13354
|
-
return result;
|
|
13355
|
-
}
|
|
13356
|
-
var update_default6 = task(run94, {
|
|
13357
|
-
name: "update",
|
|
13358
|
-
description: "Updates packages using the appropriate OS package manager.",
|
|
13359
|
-
inputSchema: PkgUpdateParamsSchema,
|
|
13360
|
-
outputSchema: PkgUpdateResultSchema
|
|
13361
|
-
});
|
|
13362
|
-
|
|
13363
|
-
// src/core/pkg/update-cp.ts
|
|
13364
|
-
var update_cp_default = update_default6;
|
|
13365
|
-
|
|
13366
13421
|
// src/core/pkg/search.ts
|
|
13367
13422
|
var AbstractPkgSearchParamsSchema = z.object({
|
|
13368
13423
|
/** Search query */
|
|
@@ -13371,13 +13426,13 @@ var AbstractPkgSearchParamsSchema = z.object({
|
|
|
13371
13426
|
packageManager: z.string().optional()
|
|
13372
13427
|
});
|
|
13373
13428
|
var AbstractPkgSearchResultSchema = AbstractPkgResultSchema;
|
|
13374
|
-
async function
|
|
13429
|
+
async function run91(context) {
|
|
13375
13430
|
const result = await abstractSearch(context);
|
|
13376
13431
|
return {
|
|
13377
13432
|
...result
|
|
13378
13433
|
};
|
|
13379
13434
|
}
|
|
13380
|
-
var search_default5 = task(
|
|
13435
|
+
var search_default5 = task(run91, {
|
|
13381
13436
|
description: "Search for packages using auto-detected or specified package manager",
|
|
13382
13437
|
inputSchema: AbstractPkgSearchParamsSchema,
|
|
13383
13438
|
outputSchema: AbstractPkgSearchResultSchema
|
|
@@ -13389,10 +13444,10 @@ var AbstractPkgListParamsSchema = z.object({
|
|
|
13389
13444
|
packageManager: z.string().optional()
|
|
13390
13445
|
});
|
|
13391
13446
|
var AbstractPkgListResultSchema = AbstractPkgResultSchema;
|
|
13392
|
-
async function
|
|
13447
|
+
async function run92(context) {
|
|
13393
13448
|
return await abstractList(context);
|
|
13394
13449
|
}
|
|
13395
|
-
var list_default7 = task(
|
|
13450
|
+
var list_default7 = task(run92, {
|
|
13396
13451
|
description: "List installed packages using auto-detected or specified package manager",
|
|
13397
13452
|
inputSchema: AbstractPkgListParamsSchema,
|
|
13398
13453
|
outputSchema: AbstractPkgListResultSchema
|
|
@@ -13404,10 +13459,10 @@ var AbstractPkgCleanParamsSchema = AbstractPkgParamsSchema.pick({
|
|
|
13404
13459
|
sudo: true
|
|
13405
13460
|
});
|
|
13406
13461
|
var AbstractPkgCleanResultSchema = AbstractPkgResultSchema;
|
|
13407
|
-
async function
|
|
13462
|
+
async function run93(context) {
|
|
13408
13463
|
return await abstractClean(context);
|
|
13409
13464
|
}
|
|
13410
|
-
var clean_default5 = task(
|
|
13465
|
+
var clean_default5 = task(run93, {
|
|
13411
13466
|
description: "Clean package cache using auto-detected or specified package manager",
|
|
13412
13467
|
inputSchema: AbstractPkgCleanParamsSchema,
|
|
13413
13468
|
outputSchema: AbstractPkgCleanResultSchema
|
|
@@ -13461,7 +13516,7 @@ var K3supInstallOutputSchema = z.object({
|
|
|
13461
13516
|
/** The command that would be run if --print-command was used */
|
|
13462
13517
|
executedCommand: z.string().optional()
|
|
13463
13518
|
});
|
|
13464
|
-
async function
|
|
13519
|
+
async function run94(context) {
|
|
13465
13520
|
const { params, exec, log, error, debug } = context;
|
|
13466
13521
|
const k3supCmd = ["k3sup", "install"];
|
|
13467
13522
|
const addFlag = (flag, condition) => {
|
|
@@ -13519,7 +13574,7 @@ async function run98(context) {
|
|
|
13519
13574
|
throw e;
|
|
13520
13575
|
}
|
|
13521
13576
|
}
|
|
13522
|
-
var k3sup_install_default = task(
|
|
13577
|
+
var k3sup_install_default = task(run94, {
|
|
13523
13578
|
name: "k3sup-install",
|
|
13524
13579
|
description: "K3s k3sup-install.",
|
|
13525
13580
|
inputSchema: K3supInstallInputSchema,
|
|
@@ -14283,7 +14338,7 @@ var AddUsersOutputSchema = z.object({
|
|
|
14283
14338
|
error: z.string().optional()
|
|
14284
14339
|
})
|
|
14285
14340
|
);
|
|
14286
|
-
async function
|
|
14341
|
+
async function run95(context) {
|
|
14287
14342
|
const { params, info, warn, error, run: runTask } = context;
|
|
14288
14343
|
const { users } = params;
|
|
14289
14344
|
if (!users || users.length === 0) {
|
|
@@ -14316,7 +14371,7 @@ async function run99(context) {
|
|
|
14316
14371
|
return { success: false, error: message };
|
|
14317
14372
|
}
|
|
14318
14373
|
}
|
|
14319
|
-
var add_users_default = task(
|
|
14374
|
+
var add_users_default = task(run95, {
|
|
14320
14375
|
description: "Adds one or more users to the docker group.",
|
|
14321
14376
|
inputSchema: AddUsersInputSchema,
|
|
14322
14377
|
outputSchema: AddUsersOutputSchema
|
|
@@ -14336,7 +14391,7 @@ var InstallComposeOutputSchema = z.object({
|
|
|
14336
14391
|
error: z.string().optional()
|
|
14337
14392
|
})
|
|
14338
14393
|
);
|
|
14339
|
-
async function
|
|
14394
|
+
async function run96(context) {
|
|
14340
14395
|
const { params, info, error, run: runTask } = context;
|
|
14341
14396
|
const version2 = params.version ?? "v2.24.5";
|
|
14342
14397
|
const composePath = params.path ?? "/usr/local/bin/docker-compose";
|
|
@@ -14374,7 +14429,7 @@ async function run100(context) {
|
|
|
14374
14429
|
return { success: false, error: message };
|
|
14375
14430
|
}
|
|
14376
14431
|
}
|
|
14377
|
-
var install_compose_default = task(
|
|
14432
|
+
var install_compose_default = task(run96, {
|
|
14378
14433
|
description: "Installs the Docker Compose standalone binary.",
|
|
14379
14434
|
inputSchema: InstallComposeInputSchema,
|
|
14380
14435
|
outputSchema: InstallComposeOutputSchema
|
|
@@ -14397,7 +14452,7 @@ var DockerInstallOutputSchema = z.object({
|
|
|
14397
14452
|
error: z.string().optional()
|
|
14398
14453
|
})
|
|
14399
14454
|
);
|
|
14400
|
-
async function
|
|
14455
|
+
async function run97(context) {
|
|
14401
14456
|
const { info, run: runTask, params, error: logError2 } = context;
|
|
14402
14457
|
const installComposePlugin = params.install_compose_plugin !== false;
|
|
14403
14458
|
const installComposeStandalone = params.install_compose_standalone === true;
|
|
@@ -14636,7 +14691,7 @@ function sanitizeSystemctlState(value) {
|
|
|
14636
14691
|
}
|
|
14637
14692
|
return value.replace(/\u001b\][^\u001b]*\u001b\\/g, "").replace(/\u001b\[[0-9;?]*[ -/]*[@-~]/g, "").trim().toLowerCase();
|
|
14638
14693
|
}
|
|
14639
|
-
var install_default6 = task(
|
|
14694
|
+
var install_default6 = task(run97, {
|
|
14640
14695
|
name: "install",
|
|
14641
14696
|
description: "Installs and configures Docker, Docker Compose, and group membership.",
|
|
14642
14697
|
inputSchema: DockerInstallInputSchema,
|
|
@@ -14785,7 +14840,7 @@ var DockerRunContainerOutputSchema = z.object({
|
|
|
14785
14840
|
containerName: z.string().optional(),
|
|
14786
14841
|
error: z.string().optional()
|
|
14787
14842
|
});
|
|
14788
|
-
async function
|
|
14843
|
+
async function run98(context) {
|
|
14789
14844
|
const { params, exec, info, error: logError2 } = context;
|
|
14790
14845
|
if (!params.image) {
|
|
14791
14846
|
const message = "Docker image is required.";
|
|
@@ -14826,7 +14881,7 @@ async function run102(context) {
|
|
|
14826
14881
|
containerName: params.name
|
|
14827
14882
|
};
|
|
14828
14883
|
}
|
|
14829
|
-
var run_container_default = task(
|
|
14884
|
+
var run_container_default = task(run98, {
|
|
14830
14885
|
description: "Runs a Docker container and returns its output (attached).",
|
|
14831
14886
|
inputSchema: DockerRunContainerInputSchema,
|
|
14832
14887
|
outputSchema: DockerRunContainerOutputSchema
|
|
@@ -14843,7 +14898,7 @@ var DockerRunDetachedOutputSchema = z.object({
|
|
|
14843
14898
|
containerName: z.string().optional(),
|
|
14844
14899
|
error: z.string().optional()
|
|
14845
14900
|
});
|
|
14846
|
-
async function
|
|
14901
|
+
async function run99(context) {
|
|
14847
14902
|
const { params, exec, info, error: logError2 } = context;
|
|
14848
14903
|
if (!params.image) {
|
|
14849
14904
|
const message = "Docker image is required.";
|
|
@@ -14883,7 +14938,7 @@ async function run103(context) {
|
|
|
14883
14938
|
containerName: params.name
|
|
14884
14939
|
};
|
|
14885
14940
|
}
|
|
14886
|
-
var run_container_detached_default = task(
|
|
14941
|
+
var run_container_detached_default = task(run99, {
|
|
14887
14942
|
description: "Runs a Docker container in detached mode and returns its metadata.",
|
|
14888
14943
|
inputSchema: DockerRunDetachedInputSchema,
|
|
14889
14944
|
outputSchema: DockerRunDetachedOutputSchema
|
|
@@ -14942,7 +14997,7 @@ var ProcessListOutputSchema = z.object({
|
|
|
14942
14997
|
error: z.string().optional()
|
|
14943
14998
|
})
|
|
14944
14999
|
);
|
|
14945
|
-
async function
|
|
15000
|
+
async function run100(context) {
|
|
14946
15001
|
const { params, exec, debug, error } = context;
|
|
14947
15002
|
const { user, command, limit, sort, reverse } = params;
|
|
14948
15003
|
try {
|
|
@@ -15028,7 +15083,7 @@ async function run104(context) {
|
|
|
15028
15083
|
return { success: false, error: errorMsg };
|
|
15029
15084
|
}
|
|
15030
15085
|
}
|
|
15031
|
-
var list_default8 = task(
|
|
15086
|
+
var list_default8 = task(run100, {
|
|
15032
15087
|
name: "list",
|
|
15033
15088
|
description: "Lists processes on the system.",
|
|
15034
15089
|
inputSchema: ProcessListInputSchema,
|
|
@@ -15074,7 +15129,7 @@ var ProcessSearchOutputSchema = z.object({
|
|
|
15074
15129
|
error: z.string().optional()
|
|
15075
15130
|
})
|
|
15076
15131
|
);
|
|
15077
|
-
async function
|
|
15132
|
+
async function run101(context) {
|
|
15078
15133
|
const { params, exec, debug, error } = context;
|
|
15079
15134
|
const { name, user, pid, ppid, args, state, regex = false, ignoreCase = false, limit } = params;
|
|
15080
15135
|
debug(`Searching processes with params: ${JSON.stringify(params)}`);
|
|
@@ -15188,7 +15243,7 @@ function filterProcesses(processes, filters) {
|
|
|
15188
15243
|
return true;
|
|
15189
15244
|
});
|
|
15190
15245
|
}
|
|
15191
|
-
var search_default6 = task(
|
|
15246
|
+
var search_default6 = task(run101, {
|
|
15192
15247
|
name: "search",
|
|
15193
15248
|
description: "Search for processes matching specified criteria.",
|
|
15194
15249
|
inputSchema: ProcessSearchInputSchema,
|
|
@@ -15216,7 +15271,7 @@ var ProcessKillOutputSchema = z.object({
|
|
|
15216
15271
|
error: z.string().optional()
|
|
15217
15272
|
})
|
|
15218
15273
|
);
|
|
15219
|
-
async function
|
|
15274
|
+
async function run102(context) {
|
|
15220
15275
|
const { params, exec, debug, error } = context;
|
|
15221
15276
|
const { pid, user, command, signal = "TERM", force = false, sudo = false } = params;
|
|
15222
15277
|
try {
|
|
@@ -15304,7 +15359,7 @@ async function run106(context) {
|
|
|
15304
15359
|
return { success: false, error: errorMsg };
|
|
15305
15360
|
}
|
|
15306
15361
|
}
|
|
15307
|
-
var kill_default = task(
|
|
15362
|
+
var kill_default = task(run102, {
|
|
15308
15363
|
name: "kill",
|
|
15309
15364
|
description: "Kills processes matching specified criteria. Requires at least one filtering parameter (pid, user, or command) to prevent accidental killing of all processes.",
|
|
15310
15365
|
inputSchema: ProcessKillInputSchema,
|
|
@@ -15325,7 +15380,7 @@ var ProcessSignalOutputSchema = z.object({
|
|
|
15325
15380
|
error: z.string().optional()
|
|
15326
15381
|
})
|
|
15327
15382
|
);
|
|
15328
|
-
async function
|
|
15383
|
+
async function run103(context) {
|
|
15329
15384
|
const { params, exec, debug, error } = context;
|
|
15330
15385
|
const { pid, signal = "TERM", sudo = false } = params;
|
|
15331
15386
|
if (!pid || pid <= 0) {
|
|
@@ -15348,7 +15403,7 @@ async function run107(context) {
|
|
|
15348
15403
|
return { success: false, error: errorMsg };
|
|
15349
15404
|
}
|
|
15350
15405
|
}
|
|
15351
|
-
var signal_default = task(
|
|
15406
|
+
var signal_default = task(run103, {
|
|
15352
15407
|
name: "signal",
|
|
15353
15408
|
description: "Sends a signal to a process.",
|
|
15354
15409
|
inputSchema: ProcessSignalInputSchema,
|
|
@@ -15384,7 +15439,7 @@ var ProcessInfoOutputSchema = z.object({
|
|
|
15384
15439
|
error: z.string().optional()
|
|
15385
15440
|
})
|
|
15386
15441
|
);
|
|
15387
|
-
async function
|
|
15442
|
+
async function run104(context) {
|
|
15388
15443
|
const { params, exec, debug, error } = context;
|
|
15389
15444
|
const { pid } = params;
|
|
15390
15445
|
if (!pid || pid <= 0) {
|
|
@@ -15460,7 +15515,7 @@ async function run108(context) {
|
|
|
15460
15515
|
return { success: false, error: errorMsg };
|
|
15461
15516
|
}
|
|
15462
15517
|
}
|
|
15463
|
-
var info_default7 = task(
|
|
15518
|
+
var info_default7 = task(run104, {
|
|
15464
15519
|
name: "info",
|
|
15465
15520
|
description: "Gets detailed information about a specific process.",
|
|
15466
15521
|
inputSchema: ProcessInfoInputSchema,
|
|
@@ -15524,7 +15579,7 @@ var ProcessTopOutputSchema = z.object({
|
|
|
15524
15579
|
timestamp: z.string()
|
|
15525
15580
|
})
|
|
15526
15581
|
);
|
|
15527
|
-
async function
|
|
15582
|
+
async function run105(context) {
|
|
15528
15583
|
const { params, exec, debug, error } = context;
|
|
15529
15584
|
const {
|
|
15530
15585
|
limit = 10,
|
|
@@ -15686,7 +15741,7 @@ function sortProcesses(processes, sort) {
|
|
|
15686
15741
|
}
|
|
15687
15742
|
});
|
|
15688
15743
|
}
|
|
15689
|
-
var top_default = task(
|
|
15744
|
+
var top_default = task(run105, {
|
|
15690
15745
|
name: "top",
|
|
15691
15746
|
description: "Get top processes with system information.",
|
|
15692
15747
|
inputSchema: ProcessTopInputSchema,
|
|
@@ -15750,7 +15805,7 @@ var ProcessStatsOutputSchema = z.object({
|
|
|
15750
15805
|
timestamp: z.string()
|
|
15751
15806
|
})
|
|
15752
15807
|
);
|
|
15753
|
-
async function
|
|
15808
|
+
async function run106(context) {
|
|
15754
15809
|
const { params, exec, debug, error } = context;
|
|
15755
15810
|
const { includeUsers = true, includeStates = true, includeCommands = false, commandLimit = 10 } = params;
|
|
15756
15811
|
debug(`Getting process statistics with params: ${JSON.stringify(params)}`);
|
|
@@ -15928,7 +15983,7 @@ function calculateCommandStats(processes, limit) {
|
|
|
15928
15983
|
}
|
|
15929
15984
|
return Array.from(commandMap.values()).sort((a, b) => b.cpu - a.cpu).slice(0, limit);
|
|
15930
15985
|
}
|
|
15931
|
-
var stats_default = task(
|
|
15986
|
+
var stats_default = task(run106, {
|
|
15932
15987
|
name: "stats",
|
|
15933
15988
|
description: "Get system-wide process statistics.",
|
|
15934
15989
|
inputSchema: ProcessStatsInputSchema,
|
|
@@ -15963,7 +16018,7 @@ var ProcessChildrenOutputSchema = z.object({
|
|
|
15963
16018
|
error: z.string().optional()
|
|
15964
16019
|
})
|
|
15965
16020
|
);
|
|
15966
|
-
async function
|
|
16021
|
+
async function run107(context) {
|
|
15967
16022
|
const { params, exec, debug, error } = context;
|
|
15968
16023
|
const { pid, recursive = false, maxDepth } = params;
|
|
15969
16024
|
debug(`Getting children for process ${pid} with params: ${JSON.stringify(params)}`);
|
|
@@ -16048,7 +16103,7 @@ async function getDescendants(exec, parentPid, currentDepth, maxDepth) {
|
|
|
16048
16103
|
}
|
|
16049
16104
|
return allDescendants;
|
|
16050
16105
|
}
|
|
16051
|
-
var children_default = task(
|
|
16106
|
+
var children_default = task(run107, {
|
|
16052
16107
|
name: "children",
|
|
16053
16108
|
description: "Get child processes of a given PID.",
|
|
16054
16109
|
inputSchema: ProcessChildrenInputSchema,
|
|
@@ -16081,7 +16136,7 @@ var RebootOutputSchema = z.object({
|
|
|
16081
16136
|
error: z.string().optional(),
|
|
16082
16137
|
status: z.string()
|
|
16083
16138
|
});
|
|
16084
|
-
async function
|
|
16139
|
+
async function run108(context) {
|
|
16085
16140
|
const { params, info, warn, exec } = context;
|
|
16086
16141
|
const time = params.time || "now";
|
|
16087
16142
|
const sudo = params.sudo ?? true;
|
|
@@ -16114,7 +16169,7 @@ stderr: ${stderr}`
|
|
|
16114
16169
|
};
|
|
16115
16170
|
}
|
|
16116
16171
|
}
|
|
16117
|
-
var reboot_default = task(
|
|
16172
|
+
var reboot_default = task(run108, {
|
|
16118
16173
|
description: "Reboots a system",
|
|
16119
16174
|
inputSchema: RebootInputSchema,
|
|
16120
16175
|
outputSchema: RebootOutputSchema
|
|
@@ -16134,7 +16189,7 @@ var ShutdownOutputSchema = z.object({
|
|
|
16134
16189
|
error: z.string().optional(),
|
|
16135
16190
|
status: z.string()
|
|
16136
16191
|
});
|
|
16137
|
-
async function
|
|
16192
|
+
async function run109(context) {
|
|
16138
16193
|
const { params, info, warn, exec } = context;
|
|
16139
16194
|
const time = params.time || "now";
|
|
16140
16195
|
const sudo = params.sudo ?? true;
|
|
@@ -16166,7 +16221,7 @@ stderr: ${stderr}`
|
|
|
16166
16221
|
};
|
|
16167
16222
|
}
|
|
16168
16223
|
}
|
|
16169
|
-
var shutdown_default = task(
|
|
16224
|
+
var shutdown_default = task(run109, {
|
|
16170
16225
|
description: "Shuts down a system",
|
|
16171
16226
|
inputSchema: ShutdownInputSchema,
|
|
16172
16227
|
outputSchema: ShutdownOutputSchema
|
|
@@ -16187,7 +16242,7 @@ var RebootIfNeededOutputSchema = z.object({
|
|
|
16187
16242
|
error: z.string().optional()
|
|
16188
16243
|
})
|
|
16189
16244
|
);
|
|
16190
|
-
async function
|
|
16245
|
+
async function run110(context) {
|
|
16191
16246
|
const { params, run: runTask, exec, error, info, warn } = context;
|
|
16192
16247
|
const delayInSeconds = Math.max(1, params.delay ?? 1);
|
|
16193
16248
|
const message = params.message ?? "Reboot is required. Initiating reboot sequence.";
|
|
@@ -16217,7 +16272,7 @@ ${stderr}`;
|
|
|
16217
16272
|
}
|
|
16218
16273
|
return { rebooting: true, success: true };
|
|
16219
16274
|
}
|
|
16220
|
-
var reboot_if_needed_default = task(
|
|
16275
|
+
var reboot_if_needed_default = task(run110, {
|
|
16221
16276
|
name: "reboot_if_needed",
|
|
16222
16277
|
description: "Reboot if needed.",
|
|
16223
16278
|
inputSchema: RebootIfNeededInputSchema,
|
|
@@ -16234,7 +16289,7 @@ var SystemUptimeOutputSchema = z.object({
|
|
|
16234
16289
|
days: z.number().optional(),
|
|
16235
16290
|
error: z.string().optional()
|
|
16236
16291
|
});
|
|
16237
|
-
async function
|
|
16292
|
+
async function run111(context) {
|
|
16238
16293
|
const { params, exec, error } = context;
|
|
16239
16294
|
const sudo = params.sudo ?? false;
|
|
16240
16295
|
const { success, stdout, stderr } = await exec(["cat", "/proc/uptime"], { sudo });
|
|
@@ -16253,7 +16308,7 @@ async function run115(context) {
|
|
|
16253
16308
|
days: Math.floor(uptimeSeconds / 86400)
|
|
16254
16309
|
};
|
|
16255
16310
|
}
|
|
16256
|
-
var uptime_default = task(
|
|
16311
|
+
var uptime_default = task(run111, {
|
|
16257
16312
|
name: "uptime",
|
|
16258
16313
|
description: "Report system uptime.",
|
|
16259
16314
|
inputSchema: SystemUptimeInputSchema,
|
|
@@ -16278,7 +16333,7 @@ var SystemDatetimeOutputSchema = z.object({
|
|
|
16278
16333
|
error: z.string().optional()
|
|
16279
16334
|
})
|
|
16280
16335
|
);
|
|
16281
|
-
async function
|
|
16336
|
+
async function run112(context) {
|
|
16282
16337
|
const { params, exec } = context;
|
|
16283
16338
|
const sudo = params.sudo ?? false;
|
|
16284
16339
|
const isoResult = await exec(["date", "--iso-8601=seconds"], { sudo }).catch((error) => error);
|
|
@@ -16299,7 +16354,7 @@ async function run116(context) {
|
|
|
16299
16354
|
timezone
|
|
16300
16355
|
};
|
|
16301
16356
|
}
|
|
16302
|
-
var datetime_default = task(
|
|
16357
|
+
var datetime_default = task(run112, {
|
|
16303
16358
|
name: "datetime",
|
|
16304
16359
|
description: "Report system time and timezone.",
|
|
16305
16360
|
inputSchema: SystemDatetimeInputSchema,
|
|
@@ -16326,7 +16381,7 @@ var SystemHardwareOutputSchema = z.object({
|
|
|
16326
16381
|
error: z.string().optional()
|
|
16327
16382
|
})
|
|
16328
16383
|
);
|
|
16329
|
-
async function
|
|
16384
|
+
async function run113(context) {
|
|
16330
16385
|
const { params, exec } = context;
|
|
16331
16386
|
const sudo = params.sudo ?? false;
|
|
16332
16387
|
const archResult = await exec(["uname", "-m"], { sudo }).catch((error) => error);
|
|
@@ -16353,7 +16408,7 @@ async function run117(context) {
|
|
|
16353
16408
|
memTotalKb: Number.isFinite(memTotalKb ?? NaN) ? memTotalKb : void 0
|
|
16354
16409
|
};
|
|
16355
16410
|
}
|
|
16356
|
-
var hardware_default = task(
|
|
16411
|
+
var hardware_default = task(run113, {
|
|
16357
16412
|
name: "hardware",
|
|
16358
16413
|
description: "Report CPU and memory details.",
|
|
16359
16414
|
inputSchema: SystemHardwareInputSchema,
|
|
@@ -16385,7 +16440,7 @@ var SystemdDisableOutputSchema = z.object({
|
|
|
16385
16440
|
error: z.string().optional()
|
|
16386
16441
|
})
|
|
16387
16442
|
);
|
|
16388
|
-
async function
|
|
16443
|
+
async function run114(context) {
|
|
16389
16444
|
const { params, exec, error } = context;
|
|
16390
16445
|
const { service, sudo = false } = params;
|
|
16391
16446
|
if (!service) {
|
|
@@ -16408,7 +16463,7 @@ async function run118(context) {
|
|
|
16408
16463
|
};
|
|
16409
16464
|
}
|
|
16410
16465
|
}
|
|
16411
|
-
var disable_default = task(
|
|
16466
|
+
var disable_default = task(run114, {
|
|
16412
16467
|
name: "disable",
|
|
16413
16468
|
description: "Systemd disable.",
|
|
16414
16469
|
inputSchema: SystemdDisableInputSchema,
|
|
@@ -16428,7 +16483,7 @@ var SystemdEnableOutputSchema = z.object({
|
|
|
16428
16483
|
error: z.string().optional()
|
|
16429
16484
|
})
|
|
16430
16485
|
);
|
|
16431
|
-
async function
|
|
16486
|
+
async function run115(context) {
|
|
16432
16487
|
const { params, exec, error } = context;
|
|
16433
16488
|
const { service, sudo = false } = params;
|
|
16434
16489
|
if (!service) {
|
|
@@ -16451,7 +16506,7 @@ async function run119(context) {
|
|
|
16451
16506
|
};
|
|
16452
16507
|
}
|
|
16453
16508
|
}
|
|
16454
|
-
var enable_default = task(
|
|
16509
|
+
var enable_default = task(run115, {
|
|
16455
16510
|
name: "enable",
|
|
16456
16511
|
description: "Systemd enable.",
|
|
16457
16512
|
inputSchema: SystemdEnableInputSchema,
|
|
@@ -16471,7 +16526,7 @@ var SystemdRestartOutputSchema = z.object({
|
|
|
16471
16526
|
error: z.string().optional()
|
|
16472
16527
|
})
|
|
16473
16528
|
);
|
|
16474
|
-
async function
|
|
16529
|
+
async function run116(context) {
|
|
16475
16530
|
const { params, exec, error } = context;
|
|
16476
16531
|
const { service, sudo = false } = params;
|
|
16477
16532
|
if (!service) {
|
|
@@ -16498,7 +16553,7 @@ async function run120(context) {
|
|
|
16498
16553
|
};
|
|
16499
16554
|
}
|
|
16500
16555
|
}
|
|
16501
|
-
var restart_default = task(
|
|
16556
|
+
var restart_default = task(run116, {
|
|
16502
16557
|
name: "restart",
|
|
16503
16558
|
description: "Systemd restart.",
|
|
16504
16559
|
inputSchema: SystemdRestartInputSchema,
|
|
@@ -16518,7 +16573,7 @@ var SystemdStartOutputSchema = z.object({
|
|
|
16518
16573
|
error: z.string().optional()
|
|
16519
16574
|
})
|
|
16520
16575
|
);
|
|
16521
|
-
async function
|
|
16576
|
+
async function run117(context) {
|
|
16522
16577
|
const { params, exec, error } = context;
|
|
16523
16578
|
const { service, sudo = false } = params;
|
|
16524
16579
|
if (!service) {
|
|
@@ -16541,7 +16596,7 @@ async function run121(context) {
|
|
|
16541
16596
|
};
|
|
16542
16597
|
}
|
|
16543
16598
|
}
|
|
16544
|
-
var start_default = task(
|
|
16599
|
+
var start_default = task(run117, {
|
|
16545
16600
|
name: "start",
|
|
16546
16601
|
description: "Systemd start.",
|
|
16547
16602
|
inputSchema: SystemdStartInputSchema,
|
|
@@ -16561,7 +16616,7 @@ var SystemdStopOutputSchema = z.object({
|
|
|
16561
16616
|
error: z.string().optional()
|
|
16562
16617
|
})
|
|
16563
16618
|
);
|
|
16564
|
-
async function
|
|
16619
|
+
async function run118(context) {
|
|
16565
16620
|
const { params, exec, error } = context;
|
|
16566
16621
|
const { service, sudo = false } = params;
|
|
16567
16622
|
if (!service) {
|
|
@@ -16588,7 +16643,7 @@ async function run122(context) {
|
|
|
16588
16643
|
};
|
|
16589
16644
|
}
|
|
16590
16645
|
}
|
|
16591
|
-
var stop_default = task(
|
|
16646
|
+
var stop_default = task(run118, {
|
|
16592
16647
|
name: "stop",
|
|
16593
16648
|
description: "Systemd stop.",
|
|
16594
16649
|
inputSchema: SystemdStopInputSchema,
|
|
@@ -16608,7 +16663,7 @@ var SystemdReloadOutputSchema = z.object({
|
|
|
16608
16663
|
error: z.string().optional()
|
|
16609
16664
|
})
|
|
16610
16665
|
);
|
|
16611
|
-
async function
|
|
16666
|
+
async function run119(context) {
|
|
16612
16667
|
const { params, exec, error } = context;
|
|
16613
16668
|
const { service, sudo = false } = params;
|
|
16614
16669
|
if (!service) {
|
|
@@ -16629,7 +16684,7 @@ async function run123(context) {
|
|
|
16629
16684
|
};
|
|
16630
16685
|
}
|
|
16631
16686
|
}
|
|
16632
|
-
var reload_default = task(
|
|
16687
|
+
var reload_default = task(run119, {
|
|
16633
16688
|
name: "reload",
|
|
16634
16689
|
description: "Reloads a systemd service (e.g., re-reads configuration without full restart).",
|
|
16635
16690
|
inputSchema: SystemdReloadInputSchema,
|
|
@@ -16651,7 +16706,7 @@ var SystemdStatusOutputSchema = z.object({
|
|
|
16651
16706
|
error: z.string().optional()
|
|
16652
16707
|
})
|
|
16653
16708
|
);
|
|
16654
|
-
async function
|
|
16709
|
+
async function run120(context) {
|
|
16655
16710
|
const { params, exec, error } = context;
|
|
16656
16711
|
const { service, sudo = false } = params;
|
|
16657
16712
|
if (!service) {
|
|
@@ -16674,7 +16729,7 @@ async function run124(context) {
|
|
|
16674
16729
|
};
|
|
16675
16730
|
}
|
|
16676
16731
|
}
|
|
16677
|
-
var status_default = task(
|
|
16732
|
+
var status_default = task(run120, {
|
|
16678
16733
|
name: "status",
|
|
16679
16734
|
description: "Checks systemd service status.",
|
|
16680
16735
|
inputSchema: SystemdStatusInputSchema,
|
|
@@ -16704,7 +16759,7 @@ var TemplateWriteOutputSchema = z.object({
|
|
|
16704
16759
|
path: z.string()
|
|
16705
16760
|
});
|
|
16706
16761
|
async function runFn3(context) {
|
|
16707
|
-
const { params, warn, error, debug, run:
|
|
16762
|
+
const { params, warn, error, debug, run: run249, file, exec } = context;
|
|
16708
16763
|
const { template, template_file, variables, to, mode, owner, group, sudo } = params;
|
|
16709
16764
|
let templateContent = template;
|
|
16710
16765
|
if (template && template_file) {
|
|
@@ -16759,7 +16814,7 @@ EOF`;
|
|
|
16759
16814
|
debug(`Setting mode ${mode} for ${outputPath}`);
|
|
16760
16815
|
try {
|
|
16761
16816
|
const chmodParams = { path: outputPath, mode, sudo };
|
|
16762
|
-
const chmodResult = await
|
|
16817
|
+
const chmodResult = await run249(chmod_default(chmodParams));
|
|
16763
16818
|
if (chmodResult instanceof Error) {
|
|
16764
16819
|
error(`Error setting mode for ${outputPath}: ${chmodResult.message}`);
|
|
16765
16820
|
overallSuccess = false;
|
|
@@ -16785,7 +16840,7 @@ EOF`;
|
|
|
16785
16840
|
if (group) {
|
|
16786
16841
|
chownTaskParams.group = group;
|
|
16787
16842
|
}
|
|
16788
|
-
const chownResult = await
|
|
16843
|
+
const chownResult = await run249(chown_default(chownTaskParams));
|
|
16789
16844
|
if (chownResult instanceof Error) {
|
|
16790
16845
|
error(`Error setting owner/group for ${outputPath}: ${chownResult.message}`);
|
|
16791
16846
|
overallSuccess = false;
|
|
@@ -16845,7 +16900,7 @@ var UfwAllowOutputSchema = z.object({
|
|
|
16845
16900
|
error: z.string().optional()
|
|
16846
16901
|
})
|
|
16847
16902
|
);
|
|
16848
|
-
async function
|
|
16903
|
+
async function run121(context) {
|
|
16849
16904
|
const { params, exec, info } = context;
|
|
16850
16905
|
const { port, proto = "tcp", from } = params;
|
|
16851
16906
|
if (!port) {
|
|
@@ -16876,7 +16931,7 @@ async function run125(context) {
|
|
|
16876
16931
|
return { success: false, error };
|
|
16877
16932
|
}
|
|
16878
16933
|
}
|
|
16879
|
-
var allow_default = task(
|
|
16934
|
+
var allow_default = task(run121, {
|
|
16880
16935
|
description: "Allows a port through UFW firewall.",
|
|
16881
16936
|
inputSchema: UfwAllowInputSchema,
|
|
16882
16937
|
outputSchema: UfwAllowOutputSchema
|
|
@@ -16897,7 +16952,7 @@ var UfwDenyOutputSchema = z.object({
|
|
|
16897
16952
|
error: z.string().optional()
|
|
16898
16953
|
})
|
|
16899
16954
|
);
|
|
16900
|
-
async function
|
|
16955
|
+
async function run122(context) {
|
|
16901
16956
|
const { params, exec, error, info } = context;
|
|
16902
16957
|
const { port, proto = "tcp", from } = params;
|
|
16903
16958
|
if (!port) {
|
|
@@ -16928,7 +16983,7 @@ async function run126(context) {
|
|
|
16928
16983
|
};
|
|
16929
16984
|
}
|
|
16930
16985
|
}
|
|
16931
|
-
var deny_default = task(
|
|
16986
|
+
var deny_default = task(run122, {
|
|
16932
16987
|
name: "deny",
|
|
16933
16988
|
description: "Ufw deny.",
|
|
16934
16989
|
inputSchema: UfwDenyInputSchema,
|
|
@@ -16947,7 +17002,7 @@ var UfwDeleteOutputSchema = z.object({
|
|
|
16947
17002
|
error: z.string().optional()
|
|
16948
17003
|
})
|
|
16949
17004
|
);
|
|
16950
|
-
async function
|
|
17005
|
+
async function run123(context) {
|
|
16951
17006
|
const { params, exec, error } = context;
|
|
16952
17007
|
const { rule_number } = params;
|
|
16953
17008
|
if (!rule_number || rule_number <= 0) {
|
|
@@ -16969,7 +17024,7 @@ async function run127(context) {
|
|
|
16969
17024
|
};
|
|
16970
17025
|
}
|
|
16971
17026
|
}
|
|
16972
|
-
var delete_default4 = task(
|
|
17027
|
+
var delete_default4 = task(run123, {
|
|
16973
17028
|
name: "delete",
|
|
16974
17029
|
description: "Ufw delete.",
|
|
16975
17030
|
inputSchema: UfwDeleteInputSchema,
|
|
@@ -16982,7 +17037,7 @@ var UfwDisableOutputSchema = z.object({
|
|
|
16982
17037
|
success: z.boolean(),
|
|
16983
17038
|
error: z.string().optional()
|
|
16984
17039
|
});
|
|
16985
|
-
async function
|
|
17040
|
+
async function run124(context) {
|
|
16986
17041
|
const { exec, error } = context;
|
|
16987
17042
|
try {
|
|
16988
17043
|
const result = await exec(["ufw", "disable"], { sudo: true });
|
|
@@ -16998,7 +17053,7 @@ async function run128(context) {
|
|
|
16998
17053
|
return { success: false, error: errorMsg };
|
|
16999
17054
|
}
|
|
17000
17055
|
}
|
|
17001
|
-
var disable_default2 = task(
|
|
17056
|
+
var disable_default2 = task(run124, {
|
|
17002
17057
|
description: "Disables UFW firewall.",
|
|
17003
17058
|
inputSchema: UfwDisableInputSchema,
|
|
17004
17059
|
outputSchema: UfwDisableOutputSchema
|
|
@@ -17010,7 +17065,7 @@ var UfwEnableOutputSchema = z.object({
|
|
|
17010
17065
|
success: z.boolean(),
|
|
17011
17066
|
error: z.string().optional()
|
|
17012
17067
|
});
|
|
17013
|
-
async function
|
|
17068
|
+
async function run125(context) {
|
|
17014
17069
|
const { exec, error } = context;
|
|
17015
17070
|
try {
|
|
17016
17071
|
const result = await exec(["ufw", "--force", "enable"], { sudo: true });
|
|
@@ -17026,7 +17081,7 @@ async function run129(context) {
|
|
|
17026
17081
|
return { success: false, error: errorMsg };
|
|
17027
17082
|
}
|
|
17028
17083
|
}
|
|
17029
|
-
var enable_default2 = task(
|
|
17084
|
+
var enable_default2 = task(run125, {
|
|
17030
17085
|
description: "Enables UFW firewall.",
|
|
17031
17086
|
inputSchema: UfwEnableInputSchema,
|
|
17032
17087
|
outputSchema: UfwEnableOutputSchema
|
|
@@ -17042,7 +17097,7 @@ var UfwInstallOutputSchema = z.object({
|
|
|
17042
17097
|
error: z.string().optional()
|
|
17043
17098
|
})
|
|
17044
17099
|
);
|
|
17045
|
-
async function
|
|
17100
|
+
async function run126(context) {
|
|
17046
17101
|
const { run: runTask, error } = context;
|
|
17047
17102
|
try {
|
|
17048
17103
|
const installResult = await runTask(install_default5({ package: "ufw", sudo: true }));
|
|
@@ -17061,7 +17116,7 @@ async function run130(context) {
|
|
|
17061
17116
|
};
|
|
17062
17117
|
}
|
|
17063
17118
|
}
|
|
17064
|
-
var install_default7 = task(
|
|
17119
|
+
var install_default7 = task(run126, {
|
|
17065
17120
|
name: "install",
|
|
17066
17121
|
description: "Ufw install.",
|
|
17067
17122
|
inputSchema: UfwInstallInputSchema,
|
|
@@ -17081,7 +17136,7 @@ var UfwLoggingOutputSchema = z.object({
|
|
|
17081
17136
|
error: z.string().optional()
|
|
17082
17137
|
})
|
|
17083
17138
|
);
|
|
17084
|
-
async function
|
|
17139
|
+
async function run127(context) {
|
|
17085
17140
|
const { params, exec, log } = context;
|
|
17086
17141
|
const level = params.level || "on";
|
|
17087
17142
|
try {
|
|
@@ -17098,7 +17153,7 @@ async function run131(context) {
|
|
|
17098
17153
|
return { success: false, error };
|
|
17099
17154
|
}
|
|
17100
17155
|
}
|
|
17101
|
-
var logging_default = task(
|
|
17156
|
+
var logging_default = task(run127, {
|
|
17102
17157
|
description: "Configures UFW logging",
|
|
17103
17158
|
inputSchema: UfwLoggingInputSchema,
|
|
17104
17159
|
outputSchema: UfwLoggingOutputSchema
|
|
@@ -17114,7 +17169,7 @@ var UfwReloadOutputSchema = z.object({
|
|
|
17114
17169
|
error: z.string().optional()
|
|
17115
17170
|
})
|
|
17116
17171
|
);
|
|
17117
|
-
async function
|
|
17172
|
+
async function run128(context) {
|
|
17118
17173
|
const { exec, error } = context;
|
|
17119
17174
|
try {
|
|
17120
17175
|
const { success } = await exec(["sudo", "ufw", "reload"], { sudo: true });
|
|
@@ -17126,7 +17181,7 @@ async function run132(context) {
|
|
|
17126
17181
|
};
|
|
17127
17182
|
}
|
|
17128
17183
|
}
|
|
17129
|
-
var reload_default2 = task(
|
|
17184
|
+
var reload_default2 = task(run128, {
|
|
17130
17185
|
name: "reload",
|
|
17131
17186
|
description: "Ufw reload.",
|
|
17132
17187
|
inputSchema: UfwReloadInputSchema,
|
|
@@ -17144,7 +17199,7 @@ var UfwResetOutputSchema = z.object({
|
|
|
17144
17199
|
error: z.string().optional()
|
|
17145
17200
|
})
|
|
17146
17201
|
);
|
|
17147
|
-
async function
|
|
17202
|
+
async function run129(context) {
|
|
17148
17203
|
const { exec, error, info } = context;
|
|
17149
17204
|
try {
|
|
17150
17205
|
const command = ["ufw", "--force", "reset"];
|
|
@@ -17165,7 +17220,7 @@ async function run133(context) {
|
|
|
17165
17220
|
return { success: false, error: errorMsg };
|
|
17166
17221
|
}
|
|
17167
17222
|
}
|
|
17168
|
-
var reset_default = task(
|
|
17223
|
+
var reset_default = task(run129, {
|
|
17169
17224
|
name: "reset",
|
|
17170
17225
|
description: "Resets UFW firewall to default state.",
|
|
17171
17226
|
inputSchema: UfwResetInputSchema,
|
|
@@ -17188,7 +17243,7 @@ var UfwStatusOutputSchema = z.object({
|
|
|
17188
17243
|
rules: z.array(UfwRuleSchema).optional(),
|
|
17189
17244
|
error: z.string().optional()
|
|
17190
17245
|
});
|
|
17191
|
-
async function
|
|
17246
|
+
async function run130(context) {
|
|
17192
17247
|
const { exec, error } = context;
|
|
17193
17248
|
try {
|
|
17194
17249
|
const result = await exec(["ufw", "status", "numbered"], { sudo: true });
|
|
@@ -17243,7 +17298,7 @@ async function run134(context) {
|
|
|
17243
17298
|
return { success: false, error: errorMsg };
|
|
17244
17299
|
}
|
|
17245
17300
|
}
|
|
17246
|
-
var status_default2 = task(
|
|
17301
|
+
var status_default2 = task(run130, {
|
|
17247
17302
|
description: "Gets UFW firewall status with numbered rules.",
|
|
17248
17303
|
inputSchema: UfwStatusInputSchema,
|
|
17249
17304
|
outputSchema: UfwStatusOutputSchema
|
|
@@ -17282,7 +17337,7 @@ var AddGroupsOutputSchema = z.object({
|
|
|
17282
17337
|
error: z.string().optional()
|
|
17283
17338
|
})
|
|
17284
17339
|
);
|
|
17285
|
-
async function
|
|
17340
|
+
async function run131(context) {
|
|
17286
17341
|
const { params, exec } = context;
|
|
17287
17342
|
const { user, groups, sudo = true } = params;
|
|
17288
17343
|
const normalizedGroups = Array.isArray(groups) ? groups : typeof groups === "string" ? groups.split(",").map((group) => group.trim()).filter(Boolean) : [];
|
|
@@ -17297,7 +17352,7 @@ async function run135(context) {
|
|
|
17297
17352
|
error: success ? void 0 : stderr || stdout
|
|
17298
17353
|
};
|
|
17299
17354
|
}
|
|
17300
|
-
var add_groups_default = task(
|
|
17355
|
+
var add_groups_default = task(run131, {
|
|
17301
17356
|
name: "add_groups",
|
|
17302
17357
|
description: "User add groups.",
|
|
17303
17358
|
inputSchema: AddGroupsInputSchema,
|
|
@@ -17317,7 +17372,7 @@ var GetGidOutputSchema = z.object({
|
|
|
17317
17372
|
gid: z.string().optional()
|
|
17318
17373
|
})
|
|
17319
17374
|
);
|
|
17320
|
-
async function
|
|
17375
|
+
async function run132(context) {
|
|
17321
17376
|
const { params, exec } = context;
|
|
17322
17377
|
const { user } = params;
|
|
17323
17378
|
const command = ["id", "-g", user].filter(Boolean).join(" ");
|
|
@@ -17327,7 +17382,7 @@ async function run136(context) {
|
|
|
17327
17382
|
gid: gid.trim()
|
|
17328
17383
|
};
|
|
17329
17384
|
}
|
|
17330
|
-
var get_gid_default = task(
|
|
17385
|
+
var get_gid_default = task(run132, {
|
|
17331
17386
|
name: "get_gid",
|
|
17332
17387
|
description: "User get gid.",
|
|
17333
17388
|
inputSchema: GetGidInputSchema,
|
|
@@ -17347,7 +17402,7 @@ var GetGroupsOutputSchema = z.object({
|
|
|
17347
17402
|
groups: z.array(z.string()).optional()
|
|
17348
17403
|
})
|
|
17349
17404
|
);
|
|
17350
|
-
async function
|
|
17405
|
+
async function run133(context) {
|
|
17351
17406
|
const { params, exec } = context;
|
|
17352
17407
|
const { user } = params;
|
|
17353
17408
|
const command = ["groups", user].filter(Boolean).join(" ");
|
|
@@ -17364,7 +17419,7 @@ async function run137(context) {
|
|
|
17364
17419
|
groups
|
|
17365
17420
|
};
|
|
17366
17421
|
}
|
|
17367
|
-
var get_groups_default = task(
|
|
17422
|
+
var get_groups_default = task(run133, {
|
|
17368
17423
|
name: "get_groups",
|
|
17369
17424
|
description: "User get groups.",
|
|
17370
17425
|
inputSchema: GetGroupsInputSchema,
|
|
@@ -17384,7 +17439,7 @@ var GetUidOutputSchema = z.object({
|
|
|
17384
17439
|
uid: z.string().optional()
|
|
17385
17440
|
})
|
|
17386
17441
|
);
|
|
17387
|
-
async function
|
|
17442
|
+
async function run134(context) {
|
|
17388
17443
|
const { params, exec } = context;
|
|
17389
17444
|
const { user } = params;
|
|
17390
17445
|
const command = ["id", "-u", user].filter(Boolean).join(" ");
|
|
@@ -17394,7 +17449,7 @@ async function run138(context) {
|
|
|
17394
17449
|
uid: uid.trim()
|
|
17395
17450
|
};
|
|
17396
17451
|
}
|
|
17397
|
-
var get_uid_default = task(
|
|
17452
|
+
var get_uid_default = task(run134, {
|
|
17398
17453
|
name: "get_uid",
|
|
17399
17454
|
description: "User get uid.",
|
|
17400
17455
|
inputSchema: GetUidInputSchema,
|
|
@@ -17415,7 +17470,7 @@ var SetUserGroupsOutputSchema = z.object({
|
|
|
17415
17470
|
error: z.string().optional()
|
|
17416
17471
|
})
|
|
17417
17472
|
);
|
|
17418
|
-
async function
|
|
17473
|
+
async function run135(context) {
|
|
17419
17474
|
const { params, exec } = context;
|
|
17420
17475
|
const { user, groups, sudo = true } = params;
|
|
17421
17476
|
const normalizedGroups = Array.isArray(groups) ? groups : typeof groups === "string" ? groups.split(",").map((group) => group.trim()).filter(Boolean) : [];
|
|
@@ -17430,7 +17485,7 @@ async function run139(context) {
|
|
|
17430
17485
|
error: success ? void 0 : stderr || stdout
|
|
17431
17486
|
};
|
|
17432
17487
|
}
|
|
17433
|
-
var set_groups_default = task(
|
|
17488
|
+
var set_groups_default = task(run135, {
|
|
17434
17489
|
name: "set_groups",
|
|
17435
17490
|
description: "User set groups.",
|
|
17436
17491
|
inputSchema: SetUserGroupsInputSchema,
|
|
@@ -17451,7 +17506,7 @@ var SetUserShellOutputSchema = z.object({
|
|
|
17451
17506
|
error: z.string().optional()
|
|
17452
17507
|
})
|
|
17453
17508
|
);
|
|
17454
|
-
async function
|
|
17509
|
+
async function run136(context) {
|
|
17455
17510
|
const { params, exec } = context;
|
|
17456
17511
|
const { user, shell, sudo = true } = params;
|
|
17457
17512
|
const command = [sudo ? "sudo" : "", "usermod", "-s", shell, user].filter(Boolean).join(" ");
|
|
@@ -17461,7 +17516,7 @@ async function run140(context) {
|
|
|
17461
17516
|
error: success ? void 0 : stderr || stdout
|
|
17462
17517
|
};
|
|
17463
17518
|
}
|
|
17464
|
-
var set_shell_default = task(
|
|
17519
|
+
var set_shell_default = task(run136, {
|
|
17465
17520
|
name: "set_shell",
|
|
17466
17521
|
description: "User set shell.",
|
|
17467
17522
|
inputSchema: SetUserShellInputSchema,
|
|
@@ -17480,8 +17535,8 @@ var UserDeleteOutputSchema = z.object({
|
|
|
17480
17535
|
success: z.boolean(),
|
|
17481
17536
|
error: z.string().optional()
|
|
17482
17537
|
});
|
|
17483
|
-
async function
|
|
17484
|
-
const { params, debug, exec, run:
|
|
17538
|
+
async function run137(context) {
|
|
17539
|
+
const { params, debug, exec, run: run249, error } = context;
|
|
17485
17540
|
const { user, remove: remove4 = false, sudo = true } = params;
|
|
17486
17541
|
if (!user) {
|
|
17487
17542
|
error('Required parameter "user" is missing');
|
|
@@ -17491,7 +17546,7 @@ async function run141(context) {
|
|
|
17491
17546
|
};
|
|
17492
17547
|
}
|
|
17493
17548
|
try {
|
|
17494
|
-
const { exists: userExists } = await
|
|
17549
|
+
const { exists: userExists } = await run249(exists_default4({ user }));
|
|
17495
17550
|
if (!userExists) {
|
|
17496
17551
|
debug(`User '${user}' does not exist, considering task successful (idempotent).`);
|
|
17497
17552
|
return { success: true };
|
|
@@ -17519,7 +17574,7 @@ async function run141(context) {
|
|
|
17519
17574
|
};
|
|
17520
17575
|
}
|
|
17521
17576
|
}
|
|
17522
|
-
var delete_default5 = task(
|
|
17577
|
+
var delete_default5 = task(run137, {
|
|
17523
17578
|
description: "Deletes a user from the system idempotently",
|
|
17524
17579
|
inputSchema: UserDeleteInputSchema,
|
|
17525
17580
|
outputSchema: UserDeleteOutputSchema
|
|
@@ -17549,7 +17604,7 @@ var ModifyUserOutputSchema = z.object({
|
|
|
17549
17604
|
error: z.string().optional()
|
|
17550
17605
|
})
|
|
17551
17606
|
);
|
|
17552
|
-
async function
|
|
17607
|
+
async function run138(context) {
|
|
17553
17608
|
const { params, exec, run: runTask, error } = context;
|
|
17554
17609
|
const {
|
|
17555
17610
|
user,
|
|
@@ -17608,7 +17663,7 @@ async function run142(context) {
|
|
|
17608
17663
|
};
|
|
17609
17664
|
}
|
|
17610
17665
|
}
|
|
17611
|
-
var modify_default2 = task(
|
|
17666
|
+
var modify_default2 = task(run138, {
|
|
17612
17667
|
name: "modify",
|
|
17613
17668
|
description: "Modify an existing user account.",
|
|
17614
17669
|
inputSchema: ModifyUserInputSchema,
|
|
@@ -17893,7 +17948,7 @@ var XcpngAttachVdiResultSchema = z.object({
|
|
|
17893
17948
|
plugged: z.boolean().optional(),
|
|
17894
17949
|
error: z.string().optional()
|
|
17895
17950
|
});
|
|
17896
|
-
async function
|
|
17951
|
+
async function run139(context) {
|
|
17897
17952
|
const { params, error, debug } = context;
|
|
17898
17953
|
const { vm_uuid, vdi_uuid, device = "0", mode = "RW", bootable: rawBootable = false } = params;
|
|
17899
17954
|
if (!vm_uuid) {
|
|
@@ -17952,7 +18007,7 @@ async function run143(context) {
|
|
|
17952
18007
|
plugged: true
|
|
17953
18008
|
};
|
|
17954
18009
|
}
|
|
17955
|
-
var attach_vdi_default = task(
|
|
18010
|
+
var attach_vdi_default = task(run139, {
|
|
17956
18011
|
inputSchema: XcpngAttachVdiParamsSchema,
|
|
17957
18012
|
outputSchema: XcpngAttachVdiResultSchema,
|
|
17958
18013
|
description: "Attaches an existing virtual disk image to a VM and plugs it into the guest."
|
|
@@ -18016,7 +18071,7 @@ var XcpngCreateVdiResultSchema = z.object({
|
|
|
18016
18071
|
command: z.string().optional(),
|
|
18017
18072
|
error: z.string().optional()
|
|
18018
18073
|
});
|
|
18019
|
-
async function
|
|
18074
|
+
async function run140(context) {
|
|
18020
18075
|
const { params, error } = context;
|
|
18021
18076
|
const { name_label, sr_uuid, size_bytes, size_mb, size_gb, description, type = "user", shareable = false } = params;
|
|
18022
18077
|
if (!name_label) {
|
|
@@ -18069,7 +18124,7 @@ async function run144(context) {
|
|
|
18069
18124
|
command: result.command
|
|
18070
18125
|
};
|
|
18071
18126
|
}
|
|
18072
|
-
var create_vdi_default = task(
|
|
18127
|
+
var create_vdi_default = task(run140, {
|
|
18073
18128
|
inputSchema: XcpngCreateVdiParamsSchema,
|
|
18074
18129
|
outputSchema: XcpngCreateVdiResultSchema,
|
|
18075
18130
|
description: "Creates a new virtual disk image on the specified XCP-ng storage repository."
|
|
@@ -18084,7 +18139,7 @@ var XcpngListSrParamsResultSchema = z.object({
|
|
|
18084
18139
|
items: z.any().optional(),
|
|
18085
18140
|
error: z.string().optional()
|
|
18086
18141
|
});
|
|
18087
|
-
async function
|
|
18142
|
+
async function run141(context) {
|
|
18088
18143
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18089
18144
|
const result = await runXeCommand(context, "sr-param-list", filters);
|
|
18090
18145
|
if (!result.success) {
|
|
@@ -18098,7 +18153,7 @@ async function run145(context) {
|
|
|
18098
18153
|
items: parseKeyValueOutput(result.stdout)
|
|
18099
18154
|
};
|
|
18100
18155
|
}
|
|
18101
|
-
var list_sr_params_default = task(
|
|
18156
|
+
var list_sr_params_default = task(run141, {
|
|
18102
18157
|
inputSchema: XcpngListSrParamsParamsSchema,
|
|
18103
18158
|
outputSchema: XcpngListSrParamsResultSchema,
|
|
18104
18159
|
description: "Lists parameters for storage repositories (SRs) on an XCP-ng host."
|
|
@@ -18113,7 +18168,7 @@ var XcpngListStorageRepositoriesResultSchema = z.object({
|
|
|
18113
18168
|
items: z.array(z.any()).optional(),
|
|
18114
18169
|
error: z.string().optional()
|
|
18115
18170
|
});
|
|
18116
|
-
async function
|
|
18171
|
+
async function run142(context) {
|
|
18117
18172
|
const { params } = context;
|
|
18118
18173
|
const filters = normalizeFilterArgs(params?.filters);
|
|
18119
18174
|
const result = await runXeCommand(context, "sr-list", filters);
|
|
@@ -18162,7 +18217,7 @@ async function run146(context) {
|
|
|
18162
18217
|
items: enrichedItems
|
|
18163
18218
|
};
|
|
18164
18219
|
}
|
|
18165
|
-
var list_storage_repositories_default = task(
|
|
18220
|
+
var list_storage_repositories_default = task(run142, {
|
|
18166
18221
|
inputSchema: XcpngListStorageRepositoriesParamsSchema,
|
|
18167
18222
|
outputSchema: XcpngListStorageRepositoriesResultSchema,
|
|
18168
18223
|
description: "Lists storage repositories on an XCP-ng host."
|
|
@@ -18185,7 +18240,7 @@ var XcpngFindStorageRepositoryResultSchema = z.object({
|
|
|
18185
18240
|
multiple: z.boolean().optional(),
|
|
18186
18241
|
error: z.string().optional()
|
|
18187
18242
|
});
|
|
18188
|
-
async function
|
|
18243
|
+
async function run143(context) {
|
|
18189
18244
|
const params = context.params ?? {};
|
|
18190
18245
|
const {
|
|
18191
18246
|
name_label: nameLabel,
|
|
@@ -18305,7 +18360,7 @@ async function runListStorageRepositories(context, params) {
|
|
|
18305
18360
|
})
|
|
18306
18361
|
);
|
|
18307
18362
|
}
|
|
18308
|
-
var find_storage_repository_default = task(
|
|
18363
|
+
var find_storage_repository_default = task(run143, {
|
|
18309
18364
|
inputSchema: XcpngFindStorageRepositoryParamsSchema,
|
|
18310
18365
|
outputSchema: XcpngFindStorageRepositoryResultSchema,
|
|
18311
18366
|
description: "Finds a single storage repository on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -18338,7 +18393,7 @@ var XcpngAddDiskResultSchema = z.object({
|
|
|
18338
18393
|
plugged: z.boolean().optional(),
|
|
18339
18394
|
error: z.string().optional()
|
|
18340
18395
|
});
|
|
18341
|
-
async function
|
|
18396
|
+
async function run144(context) {
|
|
18342
18397
|
const { params, error } = context;
|
|
18343
18398
|
const {
|
|
18344
18399
|
vm_uuid: vmUuid,
|
|
@@ -18471,7 +18526,7 @@ async function destroyVdi(context, vdiUuid, appliedCommands) {
|
|
|
18471
18526
|
context.warn(`Failed to clean up VDI ${vdiUuid}: ${xeErrorMessage(result, "unknown error")}`);
|
|
18472
18527
|
}
|
|
18473
18528
|
}
|
|
18474
|
-
var add_disk_default = task(
|
|
18529
|
+
var add_disk_default = task(run144, {
|
|
18475
18530
|
inputSchema: XcpngAddDiskParamsSchema,
|
|
18476
18531
|
outputSchema: XcpngAddDiskResultSchema,
|
|
18477
18532
|
description: "Creates a VDI and attaches it to a VM on XCP-ng."
|
|
@@ -18490,7 +18545,7 @@ var XcpngAttachIsoResultSchema = z.object({
|
|
|
18490
18545
|
plugged: z.boolean().optional(),
|
|
18491
18546
|
error: z.string().optional()
|
|
18492
18547
|
});
|
|
18493
|
-
async function
|
|
18548
|
+
async function run145(context) {
|
|
18494
18549
|
const { params, error, debug } = context;
|
|
18495
18550
|
const { vm_uuid, iso_vdi_uuid, device, eject_before_insert = true } = params;
|
|
18496
18551
|
if (!vm_uuid) {
|
|
@@ -18583,7 +18638,7 @@ async function run149(context) {
|
|
|
18583
18638
|
plugged
|
|
18584
18639
|
};
|
|
18585
18640
|
}
|
|
18586
|
-
var attach_iso_default = task(
|
|
18641
|
+
var attach_iso_default = task(run145, {
|
|
18587
18642
|
inputSchema: XcpngAttachIsoParamsSchema,
|
|
18588
18643
|
outputSchema: XcpngAttachIsoResultSchema,
|
|
18589
18644
|
description: "Attaches an ISO image to a VM by invoking xe vm-cd-insert, ejecting existing media if requested."
|
|
@@ -18604,7 +18659,7 @@ var XcpngAttachNetworkInterfaceResultSchema = z.object({
|
|
|
18604
18659
|
plugged: z.boolean().optional(),
|
|
18605
18660
|
error: z.string().optional()
|
|
18606
18661
|
});
|
|
18607
|
-
async function
|
|
18662
|
+
async function run146(context) {
|
|
18608
18663
|
const { params, error, debug } = context;
|
|
18609
18664
|
const { vm_uuid, network_uuid, device = "0", mac_address, mtu } = params;
|
|
18610
18665
|
if (!vm_uuid) {
|
|
@@ -18669,7 +18724,7 @@ async function run150(context) {
|
|
|
18669
18724
|
plugged: true
|
|
18670
18725
|
};
|
|
18671
18726
|
}
|
|
18672
|
-
var attach_network_interface_default = task(
|
|
18727
|
+
var attach_network_interface_default = task(run146, {
|
|
18673
18728
|
inputSchema: XcpngAttachNetworkInterfaceParamsSchema,
|
|
18674
18729
|
outputSchema: XcpngAttachNetworkInterfaceResultSchema,
|
|
18675
18730
|
description: "Creates and plugs a virtual network interface for a VM on XCP-ng."
|
|
@@ -18684,7 +18739,7 @@ var XcpngListTemplateParamsResultSchema = z.object({
|
|
|
18684
18739
|
items: z.any().optional(),
|
|
18685
18740
|
error: z.string().optional()
|
|
18686
18741
|
});
|
|
18687
|
-
async function
|
|
18742
|
+
async function run147(context) {
|
|
18688
18743
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18689
18744
|
const result = await runXeCommand(context, "template-param-list", filters);
|
|
18690
18745
|
if (!result.success) {
|
|
@@ -18698,7 +18753,7 @@ async function run151(context) {
|
|
|
18698
18753
|
items: parseKeyValueOutput(result.stdout)
|
|
18699
18754
|
};
|
|
18700
18755
|
}
|
|
18701
|
-
var list_template_params_default = task(
|
|
18756
|
+
var list_template_params_default = task(run147, {
|
|
18702
18757
|
inputSchema: XcpngListTemplateParamsParamsSchema,
|
|
18703
18758
|
outputSchema: XcpngListTemplateParamsResultSchema,
|
|
18704
18759
|
description: "Lists parameters for templates on an XCP-ng host."
|
|
@@ -18713,7 +18768,7 @@ var XcpngListTemplatesResultSchema = z.object({
|
|
|
18713
18768
|
items: z.array(z.any()).optional(),
|
|
18714
18769
|
error: z.string().optional()
|
|
18715
18770
|
});
|
|
18716
|
-
async function
|
|
18771
|
+
async function run148(context) {
|
|
18717
18772
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
18718
18773
|
const result = await runXeCommand(context, "template-list", filters);
|
|
18719
18774
|
if (!result.success) {
|
|
@@ -18763,7 +18818,7 @@ async function run152(context) {
|
|
|
18763
18818
|
items: enriched
|
|
18764
18819
|
};
|
|
18765
18820
|
}
|
|
18766
|
-
var list_templates_default = task(
|
|
18821
|
+
var list_templates_default = task(run148, {
|
|
18767
18822
|
inputSchema: XcpngListTemplatesParamsSchema,
|
|
18768
18823
|
outputSchema: XcpngListTemplatesResultSchema,
|
|
18769
18824
|
description: "Lists VM templates available on the XCP-ng host."
|
|
@@ -18784,7 +18839,7 @@ var XcpngFindTemplateResultSchema = z.object({
|
|
|
18784
18839
|
multiple: z.boolean().optional(),
|
|
18785
18840
|
error: z.string().optional()
|
|
18786
18841
|
});
|
|
18787
|
-
async function
|
|
18842
|
+
async function run149(context) {
|
|
18788
18843
|
const params = context.params ?? {};
|
|
18789
18844
|
const {
|
|
18790
18845
|
name_label: nameLabel,
|
|
@@ -18882,7 +18937,7 @@ async function runListTemplates(context, params) {
|
|
|
18882
18937
|
})
|
|
18883
18938
|
);
|
|
18884
18939
|
}
|
|
18885
|
-
var find_template_default = task(
|
|
18940
|
+
var find_template_default = task(run149, {
|
|
18886
18941
|
inputSchema: XcpngFindTemplateParamsSchema,
|
|
18887
18942
|
outputSchema: XcpngFindTemplateResultSchema,
|
|
18888
18943
|
description: "Finds a single template on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -18907,7 +18962,7 @@ var XcpngCloneTemplateResultSchema = z.object({
|
|
|
18907
18962
|
alreadyExists: z.boolean().optional(),
|
|
18908
18963
|
error: z.string().optional()
|
|
18909
18964
|
});
|
|
18910
|
-
async function
|
|
18965
|
+
async function run150(context) {
|
|
18911
18966
|
const { params, error } = context;
|
|
18912
18967
|
const {
|
|
18913
18968
|
source_template_uuid: sourceTemplateUuidParam,
|
|
@@ -19027,7 +19082,7 @@ async function run154(context) {
|
|
|
19027
19082
|
appliedCommands
|
|
19028
19083
|
};
|
|
19029
19084
|
}
|
|
19030
|
-
var clone_template_default = task(
|
|
19085
|
+
var clone_template_default = task(run150, {
|
|
19031
19086
|
inputSchema: XcpngCloneTemplateParamsSchema,
|
|
19032
19087
|
outputSchema: XcpngCloneTemplateResultSchema,
|
|
19033
19088
|
description: "Clones an existing XCP-ng template to a new template name."
|
|
@@ -19042,7 +19097,7 @@ var XcpngListHostsResultSchema = z.object({
|
|
|
19042
19097
|
items: z.any().optional(),
|
|
19043
19098
|
error: z.string().optional()
|
|
19044
19099
|
});
|
|
19045
|
-
async function
|
|
19100
|
+
async function run151(context) {
|
|
19046
19101
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19047
19102
|
const result = await runXeCommand(context, "host-list", filters);
|
|
19048
19103
|
if (!result.success) {
|
|
@@ -19056,7 +19111,7 @@ async function run155(context) {
|
|
|
19056
19111
|
items: parseKeyValueOutput(result.stdout)
|
|
19057
19112
|
};
|
|
19058
19113
|
}
|
|
19059
|
-
var list_hosts_default = task(
|
|
19114
|
+
var list_hosts_default = task(run151, {
|
|
19060
19115
|
inputSchema: XcpngListHostsParamsSchema,
|
|
19061
19116
|
outputSchema: XcpngListHostsResultSchema,
|
|
19062
19117
|
description: "Lists hosts in an XCP-ng pool, returning parsed xe host-list output."
|
|
@@ -19077,7 +19132,7 @@ var XcpngFindHostResultSchema = z.object({
|
|
|
19077
19132
|
multiple: z.boolean().optional(),
|
|
19078
19133
|
error: z.string().optional()
|
|
19079
19134
|
});
|
|
19080
|
-
async function
|
|
19135
|
+
async function run152(context) {
|
|
19081
19136
|
const params = context.params ?? {};
|
|
19082
19137
|
const {
|
|
19083
19138
|
name_label: nameLabel,
|
|
@@ -19177,7 +19232,7 @@ async function runListHosts(context, params) {
|
|
|
19177
19232
|
})
|
|
19178
19233
|
);
|
|
19179
19234
|
}
|
|
19180
|
-
var find_host_default = task(
|
|
19235
|
+
var find_host_default = task(run152, {
|
|
19181
19236
|
inputSchema: XcpngFindHostParamsSchema,
|
|
19182
19237
|
outputSchema: XcpngFindHostResultSchema,
|
|
19183
19238
|
description: "Finds a single host on an XCP-ng pool, optionally allowing multiple matches."
|
|
@@ -19192,7 +19247,7 @@ var XcpngListNetworkParamsResultSchema = z.object({
|
|
|
19192
19247
|
items: z.any().optional(),
|
|
19193
19248
|
error: z.string().optional()
|
|
19194
19249
|
});
|
|
19195
|
-
async function
|
|
19250
|
+
async function run153(context) {
|
|
19196
19251
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19197
19252
|
const result = await runXeCommand(context, "network-param-list", filters);
|
|
19198
19253
|
if (!result.success) {
|
|
@@ -19206,7 +19261,7 @@ async function run157(context) {
|
|
|
19206
19261
|
items: parseKeyValueOutput(result.stdout)
|
|
19207
19262
|
};
|
|
19208
19263
|
}
|
|
19209
|
-
var list_network_params_default = task(
|
|
19264
|
+
var list_network_params_default = task(run153, {
|
|
19210
19265
|
inputSchema: XcpngListNetworkParamsParamsSchema,
|
|
19211
19266
|
outputSchema: XcpngListNetworkParamsResultSchema,
|
|
19212
19267
|
description: "Lists parameters for networks on an XCP-ng host."
|
|
@@ -19221,7 +19276,7 @@ var XcpngListNetworksResultSchema = z.object({
|
|
|
19221
19276
|
items: z.array(z.any()).optional(),
|
|
19222
19277
|
error: z.string().optional()
|
|
19223
19278
|
});
|
|
19224
|
-
async function
|
|
19279
|
+
async function run154(context) {
|
|
19225
19280
|
const { params } = context;
|
|
19226
19281
|
const filters = normalizeFilterArgs(params?.filters);
|
|
19227
19282
|
const result = await runXeCommand(context, "network-list", filters);
|
|
@@ -19270,7 +19325,7 @@ async function run158(context) {
|
|
|
19270
19325
|
items: enrichedItems
|
|
19271
19326
|
};
|
|
19272
19327
|
}
|
|
19273
|
-
var list_networks_default = task(
|
|
19328
|
+
var list_networks_default = task(run154, {
|
|
19274
19329
|
inputSchema: XcpngListNetworksParamsSchema,
|
|
19275
19330
|
outputSchema: XcpngListNetworksResultSchema,
|
|
19276
19331
|
description: "Lists networks on an XCP-ng host."
|
|
@@ -19291,7 +19346,7 @@ var XcpngFindNetworkResultSchema = z.object({
|
|
|
19291
19346
|
multiple: z.boolean().optional(),
|
|
19292
19347
|
error: z.string().optional()
|
|
19293
19348
|
});
|
|
19294
|
-
async function
|
|
19349
|
+
async function run155(context) {
|
|
19295
19350
|
const params = context.params ?? {};
|
|
19296
19351
|
const {
|
|
19297
19352
|
name_label: nameLabel,
|
|
@@ -19382,7 +19437,7 @@ function buildMultipleMessage4(nameLabel, uuid, count) {
|
|
|
19382
19437
|
const detail = identifiers.length > 0 ? identifiers.join(", ") : "specified criteria";
|
|
19383
19438
|
return `Multiple networks (${count}) matched ${detail}; refine filters or set allow_multiple:true.`;
|
|
19384
19439
|
}
|
|
19385
|
-
var find_network_default = task(
|
|
19440
|
+
var find_network_default = task(run155, {
|
|
19386
19441
|
inputSchema: XcpngFindNetworkParamsSchema,
|
|
19387
19442
|
outputSchema: XcpngFindNetworkResultSchema,
|
|
19388
19443
|
description: "Finds a single network on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -19409,7 +19464,7 @@ var XcpngCreateBondResultSchema = z.object({
|
|
|
19409
19464
|
appliedCommands: z.array(z.string()),
|
|
19410
19465
|
error: z.string().optional()
|
|
19411
19466
|
});
|
|
19412
|
-
async function
|
|
19467
|
+
async function run156(context) {
|
|
19413
19468
|
const { params, error } = context;
|
|
19414
19469
|
const {
|
|
19415
19470
|
host_uuid: hostUuidParam,
|
|
@@ -19531,7 +19586,7 @@ async function run160(context) {
|
|
|
19531
19586
|
appliedCommands
|
|
19532
19587
|
};
|
|
19533
19588
|
}
|
|
19534
|
-
var create_bond_default = task(
|
|
19589
|
+
var create_bond_default = task(run156, {
|
|
19535
19590
|
inputSchema: XcpngCreateBondParamsSchema,
|
|
19536
19591
|
outputSchema: XcpngCreateBondResultSchema,
|
|
19537
19592
|
description: "Creates a bonded interface on a host, wrapping xe bond-create."
|
|
@@ -19546,7 +19601,7 @@ var XcpngListPbdParamsResultSchema = z.object({
|
|
|
19546
19601
|
items: z.any().optional(),
|
|
19547
19602
|
error: z.string().optional()
|
|
19548
19603
|
});
|
|
19549
|
-
async function
|
|
19604
|
+
async function run157(context) {
|
|
19550
19605
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19551
19606
|
const result = await runXeCommand(context, "pbd-param-list", filters);
|
|
19552
19607
|
if (!result.success) {
|
|
@@ -19560,7 +19615,7 @@ async function run161(context) {
|
|
|
19560
19615
|
items: parseKeyValueOutput(result.stdout)
|
|
19561
19616
|
};
|
|
19562
19617
|
}
|
|
19563
|
-
var list_pbd_params_default = task(
|
|
19618
|
+
var list_pbd_params_default = task(run157, {
|
|
19564
19619
|
inputSchema: XcpngListPbdParamsParamsSchema,
|
|
19565
19620
|
outputSchema: XcpngListPbdParamsResultSchema,
|
|
19566
19621
|
description: "Lists parameters for PBDs on an XCP-ng host."
|
|
@@ -19575,7 +19630,7 @@ var XcpngListPbdsResultSchema = z.object({
|
|
|
19575
19630
|
items: z.array(z.any()).optional(),
|
|
19576
19631
|
error: z.string().optional()
|
|
19577
19632
|
});
|
|
19578
|
-
async function
|
|
19633
|
+
async function run158(context) {
|
|
19579
19634
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19580
19635
|
const result = await runXeCommand(context, "pbd-list", filters);
|
|
19581
19636
|
if (!result.success) {
|
|
@@ -19623,7 +19678,7 @@ async function run162(context) {
|
|
|
19623
19678
|
items: enrichedItems
|
|
19624
19679
|
};
|
|
19625
19680
|
}
|
|
19626
|
-
var list_pbds_default = task(
|
|
19681
|
+
var list_pbds_default = task(run158, {
|
|
19627
19682
|
inputSchema: XcpngListPbdsParamsSchema,
|
|
19628
19683
|
outputSchema: XcpngListPbdsResultSchema,
|
|
19629
19684
|
description: "Lists storage bindings (PBDs) between hosts and storage repositories."
|
|
@@ -19645,7 +19700,7 @@ var XcpngFindPbdResultSchema = z.object({
|
|
|
19645
19700
|
multiple: z.boolean().optional(),
|
|
19646
19701
|
error: z.string().optional()
|
|
19647
19702
|
});
|
|
19648
|
-
async function
|
|
19703
|
+
async function run159(context) {
|
|
19649
19704
|
const params = context.params ?? {};
|
|
19650
19705
|
const {
|
|
19651
19706
|
uuid,
|
|
@@ -19758,7 +19813,7 @@ async function runListPbds(context, params) {
|
|
|
19758
19813
|
})
|
|
19759
19814
|
);
|
|
19760
19815
|
}
|
|
19761
|
-
var find_pbd_default = task(
|
|
19816
|
+
var find_pbd_default = task(run159, {
|
|
19762
19817
|
inputSchema: XcpngFindPbdParamsSchema,
|
|
19763
19818
|
outputSchema: XcpngFindPbdResultSchema,
|
|
19764
19819
|
description: "Finds a single PBD (host \u2194 SR binding), optionally allowing multiple matches."
|
|
@@ -19783,7 +19838,7 @@ var XcpngCreatePbdResultSchema = z.object({
|
|
|
19783
19838
|
skipped: z.boolean().optional(),
|
|
19784
19839
|
error: z.string().optional()
|
|
19785
19840
|
});
|
|
19786
|
-
async function
|
|
19841
|
+
async function run160(context) {
|
|
19787
19842
|
const { params, error } = context;
|
|
19788
19843
|
const {
|
|
19789
19844
|
host_uuid: hostUuidParam,
|
|
@@ -19900,7 +19955,7 @@ async function run164(context) {
|
|
|
19900
19955
|
appliedCommands
|
|
19901
19956
|
};
|
|
19902
19957
|
}
|
|
19903
|
-
var create_pbd_default = task(
|
|
19958
|
+
var create_pbd_default = task(run160, {
|
|
19904
19959
|
inputSchema: XcpngCreatePbdParamsSchema,
|
|
19905
19960
|
outputSchema: XcpngCreatePbdResultSchema,
|
|
19906
19961
|
description: "Creates a host \u2194 storage repository binding (PBD)."
|
|
@@ -19915,7 +19970,7 @@ var XcpngListVmParamsResultSchema = z.object({
|
|
|
19915
19970
|
items: z.any().optional(),
|
|
19916
19971
|
error: z.string().optional()
|
|
19917
19972
|
});
|
|
19918
|
-
async function
|
|
19973
|
+
async function run161(context) {
|
|
19919
19974
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
19920
19975
|
const result = await runXeCommand(context, "vm-param-list", filters);
|
|
19921
19976
|
if (!result.success) {
|
|
@@ -19929,7 +19984,7 @@ async function run165(context) {
|
|
|
19929
19984
|
items: parseKeyValueOutput(result.stdout)
|
|
19930
19985
|
};
|
|
19931
19986
|
}
|
|
19932
|
-
var list_vm_params_default = task(
|
|
19987
|
+
var list_vm_params_default = task(run161, {
|
|
19933
19988
|
inputSchema: XcpngListVmParamsParamsSchema,
|
|
19934
19989
|
outputSchema: XcpngListVmParamsResultSchema,
|
|
19935
19990
|
description: "Lists virtual machines (VMs) on an XCP-ng host."
|
|
@@ -19945,7 +20000,7 @@ var XcpngListVmsResultSchema = z.object({
|
|
|
19945
20000
|
items: z.array(z.any()).optional(),
|
|
19946
20001
|
error: z.string().optional()
|
|
19947
20002
|
});
|
|
19948
|
-
async function
|
|
20003
|
+
async function run162(context) {
|
|
19949
20004
|
const { params } = context;
|
|
19950
20005
|
const filters = normalizeFilterArgs(params?.filters);
|
|
19951
20006
|
const paramsArg = buildParamsArg(params?.params);
|
|
@@ -19998,7 +20053,7 @@ async function run166(context) {
|
|
|
19998
20053
|
items: enrichedItems
|
|
19999
20054
|
};
|
|
20000
20055
|
}
|
|
20001
|
-
var list_vms_default = task(
|
|
20056
|
+
var list_vms_default = task(run162, {
|
|
20002
20057
|
inputSchema: XcpngListVmsParamsSchema,
|
|
20003
20058
|
outputSchema: XcpngListVmsResultSchema,
|
|
20004
20059
|
description: "Lists VMs on an XCP-ng host and returns structured metadata."
|
|
@@ -20049,7 +20104,7 @@ var XcpngFindVmResultSchema = z.object({
|
|
|
20049
20104
|
multiple: z.boolean().optional(),
|
|
20050
20105
|
error: z.string().optional()
|
|
20051
20106
|
});
|
|
20052
|
-
async function
|
|
20107
|
+
async function run163(context) {
|
|
20053
20108
|
const params = context.params ?? {};
|
|
20054
20109
|
const {
|
|
20055
20110
|
name_label: nameLabel,
|
|
@@ -20177,7 +20232,7 @@ async function runListVms(context, params) {
|
|
|
20177
20232
|
})
|
|
20178
20233
|
);
|
|
20179
20234
|
}
|
|
20180
|
-
var find_vm_default = task(
|
|
20235
|
+
var find_vm_default = task(run163, {
|
|
20181
20236
|
inputSchema: XcpngFindVmParamsSchema,
|
|
20182
20237
|
outputSchema: XcpngFindVmResultSchema,
|
|
20183
20238
|
description: "Finds a single VM on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -20282,7 +20337,7 @@ var XcpngCreateTemplateResultSchema = z.object({
|
|
|
20282
20337
|
powerState: z.string().optional(),
|
|
20283
20338
|
waitAttempts: z.number().optional()
|
|
20284
20339
|
});
|
|
20285
|
-
async function
|
|
20340
|
+
async function run164(context) {
|
|
20286
20341
|
const { params, error } = context;
|
|
20287
20342
|
const {
|
|
20288
20343
|
source_vm_uuid: sourceVmUuidParam,
|
|
@@ -20390,7 +20445,7 @@ async function run168(context) {
|
|
|
20390
20445
|
waitAttempts: ensureHalted.attempts
|
|
20391
20446
|
};
|
|
20392
20447
|
}
|
|
20393
|
-
var create_template_default = task(
|
|
20448
|
+
var create_template_default = task(run164, {
|
|
20394
20449
|
inputSchema: XcpngCreateTemplateParamsSchema,
|
|
20395
20450
|
outputSchema: XcpngCreateTemplateResultSchema,
|
|
20396
20451
|
description: "Clones a VM and converts it into an XCP-ng template."
|
|
@@ -20417,7 +20472,7 @@ var XcpngCreateVmResultSchema = z.object({
|
|
|
20417
20472
|
appliedCommands: z.array(z.string()),
|
|
20418
20473
|
error: z.string().optional()
|
|
20419
20474
|
});
|
|
20420
|
-
async function
|
|
20475
|
+
async function run165(context) {
|
|
20421
20476
|
const { params, error } = context;
|
|
20422
20477
|
const {
|
|
20423
20478
|
name_label,
|
|
@@ -20543,7 +20598,7 @@ async function run169(context) {
|
|
|
20543
20598
|
appliedCommands
|
|
20544
20599
|
};
|
|
20545
20600
|
}
|
|
20546
|
-
var create_vm_default = task(
|
|
20601
|
+
var create_vm_default = task(run165, {
|
|
20547
20602
|
inputSchema: XcpngCreateVmParamsSchema,
|
|
20548
20603
|
outputSchema: XcpngCreateVmResultSchema,
|
|
20549
20604
|
description: "Creates a new VM on XCP-ng and optionally applies memory and CPU sizing."
|
|
@@ -20558,7 +20613,7 @@ var XcpngListVdiParamsResultSchema = z.object({
|
|
|
20558
20613
|
items: z.any().optional(),
|
|
20559
20614
|
error: z.string().optional()
|
|
20560
20615
|
});
|
|
20561
|
-
async function
|
|
20616
|
+
async function run166(context) {
|
|
20562
20617
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
20563
20618
|
const result = await runXeCommand(context, "vdi-param-list", filters);
|
|
20564
20619
|
if (!result.success) {
|
|
@@ -20572,7 +20627,7 @@ async function run170(context) {
|
|
|
20572
20627
|
items: parseKeyValueOutput(result.stdout)
|
|
20573
20628
|
};
|
|
20574
20629
|
}
|
|
20575
|
-
var list_vdi_params_default = task(
|
|
20630
|
+
var list_vdi_params_default = task(run166, {
|
|
20576
20631
|
inputSchema: XcpngListVdiParamsParamsSchema,
|
|
20577
20632
|
outputSchema: XcpngListVdiParamsResultSchema,
|
|
20578
20633
|
description: "Lists virtual disk image parameters (VDI params) on an XCP-ng host."
|
|
@@ -20587,7 +20642,7 @@ var XcpngListVdisResultSchema = z.object({
|
|
|
20587
20642
|
items: z.array(z.any()).optional(),
|
|
20588
20643
|
error: z.string().optional()
|
|
20589
20644
|
});
|
|
20590
|
-
async function
|
|
20645
|
+
async function run167(context) {
|
|
20591
20646
|
const { params } = context;
|
|
20592
20647
|
const filters = normalizeFilterArgs(params?.filters);
|
|
20593
20648
|
const result = await runXeCommand(context, "vdi-list", filters);
|
|
@@ -20638,7 +20693,7 @@ async function run171(context) {
|
|
|
20638
20693
|
items: enrichedItems
|
|
20639
20694
|
};
|
|
20640
20695
|
}
|
|
20641
|
-
var list_vdis_default = task(
|
|
20696
|
+
var list_vdis_default = task(run167, {
|
|
20642
20697
|
inputSchema: XcpngListVdisParamsSchema,
|
|
20643
20698
|
outputSchema: XcpngListVdisResultSchema,
|
|
20644
20699
|
description: "Lists VDIs on an XCP-ng host with optional filtering."
|
|
@@ -20660,7 +20715,7 @@ var XcpngFindVdiResultSchema = z.object({
|
|
|
20660
20715
|
multiple: z.boolean().optional(),
|
|
20661
20716
|
error: z.string().optional()
|
|
20662
20717
|
});
|
|
20663
|
-
async function
|
|
20718
|
+
async function run168(context) {
|
|
20664
20719
|
const params = context.params ?? {};
|
|
20665
20720
|
const {
|
|
20666
20721
|
name_label: nameLabel,
|
|
@@ -20766,7 +20821,7 @@ function buildMultipleMessage7(nameLabel, uuid, srUuid, count) {
|
|
|
20766
20821
|
const detail = identifiers.length > 0 ? identifiers.join(", ") : "specified criteria";
|
|
20767
20822
|
return `Multiple VDIs (${count}) matched ${detail}; refine filters or set allow_multiple:true.`;
|
|
20768
20823
|
}
|
|
20769
|
-
var find_vdi_default = task(
|
|
20824
|
+
var find_vdi_default = task(run168, {
|
|
20770
20825
|
inputSchema: XcpngFindVdiParamsSchema,
|
|
20771
20826
|
outputSchema: XcpngFindVdiResultSchema,
|
|
20772
20827
|
description: "Finds a single VDI on an XCP-ng host, optionally allowing multiple matches."
|
|
@@ -20781,7 +20836,7 @@ var XcpngListVbdParamsResultSchema = z.object({
|
|
|
20781
20836
|
items: z.any().optional(),
|
|
20782
20837
|
error: z.string().optional()
|
|
20783
20838
|
});
|
|
20784
|
-
async function
|
|
20839
|
+
async function run169(context) {
|
|
20785
20840
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
20786
20841
|
const result = await runXeCommand(context, "vbd-param-list", filters);
|
|
20787
20842
|
if (!result.success) {
|
|
@@ -20795,7 +20850,7 @@ async function run173(context) {
|
|
|
20795
20850
|
items: parseKeyValueOutput(result.stdout)
|
|
20796
20851
|
};
|
|
20797
20852
|
}
|
|
20798
|
-
var list_vbd_params_default = task(
|
|
20853
|
+
var list_vbd_params_default = task(run169, {
|
|
20799
20854
|
inputSchema: XcpngListVbdParamsParamsSchema,
|
|
20800
20855
|
outputSchema: XcpngListVbdParamsResultSchema,
|
|
20801
20856
|
description: "Lists virtual block devices (VBDs) on an XCP-ng host."
|
|
@@ -20810,7 +20865,7 @@ var XcpngListVbdsResultSchema = z.object({
|
|
|
20810
20865
|
items: z.array(z.any()).optional(),
|
|
20811
20866
|
error: z.string().optional()
|
|
20812
20867
|
});
|
|
20813
|
-
async function
|
|
20868
|
+
async function run170(context) {
|
|
20814
20869
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
20815
20870
|
const result = await runXeCommand(context, "vbd-list", filters);
|
|
20816
20871
|
if (!result.success) {
|
|
@@ -20860,7 +20915,7 @@ async function run174(context) {
|
|
|
20860
20915
|
items: enrichedItems
|
|
20861
20916
|
};
|
|
20862
20917
|
}
|
|
20863
|
-
var list_vbds_default = task(
|
|
20918
|
+
var list_vbds_default = task(run170, {
|
|
20864
20919
|
inputSchema: XcpngListVbdsParamsSchema,
|
|
20865
20920
|
outputSchema: XcpngListVbdsResultSchema,
|
|
20866
20921
|
description: "Lists virtual block devices (VBDs) on an XCP-ng host."
|
|
@@ -20877,7 +20932,7 @@ var XcpngListAttachedDisksResultSchema = z.object({
|
|
|
20877
20932
|
disks: z.array(z.any()).optional(),
|
|
20878
20933
|
error: z.string().optional()
|
|
20879
20934
|
});
|
|
20880
|
-
async function
|
|
20935
|
+
async function run171(context) {
|
|
20881
20936
|
const { params, error } = context;
|
|
20882
20937
|
const { vm_uuid: vmUuid, include_readonly: rawIncludeReadonly } = params ?? {};
|
|
20883
20938
|
if (!vmUuid) {
|
|
@@ -20971,7 +21026,7 @@ async function run175(context) {
|
|
|
20971
21026
|
disks
|
|
20972
21027
|
};
|
|
20973
21028
|
}
|
|
20974
|
-
var list_attached_disks_default = task(
|
|
21029
|
+
var list_attached_disks_default = task(run171, {
|
|
20975
21030
|
inputSchema: XcpngListAttachedDisksParamsSchema,
|
|
20976
21031
|
outputSchema: XcpngListAttachedDisksResultSchema,
|
|
20977
21032
|
description: "Lists VBDs attached to a VM and enriches them with VDI metadata so disks vs CD drives can be distinguished."
|
|
@@ -20998,7 +21053,7 @@ var XcpngRemoveDiskResultSchema = z.object({
|
|
|
20998
21053
|
appliedCommands: z.array(z.string()),
|
|
20999
21054
|
error: z.string().optional()
|
|
21000
21055
|
});
|
|
21001
|
-
async function
|
|
21056
|
+
async function run172(context) {
|
|
21002
21057
|
const { params, error } = context;
|
|
21003
21058
|
const {
|
|
21004
21059
|
vbd_uuid: vbdUuidParam,
|
|
@@ -21186,7 +21241,7 @@ async function waitForVdiRemoval(context, vdiUuid, timeoutMs) {
|
|
|
21186
21241
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
21187
21242
|
}
|
|
21188
21243
|
}
|
|
21189
|
-
var remove_disk_default = task(
|
|
21244
|
+
var remove_disk_default = task(run172, {
|
|
21190
21245
|
inputSchema: XcpngRemoveDiskParamsSchema,
|
|
21191
21246
|
outputSchema: XcpngRemoveDiskResultSchema,
|
|
21192
21247
|
description: "Detaches a VDI from a VM and optionally destroys the backing disk on XCP-ng."
|
|
@@ -21203,7 +21258,7 @@ var XcpngSetBootOrderResultSchema = z.object({
|
|
|
21203
21258
|
appliedCommands: z.array(z.string()),
|
|
21204
21259
|
error: z.string().optional()
|
|
21205
21260
|
});
|
|
21206
|
-
async function
|
|
21261
|
+
async function run173(context) {
|
|
21207
21262
|
const { params, error } = context;
|
|
21208
21263
|
const { vm_uuid, boot_order, firmware } = params;
|
|
21209
21264
|
if (!vm_uuid) {
|
|
@@ -21267,7 +21322,7 @@ async function run177(context) {
|
|
|
21267
21322
|
appliedCommands
|
|
21268
21323
|
};
|
|
21269
21324
|
}
|
|
21270
|
-
var set_boot_order_default = task(
|
|
21325
|
+
var set_boot_order_default = task(run173, {
|
|
21271
21326
|
inputSchema: XcpngSetBootOrderParamsSchema,
|
|
21272
21327
|
outputSchema: XcpngSetBootOrderResultSchema,
|
|
21273
21328
|
description: "Configures VM boot order and optional firmware mode via xe vm-param-set."
|
|
@@ -21320,7 +21375,7 @@ var OTHER_CONFIG_KEYS_TO_REMOVE = [
|
|
|
21320
21375
|
"cloud-init-hostname",
|
|
21321
21376
|
"cloud-init-instance-id"
|
|
21322
21377
|
];
|
|
21323
|
-
async function
|
|
21378
|
+
async function run174(context) {
|
|
21324
21379
|
if (!context.host) {
|
|
21325
21380
|
const message = "core.xcpng.create-template-from-vdi must run against a remote XCP-ng host.";
|
|
21326
21381
|
return {
|
|
@@ -21853,7 +21908,7 @@ async function run178(context) {
|
|
|
21853
21908
|
steps
|
|
21854
21909
|
};
|
|
21855
21910
|
}
|
|
21856
|
-
var create_template_from_vdi_default = task(
|
|
21911
|
+
var create_template_from_vdi_default = task(run174, {
|
|
21857
21912
|
inputSchema: XcpngCreateTemplateFromVdiParamsSchema,
|
|
21858
21913
|
outputSchema: XcpngCreateTemplateFromVdiResultSchema,
|
|
21859
21914
|
description: "Creates an XCP-ng template from an existing VDI by staging a VM and converting it."
|
|
@@ -21970,7 +22025,7 @@ var XcpngCreateNetworkResultSchema = z.object({
|
|
|
21970
22025
|
skipped: z.boolean().optional(),
|
|
21971
22026
|
error: z.string().optional()
|
|
21972
22027
|
});
|
|
21973
|
-
async function
|
|
22028
|
+
async function run175(context) {
|
|
21974
22029
|
const { params, error } = context;
|
|
21975
22030
|
const { name_label: nameLabel, description, bridge, mtu, tags, allow_existing: rawAllowExisting } = params ?? {};
|
|
21976
22031
|
if (!nameLabel) {
|
|
@@ -22035,7 +22090,7 @@ async function run179(context) {
|
|
|
22035
22090
|
appliedCommands
|
|
22036
22091
|
};
|
|
22037
22092
|
}
|
|
22038
|
-
var create_network_default = task(
|
|
22093
|
+
var create_network_default = task(run175, {
|
|
22039
22094
|
inputSchema: XcpngCreateNetworkParamsSchema,
|
|
22040
22095
|
outputSchema: XcpngCreateNetworkResultSchema,
|
|
22041
22096
|
description: "Creates a new network on an XCP-ng host (bridge, MTU, and tags optional)."
|
|
@@ -22067,7 +22122,7 @@ var XcpngFindOrCreateIsoSrResultSchema = z.object({
|
|
|
22067
22122
|
commands: z.array(z.string()),
|
|
22068
22123
|
error: z.string().optional()
|
|
22069
22124
|
});
|
|
22070
|
-
async function
|
|
22125
|
+
async function run176(context) {
|
|
22071
22126
|
const { params, debug, error: logError2 } = context;
|
|
22072
22127
|
const {
|
|
22073
22128
|
name_label: nameLabel,
|
|
@@ -22219,7 +22274,7 @@ async function runDirCreate(context, params) {
|
|
|
22219
22274
|
})
|
|
22220
22275
|
);
|
|
22221
22276
|
}
|
|
22222
|
-
var find_or_create_iso_sr_default = task(
|
|
22277
|
+
var find_or_create_iso_sr_default = task(run176, {
|
|
22223
22278
|
inputSchema: XcpngFindOrCreateIsoSrParamsSchema,
|
|
22224
22279
|
outputSchema: XcpngFindOrCreateIsoSrResultSchema,
|
|
22225
22280
|
description: "Finds an ISO storage repository by name, creating it if missing using xe sr-create."
|
|
@@ -22262,7 +22317,7 @@ var XcpngCreateConfigDriveResultSchema = z.object({
|
|
|
22262
22317
|
steps: z.array(z.any()),
|
|
22263
22318
|
error: z.string().optional()
|
|
22264
22319
|
});
|
|
22265
|
-
async function
|
|
22320
|
+
async function run177(context) {
|
|
22266
22321
|
if (!context.host) {
|
|
22267
22322
|
return {
|
|
22268
22323
|
success: false,
|
|
@@ -22781,7 +22836,7 @@ function decodeBase64Field(field, value) {
|
|
|
22781
22836
|
};
|
|
22782
22837
|
}
|
|
22783
22838
|
}
|
|
22784
|
-
var create_config_drive_default = task(
|
|
22839
|
+
var create_config_drive_default = task(run177, {
|
|
22785
22840
|
inputSchema: XcpngCreateConfigDriveParamsSchema,
|
|
22786
22841
|
outputSchema: XcpngCreateConfigDriveResultSchema,
|
|
22787
22842
|
description: "Generates a NoCloud config-drive ISO, stores it in an ISO SR, and returns the associated VDI."
|
|
@@ -22805,7 +22860,7 @@ var XcpngConvertTemplateToVmResultSchema = z.object({
|
|
|
22805
22860
|
alreadyVm: z.boolean().optional(),
|
|
22806
22861
|
error: z.string().optional()
|
|
22807
22862
|
});
|
|
22808
|
-
async function
|
|
22863
|
+
async function run178(context) {
|
|
22809
22864
|
const { params, error } = context;
|
|
22810
22865
|
const {
|
|
22811
22866
|
template_uuid: templateUuidParam,
|
|
@@ -22904,7 +22959,7 @@ async function run182(context) {
|
|
|
22904
22959
|
alreadyVm
|
|
22905
22960
|
};
|
|
22906
22961
|
}
|
|
22907
|
-
var convert_template_to_vm_default = task(
|
|
22962
|
+
var convert_template_to_vm_default = task(run178, {
|
|
22908
22963
|
inputSchema: XcpngConvertTemplateToVmParamsSchema,
|
|
22909
22964
|
outputSchema: XcpngConvertTemplateToVmResultSchema,
|
|
22910
22965
|
description: "Converts an XCP-ng template into a VM by clearing the template flag and optionally renaming it."
|
|
@@ -22925,7 +22980,7 @@ var XcpngDestroyIsoSrResultSchema = z.object({
|
|
|
22925
22980
|
skipped: z.boolean().optional(),
|
|
22926
22981
|
error: z.string().optional()
|
|
22927
22982
|
});
|
|
22928
|
-
async function
|
|
22983
|
+
async function run179(context) {
|
|
22929
22984
|
const { params, error } = context;
|
|
22930
22985
|
const { sr_uuid: srUuidParam, sr_name_label: srName, location, allow_missing: rawAllowMissing } = params ?? {};
|
|
22931
22986
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -23091,7 +23146,7 @@ async function detachSrPbds(context, srUuid, allowMissing) {
|
|
|
23091
23146
|
}
|
|
23092
23147
|
return { commands };
|
|
23093
23148
|
}
|
|
23094
|
-
var destroy_iso_sr_default = task(
|
|
23149
|
+
var destroy_iso_sr_default = task(run179, {
|
|
23095
23150
|
inputSchema: XcpngDestroyIsoSrParamsSchema,
|
|
23096
23151
|
outputSchema: XcpngDestroyIsoSrResultSchema,
|
|
23097
23152
|
description: "Destroys an ISO storage repository and optionally removes its backing directory."
|
|
@@ -23110,7 +23165,7 @@ var XcpngDestroyBondResultSchema = z.object({
|
|
|
23110
23165
|
skipped: z.boolean().optional(),
|
|
23111
23166
|
error: z.string().optional()
|
|
23112
23167
|
});
|
|
23113
|
-
async function
|
|
23168
|
+
async function run180(context) {
|
|
23114
23169
|
const { params, error } = context;
|
|
23115
23170
|
const { bond_uuid: bondUuidParam, pif_uuid: pifUuidParam, allow_missing: rawAllowMissing } = params ?? {};
|
|
23116
23171
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -23147,7 +23202,7 @@ async function run184(context) {
|
|
|
23147
23202
|
appliedCommands
|
|
23148
23203
|
};
|
|
23149
23204
|
}
|
|
23150
|
-
var destroy_bond_default = task(
|
|
23205
|
+
var destroy_bond_default = task(run180, {
|
|
23151
23206
|
inputSchema: XcpngDestroyBondParamsSchema,
|
|
23152
23207
|
outputSchema: XcpngDestroyBondResultSchema,
|
|
23153
23208
|
description: "Destroys a bonded interface, wrapping xe bond-destroy."
|
|
@@ -23169,7 +23224,7 @@ var XcpngCreateSrResultSchema = z.object({
|
|
|
23169
23224
|
skipped: z.boolean().optional(),
|
|
23170
23225
|
error: z.string().optional()
|
|
23171
23226
|
});
|
|
23172
|
-
async function
|
|
23227
|
+
async function run181(context) {
|
|
23173
23228
|
const { params, error } = context;
|
|
23174
23229
|
const {
|
|
23175
23230
|
name_label: nameLabel,
|
|
@@ -23244,7 +23299,7 @@ async function run185(context) {
|
|
|
23244
23299
|
appliedCommands
|
|
23245
23300
|
};
|
|
23246
23301
|
}
|
|
23247
|
-
var create_sr_default = task(
|
|
23302
|
+
var create_sr_default = task(run181, {
|
|
23248
23303
|
inputSchema: XcpngCreateSrParamsSchema,
|
|
23249
23304
|
outputSchema: XcpngCreateSrResultSchema,
|
|
23250
23305
|
description: "Creates a new storage repository (SR) with the specified device configuration."
|
|
@@ -23264,7 +23319,7 @@ var XcpngDestroySrResultSchema = z.object({
|
|
|
23264
23319
|
skipped: z.boolean().optional(),
|
|
23265
23320
|
error: z.string().optional()
|
|
23266
23321
|
});
|
|
23267
|
-
async function
|
|
23322
|
+
async function run182(context) {
|
|
23268
23323
|
const { params, error } = context;
|
|
23269
23324
|
const {
|
|
23270
23325
|
sr_uuid: srUuidParam,
|
|
@@ -23338,7 +23393,7 @@ async function run186(context) {
|
|
|
23338
23393
|
appliedCommands
|
|
23339
23394
|
};
|
|
23340
23395
|
}
|
|
23341
|
-
var destroy_sr_default = task(
|
|
23396
|
+
var destroy_sr_default = task(run182, {
|
|
23342
23397
|
inputSchema: XcpngDestroySrParamsSchema,
|
|
23343
23398
|
outputSchema: XcpngDestroySrResultSchema,
|
|
23344
23399
|
description: "Destroys a storage repository by UUID or name-label (optionally forcing)."
|
|
@@ -23357,7 +23412,7 @@ var XcpngDestroyNetworkResultSchema = z.object({
|
|
|
23357
23412
|
skipped: z.boolean().optional(),
|
|
23358
23413
|
error: z.string().optional()
|
|
23359
23414
|
});
|
|
23360
|
-
async function
|
|
23415
|
+
async function run183(context) {
|
|
23361
23416
|
const { params, error } = context;
|
|
23362
23417
|
const {
|
|
23363
23418
|
network_uuid: networkUuidParam,
|
|
@@ -23424,7 +23479,7 @@ async function run187(context) {
|
|
|
23424
23479
|
appliedCommands
|
|
23425
23480
|
};
|
|
23426
23481
|
}
|
|
23427
|
-
var destroy_network_default = task(
|
|
23482
|
+
var destroy_network_default = task(run183, {
|
|
23428
23483
|
inputSchema: XcpngDestroyNetworkParamsSchema,
|
|
23429
23484
|
outputSchema: XcpngDestroyNetworkResultSchema,
|
|
23430
23485
|
description: "Destroys an XCP-ng network by UUID or name-label."
|
|
@@ -23446,7 +23501,7 @@ var XcpngDestroyPbdResultSchema = z.object({
|
|
|
23446
23501
|
skipped: z.boolean().optional(),
|
|
23447
23502
|
error: z.string().optional()
|
|
23448
23503
|
});
|
|
23449
|
-
async function
|
|
23504
|
+
async function run184(context) {
|
|
23450
23505
|
const { params, error } = context;
|
|
23451
23506
|
const {
|
|
23452
23507
|
pbd_uuid: pbdUuidParam,
|
|
@@ -23555,7 +23610,7 @@ async function run188(context) {
|
|
|
23555
23610
|
appliedCommands
|
|
23556
23611
|
};
|
|
23557
23612
|
}
|
|
23558
|
-
var destroy_pbd_default = task(
|
|
23613
|
+
var destroy_pbd_default = task(run184, {
|
|
23559
23614
|
inputSchema: XcpngDestroyPbdParamsSchema,
|
|
23560
23615
|
outputSchema: XcpngDestroyPbdResultSchema,
|
|
23561
23616
|
description: "Destroys a host \u2194 storage repository binding (PBD)."
|
|
@@ -23571,7 +23626,7 @@ var XcpngDestroySnapshotResultSchema = z.object({
|
|
|
23571
23626
|
command: z.string().optional(),
|
|
23572
23627
|
error: z.string().optional()
|
|
23573
23628
|
});
|
|
23574
|
-
async function
|
|
23629
|
+
async function run185(context) {
|
|
23575
23630
|
const { params, error } = context;
|
|
23576
23631
|
const { snapshot_uuid: snapshotUuid } = params ?? {};
|
|
23577
23632
|
if (!snapshotUuid) {
|
|
@@ -23594,7 +23649,7 @@ async function run189(context) {
|
|
|
23594
23649
|
command: result.command
|
|
23595
23650
|
};
|
|
23596
23651
|
}
|
|
23597
|
-
var destroy_snapshot_default = task(
|
|
23652
|
+
var destroy_snapshot_default = task(run185, {
|
|
23598
23653
|
inputSchema: XcpngDestroySnapshotParamsSchema,
|
|
23599
23654
|
outputSchema: XcpngDestroySnapshotResultSchema,
|
|
23600
23655
|
description: "Destroys an XCP-ng VM snapshot."
|
|
@@ -23614,7 +23669,7 @@ var XcpngIntroduceSrResultSchema = z.object({
|
|
|
23614
23669
|
appliedCommands: z.array(z.string()),
|
|
23615
23670
|
error: z.string().optional()
|
|
23616
23671
|
});
|
|
23617
|
-
async function
|
|
23672
|
+
async function run186(context) {
|
|
23618
23673
|
const { params, error } = context;
|
|
23619
23674
|
const { sr_uuid: srUuid, name_label: nameLabel, type, content_type: contentType, shared } = params ?? {};
|
|
23620
23675
|
if (!srUuid) {
|
|
@@ -23655,7 +23710,7 @@ async function run190(context) {
|
|
|
23655
23710
|
appliedCommands
|
|
23656
23711
|
};
|
|
23657
23712
|
}
|
|
23658
|
-
var introduce_sr_default = task(
|
|
23713
|
+
var introduce_sr_default = task(run186, {
|
|
23659
23714
|
inputSchema: XcpngIntroduceSrParamsSchema,
|
|
23660
23715
|
outputSchema: XcpngIntroduceSrResultSchema,
|
|
23661
23716
|
description: "Introduces an existing storage repository into the pool."
|
|
@@ -23674,7 +23729,7 @@ var XcpngForgetSrResultSchema = z.object({
|
|
|
23674
23729
|
skipped: z.boolean().optional(),
|
|
23675
23730
|
error: z.string().optional()
|
|
23676
23731
|
});
|
|
23677
|
-
async function
|
|
23732
|
+
async function run187(context) {
|
|
23678
23733
|
const { params, error } = context;
|
|
23679
23734
|
const { sr_uuid: srUuidParam, sr_name_label: srNameLabel, allow_missing: rawAllowMissing } = params ?? {};
|
|
23680
23735
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -23737,7 +23792,7 @@ async function run191(context) {
|
|
|
23737
23792
|
appliedCommands
|
|
23738
23793
|
};
|
|
23739
23794
|
}
|
|
23740
|
-
var forget_sr_default = task(
|
|
23795
|
+
var forget_sr_default = task(run187, {
|
|
23741
23796
|
inputSchema: XcpngForgetSrParamsSchema,
|
|
23742
23797
|
outputSchema: XcpngForgetSrResultSchema,
|
|
23743
23798
|
description: "Forgets an SR from the pool metadata without destroying the underlying storage."
|
|
@@ -23752,7 +23807,7 @@ var XcpngListSnapshotsResultSchema = z.object({
|
|
|
23752
23807
|
items: z.any().optional(),
|
|
23753
23808
|
error: z.string().optional()
|
|
23754
23809
|
});
|
|
23755
|
-
async function
|
|
23810
|
+
async function run188(context) {
|
|
23756
23811
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
23757
23812
|
const result = await runXeCommand(context, "snapshot-list", filters);
|
|
23758
23813
|
if (!result.success) {
|
|
@@ -23766,7 +23821,7 @@ async function run192(context) {
|
|
|
23766
23821
|
items: parseKeyValueOutput(result.stdout)
|
|
23767
23822
|
};
|
|
23768
23823
|
}
|
|
23769
|
-
var list_snapshots_default = task(
|
|
23824
|
+
var list_snapshots_default = task(run188, {
|
|
23770
23825
|
inputSchema: XcpngListSnapshotsParamsSchema,
|
|
23771
23826
|
outputSchema: XcpngListSnapshotsResultSchema,
|
|
23772
23827
|
description: "Lists VM snapshots available on the host."
|
|
@@ -23781,7 +23836,7 @@ var XcpngListMessagesResultSchema = z.object({
|
|
|
23781
23836
|
items: z.any().optional(),
|
|
23782
23837
|
error: z.string().optional()
|
|
23783
23838
|
});
|
|
23784
|
-
async function
|
|
23839
|
+
async function run189(context) {
|
|
23785
23840
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
23786
23841
|
const result = await runXeCommand(context, "message-list", filters);
|
|
23787
23842
|
if (!result.success) {
|
|
@@ -23795,7 +23850,7 @@ async function run193(context) {
|
|
|
23795
23850
|
items: parseKeyValueOutput(result.stdout)
|
|
23796
23851
|
};
|
|
23797
23852
|
}
|
|
23798
|
-
var list_messages_default = task(
|
|
23853
|
+
var list_messages_default = task(run189, {
|
|
23799
23854
|
inputSchema: XcpngListMessagesParamsSchema,
|
|
23800
23855
|
outputSchema: XcpngListMessagesResultSchema,
|
|
23801
23856
|
description: "Lists messages emitted by the XCP-ng pool."
|
|
@@ -23814,7 +23869,7 @@ var XcpngClearMessagesResultSchema = z.object({
|
|
|
23814
23869
|
commands: z.any().optional(),
|
|
23815
23870
|
error: z.string().optional()
|
|
23816
23871
|
});
|
|
23817
|
-
async function
|
|
23872
|
+
async function run190(context) {
|
|
23818
23873
|
const { params, error } = context;
|
|
23819
23874
|
const { uuid, uuid_prefix: uuidPrefix, all: rawAll, filters } = params ?? {};
|
|
23820
23875
|
const all = coerceBoolean(rawAll, false);
|
|
@@ -23872,7 +23927,7 @@ async function run194(context) {
|
|
|
23872
23927
|
commands
|
|
23873
23928
|
};
|
|
23874
23929
|
}
|
|
23875
|
-
var clear_messages_default = task(
|
|
23930
|
+
var clear_messages_default = task(run190, {
|
|
23876
23931
|
inputSchema: XcpngClearMessagesParamsSchema,
|
|
23877
23932
|
outputSchema: XcpngClearMessagesResultSchema,
|
|
23878
23933
|
description: "Clears messages (all, by UUID, or UUID prefix)."
|
|
@@ -23893,7 +23948,7 @@ var XcpngDestroyTemplateResultSchema = z.object({
|
|
|
23893
23948
|
skipped: z.boolean().optional(),
|
|
23894
23949
|
error: z.string().optional()
|
|
23895
23950
|
});
|
|
23896
|
-
async function
|
|
23951
|
+
async function run191(context) {
|
|
23897
23952
|
const { params, error } = context;
|
|
23898
23953
|
const {
|
|
23899
23954
|
template_uuid: templateUuidParam,
|
|
@@ -23968,7 +24023,7 @@ async function run195(context) {
|
|
|
23968
24023
|
command: commandResult.command
|
|
23969
24024
|
};
|
|
23970
24025
|
}
|
|
23971
|
-
var destroy_template_default = task(
|
|
24026
|
+
var destroy_template_default = task(run191, {
|
|
23972
24027
|
inputSchema: XcpngDestroyTemplateParamsSchema,
|
|
23973
24028
|
outputSchema: XcpngDestroyTemplateResultSchema,
|
|
23974
24029
|
description: "Destroys an XCP-ng template by UUID or name-label."
|
|
@@ -23988,7 +24043,7 @@ var XcpngDestroyVdiResultSchema = z.object({
|
|
|
23988
24043
|
skipped: z.boolean().optional(),
|
|
23989
24044
|
error: z.string().optional()
|
|
23990
24045
|
});
|
|
23991
|
-
async function
|
|
24046
|
+
async function run192(context) {
|
|
23992
24047
|
const { params, error } = context;
|
|
23993
24048
|
const {
|
|
23994
24049
|
vdi_uuid: vdiUuidParam,
|
|
@@ -24053,7 +24108,7 @@ async function run196(context) {
|
|
|
24053
24108
|
command: result.command
|
|
24054
24109
|
};
|
|
24055
24110
|
}
|
|
24056
|
-
var destroy_vdi_default = task(
|
|
24111
|
+
var destroy_vdi_default = task(run192, {
|
|
24057
24112
|
inputSchema: XcpngDestroyVdiParamsSchema,
|
|
24058
24113
|
outputSchema: XcpngDestroyVdiResultSchema,
|
|
24059
24114
|
description: "Destroys an XCP-ng VDI by UUID (optionally resolving by name-label)."
|
|
@@ -24078,7 +24133,7 @@ var XcpngDestroyVmResultSchema = z.object({
|
|
|
24078
24133
|
skipped: z.boolean().optional(),
|
|
24079
24134
|
error: z.string().optional()
|
|
24080
24135
|
});
|
|
24081
|
-
async function
|
|
24136
|
+
async function run193(context) {
|
|
24082
24137
|
const { params, error } = context;
|
|
24083
24138
|
const {
|
|
24084
24139
|
vm_uuid: vmUuidParam,
|
|
@@ -24241,7 +24296,7 @@ async function run197(context) {
|
|
|
24241
24296
|
destroyedVdiUuids
|
|
24242
24297
|
};
|
|
24243
24298
|
}
|
|
24244
|
-
var destroy_vm_default = task(
|
|
24299
|
+
var destroy_vm_default = task(run193, {
|
|
24245
24300
|
inputSchema: XcpngDestroyVmParamsSchema,
|
|
24246
24301
|
outputSchema: XcpngDestroyVmResultSchema,
|
|
24247
24302
|
description: "Destroys an XCP-ng VM, optionally forcing and pruning snapshots."
|
|
@@ -24270,7 +24325,7 @@ var XcpngCopyVdiResultSchema = z.object({
|
|
|
24270
24325
|
skipped: z.boolean().optional(),
|
|
24271
24326
|
error: z.string().optional()
|
|
24272
24327
|
});
|
|
24273
|
-
async function
|
|
24328
|
+
async function run194(context) {
|
|
24274
24329
|
const { params, error } = context;
|
|
24275
24330
|
const {
|
|
24276
24331
|
source_vdi_uuid: sourceVdiUuidParam,
|
|
@@ -24415,7 +24470,7 @@ async function run198(context) {
|
|
|
24415
24470
|
appliedCommands
|
|
24416
24471
|
};
|
|
24417
24472
|
}
|
|
24418
|
-
var copy_vdi_default = task(
|
|
24473
|
+
var copy_vdi_default = task(run194, {
|
|
24419
24474
|
inputSchema: XcpngCopyVdiParamsSchema,
|
|
24420
24475
|
outputSchema: XcpngCopyVdiResultSchema,
|
|
24421
24476
|
description: "Copies an XCP-ng VDI to a destination storage repository and optionally updates its metadata."
|
|
@@ -24433,7 +24488,7 @@ var XcpngDetachIsoResultSchema = z.object({
|
|
|
24433
24488
|
alreadyEmpty: z.boolean().optional(),
|
|
24434
24489
|
error: z.string().optional()
|
|
24435
24490
|
});
|
|
24436
|
-
async function
|
|
24491
|
+
async function run195(context) {
|
|
24437
24492
|
const { params, error } = context;
|
|
24438
24493
|
const { vm_uuid: vmUuid, allow_missing: rawAllowMissing } = params;
|
|
24439
24494
|
if (!vmUuid) {
|
|
@@ -24465,7 +24520,7 @@ async function run199(context) {
|
|
|
24465
24520
|
error: message
|
|
24466
24521
|
};
|
|
24467
24522
|
}
|
|
24468
|
-
var detach_iso_default = task(
|
|
24523
|
+
var detach_iso_default = task(run195, {
|
|
24469
24524
|
inputSchema: XcpngDetachIsoParamsSchema,
|
|
24470
24525
|
outputSchema: XcpngDetachIsoResultSchema,
|
|
24471
24526
|
description: "Ejects ISO media from a VM, tolerating empty drives when allow_missing:true."
|
|
@@ -24491,7 +24546,7 @@ var XcpngDetachVdiResultSchema = z.object({
|
|
|
24491
24546
|
appliedCommands: z.array(z.string()),
|
|
24492
24547
|
error: z.string().optional()
|
|
24493
24548
|
});
|
|
24494
|
-
async function
|
|
24549
|
+
async function run196(context) {
|
|
24495
24550
|
const { params } = context;
|
|
24496
24551
|
const {
|
|
24497
24552
|
vbd_uuid,
|
|
@@ -24528,7 +24583,7 @@ async function run200(context) {
|
|
|
24528
24583
|
error: result.error
|
|
24529
24584
|
};
|
|
24530
24585
|
}
|
|
24531
|
-
var detach_vdi_default = task(
|
|
24586
|
+
var detach_vdi_default = task(run196, {
|
|
24532
24587
|
inputSchema: XcpngDetachVdiParamsSchema,
|
|
24533
24588
|
outputSchema: XcpngDetachVdiResultSchema,
|
|
24534
24589
|
description: "Detaches a VDI from a VM by unplugging and optionally destroying the VBD, leaving the VDI intact by default."
|
|
@@ -24550,7 +24605,7 @@ var XcpngDetachNetworkInterfaceResultSchema = z.object({
|
|
|
24550
24605
|
appliedCommands: z.array(z.string()),
|
|
24551
24606
|
error: z.string().optional()
|
|
24552
24607
|
});
|
|
24553
|
-
async function
|
|
24608
|
+
async function run197(context) {
|
|
24554
24609
|
const { params, error } = context;
|
|
24555
24610
|
const {
|
|
24556
24611
|
vif_uuid: vifUuidParam,
|
|
@@ -24644,7 +24699,7 @@ async function run201(context) {
|
|
|
24644
24699
|
appliedCommands
|
|
24645
24700
|
};
|
|
24646
24701
|
}
|
|
24647
|
-
var detach_network_interface_default = task(
|
|
24702
|
+
var detach_network_interface_default = task(run197, {
|
|
24648
24703
|
inputSchema: XcpngDetachNetworkInterfaceParamsSchema,
|
|
24649
24704
|
outputSchema: XcpngDetachNetworkInterfaceResultSchema,
|
|
24650
24705
|
description: "Unplugs (and optionally destroys) a virtual network interface from an XCP-ng VM."
|
|
@@ -24664,7 +24719,7 @@ var XcpngEnableHostResultSchema = z.object({
|
|
|
24664
24719
|
skipped: z.boolean().optional(),
|
|
24665
24720
|
error: z.string().optional()
|
|
24666
24721
|
});
|
|
24667
|
-
async function
|
|
24722
|
+
async function run198(context) {
|
|
24668
24723
|
const { params, error } = context;
|
|
24669
24724
|
const {
|
|
24670
24725
|
host_uuid: hostUuidParam,
|
|
@@ -24732,7 +24787,7 @@ async function run202(context) {
|
|
|
24732
24787
|
appliedCommands
|
|
24733
24788
|
};
|
|
24734
24789
|
}
|
|
24735
|
-
var enable_host_default = task(
|
|
24790
|
+
var enable_host_default = task(run198, {
|
|
24736
24791
|
inputSchema: XcpngEnableHostParamsSchema,
|
|
24737
24792
|
outputSchema: XcpngEnableHostResultSchema,
|
|
24738
24793
|
description: "Enables maintenance-disabled hosts so they rejoin scheduling."
|
|
@@ -24754,7 +24809,7 @@ var XcpngDisableHostResultSchema = z.object({
|
|
|
24754
24809
|
evacuated: z.boolean().optional(),
|
|
24755
24810
|
error: z.string().optional()
|
|
24756
24811
|
});
|
|
24757
|
-
async function
|
|
24812
|
+
async function run199(context) {
|
|
24758
24813
|
const { params, error } = context;
|
|
24759
24814
|
const {
|
|
24760
24815
|
host_uuid: hostUuidParam,
|
|
@@ -24839,7 +24894,7 @@ async function run203(context) {
|
|
|
24839
24894
|
evacuated: evacuate
|
|
24840
24895
|
};
|
|
24841
24896
|
}
|
|
24842
|
-
var disable_host_default = task(
|
|
24897
|
+
var disable_host_default = task(run199, {
|
|
24843
24898
|
inputSchema: XcpngDisableHostParamsSchema,
|
|
24844
24899
|
outputSchema: XcpngDisableHostResultSchema,
|
|
24845
24900
|
description: "Disables a host (optionally evacuating resident VMs first)."
|
|
@@ -24859,7 +24914,7 @@ var XcpngPlugPbdResultSchema = z.object({
|
|
|
24859
24914
|
skipped: z.boolean().optional(),
|
|
24860
24915
|
error: z.string().optional()
|
|
24861
24916
|
});
|
|
24862
|
-
async function
|
|
24917
|
+
async function run200(context) {
|
|
24863
24918
|
const { params, error } = context;
|
|
24864
24919
|
const { pbd_uuid: pbdUuidParam, sr_uuid: srUuid, host_uuid: hostUuid, allow_missing: rawAllowMissing } = params ?? {};
|
|
24865
24920
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -24923,7 +24978,7 @@ async function run204(context) {
|
|
|
24923
24978
|
appliedCommands
|
|
24924
24979
|
};
|
|
24925
24980
|
}
|
|
24926
|
-
var plug_pbd_default = task(
|
|
24981
|
+
var plug_pbd_default = task(run200, {
|
|
24927
24982
|
inputSchema: XcpngPlugPbdParamsSchema,
|
|
24928
24983
|
outputSchema: XcpngPlugPbdResultSchema,
|
|
24929
24984
|
description: "Plugs a PBD so the host reattaches the storage repository."
|
|
@@ -24943,7 +24998,7 @@ var XcpngUnplugPbdResultSchema = z.object({
|
|
|
24943
24998
|
skipped: z.boolean().optional(),
|
|
24944
24999
|
error: z.string().optional()
|
|
24945
25000
|
});
|
|
24946
|
-
async function
|
|
25001
|
+
async function run201(context) {
|
|
24947
25002
|
const { params, error } = context;
|
|
24948
25003
|
const { pbd_uuid: pbdUuidParam, sr_uuid: srUuid, host_uuid: hostUuid, allow_missing: rawAllowMissing } = params ?? {};
|
|
24949
25004
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -25007,7 +25062,7 @@ async function run205(context) {
|
|
|
25007
25062
|
appliedCommands
|
|
25008
25063
|
};
|
|
25009
25064
|
}
|
|
25010
|
-
var unplug_pbd_default = task(
|
|
25065
|
+
var unplug_pbd_default = task(run201, {
|
|
25011
25066
|
inputSchema: XcpngUnplugPbdParamsSchema,
|
|
25012
25067
|
outputSchema: XcpngUnplugPbdResultSchema,
|
|
25013
25068
|
description: "Unplugs a PBD so the host detaches the storage repository."
|
|
@@ -25022,7 +25077,7 @@ var XcpngListPoolsResultSchema = z.object({
|
|
|
25022
25077
|
items: z.any().optional(),
|
|
25023
25078
|
error: z.string().optional()
|
|
25024
25079
|
});
|
|
25025
|
-
async function
|
|
25080
|
+
async function run202(context) {
|
|
25026
25081
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
25027
25082
|
const result = await runXeCommand(context, "pool-list", filters);
|
|
25028
25083
|
if (!result.success) {
|
|
@@ -25036,7 +25091,7 @@ async function run206(context) {
|
|
|
25036
25091
|
items: parseKeyValueOutput(result.stdout)
|
|
25037
25092
|
};
|
|
25038
25093
|
}
|
|
25039
|
-
var list_pools_default = task(
|
|
25094
|
+
var list_pools_default = task(run202, {
|
|
25040
25095
|
inputSchema: XcpngListPoolsParamsSchema,
|
|
25041
25096
|
outputSchema: XcpngListPoolsResultSchema,
|
|
25042
25097
|
description: "Lists pools available to the current host."
|
|
@@ -25057,7 +25112,7 @@ var XcpngFindPoolResultSchema = z.object({
|
|
|
25057
25112
|
multiple: z.boolean().optional(),
|
|
25058
25113
|
error: z.string().optional()
|
|
25059
25114
|
});
|
|
25060
|
-
async function
|
|
25115
|
+
async function run203(context) {
|
|
25061
25116
|
const params = context.params ?? {};
|
|
25062
25117
|
const {
|
|
25063
25118
|
uuid,
|
|
@@ -25157,7 +25212,7 @@ async function runListPools(context, params) {
|
|
|
25157
25212
|
})
|
|
25158
25213
|
);
|
|
25159
25214
|
}
|
|
25160
|
-
var find_pool_default = task(
|
|
25215
|
+
var find_pool_default = task(run203, {
|
|
25161
25216
|
inputSchema: XcpngFindPoolParamsSchema,
|
|
25162
25217
|
outputSchema: XcpngFindPoolResultSchema,
|
|
25163
25218
|
description: "Finds a single pool by UUID or name-label, optionally allowing multiple matches."
|
|
@@ -25176,7 +25231,7 @@ var XcpngSetPoolParamResultSchema = z.object({
|
|
|
25176
25231
|
appliedCommands: z.array(z.string()),
|
|
25177
25232
|
error: z.string().optional()
|
|
25178
25233
|
});
|
|
25179
|
-
async function
|
|
25234
|
+
async function run204(context) {
|
|
25180
25235
|
const { params, error } = context;
|
|
25181
25236
|
const { pool_uuid: poolUuidParam, pool_name_label: poolNameLabel, key, value } = params ?? {};
|
|
25182
25237
|
if (!key) {
|
|
@@ -25237,7 +25292,7 @@ async function run208(context) {
|
|
|
25237
25292
|
appliedCommands
|
|
25238
25293
|
};
|
|
25239
25294
|
}
|
|
25240
|
-
var set_pool_param_default = task(
|
|
25295
|
+
var set_pool_param_default = task(run204, {
|
|
25241
25296
|
inputSchema: XcpngSetPoolParamParamsSchema,
|
|
25242
25297
|
outputSchema: XcpngSetPoolParamResultSchema,
|
|
25243
25298
|
description: "Updates a pool parameter (wraps xe pool-param-set)."
|
|
@@ -25257,7 +25312,7 @@ var XcpngRebootHostResultSchema = z.object({
|
|
|
25257
25312
|
skipped: z.boolean().optional(),
|
|
25258
25313
|
error: z.string().optional()
|
|
25259
25314
|
});
|
|
25260
|
-
async function
|
|
25315
|
+
async function run205(context) {
|
|
25261
25316
|
const { params, error } = context;
|
|
25262
25317
|
const {
|
|
25263
25318
|
host_uuid: hostUuidParam,
|
|
@@ -25323,7 +25378,7 @@ async function run209(context) {
|
|
|
25323
25378
|
command: commandResult.command
|
|
25324
25379
|
};
|
|
25325
25380
|
}
|
|
25326
|
-
var reboot_host_default = task(
|
|
25381
|
+
var reboot_host_default = task(run205, {
|
|
25327
25382
|
inputSchema: XcpngRebootHostParamsSchema,
|
|
25328
25383
|
outputSchema: XcpngRebootHostResultSchema,
|
|
25329
25384
|
description: "Reboots an XCP-ng host (optionally forcing)."
|
|
@@ -25343,7 +25398,7 @@ var XcpngShutdownHostResultSchema = z.object({
|
|
|
25343
25398
|
skipped: z.boolean().optional(),
|
|
25344
25399
|
error: z.string().optional()
|
|
25345
25400
|
});
|
|
25346
|
-
async function
|
|
25401
|
+
async function run206(context) {
|
|
25347
25402
|
const { params, error } = context;
|
|
25348
25403
|
const {
|
|
25349
25404
|
host_uuid: hostUuidParam,
|
|
@@ -25407,7 +25462,7 @@ async function run210(context) {
|
|
|
25407
25462
|
command: commandResult.command
|
|
25408
25463
|
};
|
|
25409
25464
|
}
|
|
25410
|
-
var shutdown_host_default = task(
|
|
25465
|
+
var shutdown_host_default = task(run206, {
|
|
25411
25466
|
inputSchema: XcpngShutdownHostParamsSchema,
|
|
25412
25467
|
outputSchema: XcpngShutdownHostResultSchema,
|
|
25413
25468
|
description: "Shuts down an XCP-ng host (optionally forcing)."
|
|
@@ -25426,7 +25481,7 @@ var XcpngEvacuateHostResultSchema = z.object({
|
|
|
25426
25481
|
skipped: z.boolean().optional(),
|
|
25427
25482
|
error: z.string().optional()
|
|
25428
25483
|
});
|
|
25429
|
-
async function
|
|
25484
|
+
async function run207(context) {
|
|
25430
25485
|
const { params, error } = context;
|
|
25431
25486
|
const { host_uuid: hostUuidParam, host_name_label: hostNameLabel, allow_missing: rawAllowMissing } = params ?? {};
|
|
25432
25487
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -25479,7 +25534,7 @@ async function run211(context) {
|
|
|
25479
25534
|
command: commandResult.command
|
|
25480
25535
|
};
|
|
25481
25536
|
}
|
|
25482
|
-
var evacuate_host_default = task(
|
|
25537
|
+
var evacuate_host_default = task(run207, {
|
|
25483
25538
|
inputSchema: XcpngEvacuateHostParamsSchema,
|
|
25484
25539
|
outputSchema: XcpngEvacuateHostResultSchema,
|
|
25485
25540
|
description: "Evacuates all VMs from a host."
|
|
@@ -25500,7 +25555,7 @@ var XcpngPlugPifResultSchema = z.object({
|
|
|
25500
25555
|
skipped: z.boolean().optional(),
|
|
25501
25556
|
error: z.string().optional()
|
|
25502
25557
|
});
|
|
25503
|
-
async function
|
|
25558
|
+
async function run208(context) {
|
|
25504
25559
|
const { params, error } = context;
|
|
25505
25560
|
const {
|
|
25506
25561
|
pif_uuid: pifUuidParam,
|
|
@@ -25597,7 +25652,7 @@ async function run212(context) {
|
|
|
25597
25652
|
appliedCommands
|
|
25598
25653
|
};
|
|
25599
25654
|
}
|
|
25600
|
-
var plug_pif_default = task(
|
|
25655
|
+
var plug_pif_default = task(run208, {
|
|
25601
25656
|
inputSchema: XcpngPlugPifParamsSchema,
|
|
25602
25657
|
outputSchema: XcpngPlugPifResultSchema,
|
|
25603
25658
|
description: "Plugs a physical interface (PIF) on the specified host."
|
|
@@ -25616,7 +25671,7 @@ var XcpngPifScanResultSchema = z.object({
|
|
|
25616
25671
|
skipped: z.boolean().optional(),
|
|
25617
25672
|
error: z.string().optional()
|
|
25618
25673
|
});
|
|
25619
|
-
async function
|
|
25674
|
+
async function run209(context) {
|
|
25620
25675
|
const { params, error } = context;
|
|
25621
25676
|
const { host_uuid: hostUuidParam, host_name_label: hostNameLabel, allow_missing: rawAllowMissing } = params ?? {};
|
|
25622
25677
|
const allowMissing = coerceBoolean(rawAllowMissing, false);
|
|
@@ -25681,7 +25736,7 @@ async function run213(context) {
|
|
|
25681
25736
|
appliedCommands
|
|
25682
25737
|
};
|
|
25683
25738
|
}
|
|
25684
|
-
var pif_scan_default = task(
|
|
25739
|
+
var pif_scan_default = task(run209, {
|
|
25685
25740
|
inputSchema: XcpngPifScanParamsSchema,
|
|
25686
25741
|
outputSchema: XcpngPifScanResultSchema,
|
|
25687
25742
|
description: "Rescans physical interfaces (PIFs) on a host to discover changes."
|
|
@@ -25702,7 +25757,7 @@ var XcpngUnplugPifResultSchema = z.object({
|
|
|
25702
25757
|
skipped: z.boolean().optional(),
|
|
25703
25758
|
error: z.string().optional()
|
|
25704
25759
|
});
|
|
25705
|
-
async function
|
|
25760
|
+
async function run210(context) {
|
|
25706
25761
|
const { params, error } = context;
|
|
25707
25762
|
const {
|
|
25708
25763
|
pif_uuid: pifUuidParam,
|
|
@@ -25799,7 +25854,7 @@ async function run214(context) {
|
|
|
25799
25854
|
appliedCommands
|
|
25800
25855
|
};
|
|
25801
25856
|
}
|
|
25802
|
-
var unplug_pif_default = task(
|
|
25857
|
+
var unplug_pif_default = task(run210, {
|
|
25803
25858
|
inputSchema: XcpngUnplugPifParamsSchema,
|
|
25804
25859
|
outputSchema: XcpngUnplugPifResultSchema,
|
|
25805
25860
|
description: "Unplugs a physical interface (PIF) on the specified host."
|
|
@@ -25817,7 +25872,7 @@ var XcpngSetPifParamResultSchema = z.object({
|
|
|
25817
25872
|
command: z.string().optional(),
|
|
25818
25873
|
error: z.string().optional()
|
|
25819
25874
|
});
|
|
25820
|
-
async function
|
|
25875
|
+
async function run211(context) {
|
|
25821
25876
|
const { params, error } = context;
|
|
25822
25877
|
const { pif_uuid: pifUuid, key, value } = params ?? {};
|
|
25823
25878
|
if (!pifUuid) {
|
|
@@ -25855,7 +25910,7 @@ async function run215(context) {
|
|
|
25855
25910
|
command: commandResult.command
|
|
25856
25911
|
};
|
|
25857
25912
|
}
|
|
25858
|
-
var set_pif_param_default = task(
|
|
25913
|
+
var set_pif_param_default = task(run211, {
|
|
25859
25914
|
inputSchema: XcpngSetPifParamParamsSchema,
|
|
25860
25915
|
outputSchema: XcpngSetPifParamResultSchema,
|
|
25861
25916
|
description: "Updates a PIF parameter (wraps `xe pif-param-set`)."
|
|
@@ -25872,7 +25927,7 @@ var XcpngUnplugVbdResultSchema = z.object({
|
|
|
25872
25927
|
alreadyDetached: z.boolean().optional(),
|
|
25873
25928
|
error: z.string().optional()
|
|
25874
25929
|
});
|
|
25875
|
-
async function
|
|
25930
|
+
async function run212(context) {
|
|
25876
25931
|
const { params, error } = context;
|
|
25877
25932
|
const { vbd_uuid: vbdUuid, allow_missing: rawAllowMissing } = params;
|
|
25878
25933
|
if (!vbdUuid) {
|
|
@@ -25902,7 +25957,7 @@ async function run216(context) {
|
|
|
25902
25957
|
error: message
|
|
25903
25958
|
};
|
|
25904
25959
|
}
|
|
25905
|
-
var unplug_vbd_default = task(
|
|
25960
|
+
var unplug_vbd_default = task(run212, {
|
|
25906
25961
|
inputSchema: XcpngUnplugVbdParamsSchema,
|
|
25907
25962
|
outputSchema: XcpngUnplugVbdResultSchema,
|
|
25908
25963
|
description: "Unplugs a VBD from an XCP-ng VM, tolerating already-detached devices when allow_missing:true."
|
|
@@ -25922,7 +25977,7 @@ var XcpngSuspendVmResultSchema = z.object({
|
|
|
25922
25977
|
waitAttempts: z.number().optional(),
|
|
25923
25978
|
error: z.string().optional()
|
|
25924
25979
|
});
|
|
25925
|
-
async function
|
|
25980
|
+
async function run213(context) {
|
|
25926
25981
|
const { params, error } = context;
|
|
25927
25982
|
const { vm_uuid: vmUuid, allow_running: rawAllowRunning } = params;
|
|
25928
25983
|
if (!vmUuid) {
|
|
@@ -25983,7 +26038,7 @@ async function run217(context) {
|
|
|
25983
26038
|
waitAttempts: waitResult.attempts
|
|
25984
26039
|
};
|
|
25985
26040
|
}
|
|
25986
|
-
var suspend_vm_default = task(
|
|
26041
|
+
var suspend_vm_default = task(run213, {
|
|
25987
26042
|
inputSchema: XcpngSuspendVmParamsSchema,
|
|
25988
26043
|
outputSchema: XcpngSuspendVmResultSchema,
|
|
25989
26044
|
description: "Suspends an XCP-ng VM, waiting until the VM reports the suspended power state."
|
|
@@ -26004,7 +26059,7 @@ var XcpngResumeVmResultSchema = z.object({
|
|
|
26004
26059
|
waitAttempts: z.number().optional(),
|
|
26005
26060
|
error: z.string().optional()
|
|
26006
26061
|
});
|
|
26007
|
-
async function
|
|
26062
|
+
async function run214(context) {
|
|
26008
26063
|
const { params, error } = context;
|
|
26009
26064
|
const { vm_uuid: vmUuid, start_paused: rawStartPaused, host_uuid: hostUuid } = params;
|
|
26010
26065
|
if (!vmUuid) {
|
|
@@ -26069,7 +26124,7 @@ async function run218(context) {
|
|
|
26069
26124
|
waitAttempts: waitResult.attempts
|
|
26070
26125
|
};
|
|
26071
26126
|
}
|
|
26072
|
-
var resume_vm_default = task(
|
|
26127
|
+
var resume_vm_default = task(run214, {
|
|
26073
26128
|
inputSchema: XcpngResumeVmParamsSchema,
|
|
26074
26129
|
outputSchema: XcpngResumeVmResultSchema,
|
|
26075
26130
|
description: "Resumes a suspended XCP-ng VM, optionally starting it in a paused state or on a specific host."
|
|
@@ -26084,7 +26139,7 @@ var XcpngListVifParamsResultSchema = z.object({
|
|
|
26084
26139
|
items: z.any().optional(),
|
|
26085
26140
|
error: z.string().optional()
|
|
26086
26141
|
});
|
|
26087
|
-
async function
|
|
26142
|
+
async function run215(context) {
|
|
26088
26143
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
26089
26144
|
const result = await runXeCommand(context, "vif-param-list", filters);
|
|
26090
26145
|
if (!result.success) {
|
|
@@ -26098,7 +26153,7 @@ async function run219(context) {
|
|
|
26098
26153
|
items: parseKeyValueOutput(result.stdout)
|
|
26099
26154
|
};
|
|
26100
26155
|
}
|
|
26101
|
-
var list_vif_params_default = task(
|
|
26156
|
+
var list_vif_params_default = task(run215, {
|
|
26102
26157
|
inputSchema: XcpngListVifParamsParamsSchema,
|
|
26103
26158
|
outputSchema: XcpngListVifParamsResultSchema,
|
|
26104
26159
|
description: "Lists parameters for virtual interfaces (VIFs) on an XCP-ng host."
|
|
@@ -26113,7 +26168,7 @@ var XcpngListVifsResultSchema = z.object({
|
|
|
26113
26168
|
items: z.array(z.any()).optional(),
|
|
26114
26169
|
error: z.string().optional()
|
|
26115
26170
|
});
|
|
26116
|
-
async function
|
|
26171
|
+
async function run216(context) {
|
|
26117
26172
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
26118
26173
|
const result = await runXeCommand(context, "vif-list", filters);
|
|
26119
26174
|
if (!result.success) {
|
|
@@ -26161,7 +26216,7 @@ async function run220(context) {
|
|
|
26161
26216
|
items: enrichedItems
|
|
26162
26217
|
};
|
|
26163
26218
|
}
|
|
26164
|
-
var list_vifs_default = task(
|
|
26219
|
+
var list_vifs_default = task(run216, {
|
|
26165
26220
|
inputSchema: XcpngListVifsParamsSchema,
|
|
26166
26221
|
outputSchema: XcpngListVifsResultSchema,
|
|
26167
26222
|
description: "Lists VIFs (virtual interfaces) attached to VMs."
|
|
@@ -26176,7 +26231,7 @@ var XcpngListPifParamsResultSchema = z.object({
|
|
|
26176
26231
|
items: z.any().optional(),
|
|
26177
26232
|
error: z.string().optional()
|
|
26178
26233
|
});
|
|
26179
|
-
async function
|
|
26234
|
+
async function run217(context) {
|
|
26180
26235
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
26181
26236
|
const result = await runXeCommand(context, "pif-param-list", filters);
|
|
26182
26237
|
if (!result.success) {
|
|
@@ -26190,7 +26245,7 @@ async function run221(context) {
|
|
|
26190
26245
|
items: parseKeyValueOutput(result.stdout)
|
|
26191
26246
|
};
|
|
26192
26247
|
}
|
|
26193
|
-
var list_pif_params_default = task(
|
|
26248
|
+
var list_pif_params_default = task(run217, {
|
|
26194
26249
|
inputSchema: XcpngListPifParamsParamsSchema,
|
|
26195
26250
|
outputSchema: XcpngListPifParamsResultSchema,
|
|
26196
26251
|
description: "Lists parameters for PIFs on an XCP-ng host."
|
|
@@ -26205,7 +26260,7 @@ var XcpngListPifsResultSchema = z.object({
|
|
|
26205
26260
|
items: z.array(z.any()).optional(),
|
|
26206
26261
|
error: z.string().optional()
|
|
26207
26262
|
});
|
|
26208
|
-
async function
|
|
26263
|
+
async function run218(context) {
|
|
26209
26264
|
const filters = normalizeFilterArgs(context.params?.filters);
|
|
26210
26265
|
const result = await runXeCommand(context, "pif-list", filters);
|
|
26211
26266
|
if (!result.success) {
|
|
@@ -26253,7 +26308,7 @@ async function run222(context) {
|
|
|
26253
26308
|
items: enrichedItems
|
|
26254
26309
|
};
|
|
26255
26310
|
}
|
|
26256
|
-
var list_pifs_default = task(
|
|
26311
|
+
var list_pifs_default = task(run218, {
|
|
26257
26312
|
inputSchema: XcpngListPifsParamsSchema,
|
|
26258
26313
|
outputSchema: XcpngListPifsResultSchema,
|
|
26259
26314
|
description: "Lists PIFs (physical interfaces) available on the XCP-ng host."
|
|
@@ -26273,7 +26328,7 @@ var XcpngRebootVmResultSchema = z.object({
|
|
|
26273
26328
|
powerState: z.string().optional(),
|
|
26274
26329
|
waitAttempts: z.number().optional()
|
|
26275
26330
|
});
|
|
26276
|
-
async function
|
|
26331
|
+
async function run219(context) {
|
|
26277
26332
|
const { params, error } = context;
|
|
26278
26333
|
const { vm_uuid: vmUuidParam, vm_name_label: vmNameLabel, force: rawForce } = params ?? {};
|
|
26279
26334
|
const force = coerceBoolean(rawForce, false);
|
|
@@ -26334,7 +26389,7 @@ async function run223(context) {
|
|
|
26334
26389
|
waitAttempts: waitResult.attempts
|
|
26335
26390
|
};
|
|
26336
26391
|
}
|
|
26337
|
-
var reboot_vm_default = task(
|
|
26392
|
+
var reboot_vm_default = task(run219, {
|
|
26338
26393
|
inputSchema: XcpngRebootVmParamsSchema,
|
|
26339
26394
|
outputSchema: XcpngRebootVmResultSchema,
|
|
26340
26395
|
description: "Reboots an XCP-ng VM using `xe vm-reboot`."
|
|
@@ -26353,7 +26408,7 @@ var XcpngSetNetworkParamResultSchema = z.object({
|
|
|
26353
26408
|
appliedCommands: z.array(z.string()),
|
|
26354
26409
|
error: z.string().optional()
|
|
26355
26410
|
});
|
|
26356
|
-
async function
|
|
26411
|
+
async function run220(context) {
|
|
26357
26412
|
const { params, error } = context;
|
|
26358
26413
|
const { network_uuid: networkUuidParam, network_name_label: networkNameLabel, key, value } = params ?? {};
|
|
26359
26414
|
if (!key) {
|
|
@@ -26414,7 +26469,7 @@ async function run224(context) {
|
|
|
26414
26469
|
appliedCommands
|
|
26415
26470
|
};
|
|
26416
26471
|
}
|
|
26417
|
-
var set_network_param_default = task(
|
|
26472
|
+
var set_network_param_default = task(run220, {
|
|
26418
26473
|
inputSchema: XcpngSetNetworkParamParamsSchema,
|
|
26419
26474
|
outputSchema: XcpngSetNetworkParamResultSchema,
|
|
26420
26475
|
description: "Updates a network parameter (wraps xe network-param-set)."
|
|
@@ -26438,7 +26493,7 @@ var XcpngResizeVdiResultSchema = z.object({
|
|
|
26438
26493
|
newSizeBytes: z.number().optional(),
|
|
26439
26494
|
error: z.string().optional()
|
|
26440
26495
|
});
|
|
26441
|
-
async function
|
|
26496
|
+
async function run221(context) {
|
|
26442
26497
|
const { params, error } = context;
|
|
26443
26498
|
const {
|
|
26444
26499
|
vdi_uuid: vdiUuidParam,
|
|
@@ -26512,7 +26567,7 @@ async function run225(context) {
|
|
|
26512
26567
|
newSizeBytes: sizeBytes
|
|
26513
26568
|
};
|
|
26514
26569
|
}
|
|
26515
|
-
var resize_vdi_default = task(
|
|
26570
|
+
var resize_vdi_default = task(run221, {
|
|
26516
26571
|
inputSchema: XcpngResizeVdiParamsSchema,
|
|
26517
26572
|
outputSchema: XcpngResizeVdiResultSchema,
|
|
26518
26573
|
description: "Resizes an existing VDI on XCP-ng using `xe vdi-resize`/`vdi-resize-online`."
|
|
@@ -26544,7 +26599,7 @@ var XcpngSetVmResourcesResultSchema = z.object({
|
|
|
26544
26599
|
powerState: z.string().optional(),
|
|
26545
26600
|
waitAttempts: z.number().optional()
|
|
26546
26601
|
});
|
|
26547
|
-
async function
|
|
26602
|
+
async function run222(context) {
|
|
26548
26603
|
const { params, error } = context;
|
|
26549
26604
|
const {
|
|
26550
26605
|
vm_uuid: vmUuidParam,
|
|
@@ -26792,14 +26847,14 @@ async function run226(context) {
|
|
|
26792
26847
|
cpuUpdates.push({ field, value });
|
|
26793
26848
|
}
|
|
26794
26849
|
}
|
|
26795
|
-
for (const
|
|
26850
|
+
for (const update of cpuUpdates) {
|
|
26796
26851
|
const result = await runXeCommand(context, "vm-param-set", {
|
|
26797
26852
|
uuid: vmUuid,
|
|
26798
|
-
[
|
|
26853
|
+
[update.field]: update.value
|
|
26799
26854
|
});
|
|
26800
26855
|
appliedCommands.push(result.command);
|
|
26801
26856
|
if (!result.success) {
|
|
26802
|
-
const message = xeErrorMessage(result, `xe vm-param-set (${
|
|
26857
|
+
const message = xeErrorMessage(result, `xe vm-param-set (${update.field}) failed`);
|
|
26803
26858
|
error(message);
|
|
26804
26859
|
return {
|
|
26805
26860
|
success: false,
|
|
@@ -26847,7 +26902,7 @@ function ensurePositiveMib(value, fieldName) {
|
|
|
26847
26902
|
bytes: mibToBytes2(value)
|
|
26848
26903
|
};
|
|
26849
26904
|
}
|
|
26850
|
-
var set_vm_resources_default = task(
|
|
26905
|
+
var set_vm_resources_default = task(run222, {
|
|
26851
26906
|
inputSchema: XcpngSetVmResourcesParamsSchema,
|
|
26852
26907
|
outputSchema: XcpngSetVmResourcesResultSchema,
|
|
26853
26908
|
description: "Updates VM memory and vCPU settings on an XCP-ng host."
|
|
@@ -26872,7 +26927,7 @@ var XcpngResizeVmCpusResultSchema = z.object({
|
|
|
26872
26927
|
powerState: z.string().optional(),
|
|
26873
26928
|
waitAttempts: z.number().optional()
|
|
26874
26929
|
});
|
|
26875
|
-
async function
|
|
26930
|
+
async function run223(context) {
|
|
26876
26931
|
const { params, error } = context;
|
|
26877
26932
|
const {
|
|
26878
26933
|
vm_uuid: vmUuid,
|
|
@@ -26921,7 +26976,7 @@ async function run227(context) {
|
|
|
26921
26976
|
waitAttempts: result.waitAttempts
|
|
26922
26977
|
};
|
|
26923
26978
|
}
|
|
26924
|
-
var resize_vm_cpus_default = task(
|
|
26979
|
+
var resize_vm_cpus_default = task(run223, {
|
|
26925
26980
|
inputSchema: XcpngResizeVmCpusParamsSchema,
|
|
26926
26981
|
outputSchema: XcpngResizeVmCpusResultSchema,
|
|
26927
26982
|
description: "Resizes an XCP-ng VM\u2019s vCPU configuration."
|
|
@@ -26942,7 +26997,7 @@ var XcpngResizeVmMemoryResultSchema = z.object({
|
|
|
26942
26997
|
powerState: z.string().optional(),
|
|
26943
26998
|
waitAttempts: z.number().optional()
|
|
26944
26999
|
});
|
|
26945
|
-
async function
|
|
27000
|
+
async function run224(context) {
|
|
26946
27001
|
const { params, error } = context;
|
|
26947
27002
|
const { vm_uuid: vmUuid, vm_name_label: vmNameLabel, memory_mib: memoryMib } = params ?? {};
|
|
26948
27003
|
if (!memoryMib || !Number.isFinite(memoryMib) || memoryMib <= 0) {
|
|
@@ -26981,7 +27036,7 @@ async function run228(context) {
|
|
|
26981
27036
|
waitAttempts: result.waitAttempts
|
|
26982
27037
|
};
|
|
26983
27038
|
}
|
|
26984
|
-
var resize_vm_memory_default = task(
|
|
27039
|
+
var resize_vm_memory_default = task(run224, {
|
|
26985
27040
|
inputSchema: XcpngResizeVmMemoryParamsSchema,
|
|
26986
27041
|
outputSchema: XcpngResizeVmMemoryResultSchema,
|
|
26987
27042
|
description: "Resizes an XCP-ng VM\u2019s memory allocation (static/dynamic bounds)."
|
|
@@ -27000,7 +27055,7 @@ var XcpngRevertSnapshotResultSchema = z.object({
|
|
|
27000
27055
|
powerState: z.string().optional(),
|
|
27001
27056
|
waitAttempts: z.number().optional()
|
|
27002
27057
|
});
|
|
27003
|
-
async function
|
|
27058
|
+
async function run225(context) {
|
|
27004
27059
|
const { params, error } = context;
|
|
27005
27060
|
const { snapshot_uuid: snapshotUuid } = params ?? {};
|
|
27006
27061
|
if (!snapshotUuid) {
|
|
@@ -27089,7 +27144,7 @@ async function run229(context) {
|
|
|
27089
27144
|
waitAttempts
|
|
27090
27145
|
};
|
|
27091
27146
|
}
|
|
27092
|
-
var revert_snapshot_default = task(
|
|
27147
|
+
var revert_snapshot_default = task(run225, {
|
|
27093
27148
|
inputSchema: XcpngRevertSnapshotParamsSchema,
|
|
27094
27149
|
outputSchema: XcpngRevertSnapshotResultSchema,
|
|
27095
27150
|
description: "Reverts an XCP-ng VM to a specified snapshot."
|
|
@@ -27107,7 +27162,7 @@ var XcpngSetSnapshotParamResultSchema = z.object({
|
|
|
27107
27162
|
command: z.string().optional(),
|
|
27108
27163
|
error: z.string().optional()
|
|
27109
27164
|
});
|
|
27110
|
-
async function
|
|
27165
|
+
async function run226(context) {
|
|
27111
27166
|
const { params, error } = context;
|
|
27112
27167
|
const { snapshot_uuid: snapshotUuid, key, value } = params ?? {};
|
|
27113
27168
|
if (!snapshotUuid) {
|
|
@@ -27145,7 +27200,7 @@ async function run230(context) {
|
|
|
27145
27200
|
command: commandResult.command
|
|
27146
27201
|
};
|
|
27147
27202
|
}
|
|
27148
|
-
var set_snapshot_param_default = task(
|
|
27203
|
+
var set_snapshot_param_default = task(run226, {
|
|
27149
27204
|
inputSchema: XcpngSetSnapshotParamParamsSchema,
|
|
27150
27205
|
outputSchema: XcpngSetSnapshotParamResultSchema,
|
|
27151
27206
|
description: "Updates a snapshot parameter (wraps xe snapshot-param-set)."
|
|
@@ -27164,7 +27219,7 @@ var XcpngSetSrParamResultSchema = z.object({
|
|
|
27164
27219
|
appliedCommands: z.array(z.string()),
|
|
27165
27220
|
error: z.string().optional()
|
|
27166
27221
|
});
|
|
27167
|
-
async function
|
|
27222
|
+
async function run227(context) {
|
|
27168
27223
|
const { params, error } = context;
|
|
27169
27224
|
const { sr_uuid: srUuidParam, sr_name_label: srNameLabel, key, value } = params ?? {};
|
|
27170
27225
|
if (!key) {
|
|
@@ -27225,7 +27280,7 @@ async function run231(context) {
|
|
|
27225
27280
|
appliedCommands
|
|
27226
27281
|
};
|
|
27227
27282
|
}
|
|
27228
|
-
var set_sr_param_default = task(
|
|
27283
|
+
var set_sr_param_default = task(run227, {
|
|
27229
27284
|
inputSchema: XcpngSetSrParamParamsSchema,
|
|
27230
27285
|
outputSchema: XcpngSetSrParamResultSchema,
|
|
27231
27286
|
description: "Updates a storage repository parameter (wraps xe sr-param-set)."
|
|
@@ -27246,7 +27301,7 @@ var XcpngStartVmResultSchema = z.object({
|
|
|
27246
27301
|
finalPowerState: z.string().optional(),
|
|
27247
27302
|
waitAttempts: z.number().optional()
|
|
27248
27303
|
});
|
|
27249
|
-
async function
|
|
27304
|
+
async function run228(context) {
|
|
27250
27305
|
const { params, error } = context;
|
|
27251
27306
|
const { vm_uuid, start_paused: rawStartPaused, force: rawForce } = params;
|
|
27252
27307
|
const startPaused = coerceBoolean(rawStartPaused, false);
|
|
@@ -27313,7 +27368,7 @@ async function run232(context) {
|
|
|
27313
27368
|
waitAttempts: waitResult.attempts
|
|
27314
27369
|
};
|
|
27315
27370
|
}
|
|
27316
|
-
var start_vm_default = task(
|
|
27371
|
+
var start_vm_default = task(run228, {
|
|
27317
27372
|
inputSchema: XcpngStartVmParamsSchema,
|
|
27318
27373
|
outputSchema: XcpngStartVmResultSchema,
|
|
27319
27374
|
description: "Starts an XCP-ng virtual machine with optional paused or forced modes."
|
|
@@ -27334,7 +27389,7 @@ var XcpngStopVmResultSchema = z.object({
|
|
|
27334
27389
|
finalPowerState: z.string().optional(),
|
|
27335
27390
|
waitAttempts: z.number().optional()
|
|
27336
27391
|
});
|
|
27337
|
-
async function
|
|
27392
|
+
async function run229(context) {
|
|
27338
27393
|
const { params, error } = context;
|
|
27339
27394
|
const { vm_uuid, force: rawForce, timeout_seconds: rawTimeout } = params;
|
|
27340
27395
|
const force = coerceBoolean(rawForce, false);
|
|
@@ -27409,7 +27464,7 @@ async function run233(context) {
|
|
|
27409
27464
|
waitAttempts: waitResult.attempts
|
|
27410
27465
|
};
|
|
27411
27466
|
}
|
|
27412
|
-
var stop_vm_default = task(
|
|
27467
|
+
var stop_vm_default = task(run229, {
|
|
27413
27468
|
inputSchema: XcpngStopVmParamsSchema,
|
|
27414
27469
|
outputSchema: XcpngStopVmResultSchema,
|
|
27415
27470
|
description: "Stops an XCP-ng virtual machine gracefully or forcefully."
|
|
@@ -27438,7 +27493,7 @@ var XcpngImportIsoResultSchema = z.object({
|
|
|
27438
27493
|
commands: z.array(z.string()),
|
|
27439
27494
|
error: z.string().optional()
|
|
27440
27495
|
});
|
|
27441
|
-
async function
|
|
27496
|
+
async function run230(context) {
|
|
27442
27497
|
if (!context.host) {
|
|
27443
27498
|
return {
|
|
27444
27499
|
success: false,
|
|
@@ -27644,7 +27699,7 @@ async function findIsoVdi2(context, srUuid, isoFileName) {
|
|
|
27644
27699
|
}
|
|
27645
27700
|
return { vdi };
|
|
27646
27701
|
}
|
|
27647
|
-
var import_iso_default = task(
|
|
27702
|
+
var import_iso_default = task(run230, {
|
|
27648
27703
|
inputSchema: XcpngImportIsoParamsSchema,
|
|
27649
27704
|
outputSchema: XcpngImportIsoResultSchema,
|
|
27650
27705
|
description: "Ensures an ISO file is represented as a VDI in an ISO SR by rescanning and importing when necessary."
|
|
@@ -27652,7 +27707,7 @@ var import_iso_default = task(run234, {
|
|
|
27652
27707
|
|
|
27653
27708
|
// src/core/xcpng/upload-iso.ts
|
|
27654
27709
|
import { basename, posix as pathPosix3 } from "path";
|
|
27655
|
-
import { createReadStream, promises as
|
|
27710
|
+
import { createReadStream, promises as fs9 } from "fs";
|
|
27656
27711
|
var DEFAULT_ISO_SR_PATH3 = "/var/opt/xen/iso-sr";
|
|
27657
27712
|
var XcpngUploadIsoParamsSchema = z.object({
|
|
27658
27713
|
source_path: z.string(),
|
|
@@ -27673,7 +27728,7 @@ var XcpngUploadIsoHostResultSchema = z.object({
|
|
|
27673
27728
|
remotePath: z.string().optional(),
|
|
27674
27729
|
error: z.string().optional()
|
|
27675
27730
|
});
|
|
27676
|
-
async function
|
|
27731
|
+
async function run231(context) {
|
|
27677
27732
|
if (context.host) {
|
|
27678
27733
|
return {
|
|
27679
27734
|
success: false,
|
|
@@ -27709,7 +27764,7 @@ async function run235(context) {
|
|
|
27709
27764
|
const resolvedLocation = location ?? DEFAULT_ISO_SR_PATH3;
|
|
27710
27765
|
const remoteFileName = filename ?? basename(sourcePath);
|
|
27711
27766
|
try {
|
|
27712
|
-
const stats = await
|
|
27767
|
+
const stats = await fs9.stat(sourcePath);
|
|
27713
27768
|
if (!stats.isFile()) {
|
|
27714
27769
|
return {
|
|
27715
27770
|
success: false,
|
|
@@ -27728,10 +27783,10 @@ async function run235(context) {
|
|
|
27728
27783
|
const uploads = await context.ssh(
|
|
27729
27784
|
[],
|
|
27730
27785
|
async (remoteContext) => {
|
|
27731
|
-
const { run:
|
|
27786
|
+
const { run: run249 } = remoteContext;
|
|
27732
27787
|
const remotePath = pathPosix3.join(resolvedLocation, remoteFileName);
|
|
27733
27788
|
try {
|
|
27734
|
-
const srResult = await
|
|
27789
|
+
const srResult = await run249(
|
|
27735
27790
|
find_or_create_iso_sr_default({
|
|
27736
27791
|
name_label: isoSrName,
|
|
27737
27792
|
location: resolvedLocation,
|
|
@@ -27748,7 +27803,7 @@ async function run235(context) {
|
|
|
27748
27803
|
error: srResult.error ?? "Failed to ensure ISO SR exists."
|
|
27749
27804
|
};
|
|
27750
27805
|
}
|
|
27751
|
-
const fileExistsResult = await
|
|
27806
|
+
const fileExistsResult = await run249(exists_default2({ path: remotePath }));
|
|
27752
27807
|
if (fileExistsResult.exists) {
|
|
27753
27808
|
return {
|
|
27754
27809
|
success: true,
|
|
@@ -27815,7 +27870,7 @@ function resolveChunkSizeBytes(chunkSizeMb) {
|
|
|
27815
27870
|
const bounded = Math.min(Math.max(safeSize, MIN_CHUNK_SIZE_MB), MAX_CHUNK_SIZE_MB);
|
|
27816
27871
|
return bounded * 1024 * 1024;
|
|
27817
27872
|
}
|
|
27818
|
-
var upload_iso_default = task(
|
|
27873
|
+
var upload_iso_default = task(run231, {
|
|
27819
27874
|
inputSchema: XcpngUploadIsoParamsSchema,
|
|
27820
27875
|
outputSchema: XcpngUploadIsoHostResultSchema,
|
|
27821
27876
|
description: "Uploads a local ISO to the remote XCP-ng hypervisor, ensuring the target ISO SR exists beforehand."
|
|
@@ -27852,7 +27907,7 @@ function parseMapValue(raw) {
|
|
|
27852
27907
|
return acc;
|
|
27853
27908
|
}, {});
|
|
27854
27909
|
}
|
|
27855
|
-
async function
|
|
27910
|
+
async function run232(context) {
|
|
27856
27911
|
const { params, error } = context;
|
|
27857
27912
|
const {
|
|
27858
27913
|
vm_uuid: vmUuidParam,
|
|
@@ -27990,7 +28045,7 @@ async function run236(context) {
|
|
|
27990
28045
|
}
|
|
27991
28046
|
return result;
|
|
27992
28047
|
}
|
|
27993
|
-
var get_vm_info_default = task(
|
|
28048
|
+
var get_vm_info_default = task(run232, {
|
|
27994
28049
|
inputSchema: XcpngGetVmInfoParamsSchema,
|
|
27995
28050
|
outputSchema: XcpngGetVmInfoResultSchema,
|
|
27996
28051
|
description: "Returns structured VM details (platform, boot configuration, memory/CPU sizing, and optional VBD/VIF inventory)."
|
|
@@ -28014,7 +28069,7 @@ var XcpngExportVdiResultSchema = z.object({
|
|
|
28014
28069
|
skipped: z.boolean().optional(),
|
|
28015
28070
|
error: z.string().optional()
|
|
28016
28071
|
});
|
|
28017
|
-
async function
|
|
28072
|
+
async function run233(context) {
|
|
28018
28073
|
const { params, error } = context;
|
|
28019
28074
|
const {
|
|
28020
28075
|
vdi_uuid: vdiUuidParam,
|
|
@@ -28094,7 +28149,7 @@ async function run237(context) {
|
|
|
28094
28149
|
appliedCommands
|
|
28095
28150
|
};
|
|
28096
28151
|
}
|
|
28097
|
-
var export_vdi_default = task(
|
|
28152
|
+
var export_vdi_default = task(run233, {
|
|
28098
28153
|
inputSchema: XcpngExportVdiParamsSchema,
|
|
28099
28154
|
outputSchema: XcpngExportVdiResultSchema,
|
|
28100
28155
|
description: "Exports a VDI to the hypervisor filesystem via xe vdi-export."
|
|
@@ -28148,7 +28203,7 @@ var XcpngProvisionVmFromIsoResultSchema = z.object({
|
|
|
28148
28203
|
steps: z.array(z.any()),
|
|
28149
28204
|
error: z.string().optional()
|
|
28150
28205
|
});
|
|
28151
|
-
async function
|
|
28206
|
+
async function run234(context) {
|
|
28152
28207
|
if (!context.host) {
|
|
28153
28208
|
return {
|
|
28154
28209
|
success: false,
|
|
@@ -28475,7 +28530,7 @@ async function run238(context) {
|
|
|
28475
28530
|
steps
|
|
28476
28531
|
};
|
|
28477
28532
|
}
|
|
28478
|
-
var provision_vm_from_iso_default = task(
|
|
28533
|
+
var provision_vm_from_iso_default = task(run234, {
|
|
28479
28534
|
inputSchema: XcpngProvisionVmFromIsoParamsSchema,
|
|
28480
28535
|
outputSchema: XcpngProvisionVmFromIsoResultSchema,
|
|
28481
28536
|
description: "Creates a VM from a template, attaches storage, network, and ISO media, and optionally boots it for installation."
|
|
@@ -29505,7 +29560,7 @@ function resolveMemoryMib(input) {
|
|
|
29505
29560
|
}
|
|
29506
29561
|
return { value: Math.floor(value) };
|
|
29507
29562
|
}
|
|
29508
|
-
async function
|
|
29563
|
+
async function run235(context) {
|
|
29509
29564
|
if (!context.host) {
|
|
29510
29565
|
return runLocal(context);
|
|
29511
29566
|
}
|
|
@@ -29718,7 +29773,7 @@ function buildLocalFailure(step, message) {
|
|
|
29718
29773
|
error: message
|
|
29719
29774
|
};
|
|
29720
29775
|
}
|
|
29721
|
-
var provision_vm_default = task(
|
|
29776
|
+
var provision_vm_default = task(run235, {
|
|
29722
29777
|
inputSchema: XcpngProvisionVmParamsSchema,
|
|
29723
29778
|
outputSchema: XcpngProvisionVmResultSchema,
|
|
29724
29779
|
description: "Provisions a VM from an XCP-ng template by cloning its root disk, configuring cloud-init metadata, and attaching network resources."
|
|
@@ -29784,7 +29839,7 @@ var XcpngSnapshotVmResultSchema = z.object({
|
|
|
29784
29839
|
command: z.string().optional(),
|
|
29785
29840
|
error: z.string().optional()
|
|
29786
29841
|
});
|
|
29787
|
-
async function
|
|
29842
|
+
async function run236(context) {
|
|
29788
29843
|
const { params, error } = context;
|
|
29789
29844
|
const {
|
|
29790
29845
|
vm_uuid: vmUuidParam,
|
|
@@ -29854,7 +29909,7 @@ async function run240(context) {
|
|
|
29854
29909
|
command: snapshotResult.command
|
|
29855
29910
|
};
|
|
29856
29911
|
}
|
|
29857
|
-
var snapshot_vm_default = task(
|
|
29912
|
+
var snapshot_vm_default = task(run236, {
|
|
29858
29913
|
inputSchema: XcpngSnapshotVmParamsSchema,
|
|
29859
29914
|
outputSchema: XcpngSnapshotVmResultSchema,
|
|
29860
29915
|
description: "Creates a snapshot of an XCP-ng VM (optionally with quiesce)."
|
|
@@ -29881,7 +29936,7 @@ var XcpngImportVdiResultSchema = z.object({
|
|
|
29881
29936
|
appliedCommands: z.array(z.string()),
|
|
29882
29937
|
error: z.string().optional()
|
|
29883
29938
|
});
|
|
29884
|
-
async function
|
|
29939
|
+
async function run237(context) {
|
|
29885
29940
|
const { params, error } = context;
|
|
29886
29941
|
const {
|
|
29887
29942
|
sr_uuid: srUuidParam,
|
|
@@ -30003,7 +30058,7 @@ async function run241(context) {
|
|
|
30003
30058
|
appliedCommands
|
|
30004
30059
|
};
|
|
30005
30060
|
}
|
|
30006
|
-
var import_vdi_default = task(
|
|
30061
|
+
var import_vdi_default = task(run237, {
|
|
30007
30062
|
inputSchema: XcpngImportVdiParamsSchema,
|
|
30008
30063
|
outputSchema: XcpngImportVdiResultSchema,
|
|
30009
30064
|
description: "Imports a VDI file into a storage repository via xe vdi-import."
|
|
@@ -30105,7 +30160,7 @@ var XcpngVmMigrateResultSchema = z.object({
|
|
|
30105
30160
|
skipped: z.boolean().optional(),
|
|
30106
30161
|
error: z.string().optional()
|
|
30107
30162
|
});
|
|
30108
|
-
async function
|
|
30163
|
+
async function run238(context) {
|
|
30109
30164
|
const { params, error } = context;
|
|
30110
30165
|
const {
|
|
30111
30166
|
vm_uuid: vmUuidParam,
|
|
@@ -30229,7 +30284,7 @@ async function run242(context) {
|
|
|
30229
30284
|
appliedCommands
|
|
30230
30285
|
};
|
|
30231
30286
|
}
|
|
30232
|
-
var vm_migrate_default = task(
|
|
30287
|
+
var vm_migrate_default = task(run238, {
|
|
30233
30288
|
inputSchema: XcpngVmMigrateParamsSchema,
|
|
30234
30289
|
outputSchema: XcpngVmMigrateResultSchema,
|
|
30235
30290
|
description: "Migrates a VM to another host (and optionally storage repository) via xe vm-migrate."
|
|
@@ -30254,7 +30309,7 @@ var XcpngVmExportResultSchema = z.object({
|
|
|
30254
30309
|
skipped: z.boolean().optional(),
|
|
30255
30310
|
error: z.string().optional()
|
|
30256
30311
|
});
|
|
30257
|
-
async function
|
|
30312
|
+
async function run239(context) {
|
|
30258
30313
|
const { params, error } = context;
|
|
30259
30314
|
const {
|
|
30260
30315
|
vm_uuid: vmUuidParam,
|
|
@@ -30343,7 +30398,7 @@ async function run243(context) {
|
|
|
30343
30398
|
appliedCommands
|
|
30344
30399
|
};
|
|
30345
30400
|
}
|
|
30346
|
-
var vm_export_default = task(
|
|
30401
|
+
var vm_export_default = task(run239, {
|
|
30347
30402
|
inputSchema: XcpngVmExportParamsSchema,
|
|
30348
30403
|
outputSchema: XcpngVmExportResultSchema,
|
|
30349
30404
|
description: "Exports a VM to an XVA file via xe vm-export."
|
|
@@ -30365,7 +30420,7 @@ var XcpngVmImportResultSchema = z.object({
|
|
|
30365
30420
|
appliedCommands: z.array(z.string()),
|
|
30366
30421
|
error: z.string().optional()
|
|
30367
30422
|
});
|
|
30368
|
-
async function
|
|
30423
|
+
async function run240(context) {
|
|
30369
30424
|
const { params, error } = context;
|
|
30370
30425
|
const {
|
|
30371
30426
|
filename,
|
|
@@ -30434,7 +30489,7 @@ async function run244(context) {
|
|
|
30434
30489
|
appliedCommands
|
|
30435
30490
|
};
|
|
30436
30491
|
}
|
|
30437
|
-
var vm_import_default = task(
|
|
30492
|
+
var vm_import_default = task(run240, {
|
|
30438
30493
|
inputSchema: XcpngVmImportParamsSchema,
|
|
30439
30494
|
outputSchema: XcpngVmImportResultSchema,
|
|
30440
30495
|
description: "Imports a VM image from an XVA file via xe vm-import."
|
|
@@ -30461,7 +30516,7 @@ var XcpngVmCopyResultSchema = z.object({
|
|
|
30461
30516
|
skipped: z.boolean().optional(),
|
|
30462
30517
|
error: z.string().optional()
|
|
30463
30518
|
});
|
|
30464
|
-
async function
|
|
30519
|
+
async function run241(context) {
|
|
30465
30520
|
const { params, error } = context;
|
|
30466
30521
|
const {
|
|
30467
30522
|
vm_uuid: vmUuidParam,
|
|
@@ -30588,7 +30643,7 @@ async function run245(context) {
|
|
|
30588
30643
|
appliedCommands
|
|
30589
30644
|
};
|
|
30590
30645
|
}
|
|
30591
|
-
var vm_copy_default = task(
|
|
30646
|
+
var vm_copy_default = task(run241, {
|
|
30592
30647
|
inputSchema: XcpngVmCopyParamsSchema,
|
|
30593
30648
|
outputSchema: XcpngVmCopyResultSchema,
|
|
30594
30649
|
description: "Creates a full copy of a VM, optionally targeting a different SR."
|
|
@@ -30608,7 +30663,7 @@ var XcpngDetachCdMediaResultSchema = z.object({
|
|
|
30608
30663
|
error: z.string().optional(),
|
|
30609
30664
|
skipped: z.boolean().optional()
|
|
30610
30665
|
});
|
|
30611
|
-
async function
|
|
30666
|
+
async function run242(context) {
|
|
30612
30667
|
if (!context.host) {
|
|
30613
30668
|
return {
|
|
30614
30669
|
success: false,
|
|
@@ -30745,7 +30800,7 @@ function filterCdDisks(disks) {
|
|
|
30745
30800
|
}
|
|
30746
30801
|
return results;
|
|
30747
30802
|
}
|
|
30748
|
-
var detach_cd_media_default = task(
|
|
30803
|
+
var detach_cd_media_default = task(run242, {
|
|
30749
30804
|
inputSchema: XcpngDetachCdMediaParamsSchema,
|
|
30750
30805
|
outputSchema: XcpngDetachCdMediaResultSchema,
|
|
30751
30806
|
description: "Detaches CD/DVD virtual media from a VM by unplugging and destroying associated VBDs."
|
|
@@ -30768,7 +30823,7 @@ var XcpngCleanupConfigDriveResultSchema = z.object({
|
|
|
30768
30823
|
error: z.string().optional(),
|
|
30769
30824
|
skipped: z.boolean().optional()
|
|
30770
30825
|
});
|
|
30771
|
-
async function
|
|
30826
|
+
async function run243(context) {
|
|
30772
30827
|
if (!context.host) {
|
|
30773
30828
|
return {
|
|
30774
30829
|
success: false,
|
|
@@ -30968,7 +31023,7 @@ async function run247(context) {
|
|
|
30968
31023
|
steps
|
|
30969
31024
|
};
|
|
30970
31025
|
}
|
|
30971
|
-
var cleanup_config_drive_default = task(
|
|
31026
|
+
var cleanup_config_drive_default = task(run243, {
|
|
30972
31027
|
inputSchema: XcpngCleanupConfigDriveParamsSchema,
|
|
30973
31028
|
outputSchema: XcpngCleanupConfigDriveResultSchema,
|
|
30974
31029
|
description: "Detaches an attached config-drive ISO from a VM and removes the associated VDI once the guest is halted."
|
|
@@ -31107,7 +31162,7 @@ var YumAddRepositoryResultSchema = z.object({
|
|
|
31107
31162
|
error: z.string().optional()
|
|
31108
31163
|
})
|
|
31109
31164
|
);
|
|
31110
|
-
async function
|
|
31165
|
+
async function run244(context) {
|
|
31111
31166
|
const { params, exec, info, error } = context;
|
|
31112
31167
|
const { content, name, sudo = true } = params;
|
|
31113
31168
|
if (!content) {
|
|
@@ -31139,7 +31194,7 @@ EOF`;
|
|
|
31139
31194
|
return { success: false, error: errorMsg };
|
|
31140
31195
|
}
|
|
31141
31196
|
}
|
|
31142
|
-
var add_repository_default2 = task(
|
|
31197
|
+
var add_repository_default2 = task(run244, {
|
|
31143
31198
|
description: "Adds a YUM repository.",
|
|
31144
31199
|
inputSchema: YumAddRepositoryParamsSchema,
|
|
31145
31200
|
outputSchema: YumAddRepositoryResultSchema
|
|
@@ -31165,7 +31220,7 @@ var DownloadOutputSchema = z.object({
|
|
|
31165
31220
|
path: z.string().optional(),
|
|
31166
31221
|
error: z.string().optional()
|
|
31167
31222
|
});
|
|
31168
|
-
async function
|
|
31223
|
+
async function run245(context) {
|
|
31169
31224
|
const { params, info, error, exec } = context;
|
|
31170
31225
|
const { url, dest, mode, sudo = false } = params;
|
|
31171
31226
|
if (!url || !dest) {
|
|
@@ -31210,7 +31265,7 @@ async function run249(context) {
|
|
|
31210
31265
|
return { success: false, error: errorMsg };
|
|
31211
31266
|
}
|
|
31212
31267
|
}
|
|
31213
|
-
var download_default = task(
|
|
31268
|
+
var download_default = task(run245, {
|
|
31214
31269
|
description: "Downloads a file from a URL using curl or wget.",
|
|
31215
31270
|
inputSchema: DownloadInputSchema,
|
|
31216
31271
|
outputSchema: DownloadOutputSchema
|
|
@@ -31241,7 +31296,7 @@ var InterfacesOutputSchema = z.object({
|
|
|
31241
31296
|
error: z.string()
|
|
31242
31297
|
})
|
|
31243
31298
|
);
|
|
31244
|
-
async function
|
|
31299
|
+
async function run246(context) {
|
|
31245
31300
|
const { params, info, error, exec } = context;
|
|
31246
31301
|
const { sudo = false } = params;
|
|
31247
31302
|
try {
|
|
@@ -31333,7 +31388,7 @@ async function run250(context) {
|
|
|
31333
31388
|
return { success: false, error: errorMsg };
|
|
31334
31389
|
}
|
|
31335
31390
|
}
|
|
31336
|
-
var interfaces_default = task(
|
|
31391
|
+
var interfaces_default = task(run246, {
|
|
31337
31392
|
name: "interfaces",
|
|
31338
31393
|
description: "Lists network interfaces with their properties.",
|
|
31339
31394
|
inputSchema: InterfacesInputSchema,
|
|
@@ -31359,7 +31414,7 @@ var NftablesApplyOutputSchema = z.object({
|
|
|
31359
31414
|
error: z.string().optional()
|
|
31360
31415
|
})
|
|
31361
31416
|
);
|
|
31362
|
-
async function
|
|
31417
|
+
async function run247(context) {
|
|
31363
31418
|
const { params, exec, info } = context;
|
|
31364
31419
|
const { config } = params;
|
|
31365
31420
|
if (!config) {
|
|
@@ -31383,7 +31438,7 @@ async function run251(context) {
|
|
|
31383
31438
|
return { success: false, error };
|
|
31384
31439
|
}
|
|
31385
31440
|
}
|
|
31386
|
-
var apply_default = task(
|
|
31441
|
+
var apply_default = task(run247, {
|
|
31387
31442
|
description: "Applies an nftables configuration.",
|
|
31388
31443
|
inputSchema: NftablesApplyInputSchema,
|
|
31389
31444
|
outputSchema: NftablesApplyOutputSchema
|
|
@@ -31406,7 +31461,7 @@ var FirewalldDisableResultSchema = z.object({
|
|
|
31406
31461
|
success: z.boolean(),
|
|
31407
31462
|
error: z.string().optional()
|
|
31408
31463
|
});
|
|
31409
|
-
async function
|
|
31464
|
+
async function run248(context) {
|
|
31410
31465
|
const { run: runTask, debug, error, info } = context;
|
|
31411
31466
|
const statusResult = await runTask(status_default({ service: "firewalld", sudo: true }));
|
|
31412
31467
|
if (!statusResult.success && (statusResult.error?.includes("Could not find") || statusResult.error?.includes("not-found"))) {
|
|
@@ -31430,7 +31485,7 @@ async function run252(context) {
|
|
|
31430
31485
|
info("firewalld service disabled successfully.");
|
|
31431
31486
|
return { success: true };
|
|
31432
31487
|
}
|
|
31433
|
-
var disable_default3 = task(
|
|
31488
|
+
var disable_default3 = task(run248, {
|
|
31434
31489
|
description: "Disables and stops the firewalld service.",
|
|
31435
31490
|
inputSchema: FirewalldDisableInputSchema,
|
|
31436
31491
|
outputSchema: FirewalldDisableResultSchema
|
|
@@ -31953,6 +32008,15 @@ var TaskCacheStore = class {
|
|
|
31953
32008
|
};
|
|
31954
32009
|
|
|
31955
32010
|
// src/app.ts
|
|
32011
|
+
function normalizePrivateKey2(value) {
|
|
32012
|
+
if (!value.includes("\n") && value.includes("\\n")) {
|
|
32013
|
+
return value.replace(/\\n/g, "\n");
|
|
32014
|
+
}
|
|
32015
|
+
return value;
|
|
32016
|
+
}
|
|
32017
|
+
function looksLikePrivateKey2(value) {
|
|
32018
|
+
return /-----BEGIN [A-Z0-9 ]+PRIVATE KEY-----/.test(value);
|
|
32019
|
+
}
|
|
31956
32020
|
var TaskTree = class {
|
|
31957
32021
|
// private taskEventBus: Emittery<{ newTask: NewTaskEvent; taskComplete: TaskCompleteEvent }>;
|
|
31958
32022
|
listr;
|
|
@@ -32073,8 +32137,8 @@ var App3 = class _App {
|
|
|
32073
32137
|
}
|
|
32074
32138
|
get tmpDir() {
|
|
32075
32139
|
if (!this._tmpDir) {
|
|
32076
|
-
if (!
|
|
32077
|
-
|
|
32140
|
+
if (!fs10.existsSync(this.hostctlDir().toString())) {
|
|
32141
|
+
fs10.mkdirSync(this.hostctlDir().toString(), { recursive: true });
|
|
32078
32142
|
}
|
|
32079
32143
|
this._tmpDir = this.createNamedTmpDir(version);
|
|
32080
32144
|
}
|
|
@@ -32088,10 +32152,11 @@ var App3 = class _App {
|
|
|
32088
32152
|
this.configProvider = provider;
|
|
32089
32153
|
if (provider instanceof FileConfigProvider) {
|
|
32090
32154
|
this.configRef = provider.path;
|
|
32155
|
+
this._config = await provider.getConfigFile();
|
|
32091
32156
|
} else {
|
|
32092
32157
|
this.configRef = "provider";
|
|
32158
|
+
this._config = await ProviderConfig.load(provider);
|
|
32093
32159
|
}
|
|
32094
|
-
this._config = await ProviderConfig.load(provider);
|
|
32095
32160
|
}
|
|
32096
32161
|
isValidUrl(url) {
|
|
32097
32162
|
try {
|
|
@@ -32295,9 +32360,28 @@ ${cmdRes.stderr.trim()}`));
|
|
|
32295
32360
|
host: host.hostname,
|
|
32296
32361
|
port: host.port,
|
|
32297
32362
|
username: host.user,
|
|
32298
|
-
password: hostPassword
|
|
32299
|
-
privateKeyPath: await host.plaintextSshKeyPath()
|
|
32363
|
+
password: hostPassword
|
|
32300
32364
|
};
|
|
32365
|
+
const sshKeyPassphrase = await host.decryptedSshKeyPassphrase();
|
|
32366
|
+
if (sshKeyPassphrase) {
|
|
32367
|
+
sshConnection.passphrase = sshKeyPassphrase;
|
|
32368
|
+
}
|
|
32369
|
+
const decryptedKey = await host.decryptedSshKey();
|
|
32370
|
+
if (decryptedKey) {
|
|
32371
|
+
const normalizedKey = normalizePrivateKey2(decryptedKey).trim();
|
|
32372
|
+
if (looksLikePrivateKey2(normalizedKey)) {
|
|
32373
|
+
sshConnection.privateKey = normalizedKey;
|
|
32374
|
+
} else if (fs10.existsSync(normalizedKey)) {
|
|
32375
|
+
sshConnection.privateKeyPath = normalizedKey;
|
|
32376
|
+
} else {
|
|
32377
|
+
sshConnection.privateKey = normalizedKey;
|
|
32378
|
+
}
|
|
32379
|
+
} else {
|
|
32380
|
+
const keyPath = await host.plaintextSshKeyPath();
|
|
32381
|
+
if (keyPath) {
|
|
32382
|
+
sshConnection.privateKeyPath = keyPath;
|
|
32383
|
+
}
|
|
32384
|
+
}
|
|
32301
32385
|
const interactionHandler = InteractionHandler.with(withSudo(hostPassword));
|
|
32302
32386
|
const session = new SSHSession();
|
|
32303
32387
|
await session.connect(sshConnection);
|
|
@@ -32707,7 +32791,7 @@ ${cmdRes.stderr.trim()}`));
|
|
|
32707
32791
|
await configFile.decryptAllIfPossible();
|
|
32708
32792
|
const successfullyUsedIdentityPaths = configFile.loadPrivateKeys().filter((identity2) => {
|
|
32709
32793
|
try {
|
|
32710
|
-
return
|
|
32794
|
+
return fs10.existsSync(identity2.identityFilePath);
|
|
32711
32795
|
} catch (e) {
|
|
32712
32796
|
return false;
|
|
32713
32797
|
}
|
|
@@ -33087,7 +33171,7 @@ ${successfullyUsedIdentityPaths}`);
|
|
|
33087
33171
|
};
|
|
33088
33172
|
|
|
33089
33173
|
// src/commands/pkg/create.ts
|
|
33090
|
-
import { promises as
|
|
33174
|
+
import { promises as fs11 } from "fs";
|
|
33091
33175
|
import os5 from "os";
|
|
33092
33176
|
import path11 from "path";
|
|
33093
33177
|
function expandTildePath(input) {
|
|
@@ -33314,22 +33398,22 @@ async function createPackage(packageName, options, output) {
|
|
|
33314
33398
|
const packageSlug = path11.basename(resolvedName);
|
|
33315
33399
|
const packageJsonName = packageName.startsWith("@") ? packageName : packageSlug;
|
|
33316
33400
|
const registryPrefix = registryPrefixFromPackageName(packageSlug);
|
|
33317
|
-
await
|
|
33401
|
+
await fs11.mkdir(packageDir, { recursive: true });
|
|
33318
33402
|
if (options.lang === "typescript") {
|
|
33319
|
-
await
|
|
33320
|
-
await
|
|
33321
|
-
await
|
|
33322
|
-
await
|
|
33323
|
-
await
|
|
33324
|
-
await
|
|
33325
|
-
await
|
|
33403
|
+
await fs11.writeFile(path11.join(packageDir, "package.json"), packageJsonTsTemplate(packageJsonName));
|
|
33404
|
+
await fs11.writeFile(path11.join(packageDir, "tsconfig.json"), tsconfigTemplate);
|
|
33405
|
+
await fs11.mkdir(path11.join(packageDir, "src", "tasks"), { recursive: true });
|
|
33406
|
+
await fs11.writeFile(path11.join(packageDir, "src", "index.ts"), indexTsTemplate(registryPrefix));
|
|
33407
|
+
await fs11.writeFile(path11.join(packageDir, "src", "tasks", "hello.ts"), sampleTaskTsTemplate);
|
|
33408
|
+
await fs11.writeFile(path11.join(packageDir, "README.md"), readmeTemplate(packageJsonName, registryPrefix, true));
|
|
33409
|
+
await fs11.writeFile(path11.join(packageDir, ".gitignore"), gitignoreTemplate);
|
|
33326
33410
|
} else {
|
|
33327
|
-
await
|
|
33328
|
-
await
|
|
33329
|
-
await
|
|
33330
|
-
await
|
|
33331
|
-
await
|
|
33332
|
-
await
|
|
33411
|
+
await fs11.writeFile(path11.join(packageDir, "package.json"), packageJsonJsTemplate(packageJsonName));
|
|
33412
|
+
await fs11.mkdir(path11.join(packageDir, "src", "tasks"), { recursive: true });
|
|
33413
|
+
await fs11.writeFile(path11.join(packageDir, "src", "index.js"), indexJsTemplate(registryPrefix));
|
|
33414
|
+
await fs11.writeFile(path11.join(packageDir, "src", "tasks", "hello.js"), sampleTaskJsTemplate);
|
|
33415
|
+
await fs11.writeFile(path11.join(packageDir, "README.md"), readmeTemplate(packageJsonName, registryPrefix, false));
|
|
33416
|
+
await fs11.writeFile(path11.join(packageDir, ".gitignore"), gitignoreTemplate);
|
|
33333
33417
|
}
|
|
33334
33418
|
const nextSteps = [];
|
|
33335
33419
|
nextSteps.push(`cd ${packageDir}`);
|
|
@@ -33465,14 +33549,14 @@ async function removePackage(packageIdentifier, app, output) {
|
|
|
33465
33549
|
import JSON5 from "json5";
|
|
33466
33550
|
|
|
33467
33551
|
// src/task-discovery.ts
|
|
33468
|
-
import { promises as
|
|
33552
|
+
import { promises as fs12 } from "fs";
|
|
33469
33553
|
import path12 from "path";
|
|
33470
33554
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
33471
33555
|
import { glob as glob3 } from "glob";
|
|
33472
33556
|
var metaCache = /* @__PURE__ */ new Map();
|
|
33473
33557
|
async function readPackageJson2(pkgPath) {
|
|
33474
33558
|
try {
|
|
33475
|
-
const pkgJson = await
|
|
33559
|
+
const pkgJson = await fs12.readFile(path12.join(pkgPath, "package.json"), "utf8");
|
|
33476
33560
|
const parsed = JSON.parse(pkgJson);
|
|
33477
33561
|
return { name: parsed.name, version: parsed.version };
|
|
33478
33562
|
} catch {
|