diff --git a/src/Nest/XPack/MachineLearning/Job/Config/Job.cs b/src/Nest/XPack/MachineLearning/Job/Config/Job.cs index 2886d1c03f5..42bca66fb0b 100644 --- a/src/Nest/XPack/MachineLearning/Job/Config/Job.cs +++ b/src/Nest/XPack/MachineLearning/Job/Config/Job.cs @@ -112,5 +112,16 @@ public class Job /// [DataMember(Name = "results_retention_days")] public long? ResultsRetentionDays { get; set; } + + /// + /// Advanced configuration option. Whether this job should be allowed to open when there is insufficient machine learning + /// node capacity for it to be immediately assigned to a node. The default is false, which means that the + /// machine learning open job will return an error if a machine learning node with capacity to run the job cannot immediately be found. + /// (However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting.) + /// If this option is set to true then the machine learning open job will not return an error, and the job will wait in the opening + /// state until sufficient machine learning node capacity is available. + /// + [DataMember(Name ="allow_lazy_open")] + public bool? AllowLazyOpen { get; set; } } } diff --git a/src/Nest/XPack/MachineLearning/PutJob/PutJobRequest.cs b/src/Nest/XPack/MachineLearning/PutJob/PutJobRequest.cs index e653332ce2b..774891d1680 100644 --- a/src/Nest/XPack/MachineLearning/PutJob/PutJobRequest.cs +++ b/src/Nest/XPack/MachineLearning/PutJob/PutJobRequest.cs @@ -55,6 +55,17 @@ public partial interface IPutJobRequest /// [DataMember(Name ="results_index_name")] IndexName ResultsIndexName { get; set; } + + /// + /// Advanced configuration option. Whether this job should be allowed to open when there is insufficient machine learning + /// node capacity for it to be immediately assigned to a node. The default is false, which means that the + /// machine learning open job will return an error if a machine learning node with capacity to run the job cannot immediately be found. + /// (However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting.) + /// If this option is set to true then the machine learning open job will not return an error, and the job will wait in the opening + /// state until sufficient machine learning node capacity is available. + /// + [DataMember(Name ="allow_lazy_open")] + bool? AllowLazyOpen { get; set; } } /// @@ -80,6 +91,9 @@ public partial class PutJobRequest /// public IndexName ResultsIndexName { get; set; } + + /// + public bool? AllowLazyOpen { get; set; } } /// @@ -92,6 +106,7 @@ public partial class PutJobDescriptor where TDocument : class IModelPlotConfig IPutJobRequest.ModelPlotConfig { get; set; } long? IPutJobRequest.ModelSnapshotRetentionDays { get; set; } IndexName IPutJobRequest.ResultsIndexName { get; set; } + bool? IPutJobRequest.AllowLazyOpen { get; set; } /// public PutJobDescriptor AnalysisConfig(Func, IAnalysisConfig> selector) => @@ -123,6 +138,10 @@ public PutJobDescriptor ResultsIndexName(IndexName indexName) => /// public PutJobDescriptor ResultsIndexName() => Assign(typeof(TIndex), (a, v) => a.ResultsIndexName = v); + + /// + public PutJobDescriptor AllowLazyOpen(bool? allowLazyOpen = true) => + Assign(allowLazyOpen, (a, v) => a.AllowLazyOpen = v); } [StringEnum] diff --git a/src/Nest/XPack/MachineLearning/PutJob/PutJobResponse.cs b/src/Nest/XPack/MachineLearning/PutJob/PutJobResponse.cs index 95c9f5d7ab1..d238d48c38a 100644 --- a/src/Nest/XPack/MachineLearning/PutJob/PutJobResponse.cs +++ b/src/Nest/XPack/MachineLearning/PutJob/PutJobResponse.cs @@ -105,6 +105,16 @@ public class PutJobResponse : ResponseBase /// [DataMember(Name ="results_retention_days")] public long? ResultsRetentionDays { get; internal set; } - } + /// + /// Advanced configuration option. Whether this job should be allowed to open when there is insufficient machine learning + /// node capacity for it to be immediately assigned to a node. The default is false, which means that the + /// machine learning open job will return an error if a machine learning node with capacity to run the job cannot immediately be found. + /// (However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting.) + /// If this option is set to true then the machine learning open job will not return an error, and the job will wait in the opening + /// state until sufficient machine learning node capacity is available. + /// + [DataMember(Name ="allow_lazy_open")] + public bool? AllowLazyOpen { get; set; } + } } diff --git a/src/Nest/XPack/MachineLearning/UpdateJob/UpdateJobRequest.cs b/src/Nest/XPack/MachineLearning/UpdateJob/UpdateJobRequest.cs index 1e551c9e51f..ce251da4310 100644 --- a/src/Nest/XPack/MachineLearning/UpdateJob/UpdateJobRequest.cs +++ b/src/Nest/XPack/MachineLearning/UpdateJob/UpdateJobRequest.cs @@ -66,19 +66,48 @@ public partial interface IUpdateJobRequest /// [DataMember(Name ="results_retention_days")] long? ResultsRetentionDays { get; set; } + + /// + /// Advanced configuration option. Whether this job should be allowed to open when there is insufficient machine learning + /// node capacity for it to be immediately assigned to a node. The default is false, which means that the + /// machine learning open job will return an error if a machine learning node with capacity to run the job cannot immediately be found. + /// (However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting.) + /// If this option is set to true then the machine learning open job will not return an error, and the job will wait in the opening + /// state until sufficient machine learning node capacity is available. + /// + [DataMember(Name ="allow_lazy_open")] + bool? AllowLazyOpen { get; set; } } /// public partial class UpdateJobRequest { + /// public IAnalysisMemoryLimit AnalysisLimits { get; set; } + + /// public Time BackgroundPersistInterval { get; set; } + + /// public Dictionary CustomSettings { get; set; } + + /// public string Description { get; set; } + + /// public IModelPlotConfigEnabled ModelPlotConfig { get; set; } + + /// public long? ModelSnapshotRetentionDays { get; set; } + + /// public long? RenormalizationWindowDays { get; set; } + + /// public long? ResultsRetentionDays { get; set; } + + /// + public bool? AllowLazyOpen { get; set; } } /// @@ -93,6 +122,8 @@ public partial class UpdateJobDescriptor where TDocument : class long? IUpdateJobRequest.RenormalizationWindowDays { get; set; } long? IUpdateJobRequest.ResultsRetentionDays { get; set; } + bool? IUpdateJobRequest.AllowLazyOpen { get; set; } + /// public UpdateJobDescriptor AnalysisLimits(Func selector) => Assign(selector, (a, v) => a.AnalysisLimits = v?.Invoke(new AnalysisMemoryLimitDescriptor())); @@ -123,5 +154,9 @@ public UpdateJobDescriptor RenormalizationWindowDays(long? renormaliz /// public UpdateJobDescriptor ResultsRetentionDays(long? resultsRetentionDays) => Assign(resultsRetentionDays, (a, v) => a.ResultsRetentionDays = v); + + /// + public UpdateJobDescriptor AllowLazyOpen(bool? allowLazyOpen = true) => + Assign(allowLazyOpen, (a, v) => a.AllowLazyOpen = v); } }