Files
elasticsearch-js/scripts/generate/templates/api_methods.tmpl
2014-01-15 16:55:37 -07:00

36 lines
975 B
Cheetah

[[api-reference<%= branch === 'master' ? '' : branchSuffix.replace(/_/g, '-') %>]]
== <%= branch === 'master' ? '' : branch + ' ' %>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
%>