UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

128 lines 6.75 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.Stream = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages DIS Stream resource within HuaweiCloud. * * ## Example Usage * ### Create a stream that type is BLOB * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const stream = new huaweicloud.Dis.Stream("stream", { * partitionCount: 1, * streamName: "terraform_test_dis_stream", * }); * ``` * ### Create a stream that type is JSON * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const stream = new huaweicloud.Dis.Stream("stream", { * dataSchema: "{\"type\":\"record\",\"name\":\"RecordName\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"doc\":\"Type inferred from '\\\"2017/10/11 11:11:11\\\"'\"},{\"name\":\"info\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"info\",\"fields\":[{\"name\":\"date\",\"type\":\"string\",\"doc\":\"Type inferred from '\\\"2018/10/11 11:11:11\\\"'\"}]}},\"doc\":\"Type inferred from '[{\\\"date\\\":\\\"2018/10/11 11:11:11\\\"}]'\"}]}", * dataType: "JSON", * partitionCount: 1, * streamName: "terraform_test_dis_stream", * }); * ``` * * ## Import * * Dis stream can be imported by `stream_name`. For example, bash * * ```sh * $ pulumi import huaweicloud:Dis/stream:Stream example _abc123 * ``` */ class Stream extends pulumi.CustomResource { /** * Get an existing Stream 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 Stream(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Stream. 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'] === Stream.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoScaleMaxPartitionCount"] = state ? state.autoScaleMaxPartitionCount : undefined; resourceInputs["autoScaleMinPartitionCount"] = state ? state.autoScaleMinPartitionCount : undefined; resourceInputs["compressionFormat"] = state ? state.compressionFormat : undefined; resourceInputs["created"] = state ? state.created : undefined; resourceInputs["csvDelimiter"] = state ? state.csvDelimiter : undefined; resourceInputs["dataSchema"] = state ? state.dataSchema : undefined; resourceInputs["dataType"] = state ? state.dataType : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["partitionCount"] = state ? state.partitionCount : undefined; resourceInputs["partitions"] = state ? state.partitions : undefined; resourceInputs["readablePartitionCount"] = state ? state.readablePartitionCount : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["retentionPeriod"] = state ? state.retentionPeriod : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["streamId"] = state ? state.streamId : undefined; resourceInputs["streamName"] = state ? state.streamName : undefined; resourceInputs["streamType"] = state ? state.streamType : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["writablePartitionCount"] = state ? state.writablePartitionCount : undefined; } else { const args = argsOrState; if ((!args || args.partitionCount === undefined) && !opts.urn) { throw new Error("Missing required property 'partitionCount'"); } if ((!args || args.streamName === undefined) && !opts.urn) { throw new Error("Missing required property 'streamName'"); } resourceInputs["autoScaleMaxPartitionCount"] = args ? args.autoScaleMaxPartitionCount : undefined; resourceInputs["autoScaleMinPartitionCount"] = args ? args.autoScaleMinPartitionCount : undefined; resourceInputs["compressionFormat"] = args ? args.compressionFormat : undefined; resourceInputs["csvDelimiter"] = args ? args.csvDelimiter : undefined; resourceInputs["dataSchema"] = args ? args.dataSchema : undefined; resourceInputs["dataType"] = args ? args.dataType : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["partitionCount"] = args ? args.partitionCount : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["retentionPeriod"] = args ? args.retentionPeriod : undefined; resourceInputs["streamName"] = args ? args.streamName : undefined; resourceInputs["streamType"] = args ? args.streamType : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["created"] = undefined /*out*/; resourceInputs["partitions"] = undefined /*out*/; resourceInputs["readablePartitionCount"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["streamId"] = undefined /*out*/; resourceInputs["writablePartitionCount"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Stream.__pulumiType, name, resourceInputs, opts); } } exports.Stream = Stream; /** @internal */ Stream.__pulumiType = 'huaweicloud:Dis/stream:Stream'; //# sourceMappingURL=stream.js.map