UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

118 lines 4.84 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.RegisteredModel = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to create [Models in Unity Catalog](https://docs.databricks.com/en/mlflow/models-in-uc.html) in Databricks. * * > This resource can only be used with a workspace-level provider! * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.RegisteredModel("this", { * name: "my_model", * catalogName: "main", * schemaName: "default", * }); * ``` * * ## Access Control * * * databricks.Grants can be used to grant principals `ALL_PRIVILEGES`, `APPLY_TAG`, and `EXECUTE` privileges. * * ## Related Resources * * The following resources are often used in the same context: * * * databricks.ModelServing to serve this model on a Databricks serving endpoint. * * databricks.MlflowExperiment to manage [MLflow experiments](https://docs.databricks.com/data/data-sources/mlflow-experiment.html) in Databricks. * * databricks.Schema to manage schemas within Unity Catalog. * * databricks.Catalog to manage catalogs within Unity Catalog. * * ## Import * * The registered model resource can be imported using the full (3-level) name of the model. * * hcl * * import { * * to = databricks_registered_model.this * * id = "<catalog_name>.<schema_name>.<model_name>" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * bash * * ```sh * $ pulumi import databricks:index/registeredModel:RegisteredModel this <catalog_name>.<schema_name>.<model_name> * ``` */ class RegisteredModel extends pulumi.CustomResource { /** * Get an existing RegisteredModel resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new RegisteredModel(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RegisteredModel. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RegisteredModel.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["catalogName"] = state ? state.catalogName : undefined; resourceInputs["comment"] = state ? state.comment : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["owner"] = state ? state.owner : undefined; resourceInputs["schemaName"] = state ? state.schemaName : undefined; resourceInputs["storageLocation"] = state ? state.storageLocation : undefined; } else { const args = argsOrState; if ((!args || args.catalogName === undefined) && !opts.urn) { throw new Error("Missing required property 'catalogName'"); } if ((!args || args.schemaName === undefined) && !opts.urn) { throw new Error("Missing required property 'schemaName'"); } resourceInputs["catalogName"] = args ? args.catalogName : undefined; resourceInputs["comment"] = args ? args.comment : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["owner"] = args ? args.owner : undefined; resourceInputs["schemaName"] = args ? args.schemaName : undefined; resourceInputs["storageLocation"] = args ? args.storageLocation : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RegisteredModel.__pulumiType, name, resourceInputs, opts); } } exports.RegisteredModel = RegisteredModel; /** @internal */ RegisteredModel.__pulumiType = 'databricks:index/registeredModel:RegisteredModel'; //# sourceMappingURL=registeredModel.js.map