sesterce-cli
Version:
A powerful command-line interface tool for managing Sesterce Cloud services. Sesterce CLI provides easy access to GPU cloud instances, AI inference services, container registries, and SSH key management directly from your terminal.
26 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateSSHKey = void 0;
const either_1 = require("@/core/logic/either");
const create_ssh_key_error_1 = require("./errors/create-ssh-key-error");
class CreateSSHKey {
constructor(apiClientProvider) {
this.apiClientProvider = apiClientProvider;
}
async execute(dto) {
try {
const sshKey = await this.apiClientProvider.post("/gpu-cloud/ssh-keys", {
body: JSON.stringify(dto),
});
if (!sshKey) {
return (0, either_1.left)(new create_ssh_key_error_1.CreateSSHKeyError("Failed to create SSH key"));
}
return (0, either_1.right)(sshKey);
}
catch (error) {
return (0, either_1.left)(new create_ssh_key_error_1.CreateSSHKeyError(error instanceof Error ? error.message : "Unknown error"));
}
}
}
exports.CreateSSHKey = CreateSSHKey;
//# sourceMappingURL=create-ssh-key.js.map