Skip to content

Commit cd438d0

Browse files
committed
[API] Generator: Expand ilm and ml namespaces from X-Pack
1 parent 4317f44 commit cd438d0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

elasticsearch-api/utils/thor/generate_source.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,18 @@ def generate
9393

9494
def __full_namespace
9595
names = @endpoint_name.split('.')
96-
return names unless @xpack
97-
98-
names.first == 'xpack' ? names : ['xpack', names].flatten
96+
if @xpack
97+
names = (names.first == 'xpack' ? names : ['xpack', names].flatten)
98+
# Return an array with 'ml' renamed to 'machine_learning' and 'ilm' to
99+
# 'index_lifecycle_management'
100+
names.map do |name|
101+
name
102+
.gsub(/^ml$/, 'machine_learning')
103+
.gsub(/^ilm$/, 'index_lifecycle_management')
104+
end
105+
else
106+
names
107+
end
99108
end
100109

101110
# Create the hierarchy of directories based on API namespaces

0 commit comments

Comments
 (0)