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.
24 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetInstanceDetails = void 0;
const either_1 = require("@/core/logic/either");
const get_instance_details_error_1 = require("./errors/get-instance-details-error");
class GetInstanceDetails {
constructor(apiClient) {
this.apiClient = apiClient;
}
async execute(instanceId) {
try {
const instance = await this.apiClient.request(`/gpu-cloud/instances/${instanceId}`);
if (!instance) {
return (0, either_1.left)(new get_instance_details_error_1.GetInstanceDetailsError("Instance not found"));
}
return (0, either_1.right)(instance);
}
catch (error) {
return (0, either_1.left)(new get_instance_details_error_1.GetInstanceDetailsError(error instanceof Error ? error.message : "Unexpected error occurred."));
}
}
}
exports.GetInstanceDetails = GetInstanceDetails;
//# sourceMappingURL=get-instance-details.js.map