UNPKG

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.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateInferenceInstance = void 0; const either_1 = require("@/core/logic/either"); const update_instance_error_1 = require("./errors/update-instance-error"); class UpdateInferenceInstance { constructor(apiClient) { this.apiClient = apiClient; } async execute({ instanceId, ...dto }) { try { const instance = await this.apiClient.patch(`/ai-inference/instances/${instanceId}`, { body: JSON.stringify(dto), }); if (!instance) { return (0, either_1.left)(new update_instance_error_1.UpdateInferenceInstanceError("Failed to update instance")); } return (0, either_1.right)(instance); } catch (error) { return (0, either_1.left)(new update_instance_error_1.UpdateInferenceInstanceError(error instanceof Error ? error.message : "Unexpected error occurred.")); } } } exports.UpdateInferenceInstance = UpdateInferenceInstance; //# sourceMappingURL=update-instance.js.map