@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
123 lines • 5.64 kB
JavaScript
;
// *** 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.Table = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages DLI Table resource within HuaweiCloud
*
* ## Example Usage
* ### Create a Table
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const databaseName = config.requireObject("databaseName");
* const testDatabase = new huaweicloud.dli.Database("testDatabase", {});
* const testTable = new huaweicloud.dli.Table("testTable", {
* databaseName: testDatabase.name,
* dataLocation: "DLI",
* description: "SQL table_1 description",
* columns: [
* {
* name: "column_1",
* type: "string",
* description: "the first column",
* },
* {
* name: "column_2",
* type: "string",
* description: "the second column",
* },
* ],
* });
* ```
*
* ## Import
*
* DLI table can be imported by `id`. It is composed of the name of database which table belongs and the name of table,
*
* separated by a slash. For example, bash
*
* ```sh
* $ pulumi import huaweicloud:Dli/table:Table example <database_name>/<table_name>
* ```
*/
class Table extends pulumi.CustomResource {
/**
* Get an existing Table 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 Table(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Table. 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'] === Table.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bucketLocation"] = state ? state.bucketLocation : undefined;
resourceInputs["columns"] = state ? state.columns : undefined;
resourceInputs["dataFormat"] = state ? state.dataFormat : undefined;
resourceInputs["dataLocation"] = state ? state.dataLocation : undefined;
resourceInputs["databaseName"] = state ? state.databaseName : undefined;
resourceInputs["dateFormat"] = state ? state.dateFormat : undefined;
resourceInputs["delimiter"] = state ? state.delimiter : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["escapeChar"] = state ? state.escapeChar : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["quoteChar"] = state ? state.quoteChar : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["timestampFormat"] = state ? state.timestampFormat : undefined;
resourceInputs["withColumnHeader"] = state ? state.withColumnHeader : undefined;
}
else {
const args = argsOrState;
if ((!args || args.dataLocation === undefined) && !opts.urn) {
throw new Error("Missing required property 'dataLocation'");
}
if ((!args || args.databaseName === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
resourceInputs["bucketLocation"] = args ? args.bucketLocation : undefined;
resourceInputs["columns"] = args ? args.columns : undefined;
resourceInputs["dataFormat"] = args ? args.dataFormat : undefined;
resourceInputs["dataLocation"] = args ? args.dataLocation : undefined;
resourceInputs["databaseName"] = args ? args.databaseName : undefined;
resourceInputs["dateFormat"] = args ? args.dateFormat : undefined;
resourceInputs["delimiter"] = args ? args.delimiter : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["escapeChar"] = args ? args.escapeChar : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["quoteChar"] = args ? args.quoteChar : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["timestampFormat"] = args ? args.timestampFormat : undefined;
resourceInputs["withColumnHeader"] = args ? args.withColumnHeader : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Table.__pulumiType, name, resourceInputs, opts);
}
}
exports.Table = Table;
/** @internal */
Table.__pulumiType = 'huaweicloud:Dli/table:Table';
//# sourceMappingURL=table.js.map