Client/Core/3_0/Direct.pm

filter: Statementstmt 42.1% 54 / 128 Branchbran 0.0% 0 / 18 Conditioncond 0.0% 0 / 20 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 6.6% 3 / 45 Podpod 100% 4 / 4 totaltotal 26.8% 61 / 227 CC 18 SCAR 29.5
CC
18
Cov
33%
global_method_supported_in_version
90.0
method_supported_in_version
42.0
_build__bulk_class
6.0
CRAP 19.1
« Client/Core/3_0/Direct/WLM.pm ↑ Summary Client/Role/API.pm »
1 # OpenSearch::Client is an unofficial client for OpenSearch.
2 # It is derived from Search::Elasticsearch version 7.714
3 # License details from the original work are contained in the
4 # NOTICE file distributed with this work.
5 #
6 #-----------------------------------------------------------------------
7 # OpenSearch::Client
8 #-----------------------------------------------------------------------
9 # Copyright 2026 Mark Dootson
10 #
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14 #
15 # http://www.apache.org/licenses/LICENSE-2.0
16 #
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22  
23 package OpenSearch::Client::Core::3_0::Direct;
24 56 $OpenSearch::Client::Core::3_0::Direct::VERSION = '3.007011';
25 56 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 56 with 'OpenSearch::Client::Core::3_0::Role::API';
27 56 with 'OpenSearch::Client::Role::Client::Direct';
28  
29 56 ▶use OpenSearch::Client::Util qw(parse_params is_compat);
Subroutine BEGIN: called CC=1 SCAR=0.0
30 56 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 56 our %_api_method_supported_version_stash;
33  
34 0 ▶sub _namespace {__PACKAGE__}
Subroutine _namespace: not called CC=1 SCAR=6.9
35  
36  
37 56 has 'asynchronous_search' => ( is => 'lazy', init_arg => undef );
38 56 has 'cat' => ( is => 'lazy', init_arg => undef );
39 56 has 'cluster' => ( is => 'lazy', init_arg => undef );
40 56 has 'dangling_indices' => ( is => 'lazy', init_arg => undef );
41 56 has 'flow_framework' => ( is => 'lazy', init_arg => undef );
42 56 has 'geospatial' => ( is => 'lazy', init_arg => undef );
43 56 has 'indices' => ( is => 'lazy', init_arg => undef );
44 56 has 'ingest' => ( is => 'lazy', init_arg => undef );
45 56 has 'ingestion' => ( is => 'lazy', init_arg => undef );
46 56 has 'insights' => ( is => 'lazy', init_arg => undef );
47 56 has 'ism' => ( is => 'lazy', init_arg => undef );
48 56 has 'knn' => ( is => 'lazy', init_arg => undef );
49 56 has 'list' => ( is => 'lazy', init_arg => undef );
50 56 has 'ltr' => ( is => 'lazy', init_arg => undef );
51 56 has 'ml' => ( is => 'lazy', init_arg => undef );
52 56 has 'neural' => ( is => 'lazy', init_arg => undef );
53 56 has 'nodes' => ( is => 'lazy', init_arg => undef );
54 56 has 'notifications' => ( is => 'lazy', init_arg => undef );
55 56 has 'observability' => ( is => 'lazy', init_arg => undef );
56 56 has 'ppl' => ( is => 'lazy', init_arg => undef );
57 56 has 'query' => ( is => 'lazy', init_arg => undef );
58 56 has 'remote_store' => ( is => 'lazy', init_arg => undef );
59 56 has 'replication' => ( is => 'lazy', init_arg => undef );
60 56 has 'rollups' => ( is => 'lazy', init_arg => undef );
61 56 has 'search_pipeline' => ( is => 'lazy', init_arg => undef );
62 56 has 'search_relevance' => ( is => 'lazy', init_arg => undef );
63 56 has 'security' => ( is => 'lazy', init_arg => undef );
64 56 has 'security_analytics' => ( is => 'lazy', init_arg => undef );
65 56 has 'sm' => ( is => 'lazy', init_arg => undef );
66 56 has 'snapshot' => ( is => 'lazy', init_arg => undef );
67 56 has 'sql' => ( is => 'lazy', init_arg => undef );
68 56 has 'tasks' => ( is => 'lazy', init_arg => undef );
69 56 has 'transforms' => ( is => 'lazy', init_arg => undef );
70 56 has 'ubi' => ( is => 'lazy', init_arg => undef );
71 56 has 'wlm' => ( is => 'lazy', init_arg => undef );
72 56 has 'bulk_helper_class' => ( is => 'rw' );
73 56 has 'scroll_helper_class' => ( is => 'rw' );
74 56 has '_bulk_class' => ( is => 'lazy' );
75 56 has '_scroll_class' => ( is => 'lazy' );
76  
77 #---------------------------------------
78 0 ▶sub global_method_supported_in_version {
Subroutine global_method_supported_in_version: not called CC=9 SCAR=45.0
Pod documented
79 #---------------------------------------
80 0 my( $self, @args ) = @_;
81 0 ▶ my %params = ( ref($args[0]) ) ? %{ $args[0] } : @args;
Branch: 1 branch
BranchTrueFalseTotal
ref $args[0] ? : 0 0 0
82
83 0 ▶ my $version = $params{version} || $self->opensearch_version;
Condition0%0/3
$params{'version'} || $self->opensearch_version
l!l&&r!l&&!r
000
MC/DC0%0/2
$params{'version'} || $self->opensearch_version
$params{'version'} $self->opensearch_version
Truth table0%0/3
A || B
A= $params{'version'}B= $self->opensearch_version
ABresult
1X1
011
000
84 0 ▶ my $module = $params{module} || '_core';
Condition0%0/2
$params{'module'} || '_core'
l!l
00
MC/DC0%0/1
$params{'module'} || '_core'
$params{'module'}
Truth table0%0/2
A
A= $params{'module'}
Aresult
11
00
85 0 ▶ my $method = $params{method} || 'not_a_real_method_name';
Condition0%0/2
$params{'method'} || 'not_a_real_method_name'
l!l
00
MC/DC0%0/1
$params{'method'} || 'not_a_real_method_name'
$params{'method'}
Truth table0%0/2
A
A= $params{'method'}
Aresult
11
00
86
87 0 ▶ if( $module eq '_core' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($module eq '_core') { } 0 0 0
88 0 ▶ if( $self->can($method) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can($method)) 0 0 0
89 0 my $result = $self->method_supported_in_version( method => $method, version => $version);
90 0 return $result;
91 }
92 } else {
93 0 ▶ if( $self->can($module) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can($module)) 0 0 0
94 0 my $cli = $self->$module;
95 0 ▶ if( $cli->can($method) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cli->can($method)) 0 0 0
96 0 my $result = $cli->method_supported_in_version( method => $method, version => $version);
97 0 return $result;
98 }
99 }
100 }
101
102 0 return 0;
103 }
104  
105 #===================================
106 0 ▶sub method_supported_in_version {
Subroutine method_supported_in_version: not called CC=6 SCAR=37.4
Pod documented
107 #===================================
108 0 my( $self, @args ) = @_;
109 0 ▶ my %params = ( ref($args[0]) ) ? %{ $args[0] } : @args;
Branch: 1 branch
BranchTrueFalseTotal
ref $args[0] ? : 0 0 0
110 0 my $version = $params{version};
111 0 my $method = $params{method};
112 0 ▶ return 0 unless($method && $version);
Branch: 1 branch
BranchTrueFalseTotal
unless $method and $version 0 0 0
Condition0%0/3
$method and $version
!ll&&!rl&&r
000
MC/DC0%0/2
$method and $version
$method $version
Truth table0%0/3
A and B
A= $methodB= $version
ABresult
0X0
100
111
113 0 ▶ return 0 unless(exists($_api_method_supported_version_stash{$method}));
Branch: 1 branch
BranchTrueFalseTotal
unless exists $OpenSearch::Client::Core::3_0::Direct::_api_method_supported_version_stash{$method} 0 0 0
114 0 my $supported_version = $_api_method_supported_version_stash{$method};
115 0 my $checkversion = version->declare('v' . $version)->numify;
116 0 ▶ return ( $checkversion < $supported_version ) ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
$checkversion < $supported_version ? : 0 0 0
117 }
118  
119  
120 #===================================
121 0 ▶sub _build__bulk_class {
Subroutine _build__bulk_class: not called CC=2 SCAR=17.9
122 #===================================
123 0 my $self = shift;
124 0 ▶ my $bulk_class = $self->bulk_helper_class
Condition0%0/2
$self->bulk_helper_class || 'Core::' . $self->api_version . '::Helper::Bulk'
l!l
00
MC/DC0%0/1
$self->bulk_helper_class || 'Core::' . $self->api_version . '::Helper::Bulk'
$self->bulk_helper_class
Truth table0%0/2
A
A= $self->bulk_helper_class
Aresult
11
00
125 || 'Core::' . $self->api_version . '::Helper::Bulk';
126 0 $self->_build_helper( 'bulk', $bulk_class );
127 }
128  
129 #===================================
130 0 ▶sub _build__scroll_class {
Subroutine _build__scroll_class: not called CC=2 SCAR=17.9
131 #===================================
132 0 my $self = shift;
133 0 ▶ my $scroll_class = $self->scroll_helper_class
Condition0%0/2
$self->scroll_helper_class || 'Core::' . $self->api_version . '::Helper::Scroll'
l!l
00
MC/DC0%0/1
$self->scroll_helper_class || 'Core::' . $self->api_version . '::Helper::Scroll'
$self->scroll_helper_class
Truth table0%0/2
A
A= $self->scroll_helper_class
Aresult
11
00
134 || 'Core::' . $self->api_version . '::Helper::Scroll';
135 0 $self->_build_helper( 'scroll', $scroll_class );
136 }
137  
138 #===================================
139 0 ▶sub bulk_helper {
Subroutine bulk_helper: not called CC=2 SCAR=17.9
Pod documented
140 #===================================
141 0 my ( $self, $params ) = parse_params(@_);
142 0 ▶ $params->{os} ||= $self;
Condition0%0/3
$params->{"os"} ||= $self
l!l&&r!l&&!r
000
MC/DC0%0/2
$params->{"os"} ||= $self
$params->{"os"} $self
Truth table0%0/3
A ||= B
A= $params->{"os"}B= $self
ABresult
1X1
011
000
143 0 $self->_bulk_class->new($params);
144 }
145  
146 #===================================
147 0 ▶sub scroll_helper {
Subroutine scroll_helper: not called CC=2 SCAR=17.9
Pod documented
148 #===================================
149 0 my ( $self, $params ) = parse_params(@_);
150 0 ▶ $params->{os} ||= $self;
Condition0%0/3
$params->{"os"} ||= $self
l!l&&r!l&&!r
000
MC/DC0%0/2
$params->{"os"} ||= $self
$params->{"os"} $self
Truth table0%0/3
A ||= B
A= $params->{"os"}B= $self
ABresult
1X1
011
000
151 0 $self->_scroll_class->new($params);
152 }
153  
154  
155 0 ▶sub _build_asynchronous_search { shift->_build_namespace('AsyncSearch') }
Subroutine _build_asynchronous_search: not called CC=1 SCAR=6.9
156 0 ▶sub _build_cat { shift->_build_namespace('Cat') }
Subroutine _build_cat: not called CC=1 SCAR=6.9
157 0 ▶sub _build_cluster { shift->_build_namespace('Cluster') }
Subroutine _build_cluster: not called CC=1 SCAR=6.9
158 0 ▶sub _build_dangling_indices { shift->_build_namespace('DanglingIndices') }
Subroutine _build_dangling_indices: not called CC=1 SCAR=6.9
159 0 ▶sub _build_flow_framework { shift->_build_namespace('FlowFramework') }
Subroutine _build_flow_framework: not called CC=1 SCAR=6.9
160 0 ▶sub _build_geospatial { shift->_build_namespace('GeoSpatial') }
Subroutine _build_geospatial: not called CC=1 SCAR=6.9
161 0 ▶sub _build_indices { shift->_build_namespace('Indices') }
Subroutine _build_indices: not called CC=1 SCAR=6.9
162 0 ▶sub _build_ingest { shift->_build_namespace('Ingest') }
Subroutine _build_ingest: not called CC=1 SCAR=6.9
163 0 ▶sub _build_ingestion { shift->_build_namespace('Ingestion') }
Subroutine _build_ingestion: not called CC=1 SCAR=6.9
164 0 ▶sub _build_insights { shift->_build_namespace('Insights') }
Subroutine _build_insights: not called CC=1 SCAR=6.9
165 0 ▶sub _build_ism { shift->_build_namespace('ISM') }
Subroutine _build_ism: not called CC=1 SCAR=6.9
166 0 ▶sub _build_knn { shift->_build_namespace('KNN') }
Subroutine _build_knn: not called CC=1 SCAR=6.9
167 0 ▶sub _build_list { shift->_build_namespace('List') }
Subroutine _build_list: not called CC=1 SCAR=6.9
168 0 ▶sub _build_ltr { shift->_build_namespace('LTR') }
Subroutine _build_ltr: not called CC=1 SCAR=6.9
169 0 ▶sub _build_ml { shift->_build_namespace('ML') }
Subroutine _build_ml: not called CC=1 SCAR=6.9
170 0 ▶sub _build_neural { shift->_build_namespace('Neural') }
Subroutine _build_neural: not called CC=1 SCAR=6.9
171 0 ▶sub _build_nodes { shift->_build_namespace('Nodes') }
Subroutine _build_nodes: not called CC=1 SCAR=6.9
172 0 ▶sub _build_notifications { shift->_build_namespace('Notifications') }
Subroutine _build_notifications: not called CC=1 SCAR=6.9
173 0 ▶sub _build_observability { shift->_build_namespace('Observability') }
Subroutine _build_observability: not called CC=1 SCAR=6.9
174 0 ▶sub _build_ppl { shift->_build_namespace('PPL') }
Subroutine _build_ppl: not called CC=1 SCAR=6.9
175 0 ▶sub _build_query { shift->_build_namespace('Query') }
Subroutine _build_query: not called CC=1 SCAR=6.9
176 0 ▶sub _build_remote_store { shift->_build_namespace('RemoteStore') }
Subroutine _build_remote_store: not called CC=1 SCAR=6.9
177 0 ▶sub _build_replication { shift->_build_namespace('Replication') }
Subroutine _build_replication: not called CC=1 SCAR=6.9
178 0 ▶sub _build_rollups { shift->_build_namespace('Rollups') }
Subroutine _build_rollups: not called CC=1 SCAR=6.9
179 0 ▶sub _build_search_pipeline { shift->_build_namespace('SearchPipeline') }
Subroutine _build_search_pipeline: not called CC=1 SCAR=6.9
180 0 ▶sub _build_search_relevance { shift->_build_namespace('SearchRelevance') }
Subroutine _build_search_relevance: not called CC=1 SCAR=6.9
181 0 ▶sub _build_security { shift->_build_namespace('Security') }
Subroutine _build_security: not called CC=1 SCAR=6.9
182 0 ▶sub _build_security_analytics { shift->_build_namespace('SecurityAnalytics') }
Subroutine _build_security_analytics: not called CC=1 SCAR=6.9
183 0 ▶sub _build_sm { shift->_build_namespace('SnapshotManagement') }
Subroutine _build_sm: not called CC=1 SCAR=6.9
184 0 ▶sub _build_snapshot { shift->_build_namespace('Snapshot') }
Subroutine _build_snapshot: not called CC=1 SCAR=6.9
185 0 ▶sub _build_sql { shift->_build_namespace('SQL') }
Subroutine _build_sql: not called CC=1 SCAR=6.9
186 0 ▶sub _build_tasks { shift->_build_namespace('Tasks') }
Subroutine _build_tasks: not called CC=1 SCAR=6.9
187 0 ▶sub _build_transforms { shift->_build_namespace('Transforms') }
Subroutine _build_transforms: not called CC=1 SCAR=6.9
188 0 ▶sub _build_ubi { shift->_build_namespace('UBI') }
Subroutine _build_ubi: not called CC=1 SCAR=6.9
189 0 ▶sub _build_wlm { shift->_build_namespace('WLM') }
Subroutine _build_wlm: not called CC=1 SCAR=6.9
190  
191 56 __PACKAGE__->_install_api('_core');
192  
193 56 1;
194  
195 __END__
« Client/Core/3_0/Direct/WLM.pm ↑ Summary Client/Role/API.pm »