Create ovftool.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
Namhyeon Go 2025-01-13 15:13:25 +09:00
parent dd3ebc16df
commit f9f35da4d4

56
lib/ovftool.js Normal file
View File

@ -0,0 +1,56 @@
// ovftool.js
// Namhyeon Go <abuse@catswords.net>
// https://github.com/gnh1201/welsonjs
//
var SHELL = require("lib/shell");
var CRED = require("lib/credentials");
function OVFObject() {
this.binPath = "bin/x64/VMware-ovftool-4.6.3-24031167-win.x86_64/ovftool/ovftool.exe";
this.hostname = "";
this.resourceName = "";
this.setBinPath = function(binPath) {
this.binPath = binPath;
};
this.setHostname = function(hostname) {
this.hostname = hostname;
};
this.setResourceName = function(resourceName) {
this.resourceName = resourceName;
};
this.saveTo = function() {
var cred = CRED.get("password", "ovftool");
var connectionString = "vi://" +
cred.username + ":" +
encodeURIComponent(cred.password) + "@" +
this.hostname + "/" +
this.resourceName;
// todo
};
}
function setCredential(username, password) {
CRED.push("password", "ovftool", {
"hostname": hostname,
"username": username,
"password": password,
});
}
function create() {
return new OVFObject();
}
exports.setCredential = setCredential;
exports.create = create;
exports.VERSIONINFO = "Broadcom/VMware OVF Tool interface (ovftool.js) version 0.1";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;