| 1 | # Licensed to Elasticsearch B.V. under one or more contributor | ||
| 2 | # license agreements. See the NOTICE file distributed with | ||
| 3 | # this work for additional information regarding copyright | ||
| 4 | # ownership. Elasticsearch B.V. licenses this file to you under | ||
| 5 | # the Apache License, Version 2.0 (the "License"); you may | ||
| 6 | # not use this file except in compliance with the License. | ||
| 7 | # You may obtain a copy of the License at | ||
| 8 | # | ||
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | # | ||
| 11 | # Unless required by applicable law or agreed to in writing, | ||
| 12 | # software distributed under the License is distributed on an | ||
| 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| 14 | # KIND, either express or implied. See the License for the | ||
| 15 | # specific language governing permissions and limitations | ||
| 16 | # under the License. | ||
| 17 | |||
| 18 | package Search::Elasticsearch::Client::6_0::Direct::XPack; | ||
| 19 | $Search::Elasticsearch::Client::6_0::Direct::XPack::VERSION = '7.711001'; | ||
| 20 | use Moo; | ||
| 21 | with 'Search::Elasticsearch::Client::6_0::Role::API'; | ||
| 22 | with 'Search::Elasticsearch::Role::Client::Direct'; | ||
| 23 | |||
| 24 | use namespace::clean; | ||
| 25 | sub _namespace {__PACKAGE__} | ||
| 26 | |||
| 27 | has 'graph' => ( is => 'lazy', init_arg => undef ); | ||
| 28 | has 'license' => ( is => 'lazy', init_arg => undef ); | ||
| 29 | has 'migration' => ( is => 'lazy', init_arg => undef ); | ||
| 30 | has 'ml' => ( is => 'lazy', init_arg => undef ); | ||
| 31 | has 'monitoring' => ( is => 'lazy', init_arg => undef ); | ||
| 32 | has 'rollup' => ( is => 'lazy', init_arg => undef ); | ||
| 33 | has 'security' => ( is => 'lazy', init_arg => undef ); | ||
| 34 | has 'sql' => ( is => 'lazy', init_arg => undef ); | ||
| 35 | has 'ssl' => ( is => 'lazy', init_arg => undef ); | ||
| 36 | has 'watcher' => ( is => 'lazy', init_arg => undef ); | ||
| 37 | |||
| 38 | sub _build_graph { shift->_build_namespace('Graph') } | ||
| 39 | sub _build_license { shift->_build_namespace('License') } | ||
| 40 | sub _build_migration { shift->_build_namespace('Migration') } | ||
| 41 | sub _build_ml { shift->_build_namespace('ML') } | ||
| 42 | sub _build_monitoring { shift->_build_namespace('Monitoring') } | ||
| 43 | sub _build_rollup { shift->_build_namespace('Rollup') } | ||
| 44 | sub _build_security { shift->_build_namespace('Security') } | ||
| 45 | sub _build_sql { shift->_build_namespace('SQL') } | ||
| 46 | sub _build_ssl { shift->_build_namespace('SSL') } | ||
| 47 | sub _build_watcher { shift->_build_namespace('Watcher') } | ||
| 48 | |||
| 49 | __PACKAGE__->_install_api('xpack'); | ||
| 50 | |||
| 51 | 1; | ||
| 52 | |||
| 53 | =pod | ||
| 54 | |||
| 55 | =encoding UTF-8 | ||
| 56 | |||
| 57 | =head1 NAME | ||
| 58 | |||
| 59 | Search::Elasticsearch::Client::6_0::Direct::XPack - Plugin providing XPack APIs for Search::Elasticsearch v6.x | ||
| 60 | |||
| 61 | =head1 VERSION | ||
| 62 | |||
| 63 | version 7.711001 | ||
| 64 | |||
| 65 | =head1 SYNOPSIS | ||
| 66 | |||
| 67 | use Search::Elasticsearch(); | ||
| 68 | |||
| 69 | my $es = Search::Elasticsearch->new( | ||
| 70 | nodes => \@nodes | ||
| 71 | ); | ||
| 72 | |||
| 73 | $es->xpack->graph; | ||
| 74 | $es->xpack->license; | ||
| 75 | $es->xpack->security; | ||
| 76 | $es->xpack->watcher; | ||
| 77 | $es->xpack->rollup; | ||
| 78 | $es->xpack->sql; | ||
| 79 | $es->xpack->ml; | ||
| 80 | |||
| 81 | =head2 DESCRIPTION | ||
| 82 | |||
| 83 | This class extends the L<Search::Elasticsearch> client to add support | ||
| 84 | for the X-Pack commercial plugins for Elasticsearch 6.x. | ||
| 85 | |||
| 86 | It extends the L<Search::Elasticsearch> client with a C<graph>, C<license>, C<migration>, C<ml>, | ||
| 87 | C<security>, and C<watcher> namespace, to support the APIs for the X-Pack plugins: | ||
| 88 | Graph, License, Shield, and Watcher. | ||
| 89 | |||
| 90 | In other words, it can be used as follows: | ||
| 91 | |||
| 92 | use Search::Elasticsearch(); | ||
| 93 | my $es = Search::Elasticsearch->new( | ||
| 94 | nodes => \@nodes | ||
| 95 | ); | ||
| 96 | |||
| 97 | my $response = $es->xpack->watcher->start(); | ||
| 98 | |||
| 99 | For details about the supported methods in each namespace, see: | ||
| 100 | |||
| 101 | =over | ||
| 102 | |||
| 103 | =item * | ||
| 104 | |||
| 105 | L<graph()/Search::Elasticsearch::Client::6_0::XPack::Graph> | ||
| 106 | |||
| 107 | =item * | ||
| 108 | |||
| 109 | L<license()/Search::Elasticsearch::Client::6_0::XPack::License> | ||
| 110 | |||
| 111 | =item * | ||
| 112 | |||
| 113 | L<shield()/Search::Elasticsearch::Client::6_0::XPack::Migration> | ||
| 114 | |||
| 115 | =item * | ||
| 116 | |||
| 117 | L<shield()/Search::Elasticsearch::Client::6_0::XPack::ML> | ||
| 118 | |||
| 119 | =item * | ||
| 120 | |||
| 121 | L<shield()/Search::Elasticsearch::Client::6_0::XPack::Rollup> | ||
| 122 | |||
| 123 | =item * | ||
| 124 | |||
| 125 | L<shield()/Search::Elasticsearch::Client::6_0::XPack::Security> | ||
| 126 | |||
| 127 | =item * | ||
| 128 | |||
| 129 | L<shield()/Search::Elasticsearch::Client::6_0::XPack::SQL> | ||
| 130 | |||
| 131 | =item * | ||
| 132 | |||
| 133 | L<watcher()/Search::Elasticsearch::Client::6_0::XPack::Watcher> | ||
| 134 | |||
| 135 | =back | ||
| 136 | |||
| 137 | =head1 AUTHOR | ||
| 138 | |||
| 139 | Enrico Zimuel <enrico.zimuel@elastic.co> | ||
| 140 | |||
| 141 | =head1 COPYRIGHT AND LICENSE | ||
| 142 | |||
| 143 | This software is Copyright (c) 2021 by Elasticsearch BV. | ||
| 144 | |||
| 145 | This is free software, licensed under: | ||
| 146 | |||
| 147 | The Apache License, Version 2.0, January 2004 | ||
| 148 | |||
| 149 | =cut | ||
| 150 | |||
| 151 | __END__ |