cloudflare
Version:
The official TypeScript library for the Cloudflare API
286 lines • 11.3 kB
TypeScript
import { APIResource } from "../../core/resource.js";
import * as CredentialsAPI from "./credentials.js";
import { BaseCredentials, CredentialCreateParams, CredentialCreateResponse, Credentials } from "./credentials.js";
import * as MaintenanceConfigsAPI from "./maintenance-configs.js";
import { BaseMaintenanceConfigs, MaintenanceConfigGetParams, MaintenanceConfigGetResponse, MaintenanceConfigUpdateParams, MaintenanceConfigUpdateResponse, MaintenanceConfigs } from "./maintenance-configs.js";
import * as NamespacesAPI from "./namespaces/namespaces.js";
import { BaseNamespaces, NamespaceListParams, NamespaceListResponse, Namespaces } from "./namespaces/namespaces.js";
import { APIPromise } from "../../core/api-promise.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class BaseR2DataCatalog extends APIResource {
static readonly _key: readonly ['r2DataCatalog'];
/**
* Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs
* for the specified account. Each catalog represents an R2 bucket configured to
* store Iceberg metadata and data files.
*
* @deprecated Use `GET /accounts/{account_id}/basin-catalog` instead.
*/
list(params: R2DataCatalogListParams, options?: RequestOptions): APIPromise<R2DataCatalogListResponse>;
/**
* Removes the catalog from the control plane without deleting R2 bucket objects.
* Set force=true to remove catalog namespaces, tables, views, and maintenance
* metadata. Force deletion is limited to a configured catalog object count.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/delete` instead.
*/
delete(bucketName: string, params: R2DataCatalogDeleteParams, options?: RequestOptions): APIPromise<void>;
/**
* Disable an R2 bucket as a catalog. This operation deactivates the catalog but
* preserves existing metadata and data files. The catalog can be re-enabled later.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/disable` instead.
*/
disable(bucketName: string, params: R2DataCatalogDisableParams, options?: RequestOptions): APIPromise<void>;
/**
* Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the
* necessary catalog infrastructure and activates the bucket for storing Iceberg
* metadata and data files.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/enable` instead.
*/
enable(bucketName: string, params: R2DataCatalogEnableParams, options?: RequestOptions): APIPromise<R2DataCatalogEnableResponse>;
/**
* Retrieve detailed information about a specific R2 catalog by bucket name.
* Returns catalog status, maintenance configuration, and credential status.
*
* @deprecated Use `GET /accounts/{account_id}/basin-catalog/{bucket_name}` instead.
*/
get(bucketName: string, params: R2DataCatalogGetParams, options?: RequestOptions): APIPromise<R2DataCatalogGetResponse>;
}
export declare class R2DataCatalog extends BaseR2DataCatalog {
maintenanceConfigs: MaintenanceConfigsAPI.MaintenanceConfigs;
credentials: CredentialsAPI.Credentials;
namespaces: NamespacesAPI.Namespaces;
}
/**
* Contains the list of catalogs.
*/
export interface R2DataCatalogListResponse {
/**
* Lists catalogs in the account.
*/
warehouses: Array<R2DataCatalogListResponse.Warehouse>;
}
export declare namespace R2DataCatalogListResponse {
/**
* Contains R2 Data Catalog information.
*/
interface Warehouse {
/**
* Use this to uniquely identify the catalog.
*/
id: string;
/**
* Specifies the associated R2 bucket name.
*/
bucket: string;
/**
* Specifies the catalog name (generated from account and bucket name).
*/
name: string;
/**
* Indicates the status of the catalog.
*/
status: 'active' | 'inactive';
/**
* Shows the credential configuration status.
*/
credential_status?: 'present' | 'absent' | null;
/**
* Configures maintenance for the catalog.
*/
maintenance_config?: Warehouse.MaintenanceConfig | null;
}
namespace Warehouse {
/**
* Configures maintenance for the catalog.
*/
interface MaintenanceConfig {
/**
* Configures compaction for catalog maintenance.
*/
compaction?: MaintenanceConfig.Compaction;
/**
* Scheduling interval between normal table maintenance runs.
*/
interval?: string;
/**
* Configures snapshot expiration settings.
*/
snapshot_expiration?: MaintenanceConfig.SnapshotExpiration;
}
namespace MaintenanceConfig {
/**
* Configures compaction for catalog maintenance.
*/
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';
}
/**
* Configures snapshot expiration settings.
*/
interface SnapshotExpiration {
/**
* Specifies the maximum age for snapshots. The system deletes snapshots older than
* this age. Format: <number><unit> where unit is d (days), h (hours), m (minutes),
* or s (seconds). Examples: "7d" (7 days), "48h" (48 hours), "2880m" (2,880
* minutes). Defaults to "7d".
*/
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';
}
}
}
}
/**
* Contains response from activating an R2 bucket as a catalog.
*/
export interface R2DataCatalogEnableResponse {
/**
* Use this to uniquely identify the activated catalog.
*/
id: string;
/**
* Specifies the name of the activated catalog.
*/
name: string;
}
/**
* Contains R2 Data Catalog information.
*/
export interface R2DataCatalogGetResponse {
/**
* Use this to uniquely identify the catalog.
*/
id: string;
/**
* Specifies the associated R2 bucket name.
*/
bucket: string;
/**
* Specifies the catalog name (generated from account and bucket name).
*/
name: string;
/**
* Indicates the status of the catalog.
*/
status: 'active' | 'inactive';
/**
* Shows the credential configuration status.
*/
credential_status?: 'present' | 'absent' | null;
/**
* Configures maintenance for the catalog.
*/
maintenance_config?: R2DataCatalogGetResponse.MaintenanceConfig | null;
}
export declare namespace R2DataCatalogGetResponse {
/**
* Configures maintenance for the catalog.
*/
interface MaintenanceConfig {
/**
* Configures compaction for catalog maintenance.
*/
compaction?: MaintenanceConfig.Compaction;
/**
* Scheduling interval between normal table maintenance runs.
*/
interval?: string;
/**
* Configures snapshot expiration settings.
*/
snapshot_expiration?: MaintenanceConfig.SnapshotExpiration;
}
namespace MaintenanceConfig {
/**
* Configures compaction for catalog maintenance.
*/
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';
}
/**
* Configures snapshot expiration settings.
*/
interface SnapshotExpiration {
/**
* Specifies the maximum age for snapshots. The system deletes snapshots older than
* this age. Format: <number><unit> where unit is d (days), h (hours), m (minutes),
* or s (seconds). Examples: "7d" (7 days), "48h" (48 hours), "2880m" (2,880
* minutes). Defaults to "7d".
*/
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';
}
}
}
export interface R2DataCatalogListParams {
/**
* Identifies the account.
*/
account_id: string;
}
export interface R2DataCatalogDeleteParams {
/**
* Path param: Use this to identify the account.
*/
account_id: string;
/**
* Query param: Remove child metadata before deleting the catalog.
*/
force?: boolean;
}
export interface R2DataCatalogDisableParams {
/**
* Identifies the account.
*/
account_id: string;
}
export interface R2DataCatalogEnableParams {
/**
* Identifies the account.
*/
account_id: string;
}
export interface R2DataCatalogGetParams {
/**
* Identifies the account.
*/
account_id: string;
}
export declare namespace R2DataCatalog {
export { type R2DataCatalogListResponse as R2DataCatalogListResponse, type R2DataCatalogEnableResponse as R2DataCatalogEnableResponse, type R2DataCatalogGetResponse as R2DataCatalogGetResponse, type R2DataCatalogListParams as R2DataCatalogListParams, type R2DataCatalogDeleteParams as R2DataCatalogDeleteParams, type R2DataCatalogDisableParams as R2DataCatalogDisableParams, type R2DataCatalogEnableParams as R2DataCatalogEnableParams, type R2DataCatalogGetParams as R2DataCatalogGetParams, };
export { MaintenanceConfigs as MaintenanceConfigs, BaseMaintenanceConfigs as BaseMaintenanceConfigs, type MaintenanceConfigUpdateResponse as MaintenanceConfigUpdateResponse, type MaintenanceConfigGetResponse as MaintenanceConfigGetResponse, type MaintenanceConfigUpdateParams as MaintenanceConfigUpdateParams, type MaintenanceConfigGetParams as MaintenanceConfigGetParams, };
export { Credentials as Credentials, BaseCredentials as BaseCredentials, type CredentialCreateResponse as CredentialCreateResponse, type CredentialCreateParams as CredentialCreateParams, };
export { Namespaces as Namespaces, BaseNamespaces as BaseNamespaces, type NamespaceListResponse as NamespaceListResponse, type NamespaceListParams as NamespaceListParams, };
}
//# sourceMappingURL=r2-data-catalog.d.ts.map