export type ComputePoolType = "owned" | "shared"; export type ComputePoolStatus = "active" | "archived"; /** * Which level made a pool the *authenticated company's* default on its data * plane. * * `company` is the company's own setting for that plane * ({@link ComputePoolsApi.setCompanyDefaultComputePool}) and takes precedence; * `data_plane` is the default the plane's owner set * ({@link DataPlaneApi.setDefaultComputePool}), which every collaborating * company falls through to when it has no default of its own. */ export type ComputePoolDefaultSource = "company" | "data_plane"; export type ComputePoolSize = "x_small" | "small" | "medium" | "large" | "x_large" | "2x_large" | "3x_large" | "4x_large" | "5x_large" | "6x_large"; export type SnowflakeWarehouseSize = ComputePoolSize; /** * EMR compute pool size. Includes every {@link ComputePoolSize} plus a `*_storage` variant of each * (e.g. `medium_storage`) — same memory budget, but running on instances with local NVMe SSD * storage for shuffle-/scratch-heavy jobs. */ export type AwsEmrSize = ComputePoolSize | "x_small_storage" | "small_storage" | "medium_storage" | "large_storage" | "x_large_storage" | "2x_large_storage" | "3x_large_storage" | "4x_large_storage" | "5x_large_storage" | "6x_large_storage"; export type SnowflakeWarehouseType = "standard" | "snowpark_optimized"; export type ScalingPolicy = "standard" | "economy"; export interface SnowflakeWarehouseExternalId { type: "snowflake_warehouse"; name: string; alias: string; } export interface AwsEmrExternalId { type: "aws_emr"; } export type ComputePoolExternalId = SnowflakeWarehouseExternalId | AwsEmrExternalId; export interface SnowflakeWarehouseProvider { type: "snowflake_warehouse"; warehouse_name?: string; size?: SnowflakeWarehouseSize; warehouse_type?: SnowflakeWarehouseType; auto_suspend?: number; auto_resume?: boolean; min_cluster_count?: number; max_cluster_count?: number; scaling_policy?: ScalingPolicy; max_concurrency_level?: number; statement_timeout_in_seconds?: number; statement_queued_timeout_in_seconds?: number; enable_query_acceleration?: boolean; query_acceleration_max_scale_factor?: number; resource_constraint?: string; comment?: string; } export interface AwsEmrProvider { type: "aws_emr"; size: AwsEmrSize; /** * EMR cluster auto-termination idle timeout, in seconds. Tri-state: omitted/`null` resets to the * default (900s) on both create and update; `-1` disables idle termination; otherwise must be * between 60 and 604800 (7 days). */ idle_timeout_seconds?: number; /** * Maximum time, in seconds, a single job's EMR step may stay `RUNNING` before it's cancelled. * Omitted/`null` resets to the default (14400s) on both create and update; otherwise must be * between 60 and 604800 (7 days). */ job_execution_timeout_seconds?: number; } export type ComputePoolProvider = SnowflakeWarehouseProvider | AwsEmrProvider; export interface ParticipantsAll { type: "all"; } export interface ParticipantsNone { type: "none"; } /** Only these companies. `company_ids` must be non-empty. */ export interface ParticipantsInclusion { type: "inclusion"; company_ids: number[]; } /** Every company except these. `company_ids` must be non-empty. */ export interface ParticipantsExclusion { type: "exclusion"; company_ids: number[]; } export type Participants = ParticipantsAll | ParticipantsNone | ParticipantsInclusion | ParticipantsExclusion; export interface ComputePoolCollaborators { use: Participants; } export interface ComputePoolOwnedResponse { type: "owned"; id: string; company_id: number; data_plane_id: string; external_id: ComputePoolExternalId; name: string; display_name: string; description?: string; status: ComputePoolStatus; created_at: string; updated_at?: string; tags: string[]; provider: ComputePoolProvider; collaborators: ComputePoolCollaborators; /** * Set when this pool is the one the authenticated company's jobs run on when * they don't name one themselves, and says which level made it the default. * `null` on every other pool, and at most one active pool per data plane * carries a non-null value. * * Only the pool the resolution actually landed on is marked. A company that * has set its own default therefore leaves the *plane's* default pool * reporting `null` here — read {@link DataPlane.default_compute_pool_id} for * that one. */ default_source: ComputePoolDefaultSource | null; } export interface ComputePoolSharedResponse { type: "shared"; id: string; company_id: number; data_plane_id: string; external_id: ComputePoolExternalId; name: string; display_name: string; description?: string; status: ComputePoolStatus; created_at: string; updated_at?: string; tags: string[]; provider: ComputePoolProvider; /** Behaves exactly as it does on {@link ComputePoolOwnedResponse}. */ default_source: ComputePoolDefaultSource | null; } export type ComputePoolResponse = ComputePoolOwnedResponse | ComputePoolSharedResponse; export interface CreateComputePoolRequestCommon { name: string; display_name: string; description?: string; tags?: string[]; collaborators?: ComputePoolCollaborators; } export type CreateSnowflakeWarehouseComputePoolRequest = CreateComputePoolRequestCommon & { external_id: SnowflakeWarehouseExternalId; provider: SnowflakeWarehouseProvider; }; export type CreateAwsEmrComputePoolRequest = CreateComputePoolRequestCommon & { external_id?: AwsEmrExternalId; provider: AwsEmrProvider; }; export type CreateComputePoolRequest = CreateSnowflakeWarehouseComputePoolRequest | CreateAwsEmrComputePoolRequest; export interface UpdateComputePoolRequest { display_name?: string; description?: string; tags?: string[]; provider?: ComputePoolProvider; collaborators?: ComputePoolCollaborators; } export interface ListComputePoolsResponse { records: ComputePoolResponse[]; } export interface ListComputePoolsParams { /** * Documented by the public API, but the route does not currently read it — * active compute pools are returned regardless of the value. */ status?: ComputePoolStatus; }