UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

124 lines 4.87 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getJobsOutput = exports.getJobs = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * > **Note** If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add dependsOn attribute in order to prevent _default auth: cannot configure default credentials_ errors. * * Retrieves a list of databricks.Job ids, that were created by Pulumi or manually, so that special handling could be applied. * * > **Note** Data resource will error in case of jobs with duplicate names. * * ## Example Usage * * Granting view databricks.Permissions to all databricks.Job within the workspace: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const _this = await databricks.getJobs({}); * const tests = await databricks.getJobs({ * jobNameContains: "test", * }); * const everyoneCanViewAllJobs: databricks.Permissions[] = []; * for (const range of Object.entries(_this.ids).map(([k, v]) => ({key: k, value: v}))) { * everyoneCanViewAllJobs.push(new databricks.Permissions(`everyone_can_view_all_jobs-${range.key}`, { * jobId: range.value, * accessControls: [{ * groupName: "users", * permissionLevel: "CAN_VIEW", * }], * })); * } * } * ``` * * Getting ID of specific databricks.Job by name: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = databricks.getJobs({}); * export const x = _this.then(_this => `ID of `x` job is ${_this.ids?.x}`); * ``` * * ## Related Resources * * The following resources are used in the same context: * * * databricks.Job to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code in a databricks_cluster. */ function getJobs(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("databricks:index/getJobs:getJobs", { "ids": args.ids, "jobNameContains": args.jobNameContains, }, opts); } exports.getJobs = getJobs; /** * > **Note** If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add dependsOn attribute in order to prevent _default auth: cannot configure default credentials_ errors. * * Retrieves a list of databricks.Job ids, that were created by Pulumi or manually, so that special handling could be applied. * * > **Note** Data resource will error in case of jobs with duplicate names. * * ## Example Usage * * Granting view databricks.Permissions to all databricks.Job within the workspace: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const _this = await databricks.getJobs({}); * const tests = await databricks.getJobs({ * jobNameContains: "test", * }); * const everyoneCanViewAllJobs: databricks.Permissions[] = []; * for (const range of Object.entries(_this.ids).map(([k, v]) => ({key: k, value: v}))) { * everyoneCanViewAllJobs.push(new databricks.Permissions(`everyone_can_view_all_jobs-${range.key}`, { * jobId: range.value, * accessControls: [{ * groupName: "users", * permissionLevel: "CAN_VIEW", * }], * })); * } * } * ``` * * Getting ID of specific databricks.Job by name: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = databricks.getJobs({}); * export const x = _this.then(_this => `ID of `x` job is ${_this.ids?.x}`); * ``` * * ## Related Resources * * The following resources are used in the same context: * * * databricks.Job to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code in a databricks_cluster. */ function getJobsOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("databricks:index/getJobs:getJobs", { "ids": args.ids, "jobNameContains": args.jobNameContains, }, opts); } exports.getJobsOutput = getJobsOutput; //# sourceMappingURL=getJobs.js.map