UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

108 lines 3.9 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getTablesOutput = exports.getTables = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Retrieves a list of managed or external table full names in Unity Catalog, that were created by Pulumi or manually. Use databricks.getViews for retrieving a list of views. * * > This data source can only be used with a workspace-level provider! * * ## Example Usage * * Granting `SELECT` and `MODIFY` to `sensitive` group on all tables a _things_ databricks.Schema from _sandbox_ databricks_catalog: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const things = await databricks.getTables({ * catalogName: "sandbox", * schemaName: "things", * }); * const thingsGrants: databricks.Grants[] = []; * for (const range of things.ids.map((v, k) => ({key: k, value: v}))) { * thingsGrants.push(new databricks.Grants(`things-${range.key}`, { * table: range.value, * grants: [{ * principal: "sensitive", * privileges: [ * "SELECT", * "MODIFY", * ], * }], * })); * } * } * ``` * * ## Related Resources * * The following resources are used in the same context: * * * databricks.Schema to manage schemas within Unity Catalog. * * databricks.Catalog to manage catalogs within Unity Catalog. */ function getTables(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("databricks:index/getTables:getTables", { "catalogName": args.catalogName, "ids": args.ids, "schemaName": args.schemaName, }, opts); } exports.getTables = getTables; /** * Retrieves a list of managed or external table full names in Unity Catalog, that were created by Pulumi or manually. Use databricks.getViews for retrieving a list of views. * * > This data source can only be used with a workspace-level provider! * * ## Example Usage * * Granting `SELECT` and `MODIFY` to `sensitive` group on all tables a _things_ databricks.Schema from _sandbox_ databricks_catalog: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const things = await databricks.getTables({ * catalogName: "sandbox", * schemaName: "things", * }); * const thingsGrants: databricks.Grants[] = []; * for (const range of things.ids.map((v, k) => ({key: k, value: v}))) { * thingsGrants.push(new databricks.Grants(`things-${range.key}`, { * table: range.value, * grants: [{ * principal: "sensitive", * privileges: [ * "SELECT", * "MODIFY", * ], * }], * })); * } * } * ``` * * ## Related Resources * * The following resources are used in the same context: * * * databricks.Schema to manage schemas within Unity Catalog. * * databricks.Catalog to manage catalogs within Unity Catalog. */ function getTablesOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("databricks:index/getTables:getTables", { "catalogName": args.catalogName, "ids": args.ids, "schemaName": args.schemaName, }, opts); } exports.getTablesOutput = getTablesOutput; //# sourceMappingURL=getTables.js.map