@@ -7,18 +7,202 @@ namespace Nest
77{
88 public interface IXPackUsageResponse : IResponse
99 {
10+ [ JsonProperty ( "graph" ) ]
11+ XPackUsage Graph { get ; }
12+
13+ [ JsonProperty ( "monitoring" ) ]
14+ MonitoringUsage Monitoring { get ; }
15+
16+ [ JsonProperty ( "ml" ) ]
17+ MachineLearningUsage MachineLearning { get ; }
18+
19+ [ JsonProperty ( "watcher" ) ]
20+ AlertingUsage Alerting { get ; }
21+
22+ [ JsonProperty ( "security" ) ]
23+ SecurityUsage Security { get ; }
1024 }
1125
1226 public class XPackUsageResponse : ResponseBase , IXPackUsageResponse
1327 {
14- public XPackUsage Graph { get ; set ; }
15- }
28+ [ JsonProperty ( "graph" ) ]
29+ public XPackUsage Graph { get ; internal set ; }
30+
31+ [ JsonProperty ( "monitoring" ) ]
32+ public MonitoringUsage Monitoring { get ; internal set ; }
33+
34+ [ JsonProperty ( "ml" ) ]
35+ public MachineLearningUsage MachineLearning { get ; internal set ; }
1636
37+ [ JsonProperty ( "watcher" ) ]
38+ public AlertingUsage Alerting { get ; internal set ; }
39+
40+ [ JsonProperty ( "security" ) ]
41+ public SecurityUsage Security { get ; internal set ; }
42+ }
1743
1844 public class XPackUsage
1945 {
2046 public bool Available { get ; internal set ; }
2147 public bool Enabled { get ; internal set ; }
2248 }
2349
50+ public class SecurityUsage : XPackUsage
51+ {
52+ [ JsonProperty ( "system_key" ) ]
53+ public SecurityFeatureToggle SystemKey { get ; internal set ; }
54+
55+ [ JsonProperty ( "anonymous" ) ]
56+ public SecurityFeatureToggle Anonymous { get ; internal set ; }
57+
58+ [ JsonProperty ( "ssl" ) ]
59+ public SslUsage Ssl { get ; internal set ; }
60+
61+ [ JsonProperty ( "ipfilter" ) ]
62+ public IpFilterUsage IpFilter { get ; internal set ; }
63+
64+ [ JsonProperty ( "audit" ) ]
65+ public AuditUsage Audit { get ; internal set ; }
66+
67+ [ JsonProperty ( "roles" ) ]
68+ public IReadOnlyDictionary < string , RoleUsage > Roles { get ; internal set ; } = EmptyReadOnly < string , RoleUsage > . Dictionary ;
69+
70+ [ JsonProperty ( "realms" ) ]
71+ public IReadOnlyDictionary < string , RealmUsage > Realms { get ; internal set ; } = EmptyReadOnly < string , RealmUsage > . Dictionary ;
72+
73+ public class AuditUsage : SecurityFeatureToggle
74+ {
75+ [ JsonProperty ( "outputs" ) ]
76+ public IReadOnlyCollection < string > Outputs { get ; internal set ; } = EmptyReadOnly < string > . Collection ;
77+ }
78+
79+ public class IpFilterUsage
80+ {
81+ [ JsonProperty ( "http" ) ]
82+ public bool Http { get ; internal set ; }
83+
84+ [ JsonProperty ( "transport" ) ]
85+ public bool Transport { get ; internal set ; }
86+ }
87+
88+ public class RealmUsage : XPackUsage
89+ {
90+ [ JsonProperty ( "name" ) ]
91+ public IReadOnlyCollection < string > Name { get ; internal set ; } = EmptyReadOnly < string > . Collection ;
92+
93+ [ JsonProperty ( "size" ) ]
94+ public IReadOnlyCollection < long > Size { get ; internal set ; } = EmptyReadOnly < long > . Collection ;
95+
96+ [ JsonProperty ( "order" ) ]
97+ public IReadOnlyCollection < long > Order { get ; internal set ; } = EmptyReadOnly < long > . Collection ;
98+ }
99+
100+ public class RoleUsage
101+ {
102+ [ JsonProperty ( "dls" ) ]
103+ public bool Dls { get ; internal set ; }
104+
105+ [ JsonProperty ( "fls" ) ]
106+ public bool Fls { get ; internal set ; }
107+
108+ [ JsonProperty ( "size" ) ]
109+ public long Size { get ; internal set ; }
110+ }
111+
112+ public class SslUsage
113+ {
114+ [ JsonProperty ( "http" ) ]
115+ public SecurityFeatureToggle Http { get ; internal set ; }
116+
117+ [ JsonProperty ( "transport" ) ]
118+ public SecurityFeatureToggle Transport { get ; internal set ; }
119+ }
120+
121+ public class SecurityFeatureToggle
122+ {
123+ [ JsonProperty ( "enabled" ) ]
124+ public bool Enabled { get ; internal set ; }
125+ }
126+ }
127+
128+ public class AlertingUsage : XPackUsage
129+ {
130+ [ JsonProperty ( "execution" ) ]
131+ public AlertingExecution Execution { get ; internal set ; }
132+
133+ [ JsonProperty ( "count" ) ]
134+ public AlertingCount Count { get ; internal set ; }
135+
136+ public class AlertingExecution
137+ {
138+ [ JsonProperty ( "actions" ) ]
139+ public IReadOnlyDictionary < string , ExecutionAction > Actions { get ; internal set ; } = EmptyReadOnly < string , ExecutionAction > . Dictionary ;
140+ }
141+
142+ public class ExecutionAction
143+ {
144+ [ JsonProperty ( "total" ) ]
145+ public long Total { get ; internal set ; }
146+
147+ [ JsonProperty ( "total_in_ms" ) ]
148+ public long TotalInMilliseconds { get ; internal set ; }
149+ }
150+
151+ public class AlertingCount
152+ {
153+ [ JsonProperty ( "total" ) ]
154+ public long Total { get ; internal set ; }
155+
156+ [ JsonProperty ( "active" ) ]
157+ public long Active { get ; internal set ; }
158+ }
159+ }
160+
161+ public class MonitoringUsage : XPackUsage
162+ {
163+ [ JsonProperty ( "enabled_exporters" ) ]
164+ public IReadOnlyDictionary < string , long > EnabledExporters { get ; set ; } = EmptyReadOnly < string , long > . Dictionary ;
165+ }
166+
167+ public class MachineLearningUsage : XPackUsage
168+ {
169+ [ JsonProperty ( "jobs" ) ]
170+ public IReadOnlyDictionary < string , Job > Jobs { get ; set ; } = EmptyReadOnly < string , Job > . Dictionary ;
171+
172+ [ JsonProperty ( "datafeeds" ) ]
173+ public IReadOnlyDictionary < string , DataFeed > Datafeeds { get ; set ; } = EmptyReadOnly < string , DataFeed > . Dictionary ;
174+
175+ public class DataFeed
176+ {
177+ [ JsonProperty ( "count" ) ]
178+ public long Count { get ; internal set ; }
179+ }
180+
181+ public class Job
182+ {
183+ [ JsonProperty ( "count" ) ]
184+ public long Count { get ; internal set ; }
185+
186+ [ JsonProperty ( "detectors" ) ]
187+ public JobStatistics Detectors { get ; internal set ; }
188+
189+ [ JsonProperty ( "model_size" ) ]
190+ public JobStatistics ModelSize { get ; internal set ; }
191+ }
192+
193+ public class JobStatistics
194+ {
195+ [ JsonProperty ( "total" ) ]
196+ public double Total { get ; internal set ; }
197+
198+ [ JsonProperty ( "min" ) ]
199+ public double Minimum { get ; internal set ; }
200+
201+ [ JsonProperty ( "max" ) ]
202+ public double Maximum { get ; internal set ; }
203+
204+ [ JsonProperty ( "avg" ) ]
205+ public double Average { get ; internal set ; }
206+ }
207+ }
24208}
0 commit comments