diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 083f2000..a7545720 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -7,6 +7,7 @@ steps: TEST_SUITE: "{{ matrix.suite }}" STACK_VERSION: 8.12-SNAPSHOT CLIENT_VER: "8_0" + PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT: 1 matrix: setup: suite: diff --git a/lib/Search/Elasticsearch/Client/8_0/Direct.pm b/lib/Search/Elasticsearch/Client/8_0/Direct.pm index ac65115e..e3666a18 100644 --- a/lib/Search/Elasticsearch/Client/8_0/Direct.pm +++ b/lib/Search/Elasticsearch/Client/8_0/Direct.pm @@ -19,6 +19,7 @@ has 'cat' => ( is => 'lazy', init_arg => undef ); has 'ccr' => ( is => 'lazy', init_arg => undef ); has 'cluster' => ( is => 'lazy', init_arg => undef ); has 'connector' => ( is => 'lazy', init_arg => undef ); +has 'connector_sync_job' => ( is => 'lazy', init_arg => undef ); has 'dangling_indices' => ( is => 'lazy', init_arg => undef ); has 'enrich' => ( is => 'lazy', init_arg => undef ); has 'eql' => ( is => 'lazy', init_arg => undef ); @@ -100,6 +101,7 @@ sub _build_cat { shift->_build_namespace('Cat') } sub _build_ccr { shift->_build_namespace('CCR') } sub _build_cluster { shift->_build_namespace('Cluster') } sub _build_connector { shift->_build_namespace('Connector') } +sub _build_connector_sync_job { shift->_build_namespace('ConnectorSyncJob') } sub _build_dangling_indices { shift->_build_namespace('DanglingIndices') } sub _build_enrich { shift->_build_namespace('Enrich') } sub _build_eql { shift->_build_namespace('Eql') } diff --git a/lib/Search/Elasticsearch/Client/8_0/Direct/ConnectorSyncJob.pm b/lib/Search/Elasticsearch/Client/8_0/Direct/ConnectorSyncJob.pm new file mode 100644 index 00000000..c3868f60 --- /dev/null +++ b/lib/Search/Elasticsearch/Client/8_0/Direct/ConnectorSyncJob.pm @@ -0,0 +1,56 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +package Search::Elasticsearch::Client::8_0::Direct::ConnectorSyncJob; + +use Moo; +with 'Search::Elasticsearch::Client::8_0::Role::API'; +with 'Search::Elasticsearch::Role::Client::Direct'; +__PACKAGE__->_install_api('connector_sync_job'); + +1; + +__END__ + +# ABSTRACT: A client for create and manage Elastic sync jobs + +=head1 DESCRIPTION + +The sync jobs API provides a convenient way to create +and manage Elastic sync jobs in an internal index. + +This API provides an alternative to relying solely on Kibana UI +for sync job management. + +The full documentation for Sync job feature is available here: +L + +It does L. + +=head1 METHODS + +=head2 C + + $response = $e->connector_sync_job->post( + body => { + id => "connector-id", + job_type => "full", + trigger_method => 'on_demand' + } + ); + +The C method create a connector sync job. diff --git a/t/lib/es_async.pl b/t/lib/es_async.pl index 10c2da7a..506e34a1 100644 --- a/t/lib/es_async.pl +++ b/t/lib/es_async.pl @@ -26,6 +26,8 @@ use strict; use warnings; +$ENV{ES} = $ENV{ELASTICSEARCH_URL} || 'https://elastic:changeme@localhost:9200'; + my $trace = !$ENV{TRACE} ? undef : $ENV{TRACE} eq '1' ? 'Stderr' @@ -67,11 +69,13 @@ } } +$ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT} = 1; + my $es; if ( $ENV{ES} ) { eval { $es = Search::Elasticsearch::Async->new( - nodes => $ENV{ES}, + nodes => [ $ENV{ES} ], trace_to => $trace, cxn => $cxn, cxn_pool => $cxn_pool, diff --git a/t/lib/es_sync.pl b/t/lib/es_sync.pl index 6df6df61..4a037921 100644 --- a/t/lib/es_sync.pl +++ b/t/lib/es_sync.pl @@ -44,26 +44,29 @@ our %Auth; my $es; -if ( $ENV{ES} ) { - eval { - $es = Search::Elasticsearch->new( - nodes => $ENV{ES}, - trace_to => $trace, - cxn => $cxn, - cxn_pool => $cxn_pool, - client => $api, - send_get_body_as => $body, - request_timeout => $timeout, - plugins => \@plugins, - %Auth - ); - $es->ping unless $ENV{ES_SKIP_PING}; - 1; - } || do { - diag $@; - undef $es; - }; -} + +$ENV{ES} = $ENV{ELASTICSEARCH_URL} || 'https://elastic:changeme@localhost:9200'; +$ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT} = 1; + +eval { + $es = Search::Elasticsearch->new( + nodes => [ $ENV{ES} ], + trace_to => $trace, + cxn => $cxn, + cxn_pool => $cxn_pool, + client => $api, + send_get_body_as => $body, + request_timeout => $timeout, + plugins => \@plugins, + %Auth + ); + $es->ping unless $ENV{ES_SKIP_PING}; + 1; +} || do { + diag $@; + undef $es; +}; + unless ( $ENV{ES_SKIP_PING} ) { my $version = $es->info->{version}{number}; diff --git a/test/skip_list.yaml b/test/skip_list.yaml index 26f0d4bf..aaa83f80 100644 --- a/test/skip_list.yaml +++ b/test/skip_list.yaml @@ -216,10 +216,33 @@ - aggregations/min_bucket.yml - aggregations/percentiles_bucket.yml - aggregations/sum_bucket.yml + - analytics/top_metrics.yml + - analytics/cumulative_cardinality.yml - cat.segments/10_basic.yml + - eql/10_basic.yml - field_caps/40_time_series.yml + - ml/calendar_crud.yml + - ml/data_frame_analytics_crud.yml + - ml/evaluate_data_frame.yml + - ml/explain_data_frame_analytics.yml + - ml/forecast.yml + - ml/jobs_crud.yml + - ml/preview_datafeed.yml + - ml/start_data_frame_analytics.yml + - ml/stop_data_frame_analytics.yml + - rules/10_pinned_query.yml - search/150_rewrite_on_coordinator.yml - search/220_total_hits_object.yml - search.highlight/10_unified.yml - search.vectors/90_sparse_vector.yml + - spatial/100_geo_grid_ingest.yml + - spatial/130_geo_shape_runtime.yml + - sql/sql.yml + - ssl/10_basic.yml + - transform/transforms_crud.yml + - transform/transforms_start_stop.yml + - transform/transforms_stats.yml + - transform/transforms_stats_continuous.yml + - transform/transforms_update.yml + - transform/transforms_upgrade.yml - tsdb/* diff --git a/util/get_elasticsearch_info.pl b/util/get_elasticsearch_info.pl index 52287f6a..6ba0e126 100644 --- a/util/get_elasticsearch_info.pl +++ b/util/get_elasticsearch_info.pl @@ -25,7 +25,7 @@ sub get_elasticsearch_info { #=================================== $ENV{ES} = $ENV{ELASTICSEARCH_URL} || 'https://elastic:changeme@localhost:9200'; - my $response = HTTP::Tiny->new->get($ENV{ES}) or die "The server $ENV{ES} is not running!"; + my $response = HTTP::Tiny->new(verify_SSL => 0)->get($ENV{ES}) or die "The server $ENV{ES} is not running!"; unless ($response->{success}) { die "ERROR: The server $ENV{ES} is not running!\n"; }