@phala/cloud
Version:
TypeScript SDK for Phala Cloud API
76 lines • 2.88 kB
TypeScript
import { z } from "zod";
import { type Client, type SafeResult } from "../client";
import { CvmLegacyDetailSchema } from "../types/cvm_info";
import { type KmsInfo } from "../types/kms_info";
import { ActionParameters, ActionReturnType } from "../types/common";
export { CvmLegacyDetailSchema };
export type GetCvmInfoResponse = z.infer<typeof CvmLegacyDetailSchema> & {
kms_info: KmsInfo;
};
export declare const GetCvmInfoRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
app_id: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
instance_id: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
app_id?: string | undefined;
instance_id?: string | undefined;
uuid?: string | undefined;
}, {
id?: string | undefined;
app_id?: string | undefined;
instance_id?: string | undefined;
uuid?: string | undefined;
}>, {
id?: string | undefined;
app_id?: string | undefined;
instance_id?: string | undefined;
uuid?: string | undefined;
}, {
id?: string | undefined;
app_id?: string | undefined;
instance_id?: string | undefined;
uuid?: string | undefined;
}>, {
cvmId: string | undefined;
_raw: {
id?: string | undefined;
app_id?: string | undefined;
instance_id?: string | undefined;
uuid?: string | undefined;
};
}, {
id?: string | undefined;
app_id?: string | undefined;
instance_id?: string | undefined;
uuid?: string | undefined;
}>;
export type GetCvmInfoRequest = {
id?: string;
uuid?: string;
app_id?: string;
instance_id?: string;
};
export type GetCvmInfoParameters<T = undefined> = ActionParameters<T>;
export type GetCvmInfoReturnType<T = undefined> = ActionReturnType<GetCvmInfoResponse, T>;
/**
* Get information about a specific CVM
*
* @param client - The API client
* @param request - Request parameters
* @param request.cvmId - ID of the CVM to get information for
* @param parameters - Optional behavior parameters
* @returns CVM information
*
* @example
* ```typescript
* const info = await getCvmInfo(client, { cvmId: "cvm-123" })
* ```
*/
export declare function getCvmInfo<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request: GetCvmInfoRequest, parameters?: GetCvmInfoParameters<T>): Promise<GetCvmInfoReturnType<T>>;
/**
* Safe version of getCvmInfo that returns a Result type instead of throwing
*/
export declare function safeGetCvmInfo<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request: GetCvmInfoRequest, parameters?: GetCvmInfoParameters<T>): Promise<SafeResult<GetCvmInfoReturnType<T>>>;
//# sourceMappingURL=get_cvm_info.d.ts.map