Elasticsearch::Role::API - This class contains the spec for the Elasticsearch APIs
version 0.76
All of the Elasticsearch APIs are defined in this role. The example given below is the definition for the "index()" in Elasticsearch::Client::Direct method:
'index' => { body => { desc => 'The document', required => 1 }, doc => '/api/index_/', method => 'PUT', path => '{index}/{type}/{id|blank}', qs => [ 'consistency', 'op_type', 'parent', 'percolate', 'refresh', 'replication', 'routing', 'timeout', 'timestamp', 'ttl', 'version', 'version_type' ], },
These definitions can be used by different Elasticsearch::Role::Client implementations to provide distinct user interfaces.
api()
$defn = $api->api($name);
The only method in this class is the api() method which takes the name of the action and returns its definition. Actions in the indices or cluster namespace use the namespace as a prefix, eg:
indices
cluster
$defn = $e->api('indices.create'); $defn = $e->api('cluster.node_stats');
Elasticsearch::Util::API::Path
Elasticsearch::Util::API::QS
Elasticsearch::Client::Direct
Clinton Gormley <drtech@cpan.org>
This software is Copyright (c) 2013 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install Elasticsearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elasticsearch
CPAN shell
perl -MCPAN -e shell install Elasticsearch
For more information on module installation, please visit the detailed CPAN module installation guide.