cloudflare
Version:
The official TypeScript library for the Cloudflare API
94 lines • 4.78 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import * as CredentialsAPI from "./credentials.mjs";
import { BaseCredentials, Credentials, } from "./credentials.mjs";
import * as MaintenanceConfigsAPI from "./maintenance-configs.mjs";
import { BaseMaintenanceConfigs, MaintenanceConfigs, } from "./maintenance-configs.mjs";
import * as NamespacesAPI from "./namespaces/namespaces.mjs";
import { BaseNamespaces, Namespaces, } from "./namespaces/namespaces.mjs";
import { buildHeaders } from "../../internal/headers.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseR2DataCatalog = /* @__PURE__ */ (() => {
class BaseR2DataCatalog extends APIResource {
/**
* 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, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/r2-catalog`, options)._thenUnwrap((obj) => obj.result);
}
/**
* 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, params, options) {
const { account_id, force } = params;
return this._client.post(path `/accounts/${account_id}/r2-catalog/${bucketName}/delete`, {
query: { force },
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* 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, params, options) {
const { account_id } = params;
return this._client.post(path `/accounts/${account_id}/r2-catalog/${bucketName}/disable`, {
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* 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, params, options) {
const { account_id } = params;
return this._client.post(path `/accounts/${account_id}/r2-catalog/${bucketName}/enable`, options)._thenUnwrap((obj) => obj.result);
}
/**
* 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, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/r2-catalog/${bucketName}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseR2DataCatalog._key = Object.freeze(['r2DataCatalog']);
return BaseR2DataCatalog;
})();
export var R2DataCatalog = /* @__PURE__ */ (() => {
class R2DataCatalog extends BaseR2DataCatalog {
constructor() {
super(...arguments);
this.maintenanceConfigs = new MaintenanceConfigsAPI.MaintenanceConfigs(this._client);
this.credentials = new CredentialsAPI.Credentials(this._client);
this.namespaces = new NamespacesAPI.Namespaces(this._client);
}
}
R2DataCatalog.MaintenanceConfigs = MaintenanceConfigs;
R2DataCatalog.BaseMaintenanceConfigs = BaseMaintenanceConfigs;
R2DataCatalog.Credentials = Credentials;
R2DataCatalog.BaseCredentials = BaseCredentials;
R2DataCatalog.Namespaces = Namespaces;
R2DataCatalog.BaseNamespaces = BaseNamespaces;
return R2DataCatalog;
})();
//# sourceMappingURL=r2-data-catalog.mjs.map