UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

132 lines 6.17 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.Dataset = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages ModelArts dataset resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const name = config.requireObject("name"); * const outputObsPath = config.requireObject("outputObsPath"); * const inputObsPath = config.requireObject("inputObsPath"); * const test = new huaweicloud.modelarts.Dataset("test", { * type: 1, * outputPath: outputObsPath, * description: "Terraform Demo", * dataSource: { * path: inputObsPath, * }, * labels: [{ * name: "foo", * }], * }); * ``` * * ## Import * * The datasets can be imported by `id`. bash * * ```sh * $ pulumi import huaweicloud:ModelArts/dataset:Dataset test yiROKoTTjtwjvP71yLG * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`data_source.0.path`, `data_source.0.queue_name`, `data_source.0.database_name`, `data_source.0.table_name`, `data_source.0.cluster_id`, `data_source.0.user_name` and `data_source.0.password`. It is generally recommended running `terraform plan` after importing a dataset. You can then decide if changes should be applied to the dataset, or the resource definition should be updated to align with the dataset. Also you can ignore changes as below. hcl resource "huaweicloud_modelarts_dataset" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * data_source.0.path, data_source.0.queue_name, data_source.0.database_name, data_source.0.table_name, * * data_source.0.cluster_id, data_source.0.user_name, data_source.0.password, * * ] * * } } */ class Dataset extends pulumi.CustomResource { /** * Get an existing Dataset 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 Dataset(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Dataset. 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'] === Dataset.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["dataFormat"] = state ? state.dataFormat : undefined; resourceInputs["dataSource"] = state ? state.dataSource : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["importLabeledEnabled"] = state ? state.importLabeledEnabled : undefined; resourceInputs["labelFormat"] = state ? state.labelFormat : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["outputPath"] = state ? state.outputPath : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["schemas"] = state ? state.schemas : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.dataSource === undefined) && !opts.urn) { throw new Error("Missing required property 'dataSource'"); } if ((!args || args.outputPath === undefined) && !opts.urn) { throw new Error("Missing required property 'outputPath'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["dataSource"] = args ? args.dataSource : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["importLabeledEnabled"] = args ? args.importLabeledEnabled : undefined; resourceInputs["labelFormat"] = args ? args.labelFormat : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["outputPath"] = args ? args.outputPath : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["schemas"] = args ? args.schemas : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["dataFormat"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Dataset.__pulumiType, name, resourceInputs, opts); } } exports.Dataset = Dataset; /** @internal */ Dataset.__pulumiType = 'huaweicloud:ModelArts/dataset:Dataset'; //# sourceMappingURL=dataset.js.map