cloudflare
Version:
The official TypeScript library for the Cloudflare API
208 lines • 7.34 kB
text/typescript
import { APIResource } from "../../../../core/resource.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class BaseMaintenanceConfigs extends APIResource {
static readonly _key: readonly ['r2DataCatalog', 'namespaces', 'tables', 'maintenanceConfigs'];
/**
* Update the maintenance configuration for a specific table. This allows you to
* enable or disable compaction and adjust target file sizes for optimization.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs` instead.
*/
update(tableName: string, params: MaintenanceConfigUpdateParams, options?: RequestOptions): APIPromise<MaintenanceConfigUpdateResponse>;
/**
* Retrieve the maintenance configuration for a specific table, including
* compaction settings.
*
* @deprecated Use `GET /accounts/{account_id}/basin-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs` instead.
*/
get(tableName: string, params: MaintenanceConfigGetParams, options?: RequestOptions): APIPromise<MaintenanceConfigGetResponse>;
}
export declare class MaintenanceConfigs extends BaseMaintenanceConfigs {
}
/**
* Configures maintenance for the table.
*/
export interface MaintenanceConfigUpdateResponse {
/**
* Configures compaction settings for table optimization.
*/
compaction?: MaintenanceConfigUpdateResponse.Compaction;
/**
* Scheduling interval between normal table maintenance runs.
*/
interval?: string;
snapshot_expiration?: MaintenanceConfigUpdateResponse.SnapshotExpiration;
}
export declare namespace MaintenanceConfigUpdateResponse {
/**
* Configures compaction settings for table optimization.
*/
interface Compaction {
/**
* Specifies the state of maintenance operations.
*/
state: 'enabled' | 'disabled';
/**
* Sets the target file size for compaction in megabytes. Defaults to "128".
*/
target_size_mb: '64' | '128' | '256' | '512';
/**
* Earliest time when the scheduler can claim this operation. Null when disabled.
*/
next_eligible_at?: string | null;
}
interface SnapshotExpiration {
/**
* Specifies the maximum age for snapshots.
*/
max_snapshot_age: string;
/**
* Specifies the minimum number of snapshots to retain. Defaults to 100.
*/
min_snapshots_to_keep: number;
/**
* Specifies the state of maintenance operations.
*/
state: 'enabled' | 'disabled';
/**
* Earliest time when the scheduler can claim this operation. Null when disabled.
*/
next_eligible_at?: string | null;
}
}
/**
* Contains table maintenance configuration.
*/
export interface MaintenanceConfigGetResponse {
/**
* Configures maintenance for the table.
*/
maintenance_config: MaintenanceConfigGetResponse.MaintenanceConfig;
}
export declare namespace MaintenanceConfigGetResponse {
/**
* Configures maintenance for the table.
*/
interface MaintenanceConfig {
/**
* Configures compaction settings for table optimization.
*/
compaction?: MaintenanceConfig.Compaction;
/**
* Scheduling interval between normal table maintenance runs.
*/
interval?: string;
snapshot_expiration?: MaintenanceConfig.SnapshotExpiration;
}
namespace MaintenanceConfig {
/**
* Configures compaction settings for table optimization.
*/
interface Compaction {
/**
* Specifies the state of maintenance operations.
*/
state: 'enabled' | 'disabled';
/**
* Sets the target file size for compaction in megabytes. Defaults to "128".
*/
target_size_mb: '64' | '128' | '256' | '512';
/**
* Earliest time when the scheduler can claim this operation. Null when disabled.
*/
next_eligible_at?: string | null;
}
interface SnapshotExpiration {
/**
* Specifies the maximum age for snapshots.
*/
max_snapshot_age: string;
/**
* Specifies the minimum number of snapshots to retain. Defaults to 100.
*/
min_snapshots_to_keep: number;
/**
* Specifies the state of maintenance operations.
*/
state: 'enabled' | 'disabled';
/**
* Earliest time when the scheduler can claim this operation. Null when disabled.
*/
next_eligible_at?: string | null;
}
}
}
export interface MaintenanceConfigUpdateParams {
/**
* Path param: Identifies the account.
*/
account_id: string;
/**
* Path param: Specifies the R2 bucket name.
*/
bucket_name: string;
/**
* Path param: The namespace identifier (use %1F as separator for nested
* namespaces).
*/
namespace: string;
/**
* Body param: Updates table compaction configuration; all fields are optional.
*/
compaction?: MaintenanceConfigUpdateParams.Compaction;
/**
* Body param: Updates snapshot expiration configuration (all fields optional).
*/
snapshot_expiration?: MaintenanceConfigUpdateParams.SnapshotExpiration;
}
export declare namespace MaintenanceConfigUpdateParams {
/**
* Updates table compaction configuration; all fields are optional.
*/
interface Compaction {
/**
* Specifies the state of maintenance operations.
*/
state?: 'enabled' | 'disabled';
/**
* Sets the target file size for compaction in megabytes. Defaults to "128".
*/
target_size_mb?: '64' | '128' | '256' | '512';
}
/**
* Updates snapshot expiration configuration (all fields optional).
*/
interface SnapshotExpiration {
/**
* Updates the maximum age for snapshots optionally.
*/
max_snapshot_age?: string;
/**
* Updates the minimum number of snapshots to retain optionally.
*/
min_snapshots_to_keep?: number;
/**
* Specifies the state of maintenance operations.
*/
state?: 'enabled' | 'disabled';
}
}
export interface MaintenanceConfigGetParams {
/**
* Identifies the account.
*/
account_id: string;
/**
* Specifies the R2 bucket name.
*/
bucket_name: string;
/**
* The namespace identifier (use %1F as separator for nested namespaces).
*/
namespace: string;
}
export declare namespace MaintenanceConfigs {
export { type MaintenanceConfigUpdateResponse as MaintenanceConfigUpdateResponse, type MaintenanceConfigGetResponse as MaintenanceConfigGetResponse, type MaintenanceConfigUpdateParams as MaintenanceConfigUpdateParams, type MaintenanceConfigGetParams as MaintenanceConfigGetParams, };
}
//# sourceMappingURL=maintenance-configs.d.mts.map