Documentation ¶
Index ¶
- Constants
- Variables
- func Run(c *golangsdk.ServiceClient, opts RunJobOpts) (*[]CommonResp, error)
- func Stop(c *golangsdk.ServiceClient, opts StopFlinkJobInBatch) (*[]CommonResp, error)
- type CommonResp
- type CreateJarJobOpts
- type CreateJobResp
- type CreateSqlJobOpts
- type DliError
- type GetJobResp
- type Job
- type Job4List
- type JobConf
- type JobConfBase
- type JobListWapper
- type JobStatus
- type ListOpts
- type ListResp
- type ObsBucketsOpts
- type RunJobOpts
- type StopFlinkJobInBatch
- type UpdateJarJobOpts
- type UpdateJobResp
- type UpdateJobResp_job
- type UpdateSqlJobOpts
Constants ¶
View Source
const ( JobTypeFlinkSql = "flink_sql_job" JobTypeFlinkOpenSourceSql = "flink_opensource_sql_job" JobTypeFlinkEdgeSql = "flink_sql_edge_job" JobTypeFlinkJar = "flink_jar_job" RunModeExclusiveCluster = "exclusive_cluster" RunModeEdgeNode = "edge_node" CheckpointModeExactlyOnce = "exactly_once" CheckpointModeAtLeastOnce = "at_least_once" )
Variables ¶
View Source
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
func Run ¶
func Run(c *golangsdk.ServiceClient, opts RunJobOpts) (*[]CommonResp, error)
func Stop ¶
func Stop(c *golangsdk.ServiceClient, opts StopFlinkJobInBatch) (*[]CommonResp, error)
Types ¶
type CommonResp ¶
type CommonResp struct { IsSuccess bool `json:"is_success,string"` Message string `json:"message"` }
func AuthorizeBucket ¶
func AuthorizeBucket(c *golangsdk.ServiceClient, opts ObsBucketsOpts) (*CommonResp, error)
func Delete ¶
func Delete(c *golangsdk.ServiceClient, jobId int) (*CommonResp, error)
type CreateJarJobOpts ¶
type CreateJarJobOpts struct { // Name of the job. Length range: 0 to 57 characters. Name string `json:"name" required:"true"` // Job description. Length range: 0 to 512 characters. Desc string `json:"desc,omitempty"` // Name of a queue. Length range: 1 to 128 characters. QueueName string `json:"queue_name,omitempty"` // Number of CUs selected for a job. CuNumber *int `json:"cu_number,omitempty"` // Number of CUs on the management node selected by the user for a job, // which corresponds to the number of Flink job managers. The default value is 1. ManagerCuNumber *int `json:"manager_cu_number,omitempty"` // Number of parallel operations selected for a job. ParallelNumber *int `json:"parallel_number,omitempty"` // Whether to enable the job log function. // true: indicates to enable the job log function. // false: indicates to disable the job log function. // Default value: false LogEnabled *bool `json:"log_enabled,omitempty"` // OBS bucket where users are authorized to save logs when log_enabled is set to true. ObsBucket string `json:"obs_bucket,omitempty"` // SMN topic. If a job fails, the system will send a message to users subscribed to the SMN topic. SmnTopic string `json:"smn_topic,omitempty"` // Job entry class. MainClass string `json:"main_class,omitempty"` // Job entry parameter. Multiple parameters are separated by spaces. EntrypointArgs string `json:"entrypoint_args,omitempty"` // Whether to enable the function of restart upon exceptions. The default value is false. RestartWhenException *bool `json:"restart_when_exception,omitempty"` // Name of the package that has been uploaded to the DLI resource management system. // This parameter is used to customize the JAR file where the job main class is located. Entrypoint string `json:"entrypoint,omitempty"` // Name of the package that has been uploaded to the DLI resource management system. // This parameter is used to customize other dependency packages. // Example: myGroup/test.jar,myGroup/test1.jar. DependencyJars []string `json:"dependency_jars,omitempty"` // Name of the resource package that has been uploaded to the DLI resource management system. // This parameter is used to customize dependency files. // Example: myGroup/test.cvs,myGroup/test1.csv. // You can add the following content to the application to access the corresponding dependency file: // In the command, fileName indicates the name of the file to be accessed, // and ClassName indicates the name of the class that needs to access the file. // ClassName.class.getClassLoader().getResource("userData/fileName") DependencyFiles []string `json:"dependency_files,omitempty"` // Number of CUs for each TaskManager. The default value is 1. TmCus *int `json:"tm_cus,omitempty"` // Number of slots in each TaskManager. The default value is (parallel_number*tm_cus)/(cu_number-manager_cu_number). TmSlotNum *int `json:"tm_slot_num,omitempty"` // Job feature. Type of the Flink image used by a job. // basic: indicates that the basic Flink image provided by DLI is used. // custom: indicates that the user-defined Flink image is used. Feature string `json:"feature,omitempty"` // Flink version. This parameter is valid only when feature is set to basic. You can use this parameter with the // feature parameter to specify the version of the DLI basic Flink image used for job running. FlinkVersion string `json:"flink_version,omitempty"` // Custom image. The format is Organization name/Image name:Image version. // This parameter is valid only when feature is set to custom. You can use this parameter with the feature // parameter to specify a user-defined Flink image for job running. For details about how to use custom images Image string `json:"image,omitempty"` // Whether the abnormal restart is recovered from the checkpoint. ResumeCheckpoint *bool `json:"resume_checkpoint,omitempty"` // 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 *int `json:"resume_max_num,omitempty"` // Storage address of the checkpoint in the JAR file of the user. The path must be unique. CheckpointPath string `json:"checkpoint_path,omitempty"` // Label of a Flink JAR job. For details, see Table 3. Tags []tags.ResourceTag `json:"tags"` // Customizes optimization parameters when a Flink job is running. RuntimeConfig string `json:"runtime_config,omitempty"` }
type CreateJobResp ¶
type CreateJobResp struct { IsSuccess bool `json:"is_success,string"` Message string `json:"message"` Job JobStatus `json:"job"` }
func CreateJarJob ¶
func CreateJarJob(c *golangsdk.ServiceClient, opts CreateJarJobOpts) (*CreateJobResp, error)
func CreateSqlJob ¶
func CreateSqlJob(c *golangsdk.ServiceClient, opts CreateSqlJobOpts) (*CreateJobResp, error)
type CreateSqlJobOpts ¶
type CreateSqlJobOpts struct { // Name of the job. Length range: 0 to 57 characters. Name string `json:"name" required:"true"` // Job description. Length range: 0 to 512 characters. Desc string `json:"desc,omitempty"` // Template ID. // If both template_id and sql_body are specified, sql_body is used. If template_id is specified but sql_body is // not, fill sql_body with the template_id value. TemplateId *int `json:"template_id,omitempty"` // Name of a queue. Length range: 1 to 128 characters. QueueName string `json:"queue_name,omitempty"` // Stream SQL statement, which includes at least the following three parts: source, query, and sink. // Length range: 1024x1024 characters. SqlBody string `json:"sql_body,omitempty"` // Job running mode. The options are as follows: // shared_cluster: indicates that the job is running on a shared cluster. // exclusive_cluster: indicates that the job is running on an exclusive cluster. // edge_node: indicates that the job is running on an edge node. // The default value is shared_cluster. RunMode string `json:"run_mode,omitempty"` // Number of CUs selected for a job. The default value is 2. CuNumber *int `json:"cu_number,omitempty"` // Number of parallel jobs set by a user. The default value is 1. ParallelNumber *int `json:"parallel_number,omitempty"` // 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. // Default value: false CheckpointEnabled *bool `json:"checkpoint_enabled,omitempty"` // Snapshot mode. There are two options: // 1: ExactlyOnce, indicates that data is processed only once. // 2: AtLeastOnce, indicates that data is processed at least once. // The default value is 1. CheckpointMode *int `json:"checkpoint_mode,omitempty"` // Snapshot interval. The unit is second. The default value is 10. CheckpointInterval *int `json:"checkpoint_interval,omitempty"` // OBS path where users are authorized to save the snapshot. This parameter is valid only when checkpoint_enabled // is set to true. // OBS path where users are authorized to save the snapshot. This parameter is valid only when log_enabled // is set to true. ObsBucket string `json:"obs_bucket,omitempty"` // Whether to enable the function of uploading job logs to users' OBS buckets. The default value is false. LogEnabled *bool `json:"log_enabled,omitempty"` // SMN topic. If a job fails, the system will send a message to users subscribed to the SMN topic. SmnTopic string `json:"smn_topic,omitempty"` // Whether to enable the function of automatically restarting a job upon job exceptions. The default value is false. RestartWhenException *bool `json:"restart_when_exception,omitempty"` // Retention time of the idle state. The unit is hour. The default value is 1. IdleStateRetention *int `json:"idle_state_retention,omitempty"` EdgeGroupIds []string `json:"edge_group_ids,omitempty"` // Job type. This parameter can be set to flink_sql_job, and flink_opensource_sql_job. // If run_mode is set to shared_cluster or exclusive_cluster, this parameter must be flink_sql_job. // The default value is flink_sql_job. JobType string `json:"job_type,omitempty"` // Dirty data policy of a job. // 2:obsDir: Save. obsDir specifies the path for storing dirty data. // 1: Trigger a job exception // 0: Ignore // The default value is 0. DirtyDataStrategy string `json:"dirty_data_strategy,omitempty"` // 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 string `json:"udf_jar_url,omitempty"` // Number of CUs in the JobManager selected for a job. The default value is 1. ManagerCuNumber *int `json:"manager_cu_number"` // Number of CUs for each TaskManager. The default value is 1. TmCus *int `json:"tm_cus,omitempty"` // Number of slots in each TaskManager. The default value is (parallel_number*tm_cus)/(cu_number-manager_cu_number). TmSlotNum *int `json:"tm_slot_num,omitempty"` // Whether the abnormal restart is recovered from the checkpoint. ResumeCheckpoint *bool `json:"resume_checkpoint,omitempty"` // 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 *int `json:"resume_max_num,omitempty"` // Customizes optimization parameters when a Flink job is running. RuntimeConfig string `json:"runtime_config,omitempty"` // Label of a Flink SQL job. For details, see Table 3. Tags []tags.ResourceTag `json:"tags"` // Flink version. The valid value is `1.1`0 or `1.12`. FlinkVersion string `json:"flink_version,omitempty"` }
type GetJobResp ¶
type GetJobResp struct { IsSuccess bool `json:"is_success,string"` Message string `json:"message"` JobDetail Job `json:"job_detail"` }
func Get ¶
func Get(c *golangsdk.ServiceClient, jobId int) (*GetJobResp, error)
type Job ¶
type Job struct { // Job ID. JobId int `json:"job_id"` // Name of the job. Length range: 0 to 57 characters. Name string `json:"name"` // Job description. Length range: 0 to 512 characters. Desc string `json:"desc"` // Job type. // flink_sql_job: Flink SQL job // flink_opensource_sql_job: Flink OpenSource SQL job // flink_jar_job: User-defined Flink job JobType string `json:"job_type"` // Job status. // Available job statuses are as follows: // job_init: The job is in the draft status. // job_submitting: The job is being submitted. // job_submit_fail: The job fails to be submitted. // job_running: The job is running. (The billing starts. After the job is submitted, a normal result is returned.) // job_running_exception (The billing stops. The job stops running due to an exception.) // job_downloading: The job is being downloaded. // job_idle: The job is idle. // job_canceling: The job is being stopped. // job_cancel_success: The job has been stopped. // job_cancel_fail: The job fails to be stopped. // job_savepointing: The savepoint is being created. // job_arrearage_stopped: The job is stopped because the account is in arrears. // (The billing ends. The job is stopped because the user account is in arrears.) // job_arrearage_recovering: The recharged job is being restored. // (The account in arrears is recharged, and the job is being restored). // job_finish: The job is completed. Status string `json:"status"` // Description of job status. StatusDesc string `json:"status_desc"` // Time when a job is created. CreateTime int `json:"create_time"` // Time when a job is started. StartTime int `json:"start_time"` // ID of the user who creates the job. UserId string `json:"user_id"` // Name of a queue. Length range: 1 to 128 characters. QueueName string `json:"queue_name"` // ID of the project to which a job belongs. ProjectId string `json:"project_id"` // Stream SQL statement. SqlBody string `json:"sql_body"` // Job running mode. The options are as follows: // shared_cluster: indicates that the job is running on a shared cluster. // exclusive_cluster: indicates that the job is running on an exclusive cluster. // edge_node: indicates that the job is running on an edge node. RunMode string `json:"run_mode"` // Job configurations. Refer to Table 4 for details. JobConfig JobConf `json:"job_config"` // Main class of a JAR package, for example, org.apache.spark.examples.streaming.JavaQueueStream. MainClass string `json:"main_class"` // Running parameter of a JAR package job. Multiple parameters are separated by spaces. EntrypointArgs string `json:"entrypoint_args"` // Job execution plan. ExecutionGraph string `json:"execution_graph"` // Time when a job is updated. UpdateTime int `json:"update_time"` // User-defined job feature. Type of the Flink image used by a job. // basic: indicates that the basic Flink image provided by DLI is used. // custom: indicates that the user-defined Flink image is used. Feature string `json:"feature"` // Flink version. This parameter is valid only when feature is set to basic. You can use this parameter with the // feature parameter to specify the version of the DLI basic Flink image used for job running. FlinkVersion string `json:"flink_version"` // Custom image. The format is Organization name/Image name:Image version. // This parameter is valid only when feature is set to custom. You can use this parameter with the feature // parameter to specify a user-defined Flink image for job running. For details about how to use custom images. Image string `json:"image"` }
type Job4List ¶
type Job4List struct { JobId int `json:"job_id"` Name string `json:"name"` Desc string `json:"desc"` // Job description. Length range: 0 to 512 characters. Username string `json:"username"` JobType string `json:"job_type"` Status string `json:"status"` StatusDesc string `json:"status_desc"` CreateTime int `json:"create_time"` StartTime int `json:"start_time"` // Running duration of a job. Unit: ms. This parameter is valid only when show_detail is set to false. Duration int `json:"duration"` // Parent job ID. This parameter is valid only when show_detail is set to false. RootId int `json:"root_id"` // ID of the user who creates the job. This parameter is valid only when show_detail is set to true. UserId string `json:"user_id"` // This parameter is valid only when show_detail is set to true. ProjectId string `json:"project_id"` // Stream SQL statement. This parameter is valid only when show_detail is set to false. SqlBody string `json:"sql_body"` // Job running mode. The options are as follows: The value can be shared_cluster, exclusive_cluster, or edge_node. // This parameter is valid only when show_detail is set to true. // shared_cluster: indicates that the job is running on a shared cluster. // exclusive_cluster: indicates that the job is running on an exclusive cluster. // edge_node: indicates that the job is running on an edge node. RunMode string `json:"run_mode"` // Job configuration. This parameter is valid only when show_detail is set to false. JobConfig JobConfBase `json:"job_config"` //Main class of a JAR package. This parameter is valid only when show_detail is set to false. MainClass string `json:"main_class"` // Job running parameter of the JAR file. Multiple parameters are separated by spaces. // This parameter is valid only when show_detail is set to true. EntrypointArgs string `json:"entrypoint_args"` // Job execution plan. This parameter is valid only when show_detail is set to false. ExecutionGraph string `json:"execution_graph"` // Time when a job is updated. This parameter is valid only when show_detail is set to false. UpdateTime int `json:"update_time"` }
type JobConf ¶
type JobConf struct { JobConfBase // Customizes optimization parameters when a Flink job is running. RuntimeConfig string `json:"runtime_config"` }
type JobConfBase ¶
type JobConfBase struct { // Whether to enable the automatic job snapshot function. // true: The automatic job snapshot function is enabled. // false: The automatic job snapshot function is disabled. // The default value is false. CheckpointEnabled bool `json:"checkpoint_enabled"` // 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. // The default value is exactly_once. CheckpointMode string `json:"checkpoint_mode"` // Snapshot interval. The unit is second. The default value is 10. CheckpointInterval int `json:"checkpoint_interval"` // Whether to enable the log storage function. The default value is false. LogEnabled bool `json:"log_enabled"` // Name of an OBS bucket. ObsBucket string `json:"obs_bucket"` // SMN topic name. If a job fails, the system will send a message to users subscribed to the SMN topic. SmnTopic string `json:"smn_topic"` // Parent job ID. RootId int `json:"root_id"` // List of edge computing group IDs. Use commas (,) to separate multiple IDs. EdgeGroupIds []string `json:"edge_group_ids"` // Number of CUs of the management unit. The default value is 1. ManagerCuNumber int `json:"manager_cu_number"` // Number of CUs selected for a job. This parameter is valid only when show_detail is set to true. // Minimum value: 2 // Maximum value: 400 // The default value is 2. CuNumber int `json:"cu_number"` // Number of concurrent jobs set by a user. This parameter is valid only when show_detail is set to true. // Minimum value: 1 // Maximum value: 2000 // The default value is 1. ParallelNumber int `json:"parallel_number"` // Whether to enable the function of restart upon exceptions. RestartWhenException bool `json:"restart_when_exception"` // Expiration time. IdleStateRetention int `json:"idle_state_retention"` // Name of the package that has been uploaded to the DLI resource management system. The UDF Jar file of the SQL // job is uploaded through this parameter. UdfJarUrl string `json:"udf_jar_url"` // Dirty data policy of a job. // 2:obsDir: Save. obsDir specifies the path for storing dirty data. // 1: Trigger a job exception // 0: Ignore DirtyDataStrategy string `json:"dirty_data_strategy"` // Name of the package that has been uploaded to the DLI resource management system. // This parameter is used to customize the JAR file where the job main class is located. Entrypoint string `json:"entrypoint"` // Name of the package that has been uploaded to the DLI resource management system. // This parameter is used to customize other dependency packages. DependencyJars []string `json:"dependency_jars"` // Name of the resource package that has been uploaded to the DLI resource management system. // This parameter is used to customize dependency files. DependencyFiles []string `json:"dependency_files"` // Number of compute nodes in a job. ExecutorNumber int `json:"executor_number"` // Number of CUs in a compute node. ExecutorCuNumber int `json:"executor_cu_number"` // Whether to restore data from the latest checkpoint when the system automatically restarts upon an exception. // The default value is false. ResumeCheckpoint bool `json:"resume_checkpoint"` TmCus int `json:"tm_cus"` TmSlotNum int `json:"tm_slot_num"` ResumeMaxNum int `json:"resume_max_num"` CheckpointPath string `json:"checkpoint_path"` Feature string `json:"feature"` FlinkVersion string `json:"flink_version"` Image string `json:"image"` // Degree of parallelism (DOP) of an operator. OperatorConfig string `json:"operator_config"` // The traffic or hit rate configuration of each operator. StaticEstimatorConfig string `json:"static_estimator_config"` }
type JobListWapper ¶
type ListOpts ¶
type ListOpts struct { Name string `q:"name"` UserName string `q:"user_name"` QueueName string `q:"queue_name"` Status string `q:"status"` JobType string `q:"job_type"` Tags string `q:"tags"` SysEnterpriseProjectName string `q:"sys_enterprise_project_name"` ShowDetail *bool `q:"show_detail"` Order string `q:"order"` Offset *int `q:"offset"` Limit *int `q:"limit"` // default 10 //Specifies parent job id of Edge job to query Edge subJob // empty: will dont query Edge subJob RootJobId *int `q:"root_job_id"` }
type ListResp ¶
type ListResp struct { IsSuccess bool `json:"is_success,string"` Message string `json:"message"` JobList JobListWapper `json:"job_list"` }
type ObsBucketsOpts ¶
type ObsBucketsOpts struct {
Buckets []string `json:"obs_buckets" required:"true"`
}
type RunJobOpts ¶
type StopFlinkJobInBatch ¶
type UpdateJarJobOpts ¶
type UpdateJarJobOpts struct { // Name of the job. Length range: 0 to 57 characters. Name string `json:"name,omitempty"` // Job description. Length range: 0 to 512 characters. Desc string `json:"desc,omitempty"` // Name of a queue. Length range: 1 to 128 characters. QueueName string `json:"queue_name,omitempty"` // Number of CUs selected for a job. The default value is 2. CuNumber *int `json:"cu_number,omitempty"` // Number of CUs on the management node selected by the user for a job, which corresponds to the number of Flink // job managers. The default value is 1. ManagerCuNumber *int `json:"manager_cu_number,omitempty"` // Number of parallel operations selected for a job. The default value is 1. ParallelNumber *int `json:"parallel_number,omitempty"` // Whether to enable the job log function. // true: indicates to enable the job log function. // false: indicates to disable the job log function. // Default value: false LogEnabled *bool `json:"log_enabled,omitempty"` // OBS path where users are authorized to save logs when log_enabled is set to true. ObsBucket string `json:"obs_bucket,omitempty"` // SMN topic. If a job fails, the system will send a message to users subscribed to the SMN topic. SmnTopic string `json:"smn_topic,omitempty"` // Job entry class. MainClass string `json:"main_class,omitempty"` // Job entry parameter. Multiple parameters are separated by spaces. EntrypointArgs string `json:"entrypoint_args,omitempty"` // Whether to enable the function of restart upon exceptions. The default value is false. RestartWhenException *bool `json:"restart_when_exception,omitempty"` // Name of the package that has been uploaded to the DLI resource management system. This parameter is used to // customize the JAR file where the job main class is located. Entrypoint string `json:"entrypoint,omitempty"` // Name of the package that has been uploaded to the DLI resource management system. This parameter is used to // customize other dependency packages. // Example: myGroup/test.jar,myGroup/test1.jar. DependencyJars []string `json:"dependency_jars,omitempty"` // Name of the resource package that has been uploaded to the DLI resource management system. This parameter is // used to customize dependency files. // Example: myGroup/test.cvs,myGroup/test1.csv. DependencyFiles []string `json:"dependency_files,omitempty"` // Number of CUs for each TaskManager. The default value is 1. TmCus *int `json:"tm_cus,omitempty"` // Number of slots in each TaskManager. The default value is (parallel_number*tm_cus)/(cu_number-manager_cu_number). TmSlotNum *int `json:"tm_slot_num,omitempty"` // Job feature. Type of the Flink image used by a job. // basic: indicates that the basic Flink image provided by DLI is used. // custom: indicates that the user-defined Flink image is used. Feature string `json:"feature,omitempty"` // Flink version. This parameter is valid only when feature is set to basic. You can use this parameter with the // feature parameter to specify the version of the DLI basic Flink image used for job running. FlinkVersion string `json:"flink_version,omitempty"` // Custom image. The format is Organization name/Image name:Image version. // This parameter is valid only when feature is set to custom. You can use this parameter with the feature // parameter to specify a user-defined Flink image for job running. For details about how to use custom images. Image string `json:"image,omitempty"` // Whether the abnormal restart is recovered from the checkpoint. ResumeCheckpoint *bool `json:"resume_checkpoint,omitempty"` // 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 *int `json:"resume_max_num,omitempty"` // Storage address of the checkpoint in the JAR file of the user. The path must be unique. CheckpointPath string `json:"checkpoint_path,omitempty"` // Customizes optimization parameters when a Flink job is running. RuntimeConfig string `json:"runtime_config,omitempty"` }
type UpdateJobResp ¶
type UpdateJobResp struct { IsSuccess bool `json:"is_success,string"` Message string `json:"message"` Job UpdateJobResp_job `json:"job"` }
func UpdateJarJob ¶
func UpdateJarJob(c *golangsdk.ServiceClient, jobId int, opts UpdateJarJobOpts) (*UpdateJobResp, error)
func UpdateSqlJob ¶
func UpdateSqlJob(c *golangsdk.ServiceClient, jobId int, opts UpdateSqlJobOpts) (*UpdateJobResp, error)
type UpdateJobResp_job ¶
type UpdateJobResp_job struct {
UpdateTime int `json:"update_time"`
}
type UpdateSqlJobOpts ¶
type UpdateSqlJobOpts struct { // Name of a job. Length range: 0 to 57 characters. Name string `json:"name,omitempty"` // Job description. Length range: 0 to 512 characters. Desc string `json:"desc,omitempty"` // Name of a queue. Length range: 1 to 128 characters. QueueName string `json:"queue_name,omitempty"` // Stream SQL statement, which includes at least the following three parts: source, query, and sink. // Length range: 0 to 1024x1024 characters. SqlBody string `json:"sql_body,omitempty"` // Job running mode. The options are as follows: // shared_cluster: indicates that the job is running on a shared cluster. // exclusive_cluster: indicates that the job is running on an exclusive cluster. // edge_node: indicates that the job is running on an edge node. // The default value is shared_cluster. RunMode string `json:"run_mode,omitempty"` // Number of CUs selected for a job. The default value is 2. CuNumber *int `json:"cu_number,omitempty"` // Number of parallel jobs set by a user. The default value is 1. ParallelNumber *int `json:"parallel_number,omitempty"` // 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. // Default value: false CheckpointEnabled *bool `json:"checkpoint_enabled,omitempty"` // Snapshot mode. There are two options: // 1: ExactlyOnce, indicates that data is processed only once. // 2: at_least_once, indicates that data is processed at least once. // The default value is 1. CheckpointMode *int `json:"checkpoint_mode,omitempty"` // Snapshot interval. The unit is second. The default value is 10. CheckpointInterval *int `json:"checkpoint_interval,omitempty"` // OBS path where users are authorized to save the snapshot. // This parameter is valid only when checkpoint_enabled is set to true. // OBS path where users are authorized to save the snapshot. // This parameter is valid only when log_enabled is set to true. ObsBucket string `json:"obs_bucket,omitempty"` // Whether to enable the function of uploading job logs to users' OBS buckets. The default value is false. LogEnabled *bool `json:"log_enabled,omitempty"` // SMN topic. If a job fails, the system will send a message to users subscribed to the SMN topic. SmnTopic string `json:"smn_topic,omitempty"` // Whether to enable the function of automatically restarting a job upon job exceptions. The default value is false. RestartWhenException *bool `json:"restart_when_exception,omitempty"` // Expiration time, in seconds. The default value is 3600. IdleStateRetention *int `json:"idle_state_retention,omitempty"` // List of edge computing group IDs. Use commas (,) to separate multiple IDs. EdgeGroupIds []string `json:"edge_group_ids,omitempty"` // Dirty data policy of a job. // 2:obsDir: Save. obsDir specifies the path for storing dirty data. // 1: Trigger a job exception // 0: Ignore // The default value is 0. DirtyDataStrategy string `json:"dirty_data_strategy,omitempty"` // 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 string `json:"udf_jar_url,omitempty"` // Number of CUs in the JobManager selected for a job. The default value is 1. ManagerCuNumber *int `json:"manager_cu_number,omitempty"` // Number of CUs for each TaskManager. The default value is 1. TmCus *int `json:"tm_cus,omitempty"` // Number of slots in each TaskManager. The default value is (parallel_number*tm_cus)/(cu_number-manager_cu_number). TmSlotNum *int `json:"tm_slot_num,omitempty"` // Degree of parallelism (DOP) of an operator. OperatorConfig string `json:"operator_config"` // Whether the abnormal restart is recovered from the checkpoint. ResumeCheckpoint *bool `json:"resume_checkpoint,omitempty"` // 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 *int `json:"resume_max_num,omitempty"` // Traffic or hit ratio of each operator, which is a character string in JSON format. StaticEstimatorConfig string `json:"static_estimator_config"` // Customizes optimization parameters when a Flink job is running. RuntimeConfig string `json:"runtime_config,omitempty"` // Flink version. The valid value is `1.1`0 or `1.12`. FlinkVersion string `json:"flink_version,omitempty"` }
Click to show internal directories.
Click to hide internal directories.