UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

100 lines 4.29 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.Task = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a pressure Test Task resource within HuaweiCloud CPTS. * The task resource only supports serial execution mode. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const testProject = new huaweicloud.cpts.Project("testProject", {}); * const testTask = new huaweicloud.cpts.Task("testTask", {projectId: testProject.id}); * ``` * * ## Import * * Tasks can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Cpts/task:Task test 1090 * ``` * * 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`operation`. It is generally recommended running `terraform plan` after importing an instance. You can then decide if changes should be applied to the instance, or the resource definition should be updated to align with the instance. Also you can ignore changes as below. hcl resource "huaweicloud_cpts_task" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * operation, * * ] * * } } */ class Task extends pulumi.CustomResource { /** * Get an existing Task 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 Task(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Task. 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'] === Task.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["benchmarkConcurrency"] = state ? state.benchmarkConcurrency : undefined; resourceInputs["clusterId"] = state ? state.clusterId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["operation"] = state ? state.operation : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["status"] = state ? state.status : undefined; } else { const args = argsOrState; if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } resourceInputs["benchmarkConcurrency"] = args ? args.benchmarkConcurrency : undefined; resourceInputs["clusterId"] = args ? args.clusterId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["operation"] = args ? args.operation : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Task.__pulumiType, name, resourceInputs, opts); } } exports.Task = Task; /** @internal */ Task.__pulumiType = 'huaweicloud:Cpts/task:Task'; //# sourceMappingURL=task.js.map