cloudflare
Version:
The official TypeScript library for the Cloudflare API
68 lines • 3.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MaintenanceConfigs = exports.BaseMaintenanceConfigs = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseMaintenanceConfigs = /* @__PURE__ */ (() => {
class BaseMaintenanceConfigs extends resource_1.APIResource {
/**
* Update the maintenance configuration for a specific table. This allows you to
* enable or disable compaction and adjust target file sizes for optimization.
*
* @example
* ```ts
* const maintenanceConfig =
* await client.basinCatalog.namespaces.tables.maintenanceConfigs.update(
* 'my_table',
* {
* account_id: '0123456789abcdef0123456789abcdef',
* bucket_name: 'my-data-bucket',
* namespace: 'my_namespace%1Fsub_namespace',
* compaction: {
* state: 'enabled',
* target_size_mb: '256',
* },
* snapshot_expiration: {
* max_snapshot_age: '14d',
* min_snapshots_to_keep: 5,
* state: 'enabled',
* },
* },
* );
* ```
*/
update(tableName, params, options) {
const { account_id, bucket_name, namespace, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/basin-catalog/${bucket_name}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve the maintenance configuration for a specific table, including
* compaction settings.
*
* @example
* ```ts
* const maintenanceConfig =
* await client.basinCatalog.namespaces.tables.maintenanceConfigs.get(
* 'my_table',
* {
* account_id: '0123456789abcdef0123456789abcdef',
* bucket_name: 'my-data-bucket',
* namespace: 'my_namespace%1Fsub_namespace',
* },
* );
* ```
*/
get(tableName, params, options) {
const { account_id, bucket_name, namespace } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/basin-catalog/${bucket_name}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseMaintenanceConfigs._key = Object.freeze(['basinCatalog', 'namespaces', 'tables', 'maintenanceConfigs']);
return BaseMaintenanceConfigs;
})();
exports.BaseMaintenanceConfigs = BaseMaintenanceConfigs;
class MaintenanceConfigs extends BaseMaintenanceConfigs {
}
exports.MaintenanceConfigs = MaintenanceConfigs;
//# sourceMappingURL=maintenance-configs.js.map