@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
319 lines (318 loc) • 11.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages CDM job resource within HuaweiCloud.
*
* ## Example Usage
* ### Create a cdm job
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const obsLinkName = config.requireObject("obsLinkName");
* const obsInputBucket = config.requireObject("obsInputBucket");
* const obsOutputBucket = config.requireObject("obsOutputBucket");
* const obsLinkNameInput = config.requireObject("obsLinkNameInput");
* const input = new huaweicloud.obs.Bucket("input", {
* bucket: "job-input",
* acl: "private",
* forceDestroy: true,
* });
* const output = new huaweicloud.obs.Bucket("output", {
* bucket: "job-output",
* acl: "private",
* forceDestroy: true,
* });
* const test = new huaweicloud.cdm.Job("test", {
* jobType: "NORMAL_JOB",
* clusterId: huaweicloud_cdm_cluster.test.id,
* sourceConnector: "obs-connector",
* sourceLinkName: obsLinkName,
* sourceJobConfig: {
* bucketName: obsInputBucket,
* inputDirectory: "/",
* listTextFile: "false",
* inputFormat: "BINARY_FILE",
* fromCompression: "NONE",
* fromFileOpType: "DO_NOTHING",
* useMarkerFile: "false",
* useTimeFilter: "false",
* fileSeparator: "|",
* filterType: "NONE",
* useWildCard: "false",
* decryption: "NONE",
* nonexistentPathDisregard: "false",
* },
* destinationConnector: "obs-connector",
* destinationLinkName: obsLinkName,
* destinationJobConfig: {
* bucketName: obsOutputBucket,
* outputDirectory: "/",
* outputFormat: "BINARY_FILE",
* validateMD5: "true",
* recordMD5Result: "false",
* duplicateFileOpType: "REPLACE",
* useCustomDirectory: "false",
* encryption: "NONE",
* copyContentType: "false",
* shouldClearTable: "false",
* },
* config: {
* retryType: "NONE",
* schedulerEnabled: false,
* throttlingExtractorsNumber: 4,
* throttlingRecordDirtyData: false,
* throttlingMaxErrorRecords: 10,
* throttlingLoaderNumber: 1,
* },
* });
* ```
*
* ## Import
*
* Jobs can be imported by `id`. It is composed of the ID of CDM cluster which this job run in and the name of job,
*
* separated by a slash. For example, bash
*
* ```sh
* $ pulumi import huaweicloud:Cdm/job:Job test b11b407c-e604-4e8d-8bc4-92398320b847/jobName
* ```
*
* 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`source_job_config` and `destination_job_config`.
*
* It is generally recommended running `terraform plan` after importing a cluster.
*
* You can then decide if changes should be applied to the cluster, or the resource definition should be updated to align with the cluster. Also you can ignore changes as below. hcl resource "huaweicloud_cdm_cluster" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* source_job_config, destination_job_config,
*
* ]
*
* } }
*/
export declare class Job extends pulumi.CustomResource {
/**
* Get an existing Job 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: string, id: pulumi.Input<pulumi.ID>, state?: JobState, opts?: pulumi.CustomResourceOptions): Job;
/**
* Returns true if the given object is an instance of Job. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Job;
/**
* Specifies the ID of CDM cluster which this job run in.
* Changing this parameter will create a new resource.
*/
readonly clusterId: pulumi.Output<string>;
/**
* Specifies the job configuration. Structure is documented below.
*/
readonly config: pulumi.Output<outputs.Cdm.JobConfig | undefined>;
/**
* Specifies the connector name of destination link.
* Changing this parameter will create a new resource.
*/
readonly destinationConnector: pulumi.Output<string>;
/**
* Specifies the destination job configuration parameters. Each type of the
* data source to be connected has different configuration parameters, please refer to the document link below.
*/
readonly destinationJobConfig: pulumi.Output<{
[key: string]: string;
}>;
/**
* Specifies the destination link name.
* Changing this parameter will create a new resource.
*/
readonly destinationLinkName: pulumi.Output<string>;
/**
* Specifies type of job. Changing this parameter will create a new resource.
* The options are as follows:
*/
readonly jobType: pulumi.Output<string>;
/**
* Specifies job name, which can contains of `1` to `240` characters, starting with a letter.
* Only letters, digits, hyphens (-), and underscores (_) are allowed.
*/
readonly name: pulumi.Output<string>;
/**
* The region in which to create the job resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the connector name of source link.
* Changing this parameter will create a new resource.
*/
readonly sourceConnector: pulumi.Output<string>;
/**
* Specifies the source job configuration parameters. Each type of the data source
* to be connected has different configuration parameters, please refer to the document link below.
*/
readonly sourceJobConfig: pulumi.Output<{
[key: string]: string;
}>;
/**
* Specifies the source link name.
* Changing this parameter will create a new resource.
*/
readonly sourceLinkName: pulumi.Output<string>;
/**
* Job status. The options are as follows:
*/
readonly status: pulumi.Output<string>;
/**
* Create a Job resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: JobArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Job resources.
*/
export interface JobState {
/**
* Specifies the ID of CDM cluster which this job run in.
* Changing this parameter will create a new resource.
*/
clusterId?: pulumi.Input<string>;
/**
* Specifies the job configuration. Structure is documented below.
*/
config?: pulumi.Input<inputs.Cdm.JobConfig>;
/**
* Specifies the connector name of destination link.
* Changing this parameter will create a new resource.
*/
destinationConnector?: pulumi.Input<string>;
/**
* Specifies the destination job configuration parameters. Each type of the
* data source to be connected has different configuration parameters, please refer to the document link below.
*/
destinationJobConfig?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the destination link name.
* Changing this parameter will create a new resource.
*/
destinationLinkName?: pulumi.Input<string>;
/**
* Specifies type of job. Changing this parameter will create a new resource.
* The options are as follows:
*/
jobType?: pulumi.Input<string>;
/**
* Specifies job name, which can contains of `1` to `240` characters, starting with a letter.
* Only letters, digits, hyphens (-), and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* The region in which to create the job resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the connector name of source link.
* Changing this parameter will create a new resource.
*/
sourceConnector?: pulumi.Input<string>;
/**
* Specifies the source job configuration parameters. Each type of the data source
* to be connected has different configuration parameters, please refer to the document link below.
*/
sourceJobConfig?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the source link name.
* Changing this parameter will create a new resource.
*/
sourceLinkName?: pulumi.Input<string>;
/**
* Job status. The options are as follows:
*/
status?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Job resource.
*/
export interface JobArgs {
/**
* Specifies the ID of CDM cluster which this job run in.
* Changing this parameter will create a new resource.
*/
clusterId: pulumi.Input<string>;
/**
* Specifies the job configuration. Structure is documented below.
*/
config?: pulumi.Input<inputs.Cdm.JobConfig>;
/**
* Specifies the connector name of destination link.
* Changing this parameter will create a new resource.
*/
destinationConnector: pulumi.Input<string>;
/**
* Specifies the destination job configuration parameters. Each type of the
* data source to be connected has different configuration parameters, please refer to the document link below.
*/
destinationJobConfig: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the destination link name.
* Changing this parameter will create a new resource.
*/
destinationLinkName: pulumi.Input<string>;
/**
* Specifies type of job. Changing this parameter will create a new resource.
* The options are as follows:
*/
jobType: pulumi.Input<string>;
/**
* Specifies job name, which can contains of `1` to `240` characters, starting with a letter.
* Only letters, digits, hyphens (-), and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* The region in which to create the job resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the connector name of source link.
* Changing this parameter will create a new resource.
*/
sourceConnector: pulumi.Input<string>;
/**
* Specifies the source job configuration parameters. Each type of the data source
* to be connected has different configuration parameters, please refer to the document link below.
*/
sourceJobConfig: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the source link name.
* Changing this parameter will create a new resource.
*/
sourceLinkName: pulumi.Input<string>;
}