@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
114 lines • 6.03 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.SparkJob = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages spark job resource of DLI within HuaweiCloud
*
* ## Example Usage
* ### Submit a new spark job with jar packages
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const _default = new huaweicloud.dli.SparkJob("default", {
* queueName: _var.queue_name,
* appName: "driver_package/driver_behavior.jar",
* mainClass: "driver_behavior",
* specification: "B",
* maxRetries: 20,
* });
* ```
*/
class SparkJob extends pulumi.CustomResource {
/**
* Get an existing SparkJob 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 SparkJob(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SparkJob. 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'] === SparkJob.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appName"] = state ? state.appName : undefined;
resourceInputs["appParameters"] = state ? state.appParameters : undefined;
resourceInputs["configurations"] = state ? state.configurations : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["dependentPackages"] = state ? state.dependentPackages : undefined;
resourceInputs["driverCores"] = state ? state.driverCores : undefined;
resourceInputs["driverMemory"] = state ? state.driverMemory : undefined;
resourceInputs["executorCores"] = state ? state.executorCores : undefined;
resourceInputs["executorMemory"] = state ? state.executorMemory : undefined;
resourceInputs["executors"] = state ? state.executors : undefined;
resourceInputs["files"] = state ? state.files : undefined;
resourceInputs["jars"] = state ? state.jars : undefined;
resourceInputs["mainClass"] = state ? state.mainClass : undefined;
resourceInputs["maxRetries"] = state ? state.maxRetries : undefined;
resourceInputs["modules"] = state ? state.modules : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["pythonFiles"] = state ? state.pythonFiles : undefined;
resourceInputs["queueName"] = state ? state.queueName : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["specification"] = state ? state.specification : undefined;
}
else {
const args = argsOrState;
if ((!args || args.appName === undefined) && !opts.urn) {
throw new Error("Missing required property 'appName'");
}
if ((!args || args.queueName === undefined) && !opts.urn) {
throw new Error("Missing required property 'queueName'");
}
resourceInputs["appName"] = args ? args.appName : undefined;
resourceInputs["appParameters"] = args ? args.appParameters : undefined;
resourceInputs["configurations"] = args ? args.configurations : undefined;
resourceInputs["dependentPackages"] = args ? args.dependentPackages : undefined;
resourceInputs["driverCores"] = args ? args.driverCores : undefined;
resourceInputs["driverMemory"] = args ? args.driverMemory : undefined;
resourceInputs["executorCores"] = args ? args.executorCores : undefined;
resourceInputs["executorMemory"] = args ? args.executorMemory : undefined;
resourceInputs["executors"] = args ? args.executors : undefined;
resourceInputs["files"] = args ? args.files : undefined;
resourceInputs["jars"] = args ? args.jars : undefined;
resourceInputs["mainClass"] = args ? args.mainClass : undefined;
resourceInputs["maxRetries"] = args ? args.maxRetries : undefined;
resourceInputs["modules"] = args ? args.modules : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pythonFiles"] = args ? args.pythonFiles : undefined;
resourceInputs["queueName"] = args ? args.queueName : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["specification"] = args ? args.specification : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["owner"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SparkJob.__pulumiType, name, resourceInputs, opts);
}
}
exports.SparkJob = SparkJob;
/** @internal */
SparkJob.__pulumiType = 'huaweicloud:Dli/sparkJob:SparkJob';
//# sourceMappingURL=sparkJob.js.map