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

36 lines
864 B
Cheetah

[[api-reference]]
== API Method Reference
<%
_.each(actions, function (action) {
var actionId = 'api-' + action.name.toLowerCase().replace(/[^\w]+/g, '-');
%>
[[<%= actionId %>]]
=== `<%= action.name %>`
[source,js]
--------
client.<%= action.name %>([params, [callback]])
--------
<%= description(action.name) %>
The default method is `<%= action.spec.method || 'GET' %>` and the usual <<api-conventions,params and return values>> apply. See <%= action.docUrl %>[the elasticsearch docs] for more about this method.
<%= examples(action.name) %>
<% if (_.size(action.allParams)) { %>
==== Params
[horizontal]<%
_.each(action.allParams, function (param, paramName) { %>
`<%= paramWithDefault(paramName, param.default) %>`::
`<%= paramType(param.type) %>` -- <%= joinParagraphs(param.description || '', 4) %><%
}); // endeach
} // endif
}); // endeach
%>