UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

137 lines 6.53 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.MigrationTask = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an OMS migration task resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const sourceRegion = config.requireObject("sourceRegion"); * const sourceBucket = config.requireObject("sourceBucket"); * const sourceAccessKey = config.requireObject("sourceAccessKey"); * const sourceSecretKey = config.requireObject("sourceSecretKey"); * const destRegion = config.requireObject("destRegion"); * const destBucket = config.requireObject("destBucket"); * const destAccessKey = config.requireObject("destAccessKey"); * const destSecretKey = config.requireObject("destSecretKey"); * const topicUrn = config.requireObject("topicUrn"); * const test = new huaweicloud.oms.MigrationTask("test", { * sourceObject: { * dataSource: "Aliyun", * region: sourceRegion, * bucket: sourceBucket, * accessKey: sourceAccessKey, * secretKey: sourceSecretKey, * objects: [""], * }, * destinationObject: { * region: destRegion, * bucket: destBucket, * accessKey: destAccessKey, * secretKey: destSecretKey, * }, * type: "object", * description: "test task", * bandwidthPolicies: [{ * maxBandwidth: 2, * start: "15:00", * end: "16:00", * }], * smnConfig: { * topicUrn: topicUrn, * triggerConditions: [ * "FAILURE", * "SUCCESS", * ], * }, * }); * ``` */ class MigrationTask extends pulumi.CustomResource { /** * Get an existing MigrationTask 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 MigrationTask(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MigrationTask. 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'] === MigrationTask.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bandwidthPolicies"] = state ? state.bandwidthPolicies : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["destinationObject"] = state ? state.destinationObject : undefined; resourceInputs["enableFailedObjectRecording"] = state ? state.enableFailedObjectRecording : undefined; resourceInputs["enableKms"] = state ? state.enableKms : undefined; resourceInputs["enableRestore"] = state ? state.enableRestore : undefined; resourceInputs["migrateSince"] = state ? state.migrateSince : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["smnConfig"] = state ? state.smnConfig : undefined; resourceInputs["sourceCdn"] = state ? state.sourceCdn : undefined; resourceInputs["sourceObject"] = state ? state.sourceObject : undefined; resourceInputs["startTask"] = state ? state.startTask : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.destinationObject === undefined) && !opts.urn) { throw new Error("Missing required property 'destinationObject'"); } if ((!args || args.sourceObject === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceObject'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["bandwidthPolicies"] = args ? args.bandwidthPolicies : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["destinationObject"] = args ? args.destinationObject : undefined; resourceInputs["enableFailedObjectRecording"] = args ? args.enableFailedObjectRecording : undefined; resourceInputs["enableKms"] = args ? args.enableKms : undefined; resourceInputs["enableRestore"] = args ? args.enableRestore : undefined; resourceInputs["migrateSince"] = args ? args.migrateSince : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["smnConfig"] = args ? args.smnConfig : undefined; resourceInputs["sourceCdn"] = args ? args.sourceCdn : undefined; resourceInputs["sourceObject"] = args ? args.sourceObject : undefined; resourceInputs["startTask"] = args ? args.startTask : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["name"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MigrationTask.__pulumiType, name, resourceInputs, opts); } } exports.MigrationTask = MigrationTask; /** @internal */ MigrationTask.__pulumiType = 'huaweicloud:Oms/migrationTask:MigrationTask'; //# sourceMappingURL=migrationTask.js.map