@qbraid-core/compute
Version:
Client for the qBraid Compute service.
57 lines (56 loc) • 2.59 kB
TypeScript
import { QbraidClient, QbraidSession } from '@qbraid-core/base';
import { QbraidClientV1, QbraidSessionV1 } from '@qbraid-core/base';
import { AxiosResponse } from 'axios';
import { ComputeProfile, UserServerStatus, ComputeProfileV1, ProfileQueryParamsV1, ServerStartResponseV1, ServerStopResponseV1, ServerStatusResponseV1, ProfileCost } from './types';
export declare class ComputeManagerClient extends QbraidClient {
private qBraidURLs;
constructor(session: QbraidSession, hubURL?: string, labURL?: string);
getComputeManager(userEmail: string): Promise<ComputeProfile[]>;
getUserLabToken(): Promise<string>;
startServer(labToken: string, profileSlug?: string): Promise<AxiosResponse>;
stopServer(labToken: string, labUserName: string): Promise<AxiosResponse>;
statusServer(labToken: string, labUserName: string): Promise<UserServerStatus>;
getProfilePrice(profileSlug: string): Promise<number>;
}
export declare class ComputeManagerClientV1 extends QbraidClientV1 {
constructor(session: QbraidSessionV1);
/**
* Get compute profiles from the V1 API.
* @param params - Optional query parameters to filter profiles
* @returns Array of ComputeProfileV1 objects
* @throws Error if the API returns an error response
*/
getProfiles(params?: ProfileQueryParamsV1): Promise<ComputeProfileV1[]>;
/**
* Start a compute server with the specified profile.
* @param profileSlug - The slug of the profile to use
* @returns Server start response
* @throws Error if the API returns an error response
*/
startServer(profileSlug: string): Promise<ServerStartResponseV1>;
/**
* Stop the current user's compute server.
* @returns Server stop response
* @throws Error if the API returns an error response
*/
stopServer(): Promise<ServerStopResponseV1>;
/**
* Get the status of the current user's compute server.
* @returns Server status response
* @throws Error if the API returns an error response
*/
getServerStatus(): Promise<ServerStatusResponseV1>;
/**
* Get a session token for the current user's compute server.
* @returns The session token string
* @throws Error if the API returns an error response
*/
getUserLabToken(): Promise<string>;
/**
* Get the price of a compute profile.
* @param profileSlug - The slug of the profile
* @returns Profile cost information
* @throws Error if the API returns an error response
*/
getProfilePrice(profileSlug: string): Promise<ProfileCost>;
}