UNPKG

@phala/cloud

Version:
408 lines 16.5 kB
import { z } from "zod"; import { type Client, type SafeResult } from "../client"; import { ActionParameters, ActionReturnType } from "../types/common"; export declare const GetCvmListRequestSchema: z.ZodObject<{ page: z.ZodOptional<z.ZodNumber>; page_size: z.ZodOptional<z.ZodNumber>; node_id: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { node_id?: number | undefined; page?: number | undefined; page_size?: number | undefined; }, { node_id?: number | undefined; page?: number | undefined; page_size?: number | undefined; }>; export declare const GetCvmListSchema: z.ZodObject<{ items: z.ZodArray<z.ZodObject<{ hosted: z.ZodOptional<z.ZodObject<{ id: z.ZodString; name: z.ZodString; status: z.ZodString; uptime: z.ZodString; app_url: z.ZodNullable<z.ZodString>; app_id: z.ZodString; instance_id: z.ZodNullable<z.ZodString>; configuration: z.ZodOptional<z.ZodAny>; exited_at: z.ZodNullable<z.ZodString>; boot_progress: z.ZodNullable<z.ZodString>; boot_error: z.ZodNullable<z.ZodString>; shutdown_progress: z.ZodNullable<z.ZodString>; image_version: z.ZodNullable<z.ZodString>; }, "strip", z.ZodTypeAny, { status: string; id: string; name: string; uptime: string; app_url: string | null; app_id: string; instance_id: string | null; exited_at: string | null; boot_progress: string | null; boot_error: string | null; shutdown_progress: string | null; image_version: string | null; configuration?: any; }, { status: string; id: string; name: string; uptime: string; app_url: string | null; app_id: string; instance_id: string | null; exited_at: string | null; boot_progress: string | null; boot_error: string | null; shutdown_progress: string | null; image_version: string | null; configuration?: any; }>>; name: z.ZodOptional<z.ZodString>; managed_user: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodObject<{ id: z.ZodNumber; username: z.ZodString; }, "strip", z.ZodTypeAny, { id: number; username: string; }, { id: number; username: string; }>>>>; node: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodObject<{ id: z.ZodNumber; name: z.ZodString; region_identifier: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: number; name: string; region_identifier?: string | undefined; }, { id: number; name: string; region_identifier?: string | undefined; }>>>>; listed: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; status: z.ZodOptional<z.ZodString>; in_progress: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; dapp_dashboard_url: z.ZodOptional<z.ZodNullable<z.ZodString>>; syslog_endpoint: z.ZodOptional<z.ZodNullable<z.ZodString>>; allow_upgrade: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; project_id: z.ZodOptional<z.ZodNullable<z.ZodString>>; project_type: z.ZodOptional<z.ZodNullable<z.ZodString>>; billing_period: z.ZodOptional<z.ZodNullable<z.ZodString>>; kms_info: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough">>>>; vcpu: z.ZodOptional<z.ZodNullable<z.ZodNumber>>; memory: z.ZodOptional<z.ZodNullable<z.ZodNumber>>; disk_size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>; gateway_domain: z.ZodOptional<z.ZodNullable<z.ZodString>>; public_urls: z.ZodOptional<z.ZodArray<z.ZodObject<{ app: z.ZodString; instance: z.ZodString; }, "strip", z.ZodTypeAny, { app: string; instance: string; }, { app: string; instance: string; }>, "many">>; }, "strip", z.ZodTypeAny, { status?: string | undefined; name?: string | undefined; hosted?: { status: string; id: string; name: string; uptime: string; app_url: string | null; app_id: string; instance_id: string | null; exited_at: string | null; boot_progress: string | null; boot_error: string | null; shutdown_progress: string | null; image_version: string | null; configuration?: any; } | undefined; managed_user?: { id: number; username: string; } | null | undefined; node?: { id: number; name: string; region_identifier?: string | undefined; } | null | undefined; listed?: boolean | undefined; in_progress?: boolean | undefined; dapp_dashboard_url?: string | null | undefined; syslog_endpoint?: string | null | undefined; allow_upgrade?: boolean | undefined; project_id?: string | null | undefined; project_type?: string | null | undefined; billing_period?: string | null | undefined; kms_info?: z.objectOutputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough"> | null | undefined; vcpu?: number | null | undefined; memory?: number | null | undefined; disk_size?: number | null | undefined; gateway_domain?: string | null | undefined; public_urls?: { app: string; instance: string; }[] | undefined; }, { status?: string | undefined; name?: string | undefined; hosted?: { status: string; id: string; name: string; uptime: string; app_url: string | null; app_id: string; instance_id: string | null; exited_at: string | null; boot_progress: string | null; boot_error: string | null; shutdown_progress: string | null; image_version: string | null; configuration?: any; } | undefined; managed_user?: { id: number; username: string; } | null | undefined; node?: { id: number; name: string; region_identifier?: string | undefined; } | null | undefined; listed?: boolean | undefined; in_progress?: boolean | undefined; dapp_dashboard_url?: string | null | undefined; syslog_endpoint?: string | null | undefined; allow_upgrade?: boolean | undefined; project_id?: string | null | undefined; project_type?: string | null | undefined; billing_period?: string | null | undefined; kms_info?: z.objectInputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough"> | null | undefined; vcpu?: number | null | undefined; memory?: number | null | undefined; disk_size?: number | null | undefined; gateway_domain?: string | null | undefined; public_urls?: { app: string; instance: string; }[] | undefined; }>, "many">; total: z.ZodNumber; page: z.ZodNumber; page_size: z.ZodNumber; pages: z.ZodNumber; }, "strict", z.ZodTypeAny, { page: number; page_size: number; items: { status?: string | undefined; name?: string | undefined; hosted?: { status: string; id: string; name: string; uptime: string; app_url: string | null; app_id: string; instance_id: string | null; exited_at: string | null; boot_progress: string | null; boot_error: string | null; shutdown_progress: string | null; image_version: string | null; configuration?: any; } | undefined; managed_user?: { id: number; username: string; } | null | undefined; node?: { id: number; name: string; region_identifier?: string | undefined; } | null | undefined; listed?: boolean | undefined; in_progress?: boolean | undefined; dapp_dashboard_url?: string | null | undefined; syslog_endpoint?: string | null | undefined; allow_upgrade?: boolean | undefined; project_id?: string | null | undefined; project_type?: string | null | undefined; billing_period?: string | null | undefined; kms_info?: z.objectOutputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough"> | null | undefined; vcpu?: number | null | undefined; memory?: number | null | undefined; disk_size?: number | null | undefined; gateway_domain?: string | null | undefined; public_urls?: { app: string; instance: string; }[] | undefined; }[]; total: number; pages: number; }, { page: number; page_size: number; items: { status?: string | undefined; name?: string | undefined; hosted?: { status: string; id: string; name: string; uptime: string; app_url: string | null; app_id: string; instance_id: string | null; exited_at: string | null; boot_progress: string | null; boot_error: string | null; shutdown_progress: string | null; image_version: string | null; configuration?: any; } | undefined; managed_user?: { id: number; username: string; } | null | undefined; node?: { id: number; name: string; region_identifier?: string | undefined; } | null | undefined; listed?: boolean | undefined; in_progress?: boolean | undefined; dapp_dashboard_url?: string | null | undefined; syslog_endpoint?: string | null | undefined; allow_upgrade?: boolean | undefined; project_id?: string | null | undefined; project_type?: string | null | undefined; billing_period?: string | null | undefined; kms_info?: z.objectInputType<{ id: z.ZodString; slug: z.ZodNullable<z.ZodString>; url: z.ZodString; version: z.ZodString; chain_id: z.ZodNullable<z.ZodNumber>; kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>; }, z.ZodTypeAny, "passthrough"> | null | undefined; vcpu?: number | null | undefined; memory?: number | null | undefined; disk_size?: number | null | undefined; gateway_domain?: string | null | undefined; public_urls?: { app: string; instance: string; }[] | undefined; }[]; total: number; pages: number; }>; export type GetCvmListRequest = z.infer<typeof GetCvmListRequestSchema>; export type GetCvmListResponse = z.infer<typeof GetCvmListSchema>; export type GetCvmListParameters<T = undefined> = ActionParameters<T>; export type GetCvmListReturnType<T = undefined> = ActionReturnType<GetCvmListResponse, T>; /** * Get a paginated list of CVMs * * @param client - The API client * @param request - Optional request parameters for pagination and filtering * @param request.page - Page number (1-based) * @param request.page_size - Number of items per page * @param request.node_id - Filter by node ID * @param parameters - Optional behavior parameters * @returns Paginated list of CVMs * * @example * ```typescript * // Get first page with default size * const list = await getCvmList(client, { page: 1 }) * * // Get with custom page size * const list = await getCvmList(client, { page: 1, page_size: 20 }) * * // Get with custom schema * const list = await getCvmList(client, { page: 1 }, { schema: customSchema }) * ``` */ export declare function getCvmList<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request?: GetCvmListRequest, parameters?: GetCvmListParameters<T>): Promise<GetCvmListReturnType<T>>; /** * Safe version of getCvmList that returns a Result type instead of throwing */ export declare function safeGetCvmList<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request?: GetCvmListRequest, parameters?: GetCvmListParameters<T>): Promise<SafeResult<GetCvmListReturnType<T>>>; //# sourceMappingURL=get_cvm_list.d.ts.map