@multicloud-io/client
Version:
Customer-facing Multicloud API client with limited field exposure
65 lines • 2.74 kB
TypeScript
/**
* Multicloud API client
*
* Provides a client for customer-facing operations with limited field exposure.
* This client is designed for secure, customer-facing applications.
*
* IMPORTANT: This is for server-side use only - never expose to client/browser!
*/
import { MulticloudConnectionParams } from './config';
import type { Job, Task, Cluster, Response, GameStatus } from '@multicloud-io/common';
/**
* Multicloud API client
*
* Provides only customer-facing operations with limited field exposure.
*/
export declare class MulticloudClient {
private params;
private debug;
constructor(params: MulticloudConnectionParams, debug?: boolean);
/**
* Make an authenticated request to the Multicloud API
*/
private makeRequest;
/**
* Test connection to the Multicloud server
*/
testConnection(): Promise<boolean>;
/**
* Health check endpoint for customer API
*/
pingCustomer(): Promise<string>;
/**
* Customer-facing endpoint to get jobs for authenticated users
*/
getCustomerJobs(applicationId: string | number, clusterId?: string | number): Promise<Job[]>;
/**
* Customer-facing endpoint to get public games status for authenticated users
*/
getPublicGamesStatus(applicationId: string | number, clusterId?: string | number): Promise<GameStatus[]>;
/**
* Customer-facing endpoint to get clusters for authenticated users
*/
getCustomerClusters(applicationId: string | number, clusterId?: string | number): Promise<Cluster[]>;
/**
* Customer-facing endpoint to get basic server information for authenticated users
*/
getCustomerServers(applicationId: string | number, clusterId?: string | number): Promise<any>;
/**
* Customer-facing endpoint to get tasks for authenticated users
*/
getCustomerTasks(applicationId: string | number, jobIds?: Set<number>, clusterId?: string | number): Promise<Task[]>;
/**
* Customer-facing endpoint to get cluster locations (different from admin endpoint)
*/
getCustomerClusterLocations(applicationId: string | number, clusterId: string | number): Promise<any[]>;
/**
* Customer-facing endpoint to add jobs to a cluster (different from coordinator endpoint)
*/
addCustomerJobs(jobDescs: Partial<Job>[], applicationId: string | number, clusterId: string | number): Promise<Response>;
/**
* Customer-facing endpoint to perform job actions (different from coordinator endpoint)
*/
customerJobAction(jobId: string | number, action: string, applicationId: string | number, clusterId: string | number, scaleBy?: number): Promise<Response>;
}
//# sourceMappingURL=multicloud-client.d.ts.map