UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

583 lines (582 loc) 22.4 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages a flink sql job resource within HuaweiCloud DLI. * * ## Example Usage * ### Create a flink job * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const sql = config.requireObject("sql"); * const jobName = config.requireObject("jobName"); * const test = new huaweicloud.dli.FlinksqlJob("test", { * type: "flink_sql_job", * sql: sql, * }); * ``` * * ## Import * * Clusters can be imported by their `id`. For example, bash * * ```sh * $ pulumi import huaweicloud:Dli/flinksqlJob:FlinksqlJob test 12345 * ``` * * 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`static_estimator`, `graph_type`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also you can ignore changes as below. hcl resource "huaweicloud_cae_component" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * static_estimator, graph_type, * * ] * * } } */ export declare class FlinksqlJob extends pulumi.CustomResource { /** * Get an existing FlinksqlJob 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?: FlinksqlJobState, opts?: pulumi.CustomResourceOptions): FlinksqlJob; /** * Returns true if the given object is an instance of FlinksqlJob. 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 FlinksqlJob; /** * Specifies whether to enable the automatic job snapshot function. * + **true**: indicates to enable the automatic job snapshot function. * + **false**: indicates to disable the automatic job snapshot function. */ readonly checkpointEnabled: pulumi.Output<boolean | undefined>; /** * Specifies snapshot interval. The unit is second. * The default value is 10. */ readonly checkpointInterval: pulumi.Output<number | undefined>; /** * Specifies snapshot mode. There are two options: * + **exactly_once**: indicates that data is processed only once. * + **at_least_once**: indicates that data is processed at least once. */ readonly checkpointMode: pulumi.Output<string | undefined>; /** * Specifies number of CUs selected for a job. The default value is 2. */ readonly cuNumber: pulumi.Output<number | undefined>; /** * Specifies job description. Length range: `1` to `512` characters. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies dirty data policy of a job. * + **2:obsDir**: Save the dirty data to the obs path `obsDir`. For example: `2:yourBucket/output_path` * + **1**: Trigger a job exception * + **0**: Ignore */ readonly dirtyDataStrategy: pulumi.Output<string | undefined>; /** * Specifies edge computing group IDs. */ readonly edgeGroupIds: pulumi.Output<string[] | undefined>; /** * Specifies the version of the flink. * The valid values are `1.10` and `1.12`, defalut value is `1.10`. */ readonly flinkVersion: pulumi.Output<string | undefined>; /** * Specifies the type of stream graph to be generated by the Flink SQL job. * The valid values are `simpleGraph` and `jobGraph`. The default value is `simpleGraph`. */ readonly graphType: pulumi.Output<string | undefined>; /** * Specifies retention time of the idle state. The unit is hour. * The default value is 1. */ readonly idleStateRetention: pulumi.Output<number | undefined>; /** * Specifies whether to enable the function of uploading job logs to * users' OBS buckets. The default value is false. */ readonly logEnabled: pulumi.Output<boolean | undefined>; /** * Specifies number of CUs in the JobManager selected for a job. * The default value is 1. */ readonly managerCuNumber: pulumi.Output<number | undefined>; /** * Specifies the name of the job. Length range: `1` to `57` characters. * which may consist of letters, digits, underscores (_) and hyphens (-). */ readonly name: pulumi.Output<string>; /** * Specifies OBS path. OBS path where users are authorized to save the * snapshot. This parameter is valid only when `checkpointEnabled` is set to `true`. OBS path where users are authorized * to save the snapshot. This parameter is valid only when `logEnabled` is set to `true`. */ readonly obsBucket: pulumi.Output<string | undefined>; /** * Specifies degree of parallelism (DOP) configuration of an operator, in * JSON format. */ readonly operatorConfig: pulumi.Output<string | undefined>; /** * Specifies number of parallel for a job. The default value is 1. */ readonly parallelNumber: pulumi.Output<number | undefined>; /** * Specifies name of a queue. * If you want to use the parameters, the `runMode` parameter must be set to `exclusiveCluster`. */ readonly queueName: pulumi.Output<string>; /** * The region in which to create the DLI flink 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 whether to enable the function of automatically * restarting a job upon job exceptions. The default value is false. */ readonly restartWhenException: pulumi.Output<boolean | undefined>; /** * Specifies whether the abnormal restart is recovered from the * checkpoint. */ readonly resumeCheckpoint: pulumi.Output<boolean | undefined>; /** * Specifies maximum number of retry times upon exceptions. The unit is * `times/hour`. Value range: `-1` or greater than `0`. The default value is `-1`, indicating that the number of times is * unlimited. */ readonly resumeMaxNum: pulumi.Output<number | undefined>; /** * Specifies job running mode. The options are as follows: */ readonly runMode: pulumi.Output<string | undefined>; /** * Specifies customizes optimization parameters when a Flink job is * running. */ readonly runtimeConfig: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Specifies SMN topic. If a job fails, the system will send a message to * users subscribed to the SMN topic. */ readonly smnTopic: pulumi.Output<string | undefined>; /** * Specifies stream SQL statement, which includes at least the following * three parts: source, query, and sink. Length range: 1024x1024 characters. */ readonly sql: pulumi.Output<string | undefined>; /** * Specifies whether to estimate static resources. Default value is `false`. */ readonly staticEstimator: pulumi.Output<boolean | undefined>; /** * Specifies the traffic or hit rate configuration of each operator, in * JSON format. */ readonly staticEstimatorConfig: pulumi.Output<string | undefined>; /** * The Job status. */ readonly status: pulumi.Output<string>; /** * The simplified stream graph or static stream graph information of the Flink SQL job. */ readonly streamGraph: pulumi.Output<string>; /** * Specifies the key/value pairs to associate with the resource. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Specifies number of CUs for each Task Manager. The default value is 1. */ readonly tmCus: pulumi.Output<number | undefined>; /** * Specifies number of slots in each Task Manager. * The default value is (**parallel_number** * **tm_cus**)/(**cu_number** - **manager_cu_number**). */ readonly tmSlotNum: pulumi.Output<number>; /** * Specifies the type of the job. The valid values are `flinkSqlJob`, * `flinkOpensourceSqlJob` and `flinkSqlEdgeJob`. Default value is `flinkSqlJob`. * Changing this parameter will create a new resource. */ readonly type: pulumi.Output<string | undefined>; /** * Specifies name of the resource package that has been uploaded to the * DLI resource management system. The UDF Jar file of the SQL job is specified by this parameter. */ readonly udfJarUrl: pulumi.Output<string>; /** * Create a FlinksqlJob 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?: FlinksqlJobArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FlinksqlJob resources. */ export interface FlinksqlJobState { /** * Specifies whether to enable the automatic job snapshot function. * + **true**: indicates to enable the automatic job snapshot function. * + **false**: indicates to disable the automatic job snapshot function. */ checkpointEnabled?: pulumi.Input<boolean>; /** * Specifies snapshot interval. The unit is second. * The default value is 10. */ checkpointInterval?: pulumi.Input<number>; /** * Specifies snapshot mode. There are two options: * + **exactly_once**: indicates that data is processed only once. * + **at_least_once**: indicates that data is processed at least once. */ checkpointMode?: pulumi.Input<string>; /** * Specifies number of CUs selected for a job. The default value is 2. */ cuNumber?: pulumi.Input<number>; /** * Specifies job description. Length range: `1` to `512` characters. */ description?: pulumi.Input<string>; /** * Specifies dirty data policy of a job. * + **2:obsDir**: Save the dirty data to the obs path `obsDir`. For example: `2:yourBucket/output_path` * + **1**: Trigger a job exception * + **0**: Ignore */ dirtyDataStrategy?: pulumi.Input<string>; /** * Specifies edge computing group IDs. */ edgeGroupIds?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the version of the flink. * The valid values are `1.10` and `1.12`, defalut value is `1.10`. */ flinkVersion?: pulumi.Input<string>; /** * Specifies the type of stream graph to be generated by the Flink SQL job. * The valid values are `simpleGraph` and `jobGraph`. The default value is `simpleGraph`. */ graphType?: pulumi.Input<string>; /** * Specifies retention time of the idle state. The unit is hour. * The default value is 1. */ idleStateRetention?: pulumi.Input<number>; /** * Specifies whether to enable the function of uploading job logs to * users' OBS buckets. The default value is false. */ logEnabled?: pulumi.Input<boolean>; /** * Specifies number of CUs in the JobManager selected for a job. * The default value is 1. */ managerCuNumber?: pulumi.Input<number>; /** * Specifies the name of the job. Length range: `1` to `57` characters. * which may consist of letters, digits, underscores (_) and hyphens (-). */ name?: pulumi.Input<string>; /** * Specifies OBS path. OBS path where users are authorized to save the * snapshot. This parameter is valid only when `checkpointEnabled` is set to `true`. OBS path where users are authorized * to save the snapshot. This parameter is valid only when `logEnabled` is set to `true`. */ obsBucket?: pulumi.Input<string>; /** * Specifies degree of parallelism (DOP) configuration of an operator, in * JSON format. */ operatorConfig?: pulumi.Input<string>; /** * Specifies number of parallel for a job. The default value is 1. */ parallelNumber?: pulumi.Input<number>; /** * Specifies name of a queue. * If you want to use the parameters, the `runMode` parameter must be set to `exclusiveCluster`. */ queueName?: pulumi.Input<string>; /** * The region in which to create the DLI flink job resource. If omitted, the * provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies whether to enable the function of automatically * restarting a job upon job exceptions. The default value is false. */ restartWhenException?: pulumi.Input<boolean>; /** * Specifies whether the abnormal restart is recovered from the * checkpoint. */ resumeCheckpoint?: pulumi.Input<boolean>; /** * Specifies maximum number of retry times upon exceptions. The unit is * `times/hour`. Value range: `-1` or greater than `0`. The default value is `-1`, indicating that the number of times is * unlimited. */ resumeMaxNum?: pulumi.Input<number>; /** * Specifies job running mode. The options are as follows: */ runMode?: pulumi.Input<string>; /** * Specifies customizes optimization parameters when a Flink job is * running. */ runtimeConfig?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies SMN topic. If a job fails, the system will send a message to * users subscribed to the SMN topic. */ smnTopic?: pulumi.Input<string>; /** * Specifies stream SQL statement, which includes at least the following * three parts: source, query, and sink. Length range: 1024x1024 characters. */ sql?: pulumi.Input<string>; /** * Specifies whether to estimate static resources. Default value is `false`. */ staticEstimator?: pulumi.Input<boolean>; /** * Specifies the traffic or hit rate configuration of each operator, in * JSON format. */ staticEstimatorConfig?: pulumi.Input<string>; /** * The Job status. */ status?: pulumi.Input<string>; /** * The simplified stream graph or static stream graph information of the Flink SQL job. */ streamGraph?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies number of CUs for each Task Manager. The default value is 1. */ tmCus?: pulumi.Input<number>; /** * Specifies number of slots in each Task Manager. * The default value is (**parallel_number** * **tm_cus**)/(**cu_number** - **manager_cu_number**). */ tmSlotNum?: pulumi.Input<number>; /** * Specifies the type of the job. The valid values are `flinkSqlJob`, * `flinkOpensourceSqlJob` and `flinkSqlEdgeJob`. Default value is `flinkSqlJob`. * Changing this parameter will create a new resource. */ type?: pulumi.Input<string>; /** * Specifies name of the resource package that has been uploaded to the * DLI resource management system. The UDF Jar file of the SQL job is specified by this parameter. */ udfJarUrl?: pulumi.Input<string>; } /** * The set of arguments for constructing a FlinksqlJob resource. */ export interface FlinksqlJobArgs { /** * Specifies whether to enable the automatic job snapshot function. * + **true**: indicates to enable the automatic job snapshot function. * + **false**: indicates to disable the automatic job snapshot function. */ checkpointEnabled?: pulumi.Input<boolean>; /** * Specifies snapshot interval. The unit is second. * The default value is 10. */ checkpointInterval?: pulumi.Input<number>; /** * Specifies snapshot mode. There are two options: * + **exactly_once**: indicates that data is processed only once. * + **at_least_once**: indicates that data is processed at least once. */ checkpointMode?: pulumi.Input<string>; /** * Specifies number of CUs selected for a job. The default value is 2. */ cuNumber?: pulumi.Input<number>; /** * Specifies job description. Length range: `1` to `512` characters. */ description?: pulumi.Input<string>; /** * Specifies dirty data policy of a job. * + **2:obsDir**: Save the dirty data to the obs path `obsDir`. For example: `2:yourBucket/output_path` * + **1**: Trigger a job exception * + **0**: Ignore */ dirtyDataStrategy?: pulumi.Input<string>; /** * Specifies edge computing group IDs. */ edgeGroupIds?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the version of the flink. * The valid values are `1.10` and `1.12`, defalut value is `1.10`. */ flinkVersion?: pulumi.Input<string>; /** * Specifies the type of stream graph to be generated by the Flink SQL job. * The valid values are `simpleGraph` and `jobGraph`. The default value is `simpleGraph`. */ graphType?: pulumi.Input<string>; /** * Specifies retention time of the idle state. The unit is hour. * The default value is 1. */ idleStateRetention?: pulumi.Input<number>; /** * Specifies whether to enable the function of uploading job logs to * users' OBS buckets. The default value is false. */ logEnabled?: pulumi.Input<boolean>; /** * Specifies number of CUs in the JobManager selected for a job. * The default value is 1. */ managerCuNumber?: pulumi.Input<number>; /** * Specifies the name of the job. Length range: `1` to `57` characters. * which may consist of letters, digits, underscores (_) and hyphens (-). */ name?: pulumi.Input<string>; /** * Specifies OBS path. OBS path where users are authorized to save the * snapshot. This parameter is valid only when `checkpointEnabled` is set to `true`. OBS path where users are authorized * to save the snapshot. This parameter is valid only when `logEnabled` is set to `true`. */ obsBucket?: pulumi.Input<string>; /** * Specifies degree of parallelism (DOP) configuration of an operator, in * JSON format. */ operatorConfig?: pulumi.Input<string>; /** * Specifies number of parallel for a job. The default value is 1. */ parallelNumber?: pulumi.Input<number>; /** * Specifies name of a queue. * If you want to use the parameters, the `runMode` parameter must be set to `exclusiveCluster`. */ queueName?: pulumi.Input<string>; /** * The region in which to create the DLI flink job resource. If omitted, the * provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies whether to enable the function of automatically * restarting a job upon job exceptions. The default value is false. */ restartWhenException?: pulumi.Input<boolean>; /** * Specifies whether the abnormal restart is recovered from the * checkpoint. */ resumeCheckpoint?: pulumi.Input<boolean>; /** * Specifies maximum number of retry times upon exceptions. The unit is * `times/hour`. Value range: `-1` or greater than `0`. The default value is `-1`, indicating that the number of times is * unlimited. */ resumeMaxNum?: pulumi.Input<number>; /** * Specifies job running mode. The options are as follows: */ runMode?: pulumi.Input<string>; /** * Specifies customizes optimization parameters when a Flink job is * running. */ runtimeConfig?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies SMN topic. If a job fails, the system will send a message to * users subscribed to the SMN topic. */ smnTopic?: pulumi.Input<string>; /** * Specifies stream SQL statement, which includes at least the following * three parts: source, query, and sink. Length range: 1024x1024 characters. */ sql?: pulumi.Input<string>; /** * Specifies whether to estimate static resources. Default value is `false`. */ staticEstimator?: pulumi.Input<boolean>; /** * Specifies the traffic or hit rate configuration of each operator, in * JSON format. */ staticEstimatorConfig?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies number of CUs for each Task Manager. The default value is 1. */ tmCus?: pulumi.Input<number>; /** * Specifies number of slots in each Task Manager. * The default value is (**parallel_number** * **tm_cus**)/(**cu_number** - **manager_cu_number**). */ tmSlotNum?: pulumi.Input<number>; /** * Specifies the type of the job. The valid values are `flinkSqlJob`, * `flinkOpensourceSqlJob` and `flinkSqlEdgeJob`. Default value is `flinkSqlJob`. * Changing this parameter will create a new resource. */ type?: pulumi.Input<string>; /** * Specifies name of the resource package that has been uploaded to the * DLI resource management system. The UDF Jar file of the SQL job is specified by this parameter. */ udfJarUrl?: pulumi.Input<string>; }