Files
elasticsearch-js/scripts/generate/templates/api_methods.tmpl

28 lines
872 B
Cheetah

<%
_.each(actions, function (action) {
var actionId = action.name.toLowerCase().replace(/[^\w]+/g, '-');
%>
h2#<%= actionId %>.fn <%= action.name %>(params, [callback])
include _descriptions/<%= action.name %>.jade
p.
The default method is <code><%= action.spec.method || 'GET' %></code> and
the usual <a href="#api-conventions">params and return values</a> apply.
See <a href="<%= action.docUrl %>" title="<%= action.name %>
at elasticsearch.org"><%= action.docUrl %></a> for more about this method.
include _examples/<%= action.name %>.jade
<% if (_.size(action.allParams)) { %>
h3 Params
dl.params.api
<% _.each(action.allParams, function (param, paramName) { %>
dt: dfn: code <%= paramWithDefault(paramName, param.default) %>
dd.
<span class="types"><%= paramType(param.type) %></span>
<%= indent(param.description || '', 4) %><%
}); %>
<% }
});
%>